clarify the purpose of this project
[nyanglibc.git] / gmon / sprofil.shared.s
blob0a43cfd7e641191bfe68f7a7dc6c37f369fac6de
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .type profil_count, @function
9 profil_count:
10 movq 16+prof_info(%rip), %rdx
11 cmpq %rdi, 32(%rdx)
12 ja .L2
13 cmpq %rdi, 40(%rdx)
14 movq %rdx, %rax
15 ja .L3
16 .L2:
17 movl prof_info(%rip), %eax
18 movq 8+prof_info(%rip), %r9
19 xorl %ecx, %ecx
20 leal -1(%rax), %r8d
21 jmp .L8
22 .p2align 4,,10
23 .p2align 3
24 .L29:
25 cmpq %rdi, 40(%rax)
26 ja .L28
27 leaq 1(%rdx), %rcx
28 cmpq %r8, %rcx
29 ja .L6
30 .L8:
31 leaq (%rcx,%r8), %rdx
32 shrq %rdx
33 leaq (%rdx,%rdx,2), %rax
34 salq $4, %rax
35 addq %r9, %rax
36 cmpq %rdi, 32(%rax)
37 jbe .L29
38 leaq -1(%rdx), %r8
39 cmpq %r8, %rcx
40 jbe .L8
41 .L6:
42 movq 24+prof_info(%rip), %rdx
43 .L3:
44 subq (%rdx), %rdi
45 testl %esi, %esi
46 movl 16(%rdx), %r8d
47 movq 8(%rax), %rcx
48 je .L30
49 movq %rdi, %rdx
50 shrq $18, %rdi
51 shrq $2, %rdx
52 movzwl %dx, %edx
53 imulq %r8, %rdx
54 imulq %r8, %rdi
55 shrq $16, %rdx
56 addq %rdx, %rdi
57 cmpq %rdi, %rcx
58 jbe .L31
59 movq 24(%rax), %rax
60 leaq (%rax,%rdi,4), %rdx
61 movl (%rdx), %eax
62 cmpl $-1, %eax
63 je .L1
64 addl $1, %eax
65 movl %eax, (%rdx)
66 ret
67 .p2align 4,,10
68 .p2align 3
69 .L30:
70 movq %rdi, %rdx
71 shrq $17, %rdi
72 shrq %rdx
73 movzwl %dx, %edx
74 imulq %r8, %rdx
75 imulq %r8, %rdi
76 shrq $16, %rdx
77 addq %rdx, %rdi
78 cmpq %rdi, %rcx
79 jbe .L32
80 movq 24(%rax), %rax
81 leaq (%rax,%rdi,2), %rdx
82 movzwl (%rdx), %eax
83 cmpw $-1, %ax
84 je .L1
85 addl $1, %eax
86 movw %ax, (%rdx)
87 ret
88 .p2align 4,,10
89 .p2align 3
90 .L32:
91 movq 24+prof_info(%rip), %rax
92 movq 24(%rax), %rax
93 addw $1, (%rax)
94 ret
95 .p2align 4,,10
96 .p2align 3
97 .L31:
98 movq 24+prof_info(%rip), %rax
99 movq 24(%rax), %rax
100 addl $1, (%rax)
102 .p2align 4,,10
103 .p2align 3
104 .L1:
105 rep ret
106 .p2align 4,,10
107 .p2align 3
108 .L28:
109 movq %rax, 16+prof_info(%rip)
110 movq 24+prof_info(%rip), %rdx
111 jmp .L3
112 .size profil_count, .-profil_count
113 .p2align 4,,15
114 .type __profil_counter_ushort, @function
115 __profil_counter_ushort:
116 movq 168(%rdx), %rdi
117 xorl %esi, %esi
118 call profil_count
120 .size __profil_counter_ushort, .-__profil_counter_ushort
121 .p2align 4,,15
122 .type __profil_counter_uint, @function
123 __profil_counter_uint:
124 movq 168(%rdx), %rdi
125 movl $1, %esi
126 call profil_count
128 .size __profil_counter_uint, .-__profil_counter_uint
129 .p2align 4,,15
130 .type pcmp, @function
131 pcmp:
132 movq (%rdi), %rcx
133 movq (%rsi), %rdx
134 movl $1, %eax
135 movq 16(%rdx), %rdx
136 cmpq %rdx, 16(%rcx)
137 jb .L35
138 seta %al
139 movzbl %al, %eax
140 negl %eax
141 .L35:
142 rep ret
143 .size pcmp, .-pcmp
144 .p2align 4,,15
145 .type insert.part.2, @function
146 insert.part.2:
147 pushq %r15
148 pushq %r14
149 movl %edi, %r15d
150 pushq %r13
151 pushq %r12
152 movq %rsi, %r13
153 pushq %rbp
154 pushq %rbx
155 movq %rdx, %r12
156 movq %rcx, %rbp
157 subq $24, %rsp
158 movl prof_info(%rip), %eax
159 movl %r8d, 12(%rsp)
160 testl %eax, %eax
161 jne .L39
162 movl $48, %edi
163 call malloc@PLT
164 movl 12(%rsp), %r8d
165 movq %rax, %r14
166 .L40:
167 testq %r14, %r14
168 je .L44
169 movl prof_info(%rip), %edi
170 movslq %r15d, %rax
171 leaq (%rax,%rax,2), %rax
172 movl %edi, %edx
173 salq $4, %rax
174 subl %r15d, %edx
175 leaq (%r14,%rax), %rbx
176 jne .L57
177 .L42:
178 cmpl $1, %r8d
179 movq 8(%rbp), %rax
180 movq 16(%rbp), %rcx
181 sbbq %rsi, %rsi
182 xorl %edx, %edx
183 addl $1, %edi
184 andq $-2, %rsi
185 addq $4, %rsi
186 movq %rcx, (%rbx)
187 divq %rsi
188 movq 0(%rbp), %rdx
189 movl %edi, prof_info(%rip)
190 movq %rax, 8(%rbx)
191 movq 24(%rbp), %rax
192 movq %r14, 8+prof_info(%rip)
193 movq %rdx, 24(%rbx)
194 movq %r13, 32(%rbx)
195 movq %r12, 40(%rbx)
196 cmpq $2, %rax
197 movl %eax, 16(%rbx)
198 jne .L46
199 testq %rcx, %rcx
200 je .L58
201 .L46:
202 xorl %eax, %eax
203 .L38:
204 addq $24, %rsp
205 popq %rbx
206 popq %rbp
207 popq %r12
208 popq %r13
209 popq %r14
210 popq %r15
212 .p2align 4,,10
213 .p2align 3
214 .L39:
215 addl $1, %eax
216 movq 8+prof_info(%rip), %rdi
217 leaq (%rax,%rax,2), %rsi
218 salq $4, %rsi
219 call realloc@PLT
220 movl 12(%rsp), %r8d
221 movq %rax, %r14
222 jmp .L40
223 .p2align 4,,10
224 .p2align 3
225 .L58:
226 movq %r14, 24+prof_info(%rip)
227 addq $24, %rsp
228 xorl %eax, %eax
229 popq %rbx
230 popq %rbp
231 popq %r12
232 popq %r13
233 popq %r14
234 popq %r15
236 .p2align 4,,10
237 .p2align 3
238 .L57:
239 movl %edx, %edx
240 leaq 48(%r14,%rax), %rdi
241 movq %rbx, %rsi
242 leaq (%rdx,%rdx,2), %rdx
243 movl %r8d, 12(%rsp)
244 salq $4, %rdx
245 call __GI_memmove
246 movl prof_info(%rip), %edi
247 movl 12(%rsp), %r8d
248 jmp .L42
249 .L44:
250 movl $-1, %eax
251 jmp .L38
252 .size insert.part.2, .-insert.part.2
253 .section .rodata.str1.1,"aMS",@progbits,1
254 .LC0:
255 .string "../sysdeps/posix/sprofil.c"
256 .section .rodata.str1.8,"aMS",@progbits,1
257 .align 8
258 .LC1:
259 .string "pc_to_index (pc - 1, offset, scale, prof_uint) < n && pc_to_index (pc, offset, scale, prof_uint) >= n"
260 .text
261 .p2align 4,,15
262 .globl __sprofil
263 .type __sprofil, @function
264 __sprofil:
265 pushq %rbp
266 movq %rsp, %rbp
267 pushq %r15
268 pushq %r14
269 pushq %r13
270 pushq %r12
271 movslq %esi, %r12
272 pushq %rbx
273 leaq 22(,%r12,8), %rax
274 movq %r12, %r13
275 subq $232, %rsp
276 andq $-16, %rax
277 movl %ecx, -256(%rbp)
278 subq %rax, %rsp
279 testq %rdx, %rdx
280 movq %rsp, %rbx
281 je .L60
282 movq %rdx, %r14
283 movq %rdi, -248(%rbp)
284 call __GI___profile_frequency
285 movl %eax, %ecx
286 movl $1000000, %eax
287 movq -248(%rbp), %rdi
288 cltd
289 idivl %ecx
290 movabsq $4835703278458516699, %rdx
291 movslq %eax, %rcx
292 movq %rcx, %rax
293 mulq %rdx
294 shrq $18, %rdx
295 movq %rdx, (%r14)
296 imulq $1000000, %rdx, %rdx
297 subq %rdx, %rcx
298 movq %rcx, 8(%r14)
299 .L60:
300 movl prof_info(%rip), %r8d
301 testl %r8d, %r8d
302 jne .L92
303 leaq default_overflow_region(%rip), %rax
304 testl %r13d, %r13d
305 movq $0, 8+prof_info(%rip)
306 movq %rax, 24+prof_info(%rip)
307 jle .L65
308 leal -1(%r13), %r8d
309 movq %rbx, %r14
310 movq %r8, %rax
311 salq $5, %rax
312 leaq 32(%rdi,%rax), %rdx
313 movq %rbx, %rax
314 .p2align 4,,10
315 .p2align 3
316 .L66:
317 movq %rdi, (%rax)
318 addq $32, %rdi
319 addq $8, %rax
320 cmpq %rdi, %rdx
321 jne .L66
322 leaq pcmp(%rip), %rcx
323 movl $8, %edx
324 movq %r12, %rsi
325 movq %rbx, %rdi
326 movq %r8, -248(%rbp)
327 call __GI_qsort
328 movl -256(%rbp), %eax
329 movq -248(%rbp), %r8
330 andl $1, %eax
331 cmpl $1, %eax
332 movl %eax, -252(%rbp)
333 sbbq %rax, %rax
334 andq $-2, %rax
335 addq $4, %rax
336 movq %rax, -272(%rbp)
337 leaq 8(%rbx,%r8,8), %rax
338 movq %rax, -264(%rbp)
339 .p2align 4,,10
340 .p2align 3
341 .L77:
342 movq (%r14), %r15
343 movq 24(%r15), %rcx
344 cmpq $1, %rcx
345 jbe .L68
346 movq -272(%rbp), %rbx
347 movq 8(%r15), %rax
348 xorl %edx, %edx
349 movl %ecx, %ecx
350 movq 16(%r15), %rsi
351 divq %rbx
352 xorl %edx, %edx
353 movq %rax, %r8
354 movq %rbx, %rax
355 imulq %r8, %rax
356 divq %rcx
357 salq $16, %rax
358 leaq (%rax,%rsi), %rdi
359 movq %rdx, %rax
360 xorl %edx, %edx
361 salq $16, %rax
362 divq %rcx
363 xorl %edx, %edx
364 leaq (%rdi,%rax), %r12
365 movq %r12, %rax
366 subq %rsi, %rax
367 divq %rbx
368 movzwl %ax, %edi
369 shrq $16, %rax
370 imulq %rcx, %rdi
371 imulq %rcx, %rax
372 shrq $16, %rdi
373 addq %rdi, %rax
374 cmpq %r8, %rax
375 movq %rsi, %rax
376 adcq $0, %r12
377 notq %rax
378 xorl %edx, %edx
379 addq %r12, %rax
380 divq %rbx
381 movzwl %ax, %edi
382 shrq $16, %rax
383 imulq %rcx, %rdi
384 imulq %rcx, %rax
385 shrq $16, %rdi
386 addq %rdi, %rax
387 cmpq %rax, %r8
388 jbe .L70
389 movq %r12, %rax
390 xorl %edx, %edx
391 subq %rsi, %rax
392 divq %rbx
393 movzwl %ax, %edi
394 shrq $16, %rax
395 imulq %rcx, %rdi
396 imulq %rax, %rcx
397 shrq $16, %rdi
398 addq %rdi, %rcx
399 cmpq %rcx, %r8
400 ja .L70
401 movl prof_info(%rip), %edi
402 xorl %ebx, %ebx
403 leaq prof_info(%rip), %r13
404 movq 8+prof_info(%rip), %rcx
405 testl %edi, %edi
406 je .L93
407 .p2align 4,,10
408 .p2align 3
409 .L75:
410 movl %ebx, %eax
411 leaq (%rax,%rax,2), %r9
412 salq $4, %r9
413 leaq (%rcx,%r9), %rax
414 movq %r9, -248(%rbp)
415 movq 32(%rax), %rdx
416 cmpq %rsi, %rdx
417 jbe .L73
418 cmpq %r12, %rdx
419 movl %ebx, %edi
420 ja .L72
421 movl -252(%rbp), %r8d
422 movq %r15, %rcx
423 call insert.part.2
424 testl %eax, %eax
425 movq -248(%rbp), %r9
426 js .L76
427 movq 8+prof_info(%rip), %rcx
428 leaq (%rcx,%r9), %rax
429 .L73:
430 addl $1, %ebx
431 cmpl 0(%r13), %ebx
432 movq 40(%rax), %rsi
433 jb .L75
434 movl %ebx, %edi
435 .L72:
436 cmpq %rsi, %r12
437 ja .L94
438 .L68:
439 addq $8, %r14
440 cmpq %r14, -264(%rbp)
441 jne .L77
442 movl prof_info(%rip), %edx
443 xorl %eax, %eax
444 testl %edx, %edx
445 je .L59
446 .L95:
447 movq 8+prof_info(%rip), %rax
448 testb $1, -256(%rbp)
449 leaq __profil_counter_uint(%rip), %rdx
450 leaq -208(%rbp), %rsi
451 movl $27, %edi
452 movl $268435460, -72(%rbp)
453 movq $-1, -200(%rbp)
454 movq %rax, 16+prof_info(%rip)
455 leaq __profil_counter_ushort(%rip), %rax
456 cmovne %rdx, %rax
457 leaq 64+prof_info(%rip), %rdx
458 movq %rax, -208(%rbp)
459 call __GI___sigaction
460 testl %eax, %eax
461 js .L91
462 movq $0, -224(%rbp)
463 movq $1, -216(%rbp)
464 leaq -240(%rbp), %rsi
465 movdqa -224(%rbp), %xmm0
466 leaq 32+prof_info(%rip), %rdx
467 movl $2, %edi
468 movaps %xmm0, -240(%rbp)
469 call __setitimer
470 leaq -40(%rbp), %rsp
471 popq %rbx
472 popq %r12
473 popq %r13
474 popq %r14
475 popq %r15
476 popq %rbp
478 .p2align 4,,10
479 .p2align 3
480 .L94:
481 movl -252(%rbp), %r8d
482 movq %r15, %rcx
483 movq %r12, %rdx
484 call insert.part.2
485 testl %eax, %eax
486 jns .L68
487 .p2align 4,,10
488 .p2align 3
489 .L76:
490 movq 8+prof_info(%rip), %rdi
491 call free@PLT
492 movl $0, prof_info(%rip)
493 movq $0, 8+prof_info(%rip)
494 .L91:
495 movl $-1, %eax
496 .L59:
497 leaq -40(%rbp), %rsp
498 popq %rbx
499 popq %r12
500 popq %r13
501 popq %r14
502 popq %r15
503 popq %rbp
505 .p2align 4,,10
506 .p2align 3
507 .L92:
508 leaq 32+prof_info(%rip), %rsi
509 xorl %edx, %edx
510 movl $2, %edi
511 call __setitimer
512 testl %eax, %eax
513 js .L91
514 leaq 64+prof_info(%rip), %rsi
515 xorl %edx, %edx
516 movl $27, %edi
517 call __GI___sigaction
518 testl %eax, %eax
519 js .L91
520 movq 8+prof_info(%rip), %rdi
521 call free@PLT
522 leaq -40(%rbp), %rsp
523 xorl %eax, %eax
524 popq %rbx
525 popq %r12
526 popq %r13
527 popq %r14
528 popq %r15
529 popq %rbp
531 .L93:
532 xorl %edi, %edi
533 jmp .L72
534 .L65:
535 leaq pcmp(%rip), %rcx
536 movl $8, %edx
537 movq %r12, %rsi
538 movq %rbx, %rdi
539 call __GI_qsort
540 movl prof_info(%rip), %edx
541 xorl %eax, %eax
542 testl %edx, %edx
543 jne .L95
544 jmp .L59
545 .L70:
546 leaq __PRETTY_FUNCTION__.5743(%rip), %rcx
547 leaq .LC0(%rip), %rsi
548 leaq .LC1(%rip), %rdi
549 movl $102, %edx
550 call __GI___assert_fail
551 .size __sprofil, .-__sprofil
552 .weak sprofil
553 .set sprofil,__sprofil
554 .section .rodata.str1.8
555 .align 8
556 .type __PRETTY_FUNCTION__.5743, @object
557 .size __PRETTY_FUNCTION__.5743, 12
558 __PRETTY_FUNCTION__.5743:
559 .string "index_to_pc"
560 .local prof_info
561 .comm prof_info,216,32
562 .section .data.rel.local,"aw",@progbits
563 .align 32
564 .type default_overflow_region, @object
565 .size default_overflow_region, 48
566 default_overflow_region:
567 .quad 0
568 .quad 1
569 .long 2
570 .zero 4
571 .quad overflow_counter
572 .quad 0
573 .quad -1
574 .local overflow_counter
575 .comm overflow_counter,4,4
576 .hidden __setitimer