University of Washington Condi3onal Branch Example int absdiff(int x, int y) { int result; if (x > y) { result = x-y; } else { result = y-x; } return result; } absdiff: pushl movl movl movl cmpl jle subl movl L8: leave ret L7: subl jmp x86 %ebp %esp, %ebp 8(%ebp), %edx 12(%ebp), %eax %eax, %edx L7 %eax, %edx %edx, %eax Setup Body1 Finish %edx, %eax L8 Body2 University of Washington Condi3onal Branch Example (Cont.) int goto_ad(int x, int y) { int result; if (x y) { result = x-y; } else { result = y-x; } return result; } ¢ ¢ x86 C allows “goto” as means of transferring control § Closer to machine-‐level programming style Generally considered bad coding style University of Washington Condi3onal Branch Example (Cont.) absdiff: pushl movl movl movl cmpl jle subl movl L8: leave ret L7: subl jmp int goto_ad(int x, int y) { int result; if (x