To keep gcc from unrolling the second loop, I'm using the bit masking condition which confuses the optimizer.
Note that this behavior won't change unless we stop targeting any OS below 10.3.9 and move to a more recent version of gcc (whose behavior I haven't bothered to test).