...
This proposed rewrite is provided by "A Lesson on Infinite Loops" by Bryant Zadegan [Zadegan 2009]. The loop is guaranteed to exit, as days
decreases for each iteration of the loop, unless the while
condition fails, in which case the loop terminates.
...