Lenguaje ensamblador: cómo funciona

Soy realmente nuevo en el aprendizaje del lenguaje ensamblador y comencé a investigarlo, así que me preguntaba si quizás algunos de ustedes podrían ayudarme a resolver un problema. Tengo una tarea que me dice que compare las instrucciones del lenguaje ensamblador con el código c y me diga qué código c es equivalente a las instrucciones del ensamblaje. Así que aquí están las instrucciones de montaje:

pushl %ebp // What i think is happening here is that we are creating more space for the function.
movl %esp,%ebp // Here i think we are moving the stack pointer to the old base pointer.
movl 8(%ebp),%edx // Here we are taking parameter int a and storing it in %edx
movl 12(%ebp),%eax // Here we are taking parameter int b and storing it in %eax
cmpl %eax,%edx // Here i think we are comparing int a and b ( b > a ) ?
jge .L3 // Jump to .L3 if b is greater than a - else continue the instructions
movl %edx,%eax // If the term is not met here it will return b
.L3:
movl %ebp,%esp // Starting to finish the function
popl %ebp // Putting the base pointer in the right place
ret // return

Estoy tratando de comentarlo en base a mi comprensión de esto, pero podría estar totalmente equivocado sobre esto. Las opciones para las funciones C a las cuales se supone que son equivalentes son:

int fun1(int a, int b)
{
unsigned ua = (unsigned) a;
if (ua < b)
return b;
else
return ua;
}
int fun2(int a, int b)
{
if (b < a)
return b;
else
return a;
}
int fun3(int a, int b)
{
if (a < b)
return a;
else
return b;
}

Creo que la respuesta correcta es divertida3 ... pero no estoy muy seguro.

Respuestas a la pregunta(1)

Su respuesta a la pregunta