Skip to content

Instantly share code, notes, and snippets.

@mrnugget
Created August 15, 2014 12:37
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 mrnugget/8c150423993c12469469 to your computer and use it in GitHub Desktop.
Save mrnugget/8c150423993c12469469 to your computer and use it in GitHub Desktop.
Stack Usage
int main(int argc, char *argv[])
{
int i = 10;
int j = 15;
int k = 20;
int l = i + j;
return 0;
}
.section __TEXT,__text,regular,pure_instructions
.globl _main
.align 4, 0x90
_main: ## @main
.cfi_startproc
## BB#0:
pushq %rbp
Ltmp2:
.cfi_def_cfa_offset 16
Ltmp3:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp4:
.cfi_def_cfa_register %rbp
movl $0, %eax
movl $0, -4(%rbp)
movl %edi, -8(%rbp)
movq %rsi, -16(%rbp)
movl $10, -20(%rbp)
movl $15, -24(%rbp)
movl $20, -28(%rbp)
movl -20(%rbp), %edi
addl -24(%rbp), %edi
movl %edi, -32(%rbp)
popq %rbp
ret
.cfi_endproc
.subsections_via_symbols
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment