Question: Write a function with C code that corresponds to the following assembly language. long f2(int x) { } ---------------------------------- 000000000040073d : 40073d: 89 7c 24

Write a function with C code that corresponds to the following assembly language.

long f2(int x) { }

----------------------------------

000000000040073d : 40073d: 89 7c 24 ec mov %edi,-0x14(%rsp) 400741: 48 c7 44 24 f8 11 00 movq $0x11,-0x8(%rsp) 400748: 00 00 40074a: 8b 54 24 ec mov -0x14(%rsp),%edx 40074e: 89 d0 mov %edx,%eax 400750: c1 e0 03 shl $0x3,%eax 400753: 29 d0 sub %edx,%eax 400755: 89 44 24 ec mov %eax,-0x14(%rsp) 400759: c7 44 24 f4 00 00 00 movl $0x0,-0xc(%rsp) 400760: 00 400761: eb 10 jmp 400773 400763: 8b 44 24 f4 mov -0xc(%rsp),%eax 400767: 48 98 cltq 400769: 48 01 44 24 f8 add %rax,-0x8(%rsp) 40076e: 83 44 24 f4 01 addl $0x1,-0xc(%rsp) 400773: 8b 44 24 f4 mov -0xc(%rsp),%eax 400777: 3b 44 24 ec cmp -0x14(%rsp),%eax 40077b: 7c e6 jl 400763 40077d: 48 8b 44 24 f8 mov -0x8(%rsp),%rax 400782: 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!