clarify the purpose of this project
[nyanglibc.git] / gmon / mcount.shared.s
blob90e31f88d52f690650c10685a42c28b579b61175
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .globl __mcount_internal
9 .type __mcount_internal, @function
10 __mcount_internal:
11 pushq %rbp
12 xorl %eax, %eax
13 movl $1, %edx
14 movq %rsp, %rbp
15 lock cmpxchgq %rdx, _gmonparam(%rip)
16 jne .L1
17 subq 64+_gmonparam(%rip), %rdi
18 cmpq %rdi, 80+_gmonparam(%rip)
19 jb .L3
20 movq 96+_gmonparam(%rip), %rcx
21 movq 24+_gmonparam(%rip), %rax
22 shrq %cl, %rdi
23 movslq %edi, %rdi
24 leaq (%rax,%rdi,8), %r8
25 movq 40+_gmonparam(%rip), %rdi
26 movq (%r8), %rax
27 testq %rax, %rax
28 jne .L4
29 movq 16(%rdi), %rax
30 addq $1, %rax
31 cmpq 56+_gmonparam(%rip), %rax
32 movq %rax, 16(%rdi)
33 jb .L15
34 .L5:
35 movq $2, _gmonparam(%rip)
36 .L1:
37 popq %rbp
38 ret
39 .p2align 4,,10
40 .p2align 3
41 .L16:
42 movq 16(%rdx), %rsi
43 addq $1, 8(%rdx)
44 movq %rsi, 16(%rcx)
45 movq (%r8), %rcx
46 movq %rcx, 16(%rdx)
47 movq %rax, (%r8)
48 .p2align 4,,10
49 .p2align 3
50 .L3:
51 movq $0, _gmonparam(%rip)
52 .L17:
53 popq %rbp
54 ret
55 .p2align 4,,10
56 .p2align 3
57 .L4:
58 leaq (%rax,%rax,2), %rax
59 leaq (%rdi,%rax,8), %rcx
60 cmpq %rsi, (%rcx)
61 jne .L6
62 addq $1, 8(%rcx)
63 jmp .L3
64 .p2align 4,,10
65 .p2align 3
66 .L7:
67 leaq (%rax,%rax,2), %rdx
68 leaq (%rdi,%rdx,8), %rdx
69 cmpq %rsi, (%rdx)
70 je .L16
71 movq %rdx, %rcx
72 .L6:
73 movq 16(%rcx), %rax
74 testq %rax, %rax
75 jne .L7
76 movq 16(%rdi), %rax
77 addq $1, %rax
78 cmpq 56+_gmonparam(%rip), %rax
79 movq %rax, 16(%rdi)
80 jnb .L5
81 leaq (%rax,%rax,2), %rdx
82 leaq (%rdi,%rdx,8), %rdx
83 movq %rsi, (%rdx)
84 movq $1, 8(%rdx)
85 movq (%r8), %rcx
86 movq %rcx, 16(%rdx)
87 movq %rax, (%r8)
88 jmp .L3
89 .p2align 4,,10
90 .p2align 3
91 .L15:
92 movq %rax, (%r8)
93 leaq (%rax,%rax,2), %rax
94 leaq (%rdi,%rax,8), %rax
95 movq %rsi, (%rax)
96 movq $1, 8(%rax)
97 movq $0, 16(%rax)
98 movq $0, _gmonparam(%rip)
99 jmp .L17
100 .size __mcount_internal, .-__mcount_internal
101 .hidden _gmonparam