Point. And yes, the first example, the nested for loops are the most readable, IMO. Besides a call to memset(), as you point out so nicely. ;)
Note that optimizations really mess up GDB, however. If you're working on a project that has lots of calculations to go through before it reaches a breakpoint, speed is always nice to have.