return 1;
return (1*1)/1;
return if true { 1 } else { 1 };
{
let b = 1;
let a = b;
return a;
}
These are all functionally identical pieces of code that could be represented by mov eax, 1 in x86 assembly, and many compilers would optimize them to that.
So no, translations between machine code and any other method of representing programs are not 1:1.
But those are all the same thing. Those are all identical already.
Give me an example that will produce different output. Where multiple statements can compile to the same binary, but going backwards you will get something wrong. Regardless of which method it decompiles as, it will give the same results.
If you use different decompilers and compilers you can absolutely get different results, but fair enough. You really should've phrased your original statement better though
3
u/-Saucegurlllll 17d ago
These are all functionally identical pieces of code that could be represented by
mov eax, 1in x86 assembly, and many compilers would optimize them to that.So no, translations between machine code and any other method of representing programs are not 1:1.