|
1 |
| - 1 .file "ts.c" |
2 |
| - 2 .text |
3 |
| - 3 .Ltext0: |
4 |
| - 4 .globl main |
5 |
| - 6 main: |
6 |
| - 7 .LFB2: |
7 |
| - 8 .file 1 "ts.c" |
8 |
| - 1:ts.c **** #include <stdlib.h> |
9 |
| - 2:ts.c **** |
10 |
| - 3:ts.c **** |
11 |
| - 4:ts.c **** int main() { |
12 |
| - 9 .loc 1 4 0 |
13 |
| - 10 .cfi_startproc |
14 |
| - 11 0000 55 pushq %rbp |
15 |
| - 12 .cfi_def_cfa_offset 16 |
16 |
| - 13 .cfi_offset 6, -16 |
17 |
| - 14 0001 4889E5 movq %rsp, %rbp |
18 |
| - 15 .cfi_def_cfa_register 6 |
19 |
| - 16 0004 53 pushq %rbx |
20 |
| - 17 0005 4883EC38 subq $56, %rsp |
21 |
| - 18 .cfi_offset 3, -24 |
22 |
| - 19 0009 4889E0 movq %rsp, %rax |
23 |
| - 20 000c 4889C3 movq %rax, %rbx |
24 |
| - 5:ts.c **** int n; |
25 |
| - 6:ts.c **** |
26 |
| - 7:ts.c **** int fuuuuuuuuuuuck[n]; |
27 |
| - 21 .loc 1 7 0 |
28 |
| - 22 000f 8B45EC movl -20(%rbp), %eax |
29 |
| - 23 0012 4C63C0 movslq %eax, %r8 |
30 |
| - 24 0015 4983E801 subq $1, %r8 |
31 |
| - 25 0019 4C8945E0 movq %r8, -32(%rbp) |
32 |
| - 26 001d 4C63C0 movslq %eax, %r8 |
33 |
| - 27 0020 4C89C6 movq %r8, %rsi |
34 |
| - 28 0023 BF000000 movl $0, %edi |
35 |
| - 28 00 |
36 |
| - 29 0028 4863F0 movslq %eax, %rsi |
37 |
| - 30 002b 4889F2 movq %rsi, %rdx |
38 |
| - 31 002e B9000000 movl $0, %ecx |
39 |
| - 31 00 |
40 |
| - 32 0033 4898 cltq |
41 |
| - 33 0035 48C1E002 salq $2, %rax |
42 |
| - 34 0039 488D5003 leaq 3(%rax), %rdx |
43 |
| - 35 003d B8100000 movl $16, %eax |
44 |
| - 35 00 |
45 |
| - 36 0042 4883E801 subq $1, %rax |
46 |
| - 37 0046 4801D0 addq %rdx, %rax |
47 |
| - 38 0049 B9100000 movl $16, %ecx |
48 |
| - 38 00 |
49 |
| - 39 004e BA000000 movl $0, %edx |
50 |
| - 39 00 |
51 |
| - 40 0053 48F7F1 divq %rcx |
52 |
| - 41 0056 486BC010 imulq $16, %rax, %rax |
53 |
| - 42 005a 4829C4 subq %rax, %rsp |
54 |
| - 43 005d 4889E0 movq %rsp, %rax |
55 |
| - 44 0060 4883C003 addq $3, %rax |
56 |
| - 45 0064 48C1E802 shrq $2, %rax |
57 |
| - 46 0068 48C1E002 salq $2, %rax |
58 |
| - 47 006c 488945D8 movq %rax, -40(%rbp) |
59 |
| - 8:ts.c **** int *heheheheheheheh; |
60 |
| - 9:ts.c **** heheheheheheheh = (int *) malloc (888); // 为了方便观测设置为 888 (4,8的倍数) 了, |
61 |
| - 48 .loc 1 9 0 |
62 |
| - 49 0070 BF780300 movl $888, %edi |
63 |
| - 49 00 |
64 |
| - 50 0075 E8000000 call malloc |
65 |
| - 50 00 |
66 |
| - 51 007a 488945D0 movq %rax, -48(%rbp) |
67 |
| - 10:ts.c **** |
68 |
| - 11:ts.c **** int * const nima = (int *) malloc (444); // 同上 |
69 |
| - 52 .loc 1 11 0 |
70 |
| - 53 007e BFBC0100 movl $444, %edi |
71 |
| - 53 00 |
72 |
| - 54 0083 E8000000 call malloc |
73 |
| - 54 00 |
74 |
| - 55 0088 488945C8 movq %rax, -56(%rbp) |
75 |
| - 12:ts.c **** nima[1] = 1314; |
76 |
| - 56 .loc 1 12 0 |
77 |
| - 57 008c 488B45C8 movq -56(%rbp), %rax |
78 |
| - 58 0090 4883C004 addq $4, %rax |
79 |
| - 59 0094 C7002205 movl $1314, (%rax) |
80 |
| - 59 0000 |
81 |
| - 13:ts.c **** |
82 |
| - 14:ts.c **** |
83 |
| - 15:ts.c **** fuuuuuuuuuuuck[1] = 13; |
84 |
| - 60 .loc 1 15 0 |
85 |
| - 61 009a 488B45D8 movq -40(%rbp), %rax |
86 |
| - 62 009e C740040D movl $13, 4(%rax) |
87 |
| - 62 000000 |
88 |
| - 16:ts.c **** heheheheheheheh[1] = 14; |
89 |
| - 63 .loc 1 16 0 |
90 |
| - 64 00a5 488B45D0 movq -48(%rbp), %rax |
91 |
| - 65 00a9 4883C004 addq $4, %rax |
92 |
| - 66 00ad C7000E00 movl $14, (%rax) |
93 |
| - 66 0000 |
94 |
| - 17:ts.c **** |
95 |
| - 18:ts.c **** return 0; |
96 |
| - 67 .loc 1 18 0 |
97 |
| - 68 00b3 B8000000 movl $0, %eax |
98 |
| - 68 00 |
99 |
| - 69 00b8 4889DC movq %rbx, %rsp |
100 |
| - 19:ts.c **** } |
101 |
| - 70 .loc 1 19 0 |
102 |
| - 71 00bb 488B5DF8 movq -8(%rbp), %rbx |
103 |
| - 72 00bf C9 leave |
104 |
| - 73 .cfi_def_cfa 7, 8 |
105 |
| - 74 00c0 C3 ret |
106 |
| - 75 .cfi_endproc |
107 |
| - 76 .LFE2: |
108 |
| - 78 .Letext0: |
| 1 | + .file "ts.c" |
| 2 | + .text |
| 3 | + .globl main |
| 4 | + .type main, @function |
| 5 | +main: |
| 6 | +.LFB2: |
| 7 | + .cfi_startproc |
| 8 | + pushq %rbp |
| 9 | + .cfi_def_cfa_offset 16 |
| 10 | + .cfi_offset 6, -16 |
| 11 | + movq %rsp, %rbp |
| 12 | + .cfi_def_cfa_register 6 |
| 13 | + pushq %rbx |
| 14 | + subq $56, %rsp |
| 15 | + .cfi_offset 3, -24 |
| 16 | + movq %rsp, %rax |
| 17 | + movq %rax, %rbx |
| 18 | + movl -20(%rbp), %eax |
| 19 | + movslq %eax, %r8 |
| 20 | + subq $1, %r8 |
| 21 | + movq %r8, -32(%rbp) |
| 22 | + movslq %eax, %r8 |
| 23 | + movq %r8, %rsi |
| 24 | + movl $0, %edi |
| 25 | + movslq %eax, %rsi |
| 26 | + movq %rsi, %rdx |
| 27 | + movl $0, %ecx |
| 28 | + cltq |
| 29 | + salq $2, %rax |
| 30 | + leaq 3(%rax), %rdx |
| 31 | + movl $16, %eax |
| 32 | + subq $1, %rax |
| 33 | + addq %rdx, %rax |
| 34 | + movl $16, %ecx |
| 35 | + movl $0, %edx |
| 36 | + divq %rcx |
| 37 | + imulq $16, %rax, %rax |
| 38 | + subq %rax, %rsp |
| 39 | + movq %rsp, %rax |
| 40 | + addq $3, %rax |
| 41 | + shrq $2, %rax |
| 42 | + salq $2, %rax |
| 43 | + movq %rax, -40(%rbp) |
| 44 | + movl $888, %edi |
| 45 | + call malloc |
| 46 | + movq %rax, -48(%rbp) |
| 47 | + movl $444, %edi |
| 48 | + call malloc |
| 49 | + movq %rax, -56(%rbp) |
| 50 | + movq -56(%rbp), %rax |
| 51 | + addq $4, %rax |
| 52 | + movl $1314, (%rax) |
| 53 | + movq -40(%rbp), %rax |
| 54 | + movl $13, 4(%rax) |
| 55 | + movq -48(%rbp), %rax |
| 56 | + addq $4, %rax |
| 57 | + movl $14, (%rax) |
| 58 | + movl $0, %eax |
| 59 | + movq %rbx, %rsp |
| 60 | + movq -8(%rbp), %rbx |
| 61 | + leave |
| 62 | + .cfi_def_cfa 7, 8 |
| 63 | + ret |
| 64 | + .cfi_endproc |
| 65 | +.LFE2: |
| 66 | + .size main, .-main |
| 67 | + .ident "GCC: (GNU) 4.8.2" |
| 68 | + .section .note.GNU-stack,"",@progbits |
0 commit comments