clarify the purpose of this project
[nyanglibc.git] / intl / finddomain.s
blob885af97c0a42bebccb009c91ef85e9b7f42709da
1 .text
2 .p2align 4,,15
3 .globl _nl_find_domain
4 .hidden _nl_find_domain
5 .type _nl_find_domain, @function
6 _nl_find_domain:
7 pushq %r15
8 pushq %r14
9 pushq %r13
10 pushq %r12
11 movq %rcx, %r13
12 pushq %rbp
13 pushq %rbx
14 movq %rsi, %rbp
15 movq %rdi, %rbx
16 movq %rdx, %r12
17 subq $72, %rsp
18 cmpq $0, __pthread_rwlock_rdlock@GOTPCREL(%rip)
19 je .L2
20 leaq lock.10646(%rip), %rdi
21 call __pthread_rwlock_rdlock@PLT
22 .L2:
23 movq %rbx, %rdi
24 call strlen
25 subq $8, %rsp
26 leaq 1(%rax), %rdx
27 leaq _nl_loaded_domains(%rip), %rdi
28 pushq $0
29 pushq %r12
30 xorl %r9d, %r9d
31 pushq $0
32 pushq $0
33 xorl %ecx, %ecx
34 pushq $0
35 movq %rbp, %r8
36 movq %rbx, %rsi
37 call _nl_make_l10nflist@PLT
38 addq $48, %rsp
39 cmpq $0, __pthread_rwlock_unlock@GOTPCREL(%rip)
40 movq %rax, %r14
41 je .L3
42 leaq lock.10646(%rip), %rdi
43 call __pthread_rwlock_unlock@PLT
44 .L3:
45 testq %r14, %r14
46 je .L4
47 movl 8(%r14), %esi
48 testl %esi, %esi
49 jle .L55
50 .L5:
51 cmpq $0, 16(%r14)
52 je .L56
53 .L1:
54 addq $72, %rsp
55 movq %r14, %rax
56 popq %rbx
57 popq %rbp
58 popq %r12
59 popq %r13
60 popq %r14
61 popq %r15
62 ret
63 .p2align 4,,10
64 .p2align 3
65 .L56:
66 movq 32(%r14), %rdi
67 testq %rdi, %rdi
68 je .L1
69 leaq 32(%r14), %rbx
70 jmp .L8
71 .p2align 4,,10
72 .p2align 3
73 .L7:
74 movq (%rbx), %rax
75 cmpq $0, 16(%rax)
76 jne .L1
77 addq $8, %rbx
78 movq (%rbx), %rdi
79 testq %rdi, %rdi
80 je .L1
81 .L8:
82 movl 8(%rdi), %ecx
83 testl %ecx, %ecx
84 jg .L7
85 movq %r13, %rsi
86 call _nl_load_domain
87 jmp .L7
88 .p2align 4,,10
89 .p2align 3
90 .L55:
91 movq %r13, %rsi
92 movq %r14, %rdi
93 call _nl_load_domain
94 jmp .L5
95 .p2align 4,,10
96 .p2align 3
97 .L4:
98 movq %rbp, %rdi
99 call _nl_expand_alias@PLT
100 testq %rax, %rax
101 movq %rax, 8(%rsp)
102 je .L9
103 movq %rax, %rdi
104 call strlen
105 leaq 1(%rax), %r15
106 movq %r15, %rdi
107 call malloc@PLT
108 testq %rax, %rax
109 movq %rax, %rbp
110 je .L1
111 movq 8(%rsp), %rsi
112 movq %r15, %rdx
113 movq %rax, %rdi
114 call memcpy@PLT
115 .L9:
116 leaq 40(%rsp), %rcx
117 leaq 32(%rsp), %rdx
118 leaq 24(%rsp), %rsi
119 leaq 56(%rsp), %r9
120 leaq 48(%rsp), %r8
121 movq %rbp, %rdi
122 call _nl_explode_name@PLT
123 cmpl $-1, %eax
124 movl %eax, %r15d
125 je .L1
126 cmpq $0, __pthread_rwlock_wrlock@GOTPCREL(%rip)
127 je .L12
128 leaq lock.10646(%rip), %rdi
129 call __pthread_rwlock_wrlock@PLT
130 .L12:
131 movq %rbx, %rdi
132 call strlen
133 subq $8, %rsp
134 leaq 1(%rax), %rdx
135 leaq _nl_loaded_domains(%rip), %rdi
136 pushq $1
137 pushq %r12
138 movl %r15d, %ecx
139 pushq 56(%rsp)
140 pushq 88(%rsp)
141 movq %rbx, %rsi
142 pushq 88(%rsp)
143 movq 88(%rsp), %r9
144 movq 72(%rsp), %r8
145 call _nl_make_l10nflist@PLT
146 addq $48, %rsp
147 cmpq $0, __pthread_rwlock_unlock@GOTPCREL(%rip)
148 movq %rax, %r14
149 je .L13
150 leaq lock.10646(%rip), %rdi
151 call __pthread_rwlock_unlock@PLT
152 .L13:
153 testq %r14, %r14
154 je .L15
155 movl 8(%r14), %edx
156 testl %edx, %edx
157 jle .L57
158 .L16:
159 cmpq $0, 16(%r14)
160 je .L58
161 .L17:
162 cmpq $0, 8(%rsp)
163 je .L15
164 movq %rbp, %rdi
165 call free@PLT
166 .L15:
167 andl $1, %r15d
168 je .L1
169 movq 56(%rsp), %rdi
170 call free@PLT
171 jmp .L1
172 .p2align 4,,10
173 .p2align 3
174 .L58:
175 movq 32(%r14), %rdi
176 testq %rdi, %rdi
177 je .L17
178 leaq 32(%r14), %rbx
179 jmp .L19
180 .p2align 4,,10
181 .p2align 3
182 .L18:
183 movq (%rbx), %rax
184 cmpq $0, 16(%rax)
185 jne .L17
186 addq $8, %rbx
187 movq (%rbx), %rdi
188 testq %rdi, %rdi
189 je .L17
190 .L19:
191 movl 8(%rdi), %eax
192 testl %eax, %eax
193 jg .L18
194 movq %r13, %rsi
195 call _nl_load_domain
196 jmp .L18
197 .p2align 4,,10
198 .p2align 3
199 .L57:
200 movq %r13, %rsi
201 movq %r14, %rdi
202 call _nl_load_domain
203 jmp .L16
204 .size _nl_find_domain, .-_nl_find_domain
205 .section __libc_freeres_fn,"ax",@progbits
206 .p2align 4,,15
207 .globl _nl_finddomain_subfreeres
208 .hidden _nl_finddomain_subfreeres
209 .type _nl_finddomain_subfreeres, @function
210 _nl_finddomain_subfreeres:
211 pushq %rbp
212 pushq %rbx
213 subq $8, %rsp
214 movq _nl_loaded_domains(%rip), %rbx
215 testq %rbx, %rbx
216 jne .L62
217 jmp .L59
218 .p2align 4,,10
219 .p2align 3
220 .L63:
221 movq %rbp, %rbx
222 .L62:
223 movq 16(%rbx), %rdi
224 testq %rdi, %rdi
225 je .L61
226 call _nl_unload_domain
227 .L61:
228 movq (%rbx), %rdi
229 movq 24(%rbx), %rbp
230 call free@PLT
231 movq %rbx, %rdi
232 call free@PLT
233 testq %rbp, %rbp
234 jne .L63
235 .L59:
236 addq $8, %rsp
237 popq %rbx
238 popq %rbp
240 .size _nl_finddomain_subfreeres, .-_nl_finddomain_subfreeres
241 .local lock.10646
242 .comm lock.10646,56,32
243 .local _nl_loaded_domains
244 .comm _nl_loaded_domains,8,8
245 .weak __pthread_rwlock_wrlock
246 .weak __pthread_rwlock_unlock
247 .weak __pthread_rwlock_rdlock
248 .hidden _nl_unload_domain
249 .hidden _nl_load_domain
250 .hidden strlen