Skip to content

Instantly share code, notes, and snippets.

@antonijn
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonijn/1673919f402ffc802439 to your computer and use it in GitHub Desktop.
Save antonijn/1673919f402ffc802439 to your computer and use it in GitHub Desktop.
acc <3
int main(void)
{
int i = 1 + 2;
int j = i + 1;
if (j)
return i;
return j;
}
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
.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