Created
October 24, 2013 21:10
-
-
Save rf/7145044 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$ cat thing.s | |
.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 | |
leaq L_.str(%rip), %rdi | |
movl $8, %esi | |
movl $8, %edx | |
xorb %al, %al | |
callq _printf | |
xorl %eax, %eax | |
popq %rbp | |
ret | |
.cfi_endproc | |
.section __TEXT,__cstring,cstring_literals | |
L_.str: ## @.str | |
.asciz "%d, %d\n" | |
.subsections_via_symbols | |
This file contains hidden or 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
$ cat thing.c | |
#include <stdio.h> | |
#include <math.h> | |
int | |
main (void) { | |
int a, b, c = 4; | |
a = pow(c, 2) - (3*c) + 4; | |
b = (c * (c - 3)) + 4; | |
printf("%d, %d\n", a, b); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment