int get_cont(int *p1, int *p2)
{
if (p1 > p2)
return *p2;
else
return *p1;
}
The assembly code is:
movl 8(%ebp), %eax
cmpl 12(%ebp), %eax
jbe .L2
movl 12(%ebp), %eax
movl (%eax), %eax
jmp .L3
Why use jbe
? The condition is p1 > p2
. Why not use ja
?
ja
and jbe
are both unsigned jump opcode. Why did the compiler reverse the condition?