Question: Write a function in C that does what the assembly code states: 000000000040070a : 40070a: 89 7c 24 fc mov %edi,-0x4(%rsp) 40070e: 83 7c 24

Write a function in C that does what the assembly code states:

000000000040070a : 40070a: 89 7c 24 fc mov %edi,-0x4(%rsp) 40070e: 83 7c 24 fc 0f cmpl $0xf,-0x4(%rsp) 400713: 7e 1e jle 400733 400715: 8b 44 24 fc mov -0x4(%rsp),%eax 400719: 8d 14 c5 00 00 00 00 lea 0x0(,%rax,8),%edx 400720: 8b 44 24 fc mov -0x4(%rsp),%eax 400724: c1 e0 02 shl $0x2,%eax 400727: 01 c2 add %eax,%edx 400729: 8b 44 24 fc mov -0x4(%rsp),%eax 40072d: 01 c0 add %eax,%eax 40072f: 01 d0 add %edx,%eax 400731: eb 09 jmp 40073c 400733: 8b 44 24 fc mov -0x4(%rsp),%eax 400737: d1 f8 sar %eax 400739: 83 c0 07 add $0x7,%eax 40073c: c3 retq

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