Question: What is the c code of the following MIPS function? 0000000000400e70 : 400e70: 48 89 5c 24 e8 mov %rbx,-0x18(%rsp) 400e75: 48 89 6c 24
What is the c code of the following MIPS function?
0000000000400e70
400e70: 48 89 5c 24 e8 mov %rbx,-0x18(%rsp)
400e75: 48 89 6c 24 f0 mov %rbp,-0x10(%rsp)
400e7a: 4c 89 64 24 f8 mov %r12,-0x8(%rsp)
400e7f: 48 83 ec 18 sub $0x18,%rsp
400e83: 89 fb mov %edi,%ebx
400e85: 89 f5 mov %esi,%ebp
400e87: 85 ff test %edi,%edi
400e89: 7f 07 jg 400e92
400e8b: bd 00 00 00 00 mov $0x0,%ebp
400e90: eb 20 jmp 400eb2
400e92: 83 ff 01 cmp $0x1,%edi
400e95: 74 1b je 400eb2
400e97: 8d 7b ff lea -0x1(%rbx),%edi
400e9a: e8 d1 ff ff ff callq 400e70
400e9f: 41 89 c4 mov %eax,%r12d
400ea2: 8d 7b fe lea -0x2(%rbx),%edi
400ea5: 89 ee mov %ebp,%esi
400ea7: e8 c4 ff ff ff callq 400e70
400eac: 41 01 c4 add %eax,%r12d
400eaf: 44 01 e5 add %r12d,%ebp
400eb2: 89 e8 mov %ebp,%eax
400eb4: 48 8b 1c 24 mov (%rsp),%rbx
400eb8: 48 8b 6c 24 08 mov 0x8(%rsp),%rbp
400ebd: 4c 8b 64 24 10 mov 0x10(%rsp),%r12
400ec2: 48 83 c4 18 add $0x18,%rsp
400ec6: c3 retq
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
