1 .file "test.c"
2 .intel_syntax noprefix
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
37 .Ltext0:
38
39
40 .globl some_function
42 some_function:
43 .LFB0:
44 .file 1 "test.c"
1:test.c ****
2:test.c ****
3:test.c **** int some_function(int a)
4:test.c **** {
45 .loc 1 4 0
46 .cfi_startproc
47 0000 55 push rbp
48 .LCFI0:
49 .cfi_def_cfa_offset 16
50 0001 4889E5 mov rbp, rsp
51 .cfi_offset 6, -16
52 .LCFI1:
53 .cfi_def_cfa_register 6
54 0004 897DFC mov DWORD PTR [rbp-4], edi
5:test.c **** a *= 5; // a is not really needed.
55 .loc 1 5 0
56 0007 8B55FC mov edx, DWORD PTR [rbp-4]
57 000a 89D0 mov eax, edx
58 000c C1E002 sal eax, 2
59 000f 01D0 add eax, edx
60 0011 8945FC mov DWORD PTR [rbp-4], eax
6:test.c **** return 42;
61 .loc 1 6 0
62 0014 B82A0000 mov eax, 42
62 00
7:test.c **** }
63 .loc 1 7 0
64 0019 C9 leave
65 .LCFI2:
66 .cfi_def_cfa 7, 8
67 001a C3 ret
68 .cfi_endproc
69 .LFE0:
71 .section .rodata
72 .LC0:
73 0000 54686973 .string "This is a test program."
73 20697320
73 61207465
73 73742070
73 726F6772
74 .text
75 .globl main
77 main:
78 .LFB1:
8:test.c ****
9:test.c **** int main(int argc, char* argv[])
10:test.c **** {
79 .loc 1 10 0
80 .cfi_startproc
81 001b 55 push rbp
82 .LCFI3:
83 .cfi_def_cfa_offset 16
84 001c 4889E5 mov rbp, rsp
85 .cfi_offset 6, -16
86 .LCFI4:
87 .cfi_def_cfa_register 6
88 001f 4883EC20 sub rsp, 32
89 0023 897DEC mov DWORD PTR [rbp-20], edi
90 0026 488975E0 mov QWORD PTR [rbp-32], rsi
11:test.c **** int variableA = 10;
91 .loc 1 11 0
92 002a C745FC0A mov DWORD PTR [rbp-4], 10
92 000000
12:test.c ****
13:test.c **** printf("This is a test program.\n");
93 .loc 1 13 0
94 0031 BF000000 mov edi, OFFSET FLAT:.LC0
94 00
95 0036 E8000000 call puts
95 00
14:test.c ****
15:test.c **** variableA += 5;
96 .loc 1 15 0
97 003b 8345FC05 add DWORD PTR [rbp-4], 5
16:test.c **** variableA += some_function(20);
98 .loc 1 16 0
99 003f BF140000 mov edi, 20
99 00
100 0044 E8000000 call some_function
100 00
101 0049 0145FC add DWORD PTR [rbp-4], eax
17:test.c ****
18:test.c **** return variableA;
102 .loc 1 18 0
103 004c 8B45FC mov eax, DWORD PTR [rbp-4]
19:test.c **** }
104 .loc 1 19 0
105 004f C9 leave
106 .LCFI5:
107 .cfi_def_cfa 7, 8
108 0050 C3 ret
109 .cfi_endproc
110 .LFE1:
112 .Letext0: