Created
June 16, 2018 03:48
-
-
Save ukitaka/b6c2ce12902fac1b4f1586bd7df80f9c to your computer and use it in GitHub Desktop.
clang -S -mllvm --x86-asm-syntax=intel test.c
This file contains 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
.section __TEXT,__text,regular,pure_instructions | |
.macosx_version_min 10, 13 | |
.intel_syntax noprefix | |
.globl _main ## -- Begin function main | |
.p2align 4, 0x90 | |
_main: ## @main | |
.cfi_startproc | |
## BB#0: | |
push rbp | |
Lcfi0: | |
.cfi_def_cfa_offset 16 | |
Lcfi1: | |
.cfi_offset rbp, -16 | |
mov rbp, rsp | |
Lcfi2: | |
.cfi_def_cfa_register rbp | |
sub rsp, 16 | |
lea rdi, [rip + L_.str] | |
mov esi, 2234 | |
mov dword ptr [rbp - 4], 0 | |
mov al, 0 | |
call _printf | |
xor esi, esi | |
mov dword ptr [rbp - 8], eax ## 4-byte Spill | |
mov eax, esi | |
add rsp, 16 | |
pop rbp | |
ret | |
.cfi_endproc | |
## -- End function | |
.section __TEXT,__cstring,cstring_literals | |
L_.str: ## @.str | |
.asciz "%d" | |
.subsections_via_symbols |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment