Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .file "funcptrtest.c"
- .text
- .globl b
- .section .rodata
- .align 4
- .type b, @object
- .size b, 4
- b:
- .long 23
- .align 8
- .LC0:
- .string "Value of a (%d) is lesser then value of b (%d)\n"
- .align 8
- .LC1:
- .string "Value of a (%d) is equal value of b (%d)\n"
- .align 8
- .LC2:
- .string "Value of a (%d) is greater than value of b (%d)\n"
- .text
- .globl fun
- .type fun, @function
- fun:
- .LFB0:
- .cfi_startproc
- endbr64
- pushq %rbp
- .cfi_def_cfa_offset 16
- .cfi_offset 6, -16
- movq %rsp, %rbp
- .cfi_def_cfa_register 6
- subq $16, %rsp
- movl %edi, -4(%rbp)
- movl $23, %eax
- cmpl %eax, -4(%rbp)
- jge .L2.L2:
- movl $23, %eax
- cmpl %eax, -4(%rbp)
- jne .L4
- movl $23, %edx
- movl -4(%rbp), %eax
- movl %eax, %esi
- leaq .LC1(%rip), %rax
- movq %rax, %rdi
- movl $0, %eax
- call printf@PLT
- jmp .L5
- .L2:
- movl $23, %eax
- cmpl %eax, -4(%rbp)
- jne .L4
- movl $23, %edx
- movl -4(%rbp), %eax
- movl %eax, %esi
- leaq .LC1(%rip), %rax
- movq %rax, %rdi
- movl $0, %eax
- call printf@PLT
- .L2:
- movl $23, %eax
- cmpl %eax, -4(%rbp)
- jne .L4
- movl $23, %edx
- movl -4(%rbp), %eax
- movl %eax, %esi
- leaq .LC1(%rip), %rax
- movq %rax, %rdi
- movl $0, %eax
- call printf@PLT
- jmp .L5
- .L4:
- movl $23, %eax
- cmpl %eax, -4(%rbp)
- jle .L5
- movl $23, %edx
- movl -4(%rbp), %eax
- movl %eax, %esi
- leaq .LC2(%rip), %rax
- movq %rax, %rdi
- movl $0, %eax
- call printf@PLT
- .L5:
- nop
- leave
- .cfi_def_cfa 7, 8
- ret
- .cfi_endproc
- .LFE0:
- .size fun, .-fun
- .globl main
- .type main, @function
- main:
- .LFB1:
- .cfi_startproc
- endbr64
- pushq %rbp
- .cfi_def_cfa_offset 16
- .cfi_offset 6, -16
- movq %rsp, %rbp
- .cfi_def_cfa_register 6
- subq $32, %rsp
- movl %edi, -20(%rbp)
- movq %rsi, -32(%rbp)
- movl $0, -12(%rbp)
- leaq fun(%rip), %rax
- movq %rax, -8(%rbp)
- movl $23, %edx
- movq -8(%rbp), %rax
- movl %edx, %edi
- call *%rax
- movl $1, -12(%rbp)
- jmp .L7
- .L8:
- movl -12(%rbp), %eax
- movq -8(%rbp), %rdx
- movl %eax, %edi
- call *%rdx
- addl $11, -12(%rbp)
- .L7:
- cmpl $100, -12(%rbp)
- jle .L8
- movl $0, %eax
- leave
- .cfi_def_cfa 7, 8
- ret
- .cfi_endproc
- .LFE1:
- .size main, .-main
- .ident "GCC: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0"
- .section .note.GNU-stack,"",@progbits
- .section .note.gnu.property,"a"
- .align 8
- .long 1f - 0f
- .long 4f - 1f
- .long 5
- 0:
- .string "GNU"
- 1:
- .align 8
- .long 0xc0000002
- .long 3f - 2f
- 2:
- .long 0x3
- 3:
- .align 8
- 4:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement