-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharray.s
62 lines (62 loc) · 1.03 KB
/
array.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.file "array.c"
.section .rodata
.LC0:
.string "%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $64, %rsp
movl %edi, -52(%rbp)
movq %rsi, -64(%rbp)
movl $1, -32(%rbp)
movl $2, -28(%rbp)
movl $3, -24(%rbp)
movl $4, -20(%rbp)
movl $5, -16(%rbp)
movl $6, -12(%rbp)
movq -64(%rbp), %rax
addq $8, %rax
movq (%rax), %rax
movq %rax, %rdi
movl $0, %eax
call atoi
movl %eax, -36(%rbp)
movl -36(%rbp), %eax
cltq
movl -32(%rbp,%rax,4), %eax
movl %eax, %esi
movl $.LC0, %edi
movl $0, %eax
call printf
movl -36(%rbp), %eax
cltq
movl -32(%rbp,%rax,4), %eax
cmpl $3, %eax
jle .L2
movl -36(%rbp), %eax
cltq
movl $0, -32(%rbp,%rax,4)
movl $1, %eax
jmp .L4
.L2:
movl -36(%rbp), %eax
cltq
movl $1, -32(%rbp,%rax,4)
movl $0, %eax
.L4:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4"
.section .note.GNU-stack,"",@progbits