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 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
| 1 .file "main.c"
4 .text
5 Ltext0:
208 _f:
1:main.c **** #include <stdlib.h>
2:main.c **** #include <stdio.h>
3:main.c ****
4:main.c **** static int f() {
210 LM1:
211 0000 55 pushl %ebp
212 0001 89E5 movl %esp, %ebp
5:main.c **** return 10;
214 LM2:
215 0003 B80A0000 movl $10, %eax
215 00
6:main.c **** }
217 LM3:
218 0008 5D popl %ebp
219 0009 C3 ret
220 Lscope0:
224 _g:
7:main.c ****
8:main.c **** static int g() {
226 LM4:
227 000a 55 pushl %ebp
228 000b 89E5 movl %esp, %ebp
229 000d 83EC04 subl $4, %esp
9:main.c **** int x = 10;
231 LM5:
232 0010 C745FC0A movl $10, -4(%ebp)
232 000000
10:main.c **** return x;
234 LM6:
235 0017 8B45FC movl -4(%ebp), %eax
11:main.c **** }
237 LM7:
238 001a C9 leave
239 001b C3 ret
243 Lscope1:
247 _h:
12:main.c ****
13:main.c **** static int h() {
249 LM8:
250 001c 55 pushl %ebp
251 001d 89E5 movl %esp, %ebp
252 001f 83EC04 subl $4, %esp
14:main.c **** int const x = 10;
254 LM9:
255 0022 C745FC0A movl $10, -4(%ebp)
255 000000
15:main.c **** return x;
257 LM10:
258 0029 8B45FC movl -4(%ebp), %eax
16:main.c **** }
260 LM11:
261 002c C9 leave
262 002d C3 ret
266 Lscope2:
269 .section .rdata,"dr"
270 LC0:
271 0000 663A2025 .ascii "f: %d\12\0"
271 640A00
272 LC1:
273 0007 673A2025 .ascii "g: %d\12\0"
273 640A00
274 LC2:
275 000e 683A2025 .ascii "h: %d\12\0"
275 640A00
276 0015 00000000 .text
276 00000000
276 000000
280 .globl _main
282 _main:
17:main.c ****
18:main.c **** int main(int argc, char *argv[]) {
284 LM12:
285 002e 55 pushl %ebp
286 002f 89E5 movl %esp, %ebp
287 0031 83EC18 subl $24, %esp
288 0034 83E4F0 andl $-16, %esp
289 0037 B8000000 movl $0, %eax
289 00
290 003c 83C00F addl $15, %eax
291 003f 83C00F addl $15, %eax
292 0042 C1E804 shrl $4, %eax
293 0045 C1E004 sall $4, %eax
294 0048 8945FC movl %eax, -4(%ebp)
295 004b 8B45FC movl -4(%ebp), %eax
296 004e E8000000 call __alloca
296 00
298 LM13:
299 0053 E8000000 call ___main
299 00
19:main.c **** printf("f: %d\n", f());
301 LM14:
302 0058 E8A3FFFF call _f
302 FF
303 005d 89442404 movl %eax, 4(%esp)
304 0061 C7042400 movl $LC0, (%esp)
304 000000
305 0068 E8000000 call _printf
305 00
20:main.c **** printf("g: %d\n", g());
307 LM15:
308 006d E898FFFF call _g
308 FF
309 0072 89442404 movl %eax, 4(%esp)
310 0076 C7042407 movl $LC1, (%esp)
310 000000
311 007d E8000000 call _printf
311 00
21:main.c **** printf("h: %d\n", h());
313 LM16:
314 0082 E895FFFF call _h
314 FF
315 0087 89442404 movl %eax, 4(%esp)
316 008b C704240E movl $LC2, (%esp)
316 000000
317 0092 E8000000 call _printf
317 00
22:main.c **** return EXIT_SUCCESS;
319 LM17:
320 0097 B8000000 movl $0, %eax
320 00
23:main.c **** }
322 LM18:
323 009c C9 leave
324 009d C3 ret
325 Lscope3:
327 .text
329 Letext: |