Question: A function is declared as follows: void foo(long a, long b, long c, int n); Its body compiles to the following code: # a


A function is declared as follows: void foo(long a, long b, long 

A function is declared as follows: void foo(long a, long b, long c, int n); Its body compiles to the following code: # a in %rdi, b in %rsi, c in %rdx, n in %ecx movl $0, %eax .12: .LA: capl %ecx, %eax jge .LA movalq %eax, %r8 mov (%rdx,%r8,8), %r9 addq (%rai,%r8,8), %19 movq Zr9, (Zrdi, %r8,8) addl $1, %eax jmp .L2 ret The C code for the body a loop of the form: int i; for (i=0; a. What register holds the loop variable i? b. What is i compared to in the loop test? e. What do the first three arguments point to? d. What do the three instructions in the middle of the loop (novq, addq. movq) do? e. Say in words what is the purpose of the function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!