Couldn't they just turn the optimization off for this loop?

They didn't have the code for the offensive program, they were creating the emulator to run it on a different architecture.

> offensive program

Agreed.

Which optimizer replaces a 64k loop with 64k instructions?

Ah, yes. Microsoft's!

There is no indication that the compiler that produced the code was Microsoft's. Actually the article hints otherwise ("[...] whatever compiler was used to compile this code").

Who has been validating that approach to solve their own optimization target?