Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@chamons
Created April 18, 2015 19:42
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 chamons/054ce2f59a9a14e62fc4 to your computer and use it in GitHub Desktop.
Save chamons/054ce2f59a9a14e62fc4 to your computer and use it in GitHub Desktop.
.section __TEXT,__text,regular,pure_instructions
.macosx_version_min 10, 10
.globl _main
.align 4, 0x90
_main: ## @main
.cfi_startproc
## BB#0:
pushq %rbp
Ltmp0:
.cfi_def_cfa_offset 16
Ltmp1:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp2:
.cfi_def_cfa_register %rbp
subq $16, %rsp
movl $0, -4(%rbp)
movl $0, -8(%rbp)
movl $0, -12(%rbp)
LBB0_1: ## =>This Inner Loop Header: Depth=1
cmpl $10000, -12(%rbp) ## imm = 0x2710
jg LBB0_4
## BB#2: ## in Loop: Header=BB0_1 Depth=1
movl -12(%rbp), %eax
movl -8(%rbp), %ecx
addl %eax, %ecx
movl %ecx, -8(%rbp)
## BB#3: ## in Loop: Header=BB0_1 Depth=1
movl -12(%rbp), %eax
addl $1, %eax
movl %eax, -12(%rbp)
jmp LBB0_1
LBB0_4:
leaq L_.str(%rip), %rdi
movl -8(%rbp), %esi
movb $0, %al
callq _printf
xorl %esi, %esi
movl %eax, -16(%rbp) ## 4-byte Spill
movl %esi, %eax
addq $16, %rsp
popq %rbp
retq
.cfi_endproc
.section __TEXT,__cstring,cstring_literals
L_.str: ## @.str
.asciz "%d\n"
.subsections_via_symbols
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment