Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions