Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cat sincos.c
- #include <math.h>
- void sincos(double theta, double *s, double *c) {
- *s = sin(theta);
- *c = cos(theta);
- }
- $ gcc -O3 -S sincos.c
- $ cat sincos.s
- .file "sincos.c"
- .text
- .p2align 4,,15
- .globl sincos
- .type sincos, @function
- sincos:
- .LFB3:
- .cfi_startproc
- movq %rbx, -16(%rsp)
- movq %rbp, -8(%rsp)
- subq $40, %rsp
- .cfi_def_cfa_offset 48
- movq %rdi, %rbp
- .cfi_offset 6, -16
- .cfi_offset 3, -24
- leaq 8(%rsp), %rdi
- movq %rsi, %rbx
- movq %rsp, %rsi
- call sincos
- movq 8(%rsp), %rax
- movq %rax, (%rbp)
- movq (%rsp), %rax
- movq 32(%rsp), %rbp
- movq %rax, (%rbx)
- movq 24(%rsp), %rbx
- addq $40, %rsp
- ret
- .cfi_endproc
- .LFE3:
- .size sincos, .-sincos
- .ident "GCC: (Debian 4.4.5-8) 4.4.5"
- .section .note.GNU-stack,"",@progbits
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement