clarify the purpose of this project
[nyanglibc.git] / locale / loadlocale.s
blobed20510a77d3bda405f997a904d3805cddbabce3
1 .text
2 .section .rodata.str1.1,"aMS",@progbits,1
3 .LC0:
4 .string "loadlocale.c"
5 .LC1:
6 .string "category == LC_CTYPE"
7 .text
8 .p2align 4,,15
9 .globl _nl_intern_locale_data
10 .hidden _nl_intern_locale_data
11 .type _nl_intern_locale_data, @function
12 _nl_intern_locale_data:
13 pushq %r15
14 pushq %r14
15 pushq %r13
16 pushq %r12
17 pushq %rbp
18 pushq %rbx
19 subq $8, %rsp
20 cmpq $7, %rdx
21 jbe .L37
22 cmpl $3, %edi
23 movl (%rsi), %ecx
24 movl $537202711, %eax
25 je .L3
26 movl %edi, %eax
27 movl $537462560, %r8d
28 xorl $537071893, %eax
29 testl %edi, %edi
30 cmove %r8d, %eax
31 .L3:
32 cmpl %eax, %ecx
33 jne .L37
34 leaq _nl_category_num_items(%rip), %rax
35 movl 4(%rsi), %r13d
36 movslq %edi, %r14
37 cmpq (%rax,%r14,8), %r13
38 jb .L37
39 leaq 8(,%r13,4), %rax
40 cmpq %rdx, %rax
41 jnb .L37
42 movl %edi, %ebx
43 leaq 64(,%r13,8), %rdi
44 movq %rdx, %r12
45 movq %rsi, %rbp
46 call malloc@PLT
47 testq %rax, %rax
48 jne .L39
49 .L1:
50 addq $8, %rsp
51 popq %rbx
52 popq %rbp
53 popq %r12
54 popq %r13
55 popq %r14
56 popq %r15
57 ret
58 .p2align 4,,10
59 .p2align 3
60 .L14:
61 cmpq $4, %rdx
62 jbe .L20
63 .L6:
64 movq %rax, %rdi
65 call free@PLT
66 .L37:
67 movq __libc_errno@gottpoff(%rip), %rax
68 movl $22, %fs:(%rax)
69 addq $8, %rsp
70 xorl %eax, %eax
71 popq %rbx
72 popq %rbp
73 popq %r12
74 popq %r13
75 popq %r14
76 popq %r15
77 ret
78 .p2align 4,,10
79 .p2align 3
80 .L39:
81 testq %r13, %r13
82 movq %rbp, 8(%rax)
83 movq %r12, 16(%rax)
84 movq $0, 32(%rax)
85 movq $0, 40(%rax)
86 movq $0, 48(%rax)
87 movl %r13d, 56(%rax)
88 je .L1
89 movl 8(%rbp), %ecx
90 cmpq %r12, %rcx
91 movq %rcx, %rdi
92 ja .L6
93 leaq _nl_value_types(%rip), %r10
94 leaq .L10(%rip), %r8
95 xorl %edx, %edx
96 movl %ebx, %r9d
97 .L7:
98 cmpl $12, %ebx
99 ja .L8
100 movslq (%r8,%r9,4), %rsi
101 addq %r8, %rsi
102 jmp *%rsi
103 .section .rodata
104 .align 4
105 .align 4
106 .L10:
107 .long .L8-.L10
108 .long .L9-.L10
109 .long .L11-.L10
110 .long .L12-.L10
111 .long .L13-.L10
112 .long .L14-.L10
113 .long .L8-.L10
114 .long .L15-.L10
115 .long .L16-.L10
116 .long .L17-.L10
117 .long .L14-.L10
118 .long .L18-.L10
119 .long .L19-.L10
120 .text
121 .p2align 4,,10
122 .p2align 3
123 .L11:
124 cmpq $158, %rdx
125 ja .L6
126 .p2align 4,,10
127 .p2align 3
128 .L20:
129 movq (%r10,%r14,8), %rsi
130 cmpl $5, (%rsi,%rdx,4)
131 je .L23
132 .L22:
133 addq %rbp, %rcx
134 movq %rcx, 64(%rax,%rdx,8)
135 .L24:
136 addq $1, %rdx
137 cmpq %rdx, %r13
138 je .L1
139 movl 8(%rbp,%rdx,4), %ecx
140 cmpq %rcx, %r12
141 movq %rcx, %rdi
142 jnb .L7
143 jmp .L6
144 .p2align 4,,10
145 .p2align 3
146 .L18:
147 cmpq $1, %rdx
148 jbe .L20
149 jmp .L6
150 .p2align 4,,10
151 .p2align 3
152 .L17:
153 cmpq $12, %rdx
154 jbe .L20
155 jmp .L6
156 .p2align 4,,10
157 .p2align 3
158 .L16:
159 cmpq $6, %rdx
160 jbe .L20
161 jmp .L6
162 .p2align 4,,10
163 .p2align 3
164 .L15:
165 cmpq $2, %rdx
166 jbe .L20
167 jmp .L6
168 .p2align 4,,10
169 .p2align 3
170 .L19:
171 cmpq $15, %rdx
172 jbe .L20
173 jmp .L6
174 .p2align 4,,10
175 .p2align 3
176 .L13:
177 cmpq $45, %rdx
178 jbe .L20
179 jmp .L6
180 .p2align 4,,10
181 .p2align 3
182 .L12:
183 cmpq $18, %rdx
184 jbe .L20
185 jmp .L6
186 .p2align 4,,10
187 .p2align 3
188 .L9:
189 cmpq $5, %rdx
190 jbe .L20
191 jmp .L6
192 .p2align 4,,10
193 .p2align 3
194 .L8:
195 testl %ebx, %ebx
196 jne .L40
197 cmpq $85, %rdx
198 ja .L22
199 jmp .L20
200 .p2align 4,,10
201 .p2align 3
202 .L23:
203 andl $3, %edi
204 jne .L6
205 movl 0(%rbp,%rcx), %ecx
206 movl %ecx, 64(%rax,%rdx,8)
207 jmp .L24
208 .L40:
209 leaq __PRETTY_FUNCTION__.9364(%rip), %rcx
210 leaq .LC0(%rip), %rsi
211 leaq .LC1(%rip), %rdi
212 movl $144, %edx
213 call __assert_fail
214 .size _nl_intern_locale_data, .-_nl_intern_locale_data
215 .p2align 4,,15
216 .globl _nl_load_locale
217 .hidden _nl_load_locale
218 .type _nl_load_locale, @function
219 _nl_load_locale:
220 pushq %rbp
221 xorl %eax, %eax
222 movq %rsp, %rbp
223 pushq %r15
224 pushq %r14
225 pushq %r13
226 pushq %r12
227 movl %esi, %r13d
228 pushq %rbx
229 movq %rdi, %rbx
230 movl $524288, %esi
231 subq $168, %rsp
232 movl $1, 8(%rdi)
233 movq $0, 16(%rdi)
234 movq (%rdi), %rdi
235 call __open_nocancel
236 testl %eax, %eax
237 js .L41
238 leaq -192(%rbp), %r12
239 movl %eax, %edi
240 movl %eax, %r14d
241 movq %r12, %rsi
242 call __fstat64
243 testl %eax, %eax
244 js .L53
245 .L44:
246 movl -168(%rbp), %eax
247 andl $61440, %eax
248 cmpl $16384, %eax
249 je .L77
250 .L46:
251 movq __libc_errno@gottpoff(%rip), %rax
252 movq -144(%rbp), %rsi
253 xorl %r9d, %r9d
254 xorl %edi, %edi
255 movl %r14d, %r8d
256 movl $2, %ecx
257 movl $1, %edx
258 movl %fs:(%rax), %r15d
259 call __mmap
260 cmpq $-1, %rax
261 movq %rax, %r12
262 je .L78
263 movl %r14d, %edi
264 call __close_nocancel
265 testq %r12, %r12
266 je .L41
267 movq -144(%rbp), %rdx
268 movq %r12, %rsi
269 movl %r13d, %edi
270 call _nl_intern_locale_data
271 testq %rax, %rax
272 je .L60
273 movl $1, %edx
274 .L57:
275 movq $0, (%rax)
276 movl %edx, 24(%rax)
277 movq %rax, 16(%rbx)
278 .L41:
279 leaq -40(%rbp), %rsp
280 popq %rbx
281 popq %r12
282 popq %r13
283 popq %r14
284 popq %r15
285 popq %rbp
287 .p2align 4,,10
288 .p2align 3
289 .L78:
290 movq __libc_errno@gottpoff(%rip), %rax
291 cmpl $38, %fs:(%rax)
292 jne .L53
293 movq -144(%rbp), %r12
294 movq %r12, %rdi
295 call malloc@PLT
296 testq %rax, %rax
297 movq %rax, -208(%rbp)
298 je .L53
299 testq %r12, %r12
300 jle .L54
301 movq %rax, %rcx
302 jmp .L56
303 .p2align 4,,10
304 .p2align 3
305 .L55:
306 subq %rax, %r12
307 addq %rax, %rcx
308 testq %r12, %r12
309 jle .L54
310 .L56:
311 movq %rcx, %rsi
312 movq %r12, %rdx
313 movl %r14d, %edi
314 movq %rcx, -200(%rbp)
315 call __read_nocancel
316 testq %rax, %rax
317 movq -200(%rbp), %rcx
318 jg .L55
319 movq -208(%rbp), %rdi
320 movq %rax, -200(%rbp)
321 call free@PLT
322 movq -200(%rbp), %rax
323 testq %rax, %rax
324 jne .L53
325 movq __libc_errno@gottpoff(%rip), %rax
326 movl $22, %fs:(%rax)
327 .L53:
328 movl %r14d, %edi
329 call __close_nocancel
330 leaq -40(%rbp), %rsp
331 popq %rbx
332 popq %r12
333 popq %r13
334 popq %r14
335 popq %r15
336 popq %rbp
338 .p2align 4,,10
339 .p2align 3
340 .L77:
341 movl %r14d, %edi
342 call __close_nocancel
343 movq (%rbx), %rsi
344 movq %rsi, %rdi
345 movq %rsi, -208(%rbp)
346 call strlen
347 leaq _nl_category_name_sizes(%rip), %rdx
348 movslq %r13d, %rcx
349 movq -208(%rbp), %rsi
350 movzbl (%rdx,%rcx), %edx
351 leaq 36(%rax,%rdx), %rdi
352 movq %rdx, %r14
353 leaq _nl_category_name_idxs(%rip), %rdx
354 andq $-16, %rdi
355 movzbl (%rdx,%rcx), %r8d
356 leaq _nl_category_names(%rip), %rdx
357 subq %rdi, %rsp
358 leaq 15(%rsp), %r15
359 andq $-16, %r15
360 addq %rdx, %r8
361 movq %rax, %rdx
362 movq %r15, %rdi
363 movq %r8, -200(%rbp)
364 call __mempcpy@PLT
365 leal 1(%r14), %edx
366 movl $1398362927, (%rax)
367 movb $95, 4(%rax)
368 leaq 5(%rax), %rcx
369 movq -200(%rbp), %r8
370 cmpl $8, %edx
371 jnb .L47
372 testb $4, %dl
373 jne .L79
374 testl %edx, %edx
375 je .L48
376 movzbl (%r8), %esi
377 testb $2, %dl
378 movb %sil, 5(%rax)
379 jne .L80
380 .L48:
381 xorl %eax, %eax
382 movl $524288, %esi
383 movq %r15, %rdi
384 call __open_nocancel
385 testl %eax, %eax
386 movl %eax, %r14d
387 js .L41
388 movq %r12, %rsi
389 movl %eax, %edi
390 call __fstat64
391 testl %eax, %eax
392 jns .L46
393 jmp .L53
394 .p2align 4,,10
395 .p2align 3
396 .L47:
397 movq (%r8), %rsi
398 movq %rsi, 5(%rax)
399 movl %edx, %esi
400 movq -8(%r8,%rsi), %rdi
401 movq %rdi, -8(%rcx,%rsi)
402 leaq 13(%rax), %rdi
403 movq %r8, %rsi
404 andq $-8, %rdi
405 subq %rdi, %rcx
406 subq %rcx, %rsi
407 addl %edx, %ecx
408 shrl $3, %ecx
409 movl %ecx, %ecx
410 rep movsq
411 jmp .L48
412 .p2align 4,,10
413 .p2align 3
414 .L54:
415 movq __libc_errno@gottpoff(%rip), %rax
416 movl %r14d, %edi
417 movl %r15d, %fs:(%rax)
418 call __close_nocancel
419 movq -144(%rbp), %rdx
420 movq -208(%rbp), %rsi
421 movl %r13d, %edi
422 call _nl_intern_locale_data
423 testq %rax, %rax
424 je .L41
425 xorl %edx, %edx
426 jmp .L57
427 .p2align 4,,10
428 .p2align 3
429 .L60:
430 movq -144(%rbp), %rsi
431 movq %r12, %rdi
432 call __munmap
433 jmp .L41
434 .L79:
435 movl (%r8), %esi
436 movl %esi, 5(%rax)
437 movl -4(%r8,%rdx), %eax
438 movl %eax, -4(%rcx,%rdx)
439 jmp .L48
440 .L80:
441 movzwl -2(%r8,%rdx), %eax
442 movw %ax, -2(%rcx,%rdx)
443 jmp .L48
444 .size _nl_load_locale, .-_nl_load_locale
445 .p2align 4,,15
446 .globl _nl_unload_locale
447 .hidden _nl_unload_locale
448 .type _nl_unload_locale, @function
449 _nl_unload_locale:
450 pushq %rbx
451 movq 32(%rdi), %rax
452 movq %rdi, %rbx
453 testq %rax, %rax
454 je .L82
455 call *%rax
456 .L82:
457 movl 24(%rbx), %eax
458 testl %eax, %eax
459 je .L84
460 cmpl $1, %eax
461 je .L85
462 .L83:
463 cmpl $2, %eax
464 je .L86
465 movq (%rbx), %rdi
466 call free@PLT
467 .L86:
468 movq %rbx, %rdi
469 popq %rbx
470 jmp free@PLT
471 .p2align 4,,10
472 .p2align 3
473 .L85:
474 movq 16(%rbx), %rsi
475 movq 8(%rbx), %rdi
476 call __munmap
477 movl 24(%rbx), %eax
478 jmp .L83
479 .p2align 4,,10
480 .p2align 3
481 .L84:
482 movq 8(%rbx), %rdi
483 call free@PLT
484 movl 24(%rbx), %eax
485 jmp .L83
486 .size _nl_unload_locale, .-_nl_unload_locale
487 .section .rodata.str1.16,"aMS",@progbits,1
488 .align 16
489 .type __PRETTY_FUNCTION__.9364, @object
490 .size __PRETTY_FUNCTION__.9364, 23
491 __PRETTY_FUNCTION__.9364:
492 .string "_nl_intern_locale_data"
493 .section .data.rel.ro.local,"aw",@progbits
494 .align 32
495 .type _nl_value_types, @object
496 .size _nl_value_types, 104
497 _nl_value_types:
498 .quad _nl_value_type_LC_CTYPE
499 .quad _nl_value_type_LC_NUMERIC
500 .quad _nl_value_type_LC_TIME
501 .quad _nl_value_type_LC_COLLATE
502 .quad _nl_value_type_LC_MONETARY
503 .quad _nl_value_type_LC_MESSAGES
504 .zero 8
505 .quad _nl_value_type_LC_PAPER
506 .quad _nl_value_type_LC_NAME
507 .quad _nl_value_type_LC_ADDRESS
508 .quad _nl_value_type_LC_TELEPHONE
509 .quad _nl_value_type_LC_MEASUREMENT
510 .quad _nl_value_type_LC_IDENTIFICATION
511 .section .rodata
512 .align 32
513 .type _nl_value_type_LC_IDENTIFICATION, @object
514 .size _nl_value_type_LC_IDENTIFICATION, 64
515 _nl_value_type_LC_IDENTIFICATION:
516 .long 1
517 .long 1
518 .long 1
519 .long 1
520 .long 1
521 .long 1
522 .long 1
523 .long 1
524 .long 1
525 .long 1
526 .long 1
527 .long 1
528 .long 1
529 .long 1
530 .long 2
531 .long 1
532 .section .rodata.cst8,"aM",@progbits,8
533 .align 8
534 .type _nl_value_type_LC_MEASUREMENT, @object
535 .size _nl_value_type_LC_MEASUREMENT, 8
536 _nl_value_type_LC_MEASUREMENT:
537 .long 3
538 .long 1
539 .section .rodata
540 .align 32
541 .type _nl_value_type_LC_ADDRESS, @object
542 .size _nl_value_type_LC_ADDRESS, 52
543 _nl_value_type_LC_ADDRESS:
544 .long 1
545 .long 1
546 .long 1
547 .long 1
548 .long 1
549 .long 1
550 .long 5
551 .long 1
552 .long 1
553 .long 1
554 .long 1
555 .long 1
556 .long 1
557 .align 16
558 .type _nl_value_type_LC_NAME, @object
559 .size _nl_value_type_LC_NAME, 28
560 _nl_value_type_LC_NAME:
561 .long 1
562 .long 1
563 .long 1
564 .long 1
565 .long 1
566 .long 1
567 .long 1
568 .align 8
569 .type _nl_value_type_LC_PAPER, @object
570 .size _nl_value_type_LC_PAPER, 12
571 _nl_value_type_LC_PAPER:
572 .long 5
573 .long 5
574 .long 1
575 .align 16
576 .type _nl_value_type_LC_MESSAGES, @object
577 .size _nl_value_type_LC_MESSAGES, 20
578 _nl_value_type_LC_MESSAGES:
579 .long 1
580 .long 1
581 .long 1
582 .long 1
583 .long 1
584 .set _nl_value_type_LC_TELEPHONE,_nl_value_type_LC_MESSAGES
585 .align 32
586 .type _nl_value_type_LC_TIME, @object
587 .size _nl_value_type_LC_TIME, 636
588 _nl_value_type_LC_TIME:
589 .long 2
590 .zero 24
591 .long 2
592 .zero 24
593 .long 2
594 .zero 44
595 .long 2
596 .zero 44
597 .long 2
598 .zero 4
599 .long 1
600 .long 1
601 .long 1
602 .long 1
603 .long 6
604 .long 1
605 .long 1
606 .long 6
607 .long 1
608 .long 1
609 .long 5
610 .long 1
611 .long 9
612 .zero 24
613 .long 9
614 .zero 24
615 .long 9
616 .zero 44
617 .long 9
618 .zero 44
619 .long 9
620 .zero 4
621 .long 8
622 .long 8
623 .long 8
624 .long 8
625 .long 8
626 .long 8
627 .long 10
628 .long 8
629 .long 8
630 .long 3
631 .long 5
632 .long 3
633 .long 3
634 .long 3
635 .long 3
636 .long 1
637 .long 1
638 .long 8
639 .long 1
640 .long 2
641 .zero 44
642 .long 9
643 .zero 44
644 .long 2
645 .zero 44
646 .long 9
647 .zero 44
648 .align 16
649 .type _nl_value_type_LC_NUMERIC, @object
650 .size _nl_value_type_LC_NUMERIC, 24
651 _nl_value_type_LC_NUMERIC:
652 .long 1
653 .long 1
654 .long 4
655 .long 5
656 .long 5
657 .long 1
658 .align 32
659 .type _nl_value_type_LC_MONETARY, @object
660 .size _nl_value_type_LC_MONETARY, 184
661 _nl_value_type_LC_MONETARY:
662 .long 1
663 .long 1
664 .long 1
665 .long 1
666 .long 4
667 .long 1
668 .long 1
669 .long 3
670 .long 3
671 .long 3
672 .long 3
673 .long 3
674 .long 3
675 .long 3
676 .long 3
677 .long 1
678 .long 3
679 .long 3
680 .long 3
681 .long 3
682 .long 3
683 .long 3
684 .long 1
685 .long 1
686 .long 3
687 .long 3
688 .long 3
689 .long 3
690 .long 3
691 .long 3
692 .long 3
693 .long 3
694 .long 3
695 .long 3
696 .long 3
697 .long 3
698 .long 3
699 .long 3
700 .long 5
701 .long 5
702 .long 5
703 .long 5
704 .long 7
705 .long 5
706 .long 5
707 .long 1
708 .align 32
709 .type _nl_value_type_LC_CTYPE, @object
710 .size _nl_value_type_LC_CTYPE, 344
711 _nl_value_type_LC_CTYPE:
712 .long 8
713 .long 8
714 .zero 4
715 .long 8
716 .zero 4
717 .long 8
718 .zero 16
719 .long 6
720 .long 6
721 .long 4
722 .long 5
723 .long 1
724 .long 8
725 .long 8
726 .long 5
727 .long 5
728 .long 5
729 .long 1
730 .long 1
731 .long 1
732 .long 1
733 .long 1
734 .long 1
735 .long 1
736 .long 1
737 .long 1
738 .long 1
739 .long 5
740 .long 8
741 .long 8
742 .long 8
743 .long 8
744 .long 8
745 .long 8
746 .long 8
747 .long 8
748 .long 8
749 .long 8
750 .long 1
751 .long 1
752 .long 1
753 .long 1
754 .long 1
755 .long 1
756 .long 1
757 .long 1
758 .long 1
759 .long 1
760 .long 5
761 .long 5
762 .long 5
763 .long 5
764 .long 5
765 .long 5
766 .long 5
767 .long 5
768 .long 5
769 .long 5
770 .long 5
771 .long 8
772 .long 8
773 .long 8
774 .long 8
775 .long 5
776 .long 8
777 .long 5
778 .long 1
779 .long 5
780 .long 5
781 .zero 56
782 .align 32
783 .type _nl_value_type_LC_COLLATE, @object
784 .size _nl_value_type_LC_COLLATE, 76
785 _nl_value_type_LC_COLLATE:
786 .long 5
787 .long 1
788 .long 8
789 .long 8
790 .long 8
791 .long 8
792 .zero 12
793 .long 8
794 .long 8
795 .long 8
796 .long 8
797 .long 5
798 .long 8
799 .long 8
800 .long 8
801 .long 8
802 .long 1
803 .align 32
804 .type _nl_category_num_items, @object
805 .size _nl_category_num_items, 104
806 _nl_category_num_items:
807 .quad 86
808 .quad 6
809 .quad 159
810 .quad 19
811 .quad 46
812 .quad 5
813 .zero 8
814 .quad 3
815 .quad 7
816 .quad 13
817 .quad 5
818 .quad 2
819 .quad 16
820 .hidden __munmap
821 .hidden _nl_category_names
822 .hidden _nl_category_name_idxs
823 .hidden _nl_category_name_sizes
824 .hidden strlen
825 .hidden __read_nocancel
826 .hidden __close_nocancel
827 .hidden __mmap
828 .hidden __fstat64
829 .hidden __open_nocancel
830 .hidden __assert_fail