Question: Give C code which is consistent with the following x86-64 assembly language functions f1, f2, and f3: f1: imulq %rsi, %rdi leaq (%rdi,%rdx), %rax ret

Give C code which is consistent with the following x86-64 assembly language functions f1, f2, and f3:

    f1:

        imulq   %rsi, %rdi

        leaq    (%rdi,%rdx), %rax

        ret 

 

    f2:  

        addl    %edx, %esi

        movslq  %esi, %rsi

        movl    (%rdi,%rsi,4), %eax

        ret

 

    f3:       

        movl    %esi, %eax

        leal    (%rdi,%rdi,4), %esi

        addl    %eax, %esi        

        leal    (%rdx,%rdx,8), %eax

        addl    %esi, %eax         

        ret

 

 

Step by Step Solution

3.44 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer f2 a... View full answer

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 Accounting Questions!