|
| 1 | + .section __TEXT,__text,regular,pure_instructions |
| 2 | + .build_version macos, 13, 0 sdk_version 13, 3 |
| 3 | + .intel_syntax noprefix |
| 4 | + .globl _main ## -- Begin function main |
| 5 | + .p2align 4, 0x90 |
| 6 | +_main: ## @main |
| 7 | + .cfi_startproc |
| 8 | +## %bb.0: |
| 9 | + push rbp |
| 10 | + .cfi_def_cfa_offset 16 |
| 11 | + .cfi_offset rbp, -16 |
| 12 | + mov rbp, rsp |
| 13 | + .cfi_def_cfa_register rbp |
| 14 | + sub rsp, 32 |
| 15 | + mov dword ptr [rbp - 4], 0 |
| 16 | + mov dword ptr [rbp - 8], edi |
| 17 | + mov qword ptr [rbp - 16], rsi |
| 18 | + mov rax, qword ptr [rbp - 16] |
| 19 | + mov rsi, qword ptr [rax] |
| 20 | + lea rdi, [rip + L_.str] |
| 21 | + mov al, 0 |
| 22 | + call _printf |
| 23 | + cmp dword ptr [rbp - 8], 1 |
| 24 | + jle LBB0_6 |
| 25 | +## %bb.1: |
| 26 | + lea rdi, [rip + L_.str.1] |
| 27 | + lea rsi, [rip + L_.str.2] |
| 28 | + mov al, 0 |
| 29 | + call _printf |
| 30 | + mov dword ptr [rbp - 20], 1 |
| 31 | +LBB0_2: ## =>This Inner Loop Header: Depth=1 |
| 32 | + mov eax, dword ptr [rbp - 20] |
| 33 | + cmp eax, dword ptr [rbp - 8] |
| 34 | + jge LBB0_5 |
| 35 | +## %bb.3: ## in Loop: Header=BB0_2 Depth=1 |
| 36 | + mov rax, qword ptr [rbp - 16] |
| 37 | + movsxd rcx, dword ptr [rbp - 20] |
| 38 | + mov rsi, qword ptr [rax + 8*rcx] |
| 39 | + lea rdi, [rip + L_.str.3] |
| 40 | + mov al, 0 |
| 41 | + call _printf |
| 42 | +## %bb.4: ## in Loop: Header=BB0_2 Depth=1 |
| 43 | + mov eax, dword ptr [rbp - 20] |
| 44 | + add eax, 1 |
| 45 | + mov dword ptr [rbp - 20], eax |
| 46 | + jmp LBB0_2 |
| 47 | +LBB0_5: |
| 48 | + jmp LBB0_6 |
| 49 | +LBB0_6: |
| 50 | + xor eax, eax |
| 51 | + add rsp, 32 |
| 52 | + pop rbp |
| 53 | + ret |
| 54 | + .cfi_endproc |
| 55 | + ## -- End function |
| 56 | + .section __TEXT,__cstring,cstring_literals |
| 57 | +L_.str: ## @.str |
| 58 | + .asciz "filename: %s\n" |
| 59 | + |
| 60 | +L_.str.1: ## @.str.1 |
| 61 | + .asciz "%s\n" |
| 62 | + |
| 63 | +L_.str.2: ## @.str.2 |
| 64 | + .asciz "argv: " |
| 65 | + |
| 66 | +L_.str.3: ## @.str.3 |
| 67 | + .asciz "\t%s\n" |
| 68 | + |
| 69 | +.subsections_via_symbols |
0 commit comments