Question: Suppose you know that when a function with prototype int decode3 (long x, long y, long z) is compiled into assembly code, the body of

Suppose you know that when a function with prototype int decode3 (long x, long y, long z) is compiled into assembly code, the body of the code is as follows movq %rsi, %rax subq %rdx, %rsi sara 15,%rax salq 31,%rax orq %rsi,%rax ret Parameters x, y, and z are passed in registers %rdi, %rsi, and %rax. The code stores the return value in register %rax Write C code for decode3 that will have an effect equivalent to our assembly code. You can test your solution by compiling your code with the -S switch. Your compiler may not generate identical code, but it should be functionally equivalent (and it ought to at least compile). Using the -0s flag will probably help you get similar code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
