I think this is an effect of the counter being "volatile". The line "while (--cy)" is being handled as two operations - first "cy" is decremented, then it is compared to 0. Since cy is marked volatile, these operations are not combined.
The C standards are not very clear on exactly how such code should be interpreted - I believe it is right for the compiler to be a bit conservative here.
I think this is an effect of the counter being "volatile". The line "while (--cy)" is being handled as two operations - first "cy" is decremented, then it is compared to 0. Since cy is marked volatile, these operations are not combined.
The C standards are not very clear on exactly how such code should be interpreted - I believe it is right for the compiler to be a bit conservative here.