clarify the purpose of this project
[nyanglibc.git] / malloc / mtrace.shared.s
blob39d525cabe2cec41327e1da856c1b1534cfcc660
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .section __libc_freeres_fn,"ax",@progbits
8 .p2align 4,,15
9 .type release_libc_mem, @function
10 release_libc_mem:
11 cmpq $0, mallstream(%rip)
12 je .L1
13 jmp __GI___libc_freeres
14 .p2align 4,,10
15 .p2align 3
16 .L1:
17 rep ret
18 .size release_libc_mem, .-release_libc_mem
19 .text
20 .p2align 4,,15
21 .type lock_and_info, @function
22 lock_and_info:
23 testq %rdi, %rdi
24 pushq %rbx
25 je .L8
26 xorl %ecx, %ecx
27 xorl %edx, %edx
28 movq %rsi, %rbx
29 call __GI__dl_addr
30 movl $0, %esi
31 testl %eax, %eax
32 cmove %rsi, %rbx
33 #APP
34 # 119 "mtrace.c" 1
35 movl %fs:24,%eax
36 # 0 "" 2
37 #NO_APP
38 testl %eax, %eax
39 jne .L7
40 movl $1, %edx
41 #APP
42 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
43 cmpxchgl %edx, lock(%rip)
44 # 0 "" 2
45 #NO_APP
46 .L4:
47 movq %rbx, %rax
48 popq %rbx
49 ret
50 .p2align 4,,10
51 .p2align 3
52 .L7:
53 xorl %eax, %eax
54 movl $1, %edx
55 lock cmpxchgl %edx, lock(%rip)
56 je .L4
57 leaq lock(%rip), %rdi
58 call __lll_lock_wait_private
59 jmp .L4
60 .p2align 4,,10
61 .p2align 3
62 .L8:
63 xorl %ebx, %ebx
64 jmp .L4
65 .size lock_and_info, .-lock_and_info
66 .section .rodata.str1.1,"aMS",@progbits,1
67 .LC0:
68 .string ""
69 .LC1:
70 .string ":"
71 .LC2:
72 .string "@ %s%s%s[%p] "
73 .LC3:
74 .string "@ [%p] "
75 .text
76 .p2align 4,,15
77 .type tr_where, @function
78 tr_where:
79 testq %rdi, %rdi
80 je .L27
81 pushq %rbp
82 movq %rsp, %rbp
83 pushq %r15
84 pushq %r14
85 pushq %r13
86 pushq %r12
87 movq %rdi, %r13
88 pushq %rbx
89 movq %rsi, %rbx
90 subq $8, %rsp
91 testq %rsi, %rsi
92 je .L13
93 movq 16(%rsi), %r15
94 leaq .LC0(%rip), %r12
95 testq %r15, %r15
96 je .L14
97 movq %r15, %rdi
98 call __GI_strlen
99 leaq 52(%rax), %rcx
100 movq 24(%rbx), %r14
101 andq $-16, %rcx
102 subq %rcx, %rsp
103 leaq 15(%rsp), %r12
104 andq $-16, %r12
105 cmpq %r13, %r14
106 movb $40, (%r12)
107 ja .L30
108 leaq 1(%r12), %rdi
109 movq %r15, %rsi
110 movq %rax, %rdx
111 call __GI_mempcpy@PLT
112 movq %r13, %rdi
113 leaq 3(%rax), %rsi
114 movl $7876651, (%rax)
115 subq %r14, %rdi
116 .L18:
117 movl $16, %edx
118 xorl %ecx, %ecx
119 call _fitoa_word
120 movl $41, %edx
121 movw %dx, (%rax)
122 .L14:
123 movq (%rbx), %rdx
124 leaq .LC1(%rip), %rcx
125 testq %rdx, %rdx
126 je .L31
127 .L17:
128 movq mallstream(%rip), %rdi
129 leaq .LC2(%rip), %rsi
130 movq %r13, %r9
131 movq %r12, %r8
132 xorl %eax, %eax
133 call __GI_fprintf
134 leaq -40(%rbp), %rsp
135 popq %rbx
136 popq %r12
137 popq %r13
138 popq %r14
139 popq %r15
140 popq %rbp
142 .p2align 4,,10
143 .p2align 3
144 .L27:
145 rep ret
146 .p2align 4,,10
147 .p2align 3
148 .L30:
149 leaq 1(%r12), %rdi
150 movq %r15, %rsi
151 movq %rax, %rdx
152 call __GI_mempcpy@PLT
153 movq %r14, %rdi
154 movl $7876653, (%rax)
155 leaq 3(%rax), %rsi
156 subq %r13, %rdi
157 jmp .L18
158 .p2align 4,,10
159 .p2align 3
160 .L31:
161 leaq .LC0(%rip), %rcx
162 movq %rcx, %rdx
163 jmp .L17
164 .p2align 4,,10
165 .p2align 3
166 .L13:
167 movq %rdi, %rdx
168 movq mallstream(%rip), %rdi
169 leaq .LC3(%rip), %rsi
170 xorl %eax, %eax
171 call __GI_fprintf
172 leaq -40(%rbp), %rsp
173 popq %rbx
174 popq %r12
175 popq %r13
176 popq %r14
177 popq %r15
178 popq %rbp
180 .size tr_where, .-tr_where
181 .section .rodata.str1.1
182 .LC4:
183 .string "+ %p %#lx\n"
184 .text
185 .p2align 4,,15
186 .type tr_memalignhook, @function
187 tr_memalignhook:
188 pushq %r15
189 pushq %r14
190 movq %rsi, %r14
191 pushq %r13
192 pushq %r12
193 movq %rdi, %r13
194 pushq %rbp
195 pushq %rbx
196 movq %rdx, %rdi
197 movq %rdx, %rbx
198 subq $40, %rsp
199 movq %rsp, %rsi
200 call lock_and_info
201 movq __free_hook@GOTPCREL(%rip), %r12
202 movq %rax, %r15
203 movq tr_old_free_hook(%rip), %rax
204 movq __malloc_hook@GOTPCREL(%rip), %rbp
205 movq __realloc_hook@GOTPCREL(%rip), %rcx
206 movq __memalign_hook@GOTPCREL(%rip), %rdx
207 movq %rax, (%r12)
208 movq tr_old_malloc_hook(%rip), %rax
209 movq %rax, 0(%rbp)
210 movq tr_old_realloc_hook(%rip), %rax
211 movq %rax, (%rcx)
212 movq tr_old_memalign_hook(%rip), %rax
213 testq %rax, %rax
214 movq %rax, (%rdx)
215 je .L33
216 movq %r13, %rdi
217 movq %rbx, %rdx
218 movq %r14, %rsi
219 call *%rax
220 movq %rax, %r13
221 .L34:
222 leaq tr_freehook(%rip), %rax
223 leaq tr_reallochook(%rip), %rcx
224 leaq tr_memalignhook(%rip), %rdx
225 movq %r15, %rsi
226 movq %rbx, %rdi
227 movq %rax, (%r12)
228 leaq tr_mallochook(%rip), %rax
229 movq %rax, 0(%rbp)
230 movq __realloc_hook@GOTPCREL(%rip), %rax
231 movq %rcx, (%rax)
232 movq __memalign_hook@GOTPCREL(%rip), %rax
233 movq %rdx, (%rax)
234 call tr_where
235 movq mallstream(%rip), %rdi
236 leaq .LC4(%rip), %rsi
237 movq %r14, %rcx
238 movq %r13, %rdx
239 xorl %eax, %eax
240 call __GI_fprintf
241 #APP
242 # 275 "mtrace.c" 1
243 movl %fs:24,%eax
244 # 0 "" 2
245 #NO_APP
246 testl %eax, %eax
247 jne .L35
248 subl $1, lock(%rip)
249 .L32:
250 addq $40, %rsp
251 movq %r13, %rax
252 popq %rbx
253 popq %rbp
254 popq %r12
255 popq %r13
256 popq %r14
257 popq %r15
259 .p2align 4,,10
260 .p2align 3
261 .L35:
262 xorl %eax, %eax
263 #APP
264 # 275 "mtrace.c" 1
265 xchgl %eax, lock(%rip)
266 # 0 "" 2
267 #NO_APP
268 cmpl $1, %eax
269 jle .L32
270 xorl %r10d, %r10d
271 movl $1, %edx
272 movl $129, %esi
273 leaq lock(%rip), %rdi
274 movl $202, %eax
275 #APP
276 # 275 "mtrace.c" 1
277 syscall
279 # 0 "" 2
280 #NO_APP
281 jmp .L32
282 .p2align 4,,10
283 .p2align 3
284 .L33:
285 movq %r13, %rdi
286 movq %r14, %rsi
287 call memalign@PLT
288 movq %rax, %r13
289 jmp .L34
290 .size tr_memalignhook, .-tr_memalignhook
291 .p2align 4,,15
292 .type tr_mallochook, @function
293 tr_mallochook:
294 pushq %r15
295 pushq %r14
296 movq %rdi, %r14
297 pushq %r13
298 pushq %r12
299 pushq %rbp
300 pushq %rbx
301 movq %rsi, %rbx
302 movq %rbx, %rdi
303 subq $40, %rsp
304 movq %rsp, %rsi
305 call lock_and_info
306 movq __free_hook@GOTPCREL(%rip), %r12
307 movq %rax, %r15
308 movq tr_old_free_hook(%rip), %rax
309 movq tr_old_realloc_hook(%rip), %rdx
310 movq __realloc_hook@GOTPCREL(%rip), %rcx
311 movq __malloc_hook@GOTPCREL(%rip), %rbp
312 movq %rax, (%r12)
313 movq tr_old_malloc_hook(%rip), %rax
314 movq %rdx, (%rcx)
315 movq tr_old_memalign_hook(%rip), %rdx
316 movq __memalign_hook@GOTPCREL(%rip), %rcx
317 testq %rax, %rax
318 movq %rax, 0(%rbp)
319 movq %rdx, (%rcx)
320 je .L39
321 movq %rbx, %rsi
322 movq %r14, %rdi
323 call *%rax
324 movq %rax, %r13
325 .L40:
326 leaq tr_freehook(%rip), %rax
327 leaq tr_reallochook(%rip), %rcx
328 leaq tr_memalignhook(%rip), %rdi
329 movq %r15, %rsi
330 movq %rax, (%r12)
331 leaq tr_mallochook(%rip), %rax
332 movq %rax, 0(%rbp)
333 movq __realloc_hook@GOTPCREL(%rip), %rax
334 movq %rcx, (%rax)
335 movq __memalign_hook@GOTPCREL(%rip), %rax
336 movq %rdi, (%rax)
337 movq %rbx, %rdi
338 call tr_where
339 movq mallstream(%rip), %rdi
340 leaq .LC4(%rip), %rsi
341 movq %r14, %rcx
342 movq %r13, %rdx
343 xorl %eax, %eax
344 call __GI_fprintf
345 #APP
346 # 204 "mtrace.c" 1
347 movl %fs:24,%eax
348 # 0 "" 2
349 #NO_APP
350 testl %eax, %eax
351 jne .L41
352 subl $1, lock(%rip)
353 .L38:
354 addq $40, %rsp
355 movq %r13, %rax
356 popq %rbx
357 popq %rbp
358 popq %r12
359 popq %r13
360 popq %r14
361 popq %r15
363 .p2align 4,,10
364 .p2align 3
365 .L41:
366 xorl %eax, %eax
367 #APP
368 # 204 "mtrace.c" 1
369 xchgl %eax, lock(%rip)
370 # 0 "" 2
371 #NO_APP
372 cmpl $1, %eax
373 jle .L38
374 xorl %r10d, %r10d
375 movl $1, %edx
376 movl $129, %esi
377 leaq lock(%rip), %rdi
378 movl $202, %eax
379 #APP
380 # 204 "mtrace.c" 1
381 syscall
383 # 0 "" 2
384 #NO_APP
385 jmp .L38
386 .p2align 4,,10
387 .p2align 3
388 .L39:
389 movq %r14, %rdi
390 call malloc@PLT
391 movq %rax, %r13
392 jmp .L40
393 .size tr_mallochook, .-tr_mallochook
394 .section .rodata.str1.1
395 .LC5:
396 .string "! %p %#lx\n"
397 .LC6:
398 .string "- %p\n"
399 .LC7:
400 .string "< %p\n"
401 .LC8:
402 .string "> %p %#lx\n"
403 .text
404 .p2align 4,,15
405 .type tr_reallochook, @function
406 tr_reallochook:
407 pushq %r15
408 pushq %r14
409 pushq %r13
410 pushq %r12
411 movq %rsi, %r13
412 pushq %rbp
413 pushq %rbx
414 movq %rdi, %r12
415 movq %rdx, %rdi
416 movq %rdx, %rbx
417 subq $40, %rsp
418 movq %rsp, %rsi
419 call lock_and_info
420 movq __free_hook@GOTPCREL(%rip), %r14
421 movq %rax, %r15
422 movq tr_old_free_hook(%rip), %rax
423 movq __malloc_hook@GOTPCREL(%rip), %rcx
424 movq tr_old_memalign_hook(%rip), %rdx
425 movq %rax, (%r14)
426 movq tr_old_malloc_hook(%rip), %rax
427 movq %rax, (%rcx)
428 movq tr_old_realloc_hook(%rip), %rax
429 movq __realloc_hook@GOTPCREL(%rip), %rcx
430 testq %rax, %rax
431 movq %rax, (%rcx)
432 movq __memalign_hook@GOTPCREL(%rip), %rcx
433 movq %rdx, (%rcx)
434 je .L45
435 movq %rbx, %rdx
436 movq %r13, %rsi
437 movq %r12, %rdi
438 call *%rax
439 movq %rax, %rbp
440 .L46:
441 leaq tr_freehook(%rip), %rax
442 leaq tr_mallochook(%rip), %rdx
443 leaq tr_reallochook(%rip), %rcx
444 movq %rbx, %rdi
445 movq %r15, %rsi
446 movq %rax, (%r14)
447 movq __malloc_hook@GOTPCREL(%rip), %rax
448 movq %rdx, (%rax)
449 movq __realloc_hook@GOTPCREL(%rip), %rax
450 leaq tr_memalignhook(%rip), %rdx
451 movq %rcx, (%rax)
452 movq __memalign_hook@GOTPCREL(%rip), %rax
453 movq %rdx, (%rax)
454 call tr_where
455 testq %rbp, %rbp
456 movq mallstream(%rip), %rdi
457 je .L54
458 testq %r12, %r12
459 je .L55
460 leaq .LC7(%rip), %rsi
461 movq %r12, %rdx
462 xorl %eax, %eax
463 call __GI_fprintf
464 movq %r15, %rsi
465 movq %rbx, %rdi
466 call tr_where
467 movq mallstream(%rip), %rdi
468 leaq .LC8(%rip), %rsi
469 movq %r13, %rcx
470 movq %rbp, %rdx
471 xorl %eax, %eax
472 call __GI_fprintf
473 .L49:
474 #APP
475 # 248 "mtrace.c" 1
476 movl %fs:24,%eax
477 # 0 "" 2
478 #NO_APP
479 testl %eax, %eax
480 jne .L51
481 subl $1, lock(%rip)
482 .L44:
483 addq $40, %rsp
484 movq %rbp, %rax
485 popq %rbx
486 popq %rbp
487 popq %r12
488 popq %r13
489 popq %r14
490 popq %r15
492 .p2align 4,,10
493 .p2align 3
494 .L55:
495 leaq .LC4(%rip), %rsi
496 movq %r13, %rcx
497 movq %rbp, %rdx
498 xorl %eax, %eax
499 call __GI_fprintf
500 jmp .L49
501 .p2align 4,,10
502 .p2align 3
503 .L54:
504 testq %r13, %r13
505 je .L48
506 leaq .LC5(%rip), %rsi
507 movq %r13, %rcx
508 movq %r12, %rdx
509 xorl %eax, %eax
510 call __GI_fprintf
511 jmp .L49
512 .p2align 4,,10
513 .p2align 3
514 .L48:
515 leaq .LC6(%rip), %rsi
516 movq %r12, %rdx
517 xorl %eax, %eax
518 call __GI_fprintf
519 jmp .L49
520 .p2align 4,,10
521 .p2align 3
522 .L51:
523 xorl %eax, %eax
524 #APP
525 # 248 "mtrace.c" 1
526 xchgl %eax, lock(%rip)
527 # 0 "" 2
528 #NO_APP
529 cmpl $1, %eax
530 jle .L44
531 xorl %r10d, %r10d
532 movl $1, %edx
533 movl $129, %esi
534 leaq lock(%rip), %rdi
535 movl $202, %eax
536 #APP
537 # 248 "mtrace.c" 1
538 syscall
540 # 0 "" 2
541 #NO_APP
542 jmp .L44
543 .p2align 4,,10
544 .p2align 3
545 .L45:
546 movq %r13, %rsi
547 movq %r12, %rdi
548 call realloc@PLT
549 movq %rax, %rbp
550 jmp .L46
551 .size tr_reallochook, .-tr_reallochook
552 .p2align 4,,15
553 .type tr_freehook, @function
554 tr_freehook:
555 testq %rdi, %rdi
556 je .L72
557 pushq %r15
558 pushq %r14
559 pushq %r13
560 pushq %r12
561 pushq %rbp
562 pushq %rbx
563 movq %rsi, %rbp
564 movq %rdi, %rbx
565 movq %rbp, %rdi
566 subq $40, %rsp
567 movq %rsp, %rsi
568 call lock_and_info
569 movq %rbp, %rdi
570 movq %rax, %rsi
571 call tr_where
572 movq mallstream(%rip), %rdi
573 leaq .LC6(%rip), %rsi
574 xorl %eax, %eax
575 movq %rbx, %rdx
576 call __GI_fprintf
577 movq mallwatch@GOTPCREL(%rip), %rax
578 cmpq (%rax), %rbx
579 je .L75
580 .L59:
581 movq tr_old_malloc_hook(%rip), %rdx
582 movq __malloc_hook@GOTPCREL(%rip), %r14
583 movq __realloc_hook@GOTPCREL(%rip), %r13
584 movq tr_old_free_hook(%rip), %rax
585 movq __free_hook@GOTPCREL(%rip), %r15
586 movq __memalign_hook@GOTPCREL(%rip), %r12
587 movq %rdx, (%r14)
588 movq tr_old_realloc_hook(%rip), %rdx
589 testq %rax, %rax
590 movq %rax, (%r15)
591 movq %rdx, 0(%r13)
592 movq tr_old_memalign_hook(%rip), %rdx
593 movq %rdx, (%r12)
594 je .L64
595 movq %rbp, %rsi
596 movq %rbx, %rdi
597 call *%rax
598 .L65:
599 leaq tr_freehook(%rip), %rax
600 movq %rax, (%r15)
601 leaq tr_mallochook(%rip), %rax
602 movq %rax, (%r14)
603 leaq tr_reallochook(%rip), %rax
604 movq %rax, 0(%r13)
605 leaq tr_memalignhook(%rip), %rax
606 movq %rax, (%r12)
607 #APP
608 # 182 "mtrace.c" 1
609 movl %fs:24,%eax
610 # 0 "" 2
611 #NO_APP
612 testl %eax, %eax
613 jne .L66
614 subl $1, lock(%rip)
615 .L56:
616 addq $40, %rsp
617 popq %rbx
618 popq %rbp
619 popq %r12
620 popq %r13
621 popq %r14
622 popq %r15
624 .p2align 4,,10
625 .p2align 3
626 .L72:
627 rep ret
628 .p2align 4,,10
629 .p2align 3
630 .L75:
631 #APP
632 # 172 "mtrace.c" 1
633 movl %fs:24,%eax
634 # 0 "" 2
635 #NO_APP
636 testl %eax, %eax
637 jne .L60
638 subl $1, lock(%rip)
639 .L61:
640 #APP
641 # 174 "mtrace.c" 1
642 movl %fs:24,%eax
643 # 0 "" 2
644 #NO_APP
645 testl %eax, %eax
646 jne .L62
647 movl $1, %edx
648 #APP
649 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
650 cmpxchgl %edx, lock(%rip)
651 # 0 "" 2
652 #NO_APP
653 jmp .L59
654 .p2align 4,,10
655 .p2align 3
656 .L66:
657 xorl %eax, %eax
658 #APP
659 # 182 "mtrace.c" 1
660 xchgl %eax, lock(%rip)
661 # 0 "" 2
662 #NO_APP
663 cmpl $1, %eax
664 jle .L56
665 xorl %r10d, %r10d
666 movl $1, %edx
667 movl $129, %esi
668 leaq lock(%rip), %rdi
669 movl $202, %eax
670 #APP
671 # 182 "mtrace.c" 1
672 syscall
674 # 0 "" 2
675 #NO_APP
676 jmp .L56
677 .p2align 4,,10
678 .p2align 3
679 .L64:
680 movq %rbx, %rdi
681 call free@PLT
682 jmp .L65
683 .p2align 4,,10
684 .p2align 3
685 .L62:
686 xorl %eax, %eax
687 movl $1, %edx
688 lock cmpxchgl %edx, lock(%rip)
689 je .L59
690 leaq lock(%rip), %rdi
691 call __lll_lock_wait_private
692 jmp .L59
693 .p2align 4,,10
694 .p2align 3
695 .L60:
696 xorl %eax, %eax
697 #APP
698 # 172 "mtrace.c" 1
699 xchgl %eax, lock(%rip)
700 # 0 "" 2
701 #NO_APP
702 cmpl $1, %eax
703 jle .L61
704 xorl %r10d, %r10d
705 movl $1, %edx
706 movl $129, %esi
707 leaq lock(%rip), %rdi
708 movl $202, %eax
709 #APP
710 # 172 "mtrace.c" 1
711 syscall
713 # 0 "" 2
714 #NO_APP
715 jmp .L61
716 .size tr_freehook, .-tr_freehook
717 .p2align 4,,15
718 .globl __GI_tr_break
719 .hidden __GI_tr_break
720 .type __GI_tr_break, @function
721 __GI_tr_break:
722 rep ret
723 .size __GI_tr_break, .-__GI_tr_break
724 .globl tr_break
725 .set tr_break,__GI_tr_break
726 .section .rodata.str1.1
727 .LC9:
728 .string "/dev/null"
729 .LC10:
730 .string "wce"
731 .LC11:
732 .string "= Start\n"
733 .text
734 .p2align 4,,15
735 .globl mtrace
736 .type mtrace, @function
737 mtrace:
738 cmpq $0, mallstream(%rip)
739 je .L95
740 rep ret
741 .p2align 4,,10
742 .p2align 3
743 .L95:
744 pushq %rbp
745 pushq %rbx
746 leaq mallenv(%rip), %rdi
747 subq $8, %rsp
748 call __GI___libc_secure_getenv
749 testq %rax, %rax
750 movq %rax, %rbx
751 je .L96
752 movl $512, %edi
753 call malloc@PLT
754 testq %rax, %rax
755 movq %rax, %rbp
756 je .L77
757 .L84:
758 leaq .LC10(%rip), %rsi
759 movq %rbx, %rdi
760 call _IO_new_fopen@PLT
761 testq %rax, %rax
762 movq %rax, mallstream(%rip)
763 je .L83
764 xorl %edx, %edx
765 movl $512, %ecx
766 movq %rbp, %rsi
767 movq %rax, %rdi
768 leaq tr_freehook(%rip), %rbx
769 call __GI__IO_setvbuf
770 movq mallstream(%rip), %rcx
771 leaq .LC11(%rip), %rdi
772 movl $8, %edx
773 movl $1, %esi
774 call __GI_fwrite@PLT
775 movq __free_hook@GOTPCREL(%rip), %rsi
776 movq __malloc_hook@GOTPCREL(%rip), %rcx
777 movq __realloc_hook@GOTPCREL(%rip), %rdx
778 movq (%rsi), %rax
779 movq %rbx, (%rsi)
780 leaq tr_mallochook(%rip), %rsi
781 movq %rax, tr_old_free_hook(%rip)
782 movq (%rcx), %rax
783 movq %rsi, (%rcx)
784 leaq tr_reallochook(%rip), %rcx
785 movq %rax, tr_old_malloc_hook(%rip)
786 movq (%rdx), %rax
787 movq %rcx, (%rdx)
788 leaq tr_memalignhook(%rip), %rdx
789 movq %rax, tr_old_realloc_hook(%rip)
790 movq __memalign_hook@GOTPCREL(%rip), %rax
791 movq (%rax), %rdi
792 movq %rdx, (%rax)
793 movl added_atexit_handler.9682(%rip), %eax
794 movq %rdi, tr_old_memalign_hook(%rip)
795 testl %eax, %eax
796 je .L97
797 .L77:
798 addq $8, %rsp
799 popq %rbx
800 popq %rbp
802 .p2align 4,,10
803 .p2align 3
804 .L96:
805 movq mallwatch@GOTPCREL(%rip), %rax
806 cmpq $0, (%rax)
807 je .L77
808 movl $512, %edi
809 leaq .LC9(%rip), %rbx
810 call malloc@PLT
811 testq %rax, %rax
812 movq %rax, %rbp
813 jne .L84
814 jmp .L77
815 .p2align 4,,10
816 .p2align 3
817 .L83:
818 addq $8, %rsp
819 movq %rbp, %rdi
820 popq %rbx
821 popq %rbp
822 jmp free@PLT
823 .p2align 4,,10
824 .p2align 3
825 .L97:
826 movl $1, added_atexit_handler.9682(%rip)
827 movq __dso_handle(%rip), %rdx
828 addq $8, %rsp
829 popq %rbx
830 popq %rbp
831 leaq release_libc_mem(%rip), %rdi
832 xorl %esi, %esi
833 jmp __GI___cxa_atexit
834 .size mtrace, .-mtrace
835 .section .rodata.str1.1
836 .LC12:
837 .string "= End\n"
838 .text
839 .p2align 4,,15
840 .globl muntrace
841 .type muntrace, @function
842 muntrace:
843 pushq %rbx
844 movq mallstream(%rip), %rbx
845 testq %rbx, %rbx
846 je .L98
847 movq __free_hook@GOTPCREL(%rip), %rax
848 movq tr_old_free_hook(%rip), %rdx
849 leaq .LC12(%rip), %rdi
850 movq %rbx, %rcx
851 movl $1, %esi
852 movq $0, mallstream(%rip)
853 movq %rdx, (%rax)
854 movq __malloc_hook@GOTPCREL(%rip), %rax
855 movq tr_old_malloc_hook(%rip), %rdx
856 movq %rdx, (%rax)
857 movq __realloc_hook@GOTPCREL(%rip), %rax
858 movq tr_old_realloc_hook(%rip), %rdx
859 movq %rdx, (%rax)
860 movq tr_old_memalign_hook(%rip), %rdx
861 movq __memalign_hook@GOTPCREL(%rip), %rax
862 movq %rdx, (%rax)
863 movl $6, %edx
864 call __GI_fwrite@PLT
865 movq %rbx, %rdi
866 popq %rbx
867 jmp _IO_new_fclose@PLT
868 .p2align 4,,10
869 .p2align 3
870 .L98:
871 popq %rbx
873 .size muntrace, .-muntrace
874 .local added_atexit_handler.9682
875 .comm added_atexit_handler.9682,4,4
876 .local tr_old_memalign_hook
877 .comm tr_old_memalign_hook,8,8
878 .local tr_old_realloc_hook
879 .comm tr_old_realloc_hook,8,8
880 .local tr_old_malloc_hook
881 .comm tr_old_malloc_hook,8,8
882 .local tr_old_free_hook
883 .comm tr_old_free_hook,8,8
884 .comm mallwatch,8,8
885 .local lock
886 .comm lock,4,4
887 .section .rodata.str1.8,"aMS",@progbits,1
888 .align 8
889 .type mallenv, @object
890 .size mallenv, 13
891 mallenv:
892 .string "MALLOC_TRACE"
893 .local mallstream
894 .comm mallstream,8,8
895 .hidden __dso_handle
896 .hidden _fitoa_word
897 .hidden __lll_lock_wait_private