clarify the purpose of this project
[nyanglibc.git] / elf / dl-lookup-direct.shared.s
blob386216d3c1dda37754a37a73669f978a276f1d2e
1 .text
2 .p2align 4,,15
3 .type check_match, @function
4 check_match:
5 pushq %r14
6 pushq %r13
7 movl %r8d, %r14d
8 pushq %r12
9 pushq %rbp
10 leaq (%r14,%r14,2), %r8
11 pushq %rbx
12 movq 112(%rdi), %rax
13 movq 8(%rax), %rax
14 leaq (%rax,%r8,8), %rbx
15 movzbl 4(%rbx), %eax
16 andl $15, %eax
17 cmpq $0, 8(%rbx)
18 je .L15
19 .L2:
20 movl $1127, %r8d
21 btl %eax, %r8d
22 jnc .L8
23 movq %rdx, %r12
24 movq 104(%rdi), %rdx
25 movl (%rbx), %eax
26 movq %rdi, %r13
27 movl %ecx, %ebp
28 addq 8(%rdx), %rax
29 movq %rax, %rdi
30 call strcmp
31 testl %eax, %eax
32 jne .L8
33 movq 840(%r13), %rax
34 movzwl (%rax,%r14,2), %eax
35 andl $32767, %eax
36 leaq (%rax,%rax,2), %rdx
37 movq 744(%r13), %rax
38 leaq (%rax,%rdx,8), %rax
39 cmpl %ebp, 8(%rax)
40 jne .L8
41 movq (%rax), %rdi
42 movq %r12, %rsi
43 call strcmp
44 testl %eax, %eax
45 movl $0, %eax
46 cmovne %rax, %rbx
47 movq %rbx, %rax
48 popq %rbx
49 popq %rbp
50 popq %r12
51 popq %r13
52 popq %r14
53 ret
54 .p2align 4,,10
55 .p2align 3
56 .L15:
57 cmpw $-15, 6(%rbx)
58 je .L2
59 cmpb $6, %al
60 je .L2
61 .L8:
62 xorl %ebx, %ebx
63 movq %rbx, %rax
64 popq %rbx
65 popq %rbp
66 popq %r12
67 popq %r13
68 popq %r14
69 ret
70 .size check_match, .-check_match
71 .p2align 4,,15
72 .globl _dl_lookup_direct
73 .hidden _dl_lookup_direct
74 .type _dl_lookup_direct, @function
75 _dl_lookup_direct:
76 pushq %r15
77 pushq %r14
78 pushq %r13
79 pushq %r12
80 movq %rdi, %r13
81 pushq %rbp
82 pushq %rbx
83 movq %rsi, %r12
84 subq $24, %rsp
85 cmpq $0, 768(%rdi)
86 movq %rcx, (%rsp)
87 movl %r8d, 12(%rsp)
88 movl 756(%rdi), %ecx
89 je .L17
90 movl %edx, %eax
91 movl %edx, %r14d
92 xorl %edx, %edx
93 divl %ecx
94 movq 776(%rdi), %rax
95 movl %edx, %edx
96 movl (%rax,%rdx,4), %eax
97 testl %eax, %eax
98 je .L30
99 movq 784(%rdi), %r15
100 leaq (%r15,%rax,4), %rbx
101 .p2align 4,,10
102 .p2align 3
103 .L20:
104 movl (%rbx), %ebp
105 movl %ebp, %eax
106 xorl %r14d, %eax
107 shrl %eax
108 jne .L19
109 movq %rbx, %r8
110 movl 12(%rsp), %ecx
111 movq (%rsp), %rdx
112 subq %r15, %r8
113 movq %r12, %rsi
114 movq %r13, %rdi
115 sarq $2, %r8
116 call check_match
117 testq %rax, %rax
118 jne .L16
119 .L19:
120 addq $4, %rbx
121 andl $1, %ebp
122 je .L20
123 .L30:
124 xorl %eax, %eax
125 .L16:
126 addq $24, %rsp
127 popq %rbx
128 popq %rbp
129 popq %r12
130 popq %r13
131 popq %r14
132 popq %r15
134 .p2align 4,,10
135 .p2align 3
136 .L17:
137 movzbl (%rsi), %eax
138 testq %rax, %rax
139 je .L21
140 movzbl 1(%rsi), %esi
141 testb %sil, %sil
142 je .L43
143 salq $4, %rax
144 movzbl %sil, %edx
145 addq %rdx, %rax
146 movzbl 2(%r12), %edx
147 testb %dl, %dl
148 je .L42
149 salq $4, %rax
150 addq %rdx, %rax
151 movzbl 3(%r12), %edx
152 testb %dl, %dl
153 je .L42
154 salq $4, %rax
155 addq %rdx, %rax
156 movzbl 4(%r12), %edx
157 testb %dl, %dl
158 je .L42
159 salq $4, %rax
160 movq %rax, %rsi
161 movzbl %dl, %eax
162 movzbl 5(%r12), %edx
163 addq %rsi, %rax
164 leaq 5(%r12), %rsi
165 testb %dl, %dl
166 je .L26
167 .L27:
168 salq $4, %rax
169 addq $1, %rsi
170 addq %rdx, %rax
171 movq %rax, %rdx
172 shrq $24, %rdx
173 andl $240, %edx
174 xorq %rdx, %rax
175 movzbl (%rsi), %edx
176 testb %dl, %dl
177 jne .L27
178 .L26:
179 andl $268435455, %eax
180 .L42:
181 xorl %edx, %edx
182 divl %ecx
183 movl %edx, %eax
184 salq $2, %rax
185 .L21:
186 movq 784(%r13), %rdx
187 movl (%rdx,%rax), %ebx
188 testl %ebx, %ebx
189 jne .L28
190 jmp .L30
191 .p2align 4,,10
192 .p2align 3
193 .L44:
194 movq 776(%r13), %rdx
195 movl (%rdx,%rbx,4), %ebx
196 testl %ebx, %ebx
197 je .L16
198 .L28:
199 movl 12(%rsp), %ecx
200 movq (%rsp), %rdx
201 movl %ebx, %r8d
202 movq %r12, %rsi
203 movq %r13, %rdi
204 call check_match
205 testq %rax, %rax
206 je .L44
207 jmp .L16
208 .L43:
209 movzbl %al, %eax
210 xorl %edx, %edx
211 divl %ecx
212 movl %edx, %eax
213 salq $2, %rax
214 jmp .L21
215 .size _dl_lookup_direct, .-_dl_lookup_direct
216 .hidden strcmp