.file "bufdemo.c" .text .globl gets .type gets, @function gets: .LFB20: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 pushq %rbx .cfi_def_cfa_offset 24 .cfi_offset 3, -24 subq $24, %rsp .cfi_def_cfa_offset 48 movq %rdi, %rbp movq %fs:40, %rax movq %rax, 8(%rsp) xorl %eax, %eax movq stdin(%rip), %rdi call _IO_getc movq %rbp, %rcx jmp .L2 .L3: leaq 1(%rcx), %rbx movb %al, (%rcx) movq stdin(%rip), %rdi call _IO_getc movq %rbx, %rcx .L2: cmpl $-1, %eax setne %r8b cmpl $10, %eax setne %sil testb %sil, %r8b jne .L3 movb $0, (%rcx) movq %rbp, %rax movq 8(%rsp), %rdx xorq %fs:40, %rdx je .L4 call __stack_chk_fail .L4: addq $24, %rsp .cfi_def_cfa_offset 24 popq %rbx .cfi_def_cfa_offset 16 popq %rbp .cfi_def_cfa_offset 8 ret .cfi_endproc .LFE20: .size gets, .-gets .globl echo .type echo, @function echo: .LFB21: .cfi_startproc subq $24, %rsp .cfi_def_cfa_offset 32 movq %fs:40, %rax movq %rax, 8(%rsp) xorl %eax, %eax movq %rsp, %rdi call gets movq %rsp, %rdi call puts movq 8(%rsp), %rax xorq %fs:40, %rax je .L7 call __stack_chk_fail .L7: addq $24, %rsp .cfi_def_cfa_offset 8 .p2align 4,,2 ret .cfi_endproc .LFE21: .size echo, .-echo .globl call_echo .type call_echo, @function call_echo: .LFB22: .cfi_startproc subq $24, %rsp .cfi_def_cfa_offset 32 movq %fs:40, %rax movq %rax, 8(%rsp) xorl %eax, %eax call echo movq 8(%rsp), %rax xorq %fs:40, %rax je .L10 call __stack_chk_fail .L10: addq $24, %rsp .cfi_def_cfa_offset 8 .p2align 4,,2 ret .cfi_endproc .LFE22: .size call_echo, .-call_echo .section .rodata.str1.1,"aMS",@progbits,1 .LC0: .string "I've been smashed!" .text .globl smash .type smash, @function smash: .LFB23: .cfi_startproc subq $24, %rsp .cfi_def_cfa_offset 32 movq %fs:40, %rax movq %rax, 8(%rsp) xorl %eax, %eax movl $.LC0, %edi call puts movl $0, %edi call exit .cfi_endproc .LFE23: .size smash, .-smash .section .rodata.str1.1 .LC1: .string "Type a string:" .text .globl main .type main, @function main: .LFB24: .cfi_startproc subq $24, %rsp .cfi_def_cfa_offset 32 movq %fs:40, %rax movq %rax, 8(%rsp) xorl %eax, %eax movl $.LC1, %edi call printf movl $0, %eax call call_echo movl $0, %eax movq 8(%rsp), %rdx xorq %fs:40, %rdx je .L16 call __stack_chk_fail .L16: addq $24, %rsp .cfi_def_cfa_offset 8 ret .cfi_endproc .LFE24: .size main, .-main .ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-28)" .section .note.GNU-stack,"",@progbits