Last active
August 29, 2015 14:07
-
-
Save antonijn/1673919f402ffc802439 to your computer and use it in GitHub Desktop.
acc <3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(void) | |
{ | |
int i = 1 + 2; | |
int j = i + 1; | |
if (j) | |
return i; | |
return j; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global main | |
main: | |
.L0: | |
mov eax, dword 1 | |
add eax, dword 2 | |
mov ecx, eax | |
inc ecx | |
test ecx, ecx | |
je .L1 | |
.L2: | |
ret | |
.L1: | |
mov eax, ecx | |
ret | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.globl main | |
main: | |
.L0: | |
movl $1, %eax | |
addl $2, %eax | |
movl %eax, %ecx | |
incl %ecx | |
testl %ecx, %ecx | |
je .L1 | |
.L2: | |
ret | |
.L1: | |
movl %ecx, %eax | |
ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment