clarify the purpose of this project
[nyanglibc.git] / gmon / profil.s
blob2501dad55be35f8503f6d0fb0df84461ec960ab8
1 .text
2 .p2align 4,,15
3 .type __profil_counter, @function
4 __profil_counter:
5 movq 168(%rdx), %rdx
6 subq pc_offset(%rip), %rdx
7 movl pc_scale(%rip), %eax
8 movq %rdx, %rcx
9 shrq $17, %rdx
10 shrq %rcx
11 movzwl %cx, %ecx
12 imulq %rax, %rcx
13 imulq %rax, %rdx
14 shrq $16, %rcx
15 leaq (%rdx,%rcx), %rax
16 cmpq nsamples(%rip), %rax
17 jnb .L2
18 movq samples(%rip), %rdx
19 addw $1, (%rdx,%rax,2)
20 .L2:
21 ret
22 .size __profil_counter, .-__profil_counter
23 .p2align 4,,15
24 .globl __profil
25 .hidden __profil
26 .type __profil, @function
27 __profil:
28 pushq %r13
29 pushq %r12
30 movq %rdx, %r12
31 pushq %rbp
32 pushq %rbx
33 subq $200, %rsp
34 testq %rdi, %rdi
35 movq samples(%rip), %rdx
36 je .L16
37 testq %rdx, %rdx
38 movq %rdi, %rbp
39 movq %rsi, %rbx
40 movl %ecx, %r13d
41 je .L11
42 leaq otimer.4217(%rip), %rsi
43 xorl %edx, %edx
44 movl $2, %edi
45 call __setitimer
46 testl %eax, %eax
47 js .L9
48 leaq oact.4216(%rip), %rsi
49 xorl %edx, %edx
50 movl $27, %edi
51 call __sigaction
52 testl %eax, %eax
53 js .L9
54 .L11:
55 leaq __profil_counter(%rip), %rax
56 leaq 32(%rsp), %rsi
57 leaq oact.4216(%rip), %rdx
58 shrq %rbx
59 movl $27, %edi
60 movq %rbp, samples(%rip)
61 movq %rbx, nsamples(%rip)
62 movq %r12, pc_offset(%rip)
63 movl %r13d, pc_scale(%rip)
64 movq %rax, 32(%rsp)
65 movl $268435460, 168(%rsp)
66 movq $-1, 40(%rsp)
67 call __sigaction
68 testl %eax, %eax
69 js .L9
70 movq $0, 16(%rsp)
71 call __profile_frequency
72 movl %eax, %ecx
73 movl $1000000, %eax
74 movq %rsp, %rsi
75 cltd
76 movl $2, %edi
77 idivl %ecx
78 leaq otimer.4217(%rip), %rdx
79 cltq
80 movq %rax, 24(%rsp)
81 movdqa 16(%rsp), %xmm0
82 movaps %xmm0, (%rsp)
83 call __setitimer
84 .L4:
85 addq $200, %rsp
86 popq %rbx
87 popq %rbp
88 popq %r12
89 popq %r13
90 ret
91 .p2align 4,,10
92 .p2align 3
93 .L16:
94 xorl %eax, %eax
95 testq %rdx, %rdx
96 je .L4
97 leaq otimer.4217(%rip), %rsi
98 xorl %edx, %edx
99 movl $2, %edi
100 call __setitimer
101 testl %eax, %eax
102 js .L9
103 leaq oact.4216(%rip), %rsi
104 xorl %edx, %edx
105 movl $27, %edi
106 movq $0, samples(%rip)
107 call __sigaction
108 addq $200, %rsp
109 popq %rbx
110 popq %rbp
111 popq %r12
112 popq %r13
114 .p2align 4,,10
115 .p2align 3
116 .L9:
117 movl $-1, %eax
118 jmp .L4
119 .size __profil, .-__profil
120 .weak profil
121 .set profil,__profil
122 .local oact.4216
123 .comm oact.4216,152,32
124 .local otimer.4217
125 .comm otimer.4217,32,32
126 .local pc_scale
127 .comm pc_scale,4,4
128 .local pc_offset
129 .comm pc_offset,8,8
130 .local nsamples
131 .comm nsamples,8,8
132 .local samples
133 .comm samples,8,8
134 .hidden __profile_frequency
135 .hidden __sigaction
136 .hidden __setitimer