clarify the purpose of this project
[nyanglibc.git] / gmon / gmon.shared.s
blob5f78c139cb863800f2b3b56b34ed300bc1d6b7e0
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 callback, @function
9 callback:
10 movq 8(%rdi), %rcx
11 xorl %eax, %eax
12 cmpb $0, (%rcx)
13 jne .L1
14 movq (%rdi), %rax
15 movq %rax, (%rdx)
16 movl $1, %eax
17 .L1:
18 rep ret
19 .size callback, .-callback
20 .section .rodata.str1.1,"aMS",@progbits,1
21 .LC0:
22 .string "GMON_OUT_PREFIX"
23 .LC1:
24 .string "gmon.out"
25 .LC2:
26 .string "%s.%u"
27 .LC3:
28 .string "_mcleanup: gmon.out: %s\n"
29 .text
30 .p2align 4,,15
31 .type write_gmon, @function
32 write_gmon:
33 pushq %rbp
34 leaq .LC0(%rip), %rdi
35 movq %rsp, %rbp
36 pushq %r15
37 pushq %r14
38 pushq %r13
39 pushq %r12
40 pushq %rbx
41 subq $1768, %rsp
42 call __GI_getenv
43 testq %rax, %rax
44 je .L9
45 movq %rax, %rbx
46 movq __libc_enable_secure@GOTPCREL(%rip), %rax
47 movl (%rax), %edx
48 testl %edx, %edx
49 je .L50
50 .L9:
51 leaq .LC1(%rip), %rdi
52 xorl %eax, %eax
53 movl $438, %edx
54 movl $131649, %esi
55 call __GI___open_nocancel
56 testl %eax, %eax
57 movl %eax, %ebx
58 js .L51
59 .L8:
60 leaq -1776(%rbp), %rsi
61 movq $0, -1768(%rbp)
62 movl $20, %edx
63 movl %ebx, %edi
64 movl $1852796263, -1776(%rbp)
65 movl $1, -1772(%rbp)
66 movl $0, 16(%rsi)
67 call __GI___write_nocancel
68 leaq callback(%rip), %rdi
69 leaq -1784(%rbp), %rsi
70 movq $0, -1784(%rbp)
71 call __GI___dl_iterate_phdr
72 movq -1784(%rbp), %rax
73 movb $0, -1744(%rbp)
74 movq %rax, %rdi
75 movq 16+_gmonparam(%rip), %rax
76 testq %rax, %rax
77 jne .L48
78 leaq -1072(%rbp), %r13
79 leaq -1744(%rbp), %r12
80 leaq -1712(%rbp), %r15
81 .L11:
82 leaq -48(%rbp), %rcx
83 leaq -1785(%rbp), %r10
84 movb $1, -1785(%rbp)
85 movq %r13, %rax
86 movq %r15, %rdx
87 .p2align 4,,10
88 .p2align 3
89 .L12:
90 movq %rdx, 16(%rax)
91 movq %r10, (%rax)
92 addq $32, %rax
93 movq $1, -24(%rax)
94 movq $20, -8(%rax)
95 addq $20, %rdx
96 cmpq %rax, %rcx
97 jne .L12
98 movq 32+_gmonparam(%rip), %rax
99 xorl %edx, %edx
100 xorl %r14d, %r14d
101 shrq $3, %rax
102 testq %rax, %rax
103 movq %rax, -1800(%rbp)
104 je .L14
105 movq %r10, -1808(%rbp)
106 movq %rdi, %r10
107 .p2align 4,,10
108 .p2align 3
109 .L13:
110 movq 24+_gmonparam(%rip), %rax
111 movq (%rax,%r14,8), %rax
112 testq %rax, %rax
113 je .L15
114 movq 88+_gmonparam(%rip), %rdi
115 movq 64+_gmonparam(%rip), %rcx
116 movq 40+_gmonparam(%rip), %rsi
117 leaq 0(,%rdi,8), %r9
118 subq %r10, %rcx
119 imulq %r14, %r9
120 addq %rcx, %r9
121 .p2align 4,,10
122 .p2align 3
123 .L17:
124 leaq (%rax,%rax,2), %r8
125 movq %r9, -1744(%rbp)
126 salq $3, %r8
127 leaq (%rsi,%r8), %rax
128 movq (%rax), %rcx
129 subq %r10, %rcx
130 movq %rcx, -1736(%rbp)
131 movq 8(%rax), %rcx
132 movl %ecx, -1728(%rbp)
133 movslq %edx, %rcx
134 movl 16(%r12), %edi
135 leaq (%rcx,%rcx,4), %rcx
136 movdqa (%r12), %xmm0
137 addl $1, %edx
138 leaq (%r15,%rcx,4), %rcx
139 cmpl $32, %edx
140 movups %xmm0, (%rcx)
141 movl %edi, 16(%rcx)
142 jne .L16
143 movl $64, %edx
144 movq %r13, %rsi
145 movl %ebx, %edi
146 movl $20, %eax
147 #APP
148 # 68 "../sysdeps/unix/sysv/linux/not-cancel.h" 1
149 syscall
151 # 0 "" 2
152 #NO_APP
153 movq 40+_gmonparam(%rip), %rsi
154 xorl %edx, %edx
155 leaq (%rsi,%r8), %rax
156 .L16:
157 movq 16(%rax), %rax
158 testq %rax, %rax
159 jne .L17
160 .L15:
161 addq $1, %r14
162 cmpq %r14, -1800(%rbp)
163 jne .L13
164 testl %edx, %edx
165 movq -1808(%rbp), %r10
166 je .L14
167 addl %edx, %edx
168 movq %r13, %rsi
169 movl %ebx, %edi
170 movl $20, %eax
171 #APP
172 # 68 "../sysdeps/unix/sysv/linux/not-cancel.h" 1
173 syscall
175 # 0 "" 2
176 #NO_APP
177 .L14:
178 movq __bb_head(%rip), %r9
179 movb $2, -1785(%rbp)
180 movq %r10, -1712(%rbp)
181 movq $1, -1704(%rbp)
182 movq %r12, -1696(%rbp)
183 movq $8, -1688(%rbp)
184 testq %r9, %r9
185 movq $8, -1064(%rbp)
186 movq $8, -1048(%rbp)
187 movq $8, -1032(%rbp)
188 movq $8, -1016(%rbp)
189 movq $8, -1000(%rbp)
190 movq $8, -984(%rbp)
191 movq $8, -968(%rbp)
192 movq $8, -952(%rbp)
193 je .L19
194 movl $20, %r10d
195 .p2align 4,,10
196 .p2align 3
197 .L24:
198 movq 24(%r9), %rax
199 movl $2, %edx
200 movq %r15, %rsi
201 movl %ebx, %edi
202 movq %rax, -1744(%rbp)
203 movl %r10d, %eax
204 #APP
205 # 68 "../sysdeps/unix/sysv/linux/not-cancel.h" 1
206 syscall
208 # 0 "" 2
209 #NO_APP
210 movq -1744(%rbp), %rsi
211 testq %rsi, %rsi
212 je .L20
213 movq 40(%r9), %r11
214 movq 16(%r9), %rdi
215 xorl %r8d, %r8d
216 xorl %edx, %edx
217 .p2align 4,,10
218 .p2align 3
219 .L21:
220 leaq 0(,%r8,8), %rax
221 leaq 1(%rdx), %rcx
222 movq %rdx, %r12
223 addq $1, %r8
224 salq $4, %r12
225 addq $2, %rdx
226 leaq (%r11,%rax), %r14
227 salq $4, %rcx
228 addq %rdi, %rax
229 cmpq %rsi, %r8
230 movq %r14, -1072(%rbp,%r12)
231 movq %rax, -1072(%rbp,%rcx)
232 jnb .L52
233 cmpq $6, %rdx
234 jbe .L21
235 movq %r13, %rsi
236 movl %ebx, %edi
237 movl %r10d, %eax
238 #APP
239 # 68 "../sysdeps/unix/sysv/linux/not-cancel.h" 1
240 syscall
242 # 0 "" 2
243 #NO_APP
244 xorl %edx, %edx
245 movq 40(%r9), %r11
246 movq 16(%r9), %rdi
247 movq -1744(%rbp), %rsi
248 jmp .L21
249 .p2align 4,,10
250 .p2align 3
251 .L52:
252 movq %r13, %rsi
253 movl %ebx, %edi
254 movl %r10d, %eax
255 #APP
256 # 68 "../sysdeps/unix/sysv/linux/not-cancel.h" 1
257 syscall
259 # 0 "" 2
260 #NO_APP
261 .L20:
262 movq 32(%r9), %r9
263 testq %r9, %r9
264 jne .L24
265 .L19:
266 movl %ebx, %edi
267 call __GI___close_nocancel
268 leaq -40(%rbp), %rsp
269 popq %rbx
270 popq %r12
271 popq %r13
272 popq %r14
273 popq %r15
274 popq %rbp
276 .p2align 4,,10
277 .p2align 3
278 .L48:
279 movq 8+_gmonparam(%rip), %rdx
280 leaq -1712(%rbp), %r15
281 leaq -1744(%rbp), %r12
282 movq %rax, -1032(%rbp)
283 leaq -1072(%rbp), %r13
284 shrq %rax
285 movq %r12, -1072(%rbp)
286 movq $1, -1064(%rbp)
287 movq %rdx, -1040(%rbp)
288 movq 64+_gmonparam(%rip), %rdx
289 movq %r15, -1056(%rbp)
290 movq $40, -1048(%rbp)
291 movl %eax, -1696(%rbp)
292 subq %rdi, %rdx
293 movq %rdx, -1712(%rbp)
294 movq 72+_gmonparam(%rip), %rdx
295 subq %rdi, %rdx
296 movq %rdx, -1704(%rbp)
297 call __GI___profile_frequency
298 movabsq $32480047799690611, %rdi
299 movl %eax, -1692(%rbp)
300 xorl %eax, %eax
301 movq %rdi, -1688(%rbp)
302 movl $3, %edx
303 movw %ax, 36(%r15)
304 movl $0, 32(%r15)
305 movb $0, 38(%r15)
306 movq %r13, %rsi
307 movb $115, -1673(%rbp)
308 movl %ebx, %edi
309 movl $20, %eax
310 #APP
311 # 68 "../sysdeps/unix/sysv/linux/not-cancel.h" 1
312 syscall
314 # 0 "" 2
315 #NO_APP
316 movq -1784(%rbp), %rax
317 movq %rax, %rdi
318 jmp .L11
319 .L50:
320 movq %rbx, %rdi
321 movq %rsp, %r12
322 call __GI_strlen
323 leaq 20(%rax), %r13
324 addq $35, %rax
325 andq $-16, %rax
326 subq %rax, %rsp
327 call __GI___getpid
328 leaq .LC2(%rip), %rdx
329 movl %eax, %r8d
330 movq %rbx, %rcx
331 movq %rsp, %rdi
332 movq %r13, %rsi
333 xorl %eax, %eax
334 call __GI___snprintf
335 movq %rsp, %rdi
336 xorl %eax, %eax
337 movl $438, %edx
338 movl $131649, %esi
339 call __GI___open_nocancel
340 cmpl $-1, %eax
341 movl %eax, %ebx
342 movq %r12, %rsp
343 jne .L8
344 jmp .L9
345 .L51:
346 movq __libc_errno@gottpoff(%rip), %rax
347 leaq -1072(%rbp), %rsi
348 movl $300, %edx
349 movl %fs:(%rax), %edi
350 call __GI___strerror_r
351 leaq .LC3(%rip), %rsi
352 movq %rax, %rdx
353 xorl %edi, %edi
354 xorl %eax, %eax
355 call __fxprintf
356 leaq -40(%rbp), %rsp
357 popq %rbx
358 popq %r12
359 popq %r13
360 popq %r14
361 popq %r15
362 popq %rbp
364 .size write_gmon, .-write_gmon
365 .p2align 4,,15
366 .type __GI___moncontrol.part.0, @function
367 __GI___moncontrol.part.0:
368 subq $8, %rsp
369 movl s_scale(%rip), %ecx
370 movq 64+_gmonparam(%rip), %rdx
371 movq 16+_gmonparam(%rip), %rsi
372 movq 8+_gmonparam(%rip), %rdi
373 call __profil
374 movq $0, _gmonparam(%rip)
375 addq $8, %rsp
377 .size __GI___moncontrol.part.0, .-__GI___moncontrol.part.0
378 .p2align 4,,15
379 .globl __GI___moncontrol
380 .hidden __GI___moncontrol
381 .type __GI___moncontrol, @function
382 __GI___moncontrol:
383 cmpq $2, _gmonparam(%rip)
384 je .L59
385 testl %edi, %edi
386 jne .L61
387 subq $8, %rsp
388 xorl %ecx, %ecx
389 xorl %edx, %edx
390 xorl %esi, %esi
391 xorl %edi, %edi
392 call __profil
393 movq $3, _gmonparam(%rip)
394 addq $8, %rsp
396 .p2align 4,,10
397 .p2align 3
398 .L61:
399 jmp __GI___moncontrol.part.0
400 .p2align 4,,10
401 .p2align 3
402 .L59:
403 rep ret
404 .size __GI___moncontrol, .-__GI___moncontrol
405 .globl __moncontrol
406 .set __moncontrol,__GI___moncontrol
407 .weak moncontrol
408 .set moncontrol,__moncontrol
409 .section .rodata.str1.1
410 .LC4:
411 .string "monstartup: out of memory\n"
412 .text
413 .p2align 4,,15
414 .globl __monstartup
415 .type __monstartup, @function
416 __monstartup:
417 pushq %r13
418 pushq %r12
419 andq $-4, %rdi
420 pushq %rbp
421 leaq 3(%rsi), %rbp
422 pushq %rbx
423 movq %rdi, %r13
424 movabsq $2951479051793528259, %rcx
425 andq $-4, %rbp
426 subq $8, %rsp
427 movq %rdi, 64+_gmonparam(%rip)
428 movq %rbp, %rax
429 movq %rbp, 72+_gmonparam(%rip)
430 movq $2, 88+_gmonparam(%rip)
431 subq %rdi, %rax
432 movq $4, 96+_gmonparam(%rip)
433 leaq (%rax,%rax,2), %rdx
434 movq %rax, %rdi
435 movq %rax, 80+_gmonparam(%rip)
436 shrq %rdi
437 shrq $2, %rdx
438 leaq 7(%rdi), %rbx
439 movq %rdi, 32+_gmonparam(%rip)
440 movq %rdx, %rax
441 mulq %rcx
442 andq $-8, %rbx
443 movq %rbx, 16+_gmonparam(%rip)
444 shrq $2, %rdx
445 cmpq $49, %rdx
446 ja .L63
447 movq $50, 56+_gmonparam(%rip)
448 movl $1200, %r12d
449 .L64:
450 addq %rbx, %rdi
451 movl $1, %esi
452 movq %r12, 48+_gmonparam(%rip)
453 addq %r12, %rdi
454 call calloc@PLT
455 testq %rax, %rax
456 je .L73
457 subl %r13d, %ebp
458 addq %rax, %r12
459 movq %rax, 40+_gmonparam(%rip)
460 movq $0, 16(%rax)
461 movslq %ebp, %rax
462 movq %r12, 8+_gmonparam(%rip)
463 addq %rbx, %r12
464 cmpq %rax, %rbx
465 movq %r12, 24+_gmonparam(%rip)
466 jnb .L68
467 testq %rbx, %rbx
468 js .L69
469 pxor %xmm0, %xmm0
470 cvtsi2ssq %rbx, %xmm0
471 .L70:
472 cmpq $2, _gmonparam(%rip)
473 pxor %xmm1, %xmm1
474 cvtsi2ss %ebp, %xmm1
475 divss %xmm1, %xmm0
476 mulss .LC5(%rip), %xmm0
477 cvttss2si %xmm0, %eax
478 movl %eax, s_scale(%rip)
479 jne .L74
480 .L62:
481 addq $8, %rsp
482 popq %rbx
483 popq %rbp
484 popq %r12
485 popq %r13
487 .p2align 4,,10
488 .p2align 3
489 .L63:
490 cmpq $1048576, %rdx
491 jbe .L75
492 movq $1048576, 56+_gmonparam(%rip)
493 movl $25165824, %r12d
494 jmp .L64
495 .p2align 4,,10
496 .p2align 3
497 .L68:
498 cmpq $2, _gmonparam(%rip)
499 movl $65536, s_scale(%rip)
500 je .L62
501 .L74:
502 addq $8, %rsp
503 popq %rbx
504 popq %rbp
505 popq %r12
506 popq %r13
507 jmp __GI___moncontrol.part.0
508 .p2align 4,,10
509 .p2align 3
510 .L75:
511 leaq (%rdx,%rdx,2), %r12
512 movq %rdx, 56+_gmonparam(%rip)
513 salq $3, %r12
514 jmp .L64
515 .p2align 4,,10
516 .p2align 3
517 .L69:
518 pxor %xmm0, %xmm0
519 shrq %rbx
520 cvtsi2ssq %rbx, %xmm0
521 addss %xmm0, %xmm0
522 jmp .L70
523 .p2align 4,,10
524 .p2align 3
525 .L73:
526 leaq .LC4(%rip), %rsi
527 movl $26, %edx
528 movl $2, %edi
529 call __GI___write_nocancel
530 movq $0, 40+_gmonparam(%rip)
531 movq $2, _gmonparam(%rip)
532 addq $8, %rsp
533 popq %rbx
534 popq %rbp
535 popq %r12
536 popq %r13
538 .size __monstartup, .-__monstartup
539 .weak monstartup
540 .set monstartup,__monstartup
541 .p2align 4,,15
542 .globl __write_profiling
543 .type __write_profiling, @function
544 __write_profiling:
545 pushq %rbx
546 movq _gmonparam(%rip), %rbx
547 movq $3, _gmonparam(%rip)
548 testl %ebx, %ebx
549 jne .L77
550 call write_gmon
551 .L77:
552 movslq %ebx, %rbx
553 movq %rbx, _gmonparam(%rip)
554 popq %rbx
556 .size __write_profiling, .-__write_profiling
557 .p2align 4,,15
558 .globl _mcleanup
559 .type _mcleanup, @function
560 _mcleanup:
561 subq $8, %rsp
562 xorl %edi, %edi
563 call __GI___moncontrol
564 cmpq $2, _gmonparam(%rip)
565 je .L80
566 call write_gmon
567 .L80:
568 movq 40+_gmonparam(%rip), %rdi
569 addq $8, %rsp
570 jmp free@PLT
571 .size _mcleanup, .-_mcleanup
572 .local s_scale
573 .comm s_scale,4,4
574 .hidden _gmonparam
575 .globl _gmonparam
576 .data
577 .align 32
578 .type _gmonparam, @object
579 .size _gmonparam, 104
580 _gmonparam:
581 .quad 3
582 .zero 96
583 .hidden __bb_head
584 .comm __bb_head,8,8
585 .section .rodata.cst4,"aM",@progbits,4
586 .align 4
587 .LC5:
588 .long 1199570944
589 .hidden __profil
590 .hidden __fxprintf