clarify the purpose of this project
[nyanglibc.git] / locale / loadarchive.shared.s.in
blob1dbe2282be27437ba04ade77da6c7eb8e34c618e
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 .section .rodata.str1.1,"aMS",@progbits,1
7 .LC0:
8 .string "loadarchive.c"
9 .section .rodata.str1.8,"aMS",@progbits,1
10 .align 8
11 .LC1:
12 .string "headmap.len == archive_stat.st_size"
13 #NO_APP
14 .text
15 .p2align 4,,15
16 .globl _nl_load_locale_from_archive
17 .hidden _nl_load_locale_from_archive
18 .type _nl_load_locale_from_archive, @function
19 _nl_load_locale_from_archive:
20 pushq %rbp
21 movq %rsp, %rbp
22 pushq %r15
23 pushq %r14
24 pushq %r13
25 pushq %r12
26 movq %rsi, %r13
27 pushq %rbx
28 subq $264, %rsp
29 movl %edi, -288(%rbp)
30 movl $30, %edi
31 movq (%rsi), %rbx
32 call __GI___sysconf
33 movq archloaded(%rip), %r14
34 testq %r14, %r14
35 jne .L7
36 jmp .L2
37 .p2align 4,,10
38 .p2align 3
39 .L75:
40 movq %r15, %rsi
41 movq %rbx, %rdi
42 call __GI_strcmp
43 testl %eax, %eax
44 je .L74
45 movq (%r14), %r14
46 testq %r14, %r14
47 je .L2
48 .L7:
49 movq 8(%r14), %r15
50 cmpq %rbx, %r15
51 jne .L75
52 .L3:
53 movslq -288(%rbp), %r12
54 movq %rbx, 0(%r13)
55 movq 16(%r14,%r12,8), %rax
56 .L1:
57 leaq -40(%rbp), %rsp
58 popq %rbx
59 popq %r12
60 popq %r13
61 popq %r14
62 popq %r15
63 popq %rbp
64 ret
65 .p2align 4,,10
66 .p2align 3
67 .L2:
68 movl $46, %esi
69 movq %rbx, %rdi
70 call __GI_strchr
71 testq %rax, %rax
72 je .L8
73 testb $-65, 1(%rax)
74 jne .L76
75 .L8:
76 cmpq $0, archmapped(%rip)
77 je .L12
78 movq headmap(%rip), %r14
79 testq %r14, %r14
80 je .L72
81 .L14:
82 movq %rbx, %rdi
83 call __GI_strlen
84 testq %rax, %rax
85 movl %eax, %r9d
86 je .L32
87 movq %rbx, %rdx
88 addq %rbx, %rax
89 .p2align 4,,10
90 .p2align 3
91 .L19:
92 movzbl (%rdx), %ecx
93 roll $9, %r9d
94 addq $1, %rdx
95 addl %ecx, %r9d
96 cmpq %rax, %rdx
97 jne .L19
98 testl %r9d, %r9d
99 movl %r9d, %ecx
100 je .L32
101 .L18:
102 movl 8(%r14), %eax
103 movl 16(%r14), %esi
104 cmpl $2, %esi
105 movq %rax, -296(%rbp)
106 jbe .L72
107 movl %esi, %r10d
108 movq %rcx, %rax
109 xorl %edx, %edx
110 divq %r10
111 subl $2, %esi
112 movq %rcx, %rax
113 movq %rdx, %r8
114 xorl %edx, %edx
115 divq %rsi
116 addq $1, %rdx
117 leaq (%rdx,%rdx,2), %r11
118 leaq 0(,%r11,4), %r12
119 .L23:
120 movq -296(%rbp), %rcx
121 leaq (%r8,%r8,2), %rax
122 leaq (%rcx,%rax,4), %rcx
123 leaq (%r14,%rcx), %r15
124 jmp .L22
125 .p2align 4,,10
126 .p2align 3
127 .L20:
128 addq %rdx, %r8
129 addq %r12, %r15
130 cmpq %r8, %r10
131 jbe .L77
132 .L22:
133 movl 4(%r15), %esi
134 testl %esi, %esi
135 je .L72
136 cmpl %r9d, (%r15)
137 jne .L20
138 addq %r14, %rsi
139 movq %rbx, %rdi
140 movl %r9d, -284(%rbp)
141 movq %rdx, -280(%rbp)
142 movq %r8, -272(%rbp)
143 movq %r10, -264(%rbp)
144 call __GI_strcmp
145 testl %eax, %eax
146 movq -264(%rbp), %r10
147 movq -272(%rbp), %r8
148 movq -280(%rbp), %rdx
149 movl -284(%rbp), %r9d
150 jne .L20
151 movl 8(%r15), %eax
152 testl %eax, %eax
153 je .L72
154 leaq (%r14,%rax), %rdi
155 movl 12+headmap(%rip), %eax
156 cmpq 48+archive_stat(%rip), %rax
157 movq %rax, %r9
158 jne .L24
159 leaq -256(%rbp), %r15
160 xorl %edx, %edx
161 movq %r15, %rcx
162 jmp .L25
163 .p2align 4,,10
164 .p2align 3
165 .L26:
166 addq $1, %rdx
167 addq $16, %rcx
168 .L25:
169 cmpq $6, %rdx
170 je .L26
171 movl 4(%rdi,%rdx,8), %eax
172 movl 8(%rdi,%rdx,8), %esi
173 leal (%rax,%rsi), %r8d
174 cmpl %r8d, %r9d
175 jb .L72
176 addq %r14, %rax
177 cmpl $12, %edx
178 movq %rax, (%rcx)
179 movl %esi, %eax
180 movq %rax, 8(%rcx)
181 jne .L26
182 movl $120, %edi
183 call malloc@PLT
184 testq %rax, %rax
185 movq %rax, %r14
186 je .L72
187 movq 0(%r13), %rdi
188 call __GI___strdup
189 testq %rax, %rax
190 movq %rax, 8(%r14)
191 je .L78
192 movq archloaded(%rip), %rax
193 xorl %ebx, %ebx
194 movq %r14, archloaded(%rip)
195 movq %rax, (%r14)
196 jmp .L30
197 .p2align 4,,10
198 .p2align 3
199 .L28:
200 addq $1, %rbx
201 addq $16, %r15
202 .L30:
203 cmpq $6, %rbx
204 je .L28
205 movq 8(%r15), %rdx
206 movq (%r15), %rsi
207 movl %ebx, %edi
208 call _nl_intern_locale_data
209 testq %rax, %rax
210 movq %rax, 16(%r14,%rbx,8)
211 je .L29
212 movq 8(%r14), %rdx
213 movl $2, 24(%rax)
214 movl $-1, 48(%rax)
215 movq %rdx, (%rax)
216 .L29:
217 cmpl $12, %ebx
218 jne .L28
219 movslq -288(%rbp), %r12
220 movq 8(%r14), %rax
221 movq %rax, 0(%r13)
222 movq 16(%r14,%r12,8), %rax
223 jmp .L1
224 .p2align 4,,10
225 .p2align 3
226 .L74:
227 movq %r15, %rbx
228 jmp .L3
229 .L78:
230 movq %r14, %rdi
231 call free@PLT
232 .L72:
233 leaq -40(%rbp), %rsp
234 xorl %eax, %eax
235 popq %rbx
236 popq %r12
237 popq %r13
238 popq %r14
239 popq %r15
240 popq %rbp
242 .p2align 4,,10
243 .p2align 3
244 .L32:
245 movl $4294967295, %ecx
246 movl $-1, %r9d
247 jmp .L18
248 .L76:
249 leaq 1(%rax), %r14
250 movl $64, %esi
251 movq %r14, %rdi
252 call __strchrnul@PLT
253 movq %rax, %r15
254 movq %r14, %rdi
255 movq %rax, -264(%rbp)
256 subq %r14, %r15
257 movq %r15, %rsi
258 call _nl_normalize_codeset@PLT
259 testq %rax, %rax
260 movq %rax, %r12
261 je .L72
262 movq %r15, %rdx
263 movq %r14, %rsi
264 movq %rax, %rdi
265 call __GI_strncmp
266 testl %eax, %eax
267 jne .L10
268 cmpb $0, (%r12,%r15)
269 je .L11
270 .L10:
271 movq %r12, %rdi
272 call __GI_strlen
273 movq -264(%rbp), %rdi
274 movq %rax, %r15
275 call __GI_strlen
276 movq %r14, %rdx
277 leaq 1(%rax), %r8
278 movq %rbx, %rsi
279 subq %rbx, %rdx
280 leaq (%rdx,%r15), %rax
281 movq %r8, -272(%rbp)
282 leaq 30(%r8,%rax), %rax
283 andq $-16, %rax
284 subq %rax, %rsp
285 leaq 15(%rsp), %r14
286 andq $-16, %r14
287 movq %r14, %rdi
288 movq %r14, %rbx
289 call __GI_mempcpy@PLT
290 movq %r15, %rdx
291 movq %r12, %rsi
292 movq %rax, %rdi
293 call __GI_mempcpy@PLT
294 movq -272(%rbp), %r8
295 movq -264(%rbp), %rsi
296 movq %rax, %rdi
297 movq %r8, %rdx
298 call __GI_memcpy@PLT
299 .L11:
300 movq %r12, %rdi
301 call free@PLT
302 jmp .L8
303 .p2align 4,,10
304 .p2align 3
305 .L77:
306 subq %r10, %r8
307 jmp .L23
308 .L12:
309 leaq headmap(%rip), %rax
310 leaq archfname(%rip), %rdi
311 movl $524288, %esi
312 movq %rax, archmapped(%rip)
313 xorl %eax, %eax
314 call __GI___open_nocancel
315 testl %eax, %eax
316 movl %eax, %r15d
317 js .L72
318 leaq archive_stat(%rip), %rsi
319 movl %eax, %edi
320 call __GI___fstat64
321 cmpl $-1, %eax
322 jne .L79
323 .L17:
324 movl %r15d, %edi
325 call __GI___close_nocancel
326 leaq -40(%rbp), %rsp
327 xorl %eax, %eax
328 popq %rbx
329 popq %r12
330 popq %r13
331 popq %r14
332 popq %r15
333 popq %rbp
335 .L79:
336 movq 48+archive_stat(%rip), %r12
337 xorl %r9d, %r9d
338 xorl %edi, %edi
339 movl %r15d, %r8d
340 movl $2, %ecx
341 movl $1, %edx
342 movq %r12, %rsi
343 call __GI___mmap64
344 cmpq $-1, %rax
345 movq %rax, %r14
346 je .L17
347 movl 16(%rax), %eax
348 leaq (%rax,%rax,2), %rdx
349 movl 8(%r14), %eax
350 leaq (%rax,%rdx,4), %rax
351 movl 36(%r14), %edx
352 leaq (%rdx,%rdx,2), %rdx
353 leaq (%rdx,%rdx,8), %rcx
354 movl 32(%r14), %edx
355 leaq (%rdx,%rcx,4), %rdx
356 cmpq %rdx, %rax
357 cmovl %rdx, %rax
358 movl 24(%r14), %edx
359 addl 20(%r14), %edx
360 cmpq %rdx, %rax
361 cmovl %rdx, %rax
362 cmpq %rax, %r12
363 jnb .L16
364 movq %r12, %rsi
365 movq %r14, %rdi
366 call __GI___munmap
367 jmp .L17
368 .L16:
369 movl %r15d, %edi
370 call __GI___close_nocancel
371 movq %r14, headmap(%rip)
372 movl %r12d, 12+headmap(%rip)
373 jmp .L14
374 .L24:
375 leaq __PRETTY_FUNCTION__.9426(%rip), %rcx
376 leaq .LC0(%rip), %rsi
377 leaq .LC1(%rip), %rdi
378 movl $310, %edx
379 call __GI___assert_fail
380 .size _nl_load_locale_from_archive, .-_nl_load_locale_from_archive
381 .section .rodata.str1.1
382 .LC2:
383 .string "archmapped == &headmap"
384 .section __libc_freeres_fn,"ax",@progbits
385 .p2align 4,,15
386 .globl _nl_archive_subfreeres
387 .hidden _nl_archive_subfreeres
388 .type _nl_archive_subfreeres, @function
389 _nl_archive_subfreeres:
390 pushq %r12
391 pushq %rbp
392 movq archloaded(%rip), %rbp
393 pushq %rbx
394 testq %rbp, %rbp
395 je .L81
396 .p2align 4,,10
397 .p2align 3
398 .L85:
399 movq 8(%rbp), %rdi
400 movq 0(%rbp), %r12
401 xorl %ebx, %ebx
402 call free@PLT
403 jmp .L89
404 .p2align 4,,10
405 .p2align 3
406 .L82:
407 addq $1, %rbx
408 .L89:
409 cmpq $6, %rbx
410 je .L82
411 movq 16(%rbp,%rbx,8), %rdi
412 testq %rdi, %rdi
413 je .L83
414 movq 32(%rdi), %rax
415 testq %rax, %rax
416 je .L84
417 call *%rax
418 movq 16(%rbp,%rbx,8), %rdi
419 .L84:
420 call free@PLT
421 .L83:
422 cmpl $12, %ebx
423 jne .L82
424 movq %rbp, %rdi
425 movq %r12, %rbp
426 call free@PLT
427 testq %r12, %r12
428 jne .L85
429 .L81:
430 movq archmapped(%rip), %rbx
431 movq $0, archloaded(%rip)
432 testq %rbx, %rbx
433 je .L80
434 leaq headmap(%rip), %rax
435 cmpq %rax, %rbx
436 jne .L111
437 movl 12(%rbx), %esi
438 movq (%rbx), %rdi
439 movq $0, archmapped(%rip)
440 call __GI___munmap
441 movq 16(%rbx), %rbx
442 testq %rbx, %rbx
443 je .L80
444 .p2align 4,,10
445 .p2align 3
446 .L88:
447 movl 12(%rbx), %esi
448 movq (%rbx), %rdi
449 movq 16(%rbx), %rbp
450 call __GI___munmap
451 movq %rbx, %rdi
452 movq %rbp, %rbx
453 call free@PLT
454 testq %rbp, %rbp
455 jne .L88
456 .L80:
457 popq %rbx
458 popq %rbp
459 popq %r12
461 .L111:
462 leaq __PRETTY_FUNCTION__.9466(%rip), %rcx
463 leaq .LC0(%rip), %rsi
464 leaq .LC2(%rip), %rdi
465 movl $534, %edx
466 call __GI___assert_fail
467 .size _nl_archive_subfreeres, .-_nl_archive_subfreeres
468 .section .rodata.str1.16,"aMS",@progbits,1
469 .align 16
470 .type __PRETTY_FUNCTION__.9466, @object
471 .size __PRETTY_FUNCTION__.9466, 23
472 __PRETTY_FUNCTION__.9466:
473 .string "_nl_archive_subfreeres"
474 .align 16
475 .type __PRETTY_FUNCTION__.9426, @object
476 .size __PRETTY_FUNCTION__.9426, 29
477 __PRETTY_FUNCTION__.9426:
478 .string "_nl_load_locale_from_archive"
479 .local archloaded
480 .comm archloaded,8,8
481 .local archive_stat
482 .comm archive_stat,144,32
483 .local headmap
484 .comm headmap,24,16
485 .local archmapped
486 .comm archmapped,8,8
487 .section .rodata.str1.32,"aMS",@progbits,1
488 .align 32
489 .type archfname, @object
490 archfname:
491 .string "CONF_PREFIX/lib/locale/locale-archive"
492 .size archfname,.-archfname
493 .hidden _nl_intern_locale_data