>>106961423
>If they could shrink down the assembly without affecting performance, why not do that?
Because compiler only knows limited set of optimizations it can do in reasonable time, and these optimizations have to be universal enough to work on wide range of different platforms and architectures. These snippets of code generate IR distinct enough to trigger different kinds of optimizations which result in slightly different machine code.
If you want to learn more, you can use godbolt optimization pipeline analysis and look at it step by step too see what exactly happened, but I personally do not care enough to go through all of this.