xorebxebx, no, it is not a good or bad compiler and/or optimization options.
Iar compiler produces the same output with full optimization.
The fact is that if you wrote worst code no optimizers could rescue it.
And "which one is faster" if you write your code for avr with gcc toolchain? ;-)
boolivar: I don't know. Are you sure the second one is faster just because it's shorter?. In my experience, comparing pointers takes much longer than comparing integers.
I am just making a wild guess. To compare pointer values which contains memory address in the form of 32 bits or 64 bits take longer compared to integer which could be contained in say 16 bits depending on platform ?