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

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!