macaw/x86/tests/x64/test-direct-calls.s
2017-09-27 15:54:43 -07:00

112 lines
1.8 KiB
ArmAsm

.file "shadow.c"
.comm g1,4,4
.comm g2,4,4
.comm g3,4,4
.comm g4,4,4
.text
.globl f2
.type f2, @function
f2:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
leaq g2(%rip), %rax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size f2, .-f2
.globl f1
.type f1, @function
f1:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
pushq %rbx
subq $40, %rsp
.cfi_offset 3, -24
movq %rdi, -32(%rbp)
movq %rsi, -40(%rbp)
movq %rdx, -48(%rbp)
leaq g1(%rip), %rax
movq %rax, -16(%rbp)
movq -32(%rbp), %rdx
movq -16(%rbp), %rax
addq %rax, %rdx
movq -40(%rbp), %rax
addq %rax, %rdx
movq -48(%rbp), %rax
addq %rdx, %rax
movq %rax, -16(%rbp)
movq -48(%rbp), %rax
addq %rax, %rax
addq %rax, -16(%rbp)
movq -40(%rbp), %rax
leaq -100(%rax), %rbx
movl $0, %eax
call f2
cltq
leaq (%rbx,%rax), %rcx
movq -16(%rbp), %rax
cqto
idivq %rcx
movq %rax, -16(%rbp)
movq -16(%rbp), %rax
addq $40, %rsp
popq %rbx
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size f1, .-f1
.globl _start
.type _start, @function
_start:
.LFB2:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
leaq g1(%rip), %rax
movq %rax, -8(%rbp)
leaq g2(%rip), %rax
movq %rax, -16(%rbp)
leaq g3(%rip), %rax
movq %rax, -24(%rbp)
movq -24(%rbp), %rdx
movq -16(%rbp), %rcx
movq -8(%rbp), %rax
movq %rcx, %rsi
movq %rax, %rdi
call f1
movl %eax, g1(%rip)
#APP
# 25 "shadow.c" 1
movq $60,%rax
movq $0,%rdi
syscall
# 0 "" 2
#NO_APP
nop
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE2:
.size _start, .-_start
.ident "GCC: (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005"
.section .note.GNU-stack,"",@progbits