Break-out of the (mostly) pure style changes from D43470.
Non-style changes include the use of SEQ_SUB instead of
a plain subtraction, for an implict type conversion.
Using curly brackets in more or less deeply stacked if
statements throughout.
Split "} else if () {" with a newline to improve readabiliy:
} else if () {
Evaluation order change in if condition and preventing
a theoretical overflow.
Use of the ? operator to enhance readability (clearing
of the FIN flag).
None of the above change the function.