Your task is to fill in the missing parts of the C code to get a program equivalent to the generated assembly code. Recall that the result of the function is returned in register %eax. You will find it helpful to examine the assembly code before, during, and after the loop to form a consistent mapping between the registers and the program variables.

Respuesta :

Answer:

See Explaination

Explanation:

//Function

long loop (long x, long n)

{

//Declare a variable named result and initialize it to zero

long result = 0;

//Declare a variable named mask

long mask;

//For loop

for(mask = 1; mask != 0; mask = mask << (n & 0xFF))

{

//Calculate

result | = (x&mask);

}

//Return result

return result;

}