Hi, I have to convert the following assembly code to C code: e1: e1_reference.o:
ID: 3598981 • Letter: H
Question
Hi, I have to convert the following assembly code to C code:
e1:
e1_reference.o: file format elf64-x86-64
Disassembly of section .text:
0: 8d 47 ff
3: c3
lea -0x1(%rdi),%eax
retq
e2:
e2_reference.o: file format elf64-x86-64
Disassembly of section .text:
00000000000000 :
0: 89 f8
2: ba 00 00 00 00
7: eb 06
9: 83 c0 01
c: 83 c2 01
f: 83 fa 09
12: 7e f5
14: f3 c3
mov %edi,%eax
mov $0x0,%edx
add $0x1,%eax
add $0x1,%edx
cmp $0x9,%edx
repz retq
Specifically, there should be two functions of the following type:
int e1(int a) {}
int e2(int a) {}
Explanation / Answer
int e1(int a){
x++;
}
int e2(int a){
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.