Skip to content

Instantly share code, notes, and snippets.

@samrat
Created June 2, 2017 04:48
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 samrat/70381c9cee58d1f981d72337c1848038 to your computer and use it in GitHub Desktop.
Save samrat/70381c9cee58d1f981d72337c1848038 to your computer and use it in GitHub Desktop.
function w $foo(w %x) {
@start
jnz %x, @cond, @end
@cond
%B0 =l alloc4 8
%B1 =l add %B0, 4
storew 12, %B0
storew 111, %B1
%v5 =w add 1, %x
ret %B0
@end
ret 12
}
.text
foo:
pushq %rbp
movq %rsp, %rbp
cmpl $0, %edi
jnz .Lbb2
movl $12, %eax
leave
ret
.Lbb2:
subq $16, %rsp
movq %rsp, %rax
movl $12, (%rax)
movl $111, 4(%rax)
leave
ret
/* end function foo */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment