Question
Consider the following C functions and assembly code: int fun1(int a, int b) { if (a < b) return a; else return b; } int
Consider the following C functions and assembly code:
int fun1(int a, int b) { if (a < b) return a; else return b; }
int fun2(int a, int b) { if (b < a) return b; else return a; }
int fun3(int a, int b) { unsigned ua = (unsigned) a; if (ua < b) return b; else return ua; }
int fun4(int a, int b) { if (a >= b) return a; else return b; }
int fun5(int a, int b) {
if (a < b) return b; else return a; }
pushl %ebp movl %esp,%ebp movl 8(%ebp),%edx movl 12(%ebp),%eax cmpl %eax,%edx jge .L9 movl %edx,%eax .L9: movl %ebp,%esp popl %ebp ret
Pick the function that compiled into the assembly code shown above.
fun4
fun1
fun2
fun3
fun5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started