Did you ever think about how your CPU executes the code that you wrote? The compiler takes your code and turns it into an executable binary. This binary is loaded into memory. CPU reads instructions from the memory one-by-one and executes them. Let's look closely at the example:
Open this example in Compiler Explorer
With all optimizations enabled in GCC it's just three lines of assembly
imul edi, edi # multiply 1st argument by itself and store result back to edi
mov eax, edi # move contents of edi to eax







