clarify the purpose of this project
[nyanglibc.git] / stdio-common / printf_size.shared.s
blob9d4b3f86bc4136f9a4e042365deba0472cdca70e
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 .section .rodata.str4.4,"aMS",@progbits,4
7 .align 4
8 .LC0:
9 .string "i"
10 .string ""
11 .string ""
12 .string "n"
13 .string ""
14 .string ""
15 .string "f"
16 .string ""
17 .string ""
18 .string ""
19 .string ""
20 .string ""
21 .string ""
22 .section .rodata.str1.1,"aMS",@progbits,1
23 .LC1:
24 .string "inf"
25 .section .rodata.str4.4
26 .align 4
27 .LC2:
28 .string "n"
29 .string ""
30 .string ""
31 .string "a"
32 .string ""
33 .string ""
34 .string "n"
35 .string ""
36 .string ""
37 .string ""
38 .string ""
39 .string ""
40 .string ""
41 .section .rodata.str1.1
42 .LC3:
43 .string "nan"
44 .globl __unordtf2
45 .globl __letf2
46 .globl __floatsitf
47 .globl __getf2
48 .globl __divtf3
49 #NO_APP
50 .text
51 .p2align 4,,15
52 .globl __printf_size
53 .type __printf_size, @function
54 __printf_size:
55 pushq %r15
56 pushq %r14
57 movq %rsi, %r14
58 pushq %r13
59 pushq %r12
60 movq %rdi, %r13
61 pushq %rbp
62 pushq %rbx
63 xorl %edi, %edi
64 subq $120, %rsp
65 movq __libc_tsd_CTYPE_B@gottpoff(%rip), %rax
66 movslq 8(%rsi), %rsi
67 movl (%r14), %ebp
68 movq %fs:(%rax), %rax
69 movzwl (%rax,%rsi,2), %eax
70 andw $256, %ax
71 setne %dil
72 leaq 0(,%rdi,4), %rsi
73 addq %rdi, %rsi
74 cmpw $1, %ax
75 leaq 64(%rsp), %rax
76 sbbl %ebx, %ebx
77 leaq units.13557(%rip), %rdi
78 movq %rax, 56(%rsp)
79 movzbl 13(%r14), %eax
80 andl $24, %ebx
81 addl $1000, %ebx
82 leaq (%rdi,%rsi,2), %r12
83 movq (%rdx), %rsi
84 movl %eax, %r15d
85 shrb $2, %r15b
86 andl $1, %r15d
87 testb $16, %al
88 movzbl %r15b, %ecx
89 movl %ecx, 28(%rsp)
90 je .L3
91 movdqa (%rsi), %xmm2
92 movdqa %xmm2, %xmm1
93 movdqa %xmm2, %xmm0
94 movaps %xmm2, 64(%rsp)
95 movaps %xmm2, (%rsp)
96 call __unordtf2@PLT
97 testq %rax, %rax
98 jne .L4
99 movdqa (%rsp), %xmm2
100 movdqa .LC4(%rip), %xmm3
101 pand %xmm2, %xmm3
102 movdqa .LC5(%rip), %xmm1
103 movdqa %xmm3, %xmm0
104 movaps %xmm3, 32(%rsp)
105 call __unordtf2@PLT
106 testq %rax, %rax
107 movdqa (%rsp), %xmm2
108 jne .L97
109 movdqa 32(%rsp), %xmm3
110 movdqa .LC5(%rip), %xmm1
111 movdqa %xmm3, %xmm0
112 call __letf2@PLT
113 testq %rax, %rax
114 movdqa (%rsp), %xmm2
115 jg .L148
116 .L97:
117 movl %ebx, %edi
118 movaps %xmm2, 32(%rsp)
119 call __floatsitf@PLT
120 movdqa %xmm0, %xmm1
121 movaps %xmm0, (%rsp)
122 movdqa 32(%rsp), %xmm2
123 movdqa %xmm2, %xmm0
124 call __getf2@PLT
125 testq %rax, %rax
126 js .L7
127 cmpb $0, 1(%r12)
128 movdqa 32(%rsp), %xmm2
129 jne .L9
130 jmp .L7
131 .L172:
132 fstp %st(0)
133 fstp %st(0)
134 .p2align 4,,10
135 .p2align 3
136 .L7:
137 movl 16(%r14), %eax
138 testl %ebp, %ebp
139 movdqu (%r14), %xmm0
140 movaps %xmm0, 80(%rsp)
141 movzbl 93(%rsp), %edx
142 movl %eax, 96(%rsp)
143 movl $3, %eax
144 cmovs %eax, %ebp
145 movl %r15d, %eax
146 andl $1, %eax
147 sall $2, %eax
148 movl $102, 88(%rsp)
149 movl %ebp, 80(%rsp)
150 andl $-5, %edx
151 orl %edx, %eax
152 testb $32, 92(%rsp)
153 movb %al, 93(%rsp)
154 je .L64
155 cmpl $32, 96(%rsp)
156 je .L163
157 .L64:
158 movl 4(%r14), %eax
159 leaq 56(%rsp), %rdx
160 leaq 80(%rsp), %rsi
161 movq %r13, %rdi
162 subl $1, %eax
163 movl %eax, 84(%rsp)
164 call __GI___printf_fp
165 testl %eax, %eax
166 movl %eax, %r9d
167 jle .L1
168 movl 28(%rsp), %edx
169 movsbl (%r12), %eax
170 testl %edx, %edx
171 je .L72
172 movq 160(%r13), %rdx
173 testq %rdx, %rdx
174 je .L73
175 movq 32(%rdx), %rcx
176 cmpq 40(%rdx), %rcx
177 jnb .L73
178 leaq 4(%rcx), %rsi
179 cmpl $-1, %eax
180 movq %rsi, 32(%rdx)
181 movl %eax, (%rcx)
182 sete %al
183 .L75:
184 testb %al, %al
185 jne .L38
186 .L77:
187 addl $1, %r9d
188 .L1:
189 addq $120, %rsp
190 movl %r9d, %eax
191 popq %rbx
192 popq %rbp
193 popq %r12
194 popq %r13
195 popq %r14
196 popq %r15
198 .p2align 4,,10
199 .p2align 3
200 .L3:
201 movzbl 12(%r14), %edx
202 testb $1, %dl
203 je .L13
204 fldt (%rsi)
205 fld %st(0)
206 fstpt 64(%rsp)
207 fucomi %st(0), %st
208 jp .L171
209 fxam
210 fnstsw %ax
211 movl %eax, %esi
212 andb $69, %ah
213 cmpb $5, %ah
214 je .L15
215 movl %ebx, (%rsp)
216 fildl (%rsp)
217 fxch %st(1)
218 fucomi %st(1), %st
219 jb .L172
220 cmpb $0, 1(%r12)
221 jne .L17
222 fstp %st(0)
223 fstp %st(0)
224 jmp .L7
225 .p2align 4,,10
226 .p2align 3
227 .L18:
228 cmpb $0, 1(%r12)
229 je .L173
230 .L17:
231 fdiv %st(1), %st
232 addq $1, %r12
233 fucomi %st(1), %st
234 jnb .L18
235 fstp %st(1)
236 jmp .L156
237 .p2align 4,,10
238 .p2align 3
239 .L173:
240 fstp %st(1)
241 .L156:
242 fstpt 64(%rsp)
243 jmp .L7
244 .p2align 4,,10
245 .p2align 3
246 .L11:
247 cmpb $0, 1(%r12)
248 je .L149
249 .L9:
250 movdqa %xmm2, %xmm0
251 movdqa (%rsp), %xmm1
252 addq $1, %r12
253 call __divtf3@PLT
254 movdqa (%rsp), %xmm1
255 movaps %xmm0, 32(%rsp)
256 call __getf2@PLT
257 testq %rax, %rax
258 movdqa 32(%rsp), %xmm2
259 jns .L11
260 .L149:
261 movaps %xmm2, 64(%rsp)
262 jmp .L7
263 .p2align 4,,10
264 .p2align 3
265 .L13:
266 movsd (%rsi), %xmm1
267 ucomisd %xmm1, %xmm1
268 movsd %xmm1, 64(%rsp)
269 jp .L14
270 movapd %xmm1, %xmm0
271 andpd .LC6(%rip), %xmm0
272 ucomisd .LC7(%rip), %xmm0
273 ja .L150
274 pxor %xmm0, %xmm0
275 cvtsi2sd %ebx, %xmm0
276 ucomisd %xmm0, %xmm1
277 jb .L7
278 cmpb $0, 1(%r12)
279 jne .L23
280 jmp .L7
281 .p2align 4,,10
282 .p2align 3
283 .L24:
284 cmpb $0, 1(%r12)
285 je .L157
286 .L23:
287 divsd %xmm0, %xmm1
288 addq $1, %r12
289 ucomisd %xmm0, %xmm1
290 jnb .L24
291 .L157:
292 movsd %xmm1, 64(%rsp)
293 jmp .L7
294 .p2align 4,,10
295 .p2align 3
296 .L148:
297 movmskps %xmm2, %eax
298 movzbl 12(%r14), %edx
299 andl $8, %eax
300 movl %eax, %ebx
301 .L10:
302 cmpl %ebp, 4(%r14)
303 movl %edx, %eax
304 leaq .LC0(%rip), %r15
305 cmovge 4(%r14), %ebp
306 andl $32, %eax
307 testl %ebx, %ebx
308 leaq .LC1(%rip), %r8
309 je .L80
310 testb %al, %al
311 leal -4(%rbp), %r12d
312 je .L96
313 leaq .LC1(%rip), %r8
314 leaq .LC0(%rip), %r15
315 xorl %ebp, %ebp
316 .L89:
317 movl 28(%rsp), %r11d
318 testl %r11d, %r11d
319 je .L32
320 movq 160(%r13), %rax
321 testq %rax, %rax
322 je .L33
323 movq 32(%rax), %rdx
324 cmpq 40(%rax), %rdx
325 jnb .L33
326 leaq 4(%rdx), %rsi
327 movq %rsi, 32(%rax)
328 movl $45, (%rdx)
329 jmp .L51
330 .p2align 4,,10
331 .p2align 3
332 .L4:
333 movzbl 12(%r14), %edx
334 cmpl %ebp, 4(%r14)
335 leaq .LC2(%rip), %r15
336 leaq .LC3(%rip), %r8
337 cmovge 4(%r14), %ebp
338 movl %edx, %eax
339 andl $32, %eax
340 .p2align 4,,10
341 .p2align 3
342 .L80:
343 testb $80, %dl
344 jne .L25
345 testb %al, %al
346 leal -3(%rbp), %r12d
347 jne .L93
348 xorl %ebx, %ebx
349 testl %r12d, %r12d
350 movl %r12d, %ebp
351 jle .L93
352 .L83:
353 movl 28(%rsp), %r12d
354 movslq %ebp, %r9
355 movq %r8, 32(%rsp)
356 movq %r9, %rdx
357 movq %r9, (%rsp)
358 movl $32, %esi
359 movq %r13, %rdi
360 testl %r12d, %r12d
361 je .L28
362 call _IO_wpadn@PLT
363 movq (%rsp), %r9
364 movq 32(%rsp), %r8
365 .L29:
366 cmpq %r9, %rax
367 movl %ebp, %r12d
368 jne .L38
369 .L27:
370 testl %ebx, %ebx
371 jne .L89
372 movzbl 12(%r14), %edx
373 .L82:
374 testb $64, %dl
375 je .L40
376 movl 28(%rsp), %r10d
377 testl %r10d, %r10d
378 je .L41
379 movq 160(%r13), %rax
380 testq %rax, %rax
381 je .L42
382 movq 32(%rax), %rdx
383 cmpq 40(%rax), %rdx
384 jnb .L42
385 leaq 4(%rdx), %rsi
386 movq %rsi, 32(%rax)
387 movl $43, (%rdx)
388 .p2align 4,,10
389 .p2align 3
390 .L51:
391 addl $1, %ebp
392 .L39:
393 movl 28(%rsp), %edi
394 testl %edi, %edi
395 je .L53
396 xorl %ebx, %ebx
397 addl $1, %ebp
398 .L57:
399 movq 160(%r13), %rax
400 movl (%r15,%rbx,4), %esi
401 testq %rax, %rax
402 je .L54
403 movq 32(%rax), %rdx
404 cmpq 40(%rax), %rdx
405 jnb .L54
406 leaq 4(%rdx), %rdi
407 cmpl $-1, %esi
408 movq %rdi, 32(%rax)
409 movl %esi, (%rdx)
410 sete %al
411 .L56:
412 testb %al, %al
413 jne .L38
414 leal 0(%rbp,%rbx), %r9d
415 addq $1, %rbx
416 cmpq $3, %rbx
417 jne .L57
418 testb $32, 12(%r14)
419 je .L1
420 testl %r12d, %r12d
421 jle .L1
422 movslq %r12d, %rbx
423 movl $32, %esi
424 movq %r13, %rdi
425 movq %rbx, %rdx
426 movl %r9d, (%rsp)
427 call _IO_wpadn@PLT
428 movl (%rsp), %r9d
429 .L63:
430 cmpq %rax, %rbx
431 jne .L38
432 addl %r12d, %r9d
433 jmp .L1
434 .p2align 4,,10
435 .p2align 3
436 .L25:
437 subl $4, %ebp
438 testb %al, %al
439 jne .L164
440 xorl %ebx, %ebx
441 .L88:
442 testl %ebp, %ebp
443 jg .L83
444 movl %ebp, %r12d
445 xorl %ebp, %ebp
446 jmp .L27
447 .p2align 4,,10
448 .p2align 3
449 .L32:
450 movq 40(%r13), %rax
451 cmpq 48(%r13), %rax
452 jnb .L165
453 leaq 1(%rax), %rdx
454 movq %rdx, 40(%r13)
455 movb $45, (%rax)
456 jmp .L51
457 .p2align 4,,10
458 .p2align 3
459 .L15:
460 fstp %st(0)
461 movl %esi, %ebx
462 andl $512, %ebx
463 jmp .L10
464 .p2align 4,,10
465 .p2align 3
466 .L150:
467 movmskpd %xmm1, %eax
468 andl $1, %eax
469 movl %eax, %ebx
470 jmp .L10
471 .p2align 4,,10
472 .p2align 3
473 .L53:
474 leaq 3(%r8), %r15
475 movq %r8, %rbx
476 .L61:
477 addq $1, %rbx
478 movq 40(%r13), %rax
479 cmpq 48(%r13), %rax
480 movzbl -1(%rbx), %esi
481 jnb .L166
482 leaq 1(%rax), %rdx
483 movq %rdx, 40(%r13)
484 movb %sil, (%rax)
485 .L60:
486 leal 0(%rbp,%rbx), %eax
487 subl %r8d, %eax
488 cmpq %r15, %rbx
489 movl %eax, %r9d
490 jne .L61
491 testb $32, 12(%r14)
492 je .L1
493 testl %r12d, %r12d
494 jle .L1
495 movslq %r12d, %rbx
496 movl $32, %esi
497 movq %r13, %rdi
498 movq %rbx, %rdx
499 movl %r9d, (%rsp)
500 call __GI__IO_padn
501 movl (%rsp), %r9d
502 jmp .L63
503 .p2align 4,,10
504 .p2align 3
505 .L40:
506 andl $16, %edx
507 je .L39
508 movl 28(%rsp), %r9d
509 testl %r9d, %r9d
510 je .L47
511 movq 160(%r13), %rax
512 testq %rax, %rax
513 je .L48
514 movq 32(%rax), %rdx
515 cmpq 40(%rax), %rdx
516 jnb .L48
517 leaq 4(%rdx), %rsi
518 movq %rsi, 32(%rax)
519 movl $32, (%rdx)
520 jmp .L51
521 .p2align 4,,10
522 .p2align 3
523 .L54:
524 movq %r13, %rdi
525 call __GI___woverflow
526 cmpl $-1, %eax
527 sete %al
528 jmp .L56
529 .p2align 4,,10
530 .p2align 3
531 .L93:
532 xorl %ebp, %ebp
533 jmp .L82
534 .p2align 4,,10
535 .p2align 3
536 .L28:
537 call __GI__IO_padn
538 movq 32(%rsp), %r8
539 movq (%rsp), %r9
540 jmp .L29
541 .p2align 4,,10
542 .p2align 3
543 .L166:
544 movq %r13, %rdi
545 movq %r8, (%rsp)
546 call __GI___overflow
547 cmpl $-1, %eax
548 movq (%rsp), %r8
549 jne .L60
550 .p2align 4,,10
551 .p2align 3
552 .L38:
553 movl $-1, %r9d
554 jmp .L1
555 .p2align 4,,10
556 .p2align 3
557 .L96:
558 movl %r12d, %ebp
559 leaq .LC0(%rip), %r15
560 leaq .LC1(%rip), %r8
561 jmp .L88
562 .p2align 4,,10
563 .p2align 3
564 .L72:
565 movq 40(%r13), %rdx
566 cmpq 48(%r13), %rdx
567 jnb .L167
568 leaq 1(%rdx), %rcx
569 movq %rcx, 40(%r13)
570 movb %al, (%rdx)
571 jmp .L77
572 .p2align 4,,10
573 .p2align 3
574 .L41:
575 movq 40(%r13), %rax
576 cmpq 48(%r13), %rax
577 jnb .L168
578 leaq 1(%rax), %rdx
579 movq %rdx, 40(%r13)
580 movb $43, (%rax)
581 jmp .L51
582 .p2align 4,,10
583 .p2align 3
584 .L171:
585 fstp %st(0)
586 .L14:
587 cmpl %ebp, 4(%r14)
588 movl %edx, %eax
589 leaq .LC2(%rip), %r15
590 cmovge 4(%r14), %ebp
591 leaq .LC3(%rip), %r8
592 andl $32, %eax
593 jmp .L80
594 .p2align 4,,10
595 .p2align 3
596 .L47:
597 movq 40(%r13), %rax
598 cmpq 48(%r13), %rax
599 jnb .L169
600 leaq 1(%rax), %rdx
601 movq %rdx, 40(%r13)
602 movb $32, (%rax)
603 jmp .L51
604 .p2align 4,,10
605 .p2align 3
606 .L163:
607 leaq 56(%rsp), %rdx
608 leaq 80(%rsp), %rsi
609 movq %r13, %rdi
610 movl $0, 84(%rsp)
611 call __GI___printf_fp
612 testl %eax, %eax
613 movl %eax, %r9d
614 jle .L1
615 movl 28(%rsp), %esi
616 movsbl (%r12), %eax
617 testl %esi, %esi
618 je .L65
619 movq 160(%r13), %rdx
620 testq %rdx, %rdx
621 je .L66
622 movq 32(%rdx), %rsi
623 cmpq 40(%rdx), %rsi
624 jnb .L66
625 leaq 4(%rsi), %rdi
626 cmpl $-1, %eax
627 movq %rdi, 32(%rdx)
628 movl %eax, (%rsi)
629 sete %al
630 .L68:
631 testb %al, %al
632 jne .L38
633 movl 4(%r14), %eax
634 addl $1, %r9d
635 cmpl %r9d, %eax
636 jle .L1
637 movl 28(%rsp), %ecx
638 movl %eax, %edx
639 subl %r9d, %edx
640 movslq %edx, %rdx
641 testl %ecx, %ecx
642 je .L70
643 movl $32, %esi
644 movq %r13, %rdi
645 movl %r9d, (%rsp)
646 call _IO_wpadn@PLT
647 movl (%rsp), %r9d
648 movl %r9d, %edx
649 .L71:
650 movl 4(%r14), %r9d
651 movl %r9d, %ecx
652 subl %edx, %ecx
653 movslq %ecx, %rdx
654 cmpq %rax, %rdx
655 je .L1
656 jmp .L38
657 .p2align 4,,10
658 .p2align 3
659 .L33:
660 movq %r8, (%rsp)
661 movl $45, %esi
662 .L161:
663 movq %r13, %rdi
664 call __GI___woverflow
665 movq (%rsp), %r8
666 cmpl $-1, %eax
667 sete %al
668 .L50:
669 testb %al, %al
670 je .L51
671 jmp .L38
672 .p2align 4,,10
673 .p2align 3
674 .L165:
675 movq %r8, (%rsp)
676 movl $45, %esi
677 .L160:
678 movq %r13, %rdi
679 call __GI___overflow
680 cmpl $-1, %eax
681 movq (%rsp), %r8
682 sete %al
683 jmp .L50
684 .p2align 4,,10
685 .p2align 3
686 .L73:
687 movsbl %al, %esi
688 movq %r13, %rdi
689 movl %r9d, (%rsp)
690 call __GI___woverflow
691 cmpl $-1, %eax
692 movl (%rsp), %r9d
693 sete %al
694 jmp .L75
695 .p2align 4,,10
696 .p2align 3
697 .L42:
698 movq %r8, (%rsp)
699 movl $43, %esi
700 jmp .L161
701 .p2align 4,,10
702 .p2align 3
703 .L65:
704 movq 40(%r13), %rdx
705 cmpq 48(%r13), %rdx
706 jnb .L170
707 leaq 1(%rdx), %rsi
708 addl $1, %r9d
709 movq %rsi, 40(%r13)
710 movb %al, (%rdx)
711 movl 4(%r14), %eax
712 cmpl %eax, %r9d
713 jge .L1
714 .L70:
715 subl %r9d, %eax
716 movl $32, %esi
717 movq %r13, %rdi
718 movslq %eax, %rdx
719 movl %r9d, (%rsp)
720 call __GI__IO_padn
721 movl (%rsp), %r9d
722 movl %r9d, %edx
723 jmp .L71
724 .L167:
725 movzbl %al, %esi
726 movq %r13, %rdi
727 movl %r9d, (%rsp)
728 call __GI___overflow
729 cmpl $-1, %eax
730 movl (%rsp), %r9d
731 sete %al
732 jmp .L75
733 .L168:
734 movq %r8, (%rsp)
735 movl $43, %esi
736 jmp .L160
737 .L48:
738 movq %r8, (%rsp)
739 movl $32, %esi
740 jmp .L161
741 .L169:
742 movq %r8, (%rsp)
743 movl $32, %esi
744 jmp .L160
745 .L66:
746 movsbl %al, %esi
747 movq %r13, %rdi
748 movl %r9d, (%rsp)
749 call __GI___woverflow
750 cmpl $-1, %eax
751 movl (%rsp), %r9d
752 sete %al
753 jmp .L68
754 .L170:
755 movzbl %al, %esi
756 movq %r13, %rdi
757 movl %r9d, (%rsp)
758 call __GI___overflow
759 cmpl $-1, %eax
760 movl (%rsp), %r9d
761 sete %al
762 jmp .L68
763 .L164:
764 movl %ebp, %r12d
765 xorl %ebp, %ebp
766 jmp .L82
767 .size __printf_size, .-__printf_size
768 .globl printf_size
769 .set printf_size,__printf_size
770 .p2align 4,,15
771 .globl printf_size_info
772 .type printf_size_info, @function
773 printf_size_info:
774 testq %rsi, %rsi
775 je .L175
776 movzbl 12(%rdi), %eax
777 sall $8, %eax
778 andl $256, %eax
779 orl $7, %eax
780 movl %eax, (%rdx)
781 .L175:
782 movl $1, %eax
784 .size printf_size_info, .-printf_size_info
785 .section .rodata
786 .align 16
787 .type units.13557, @object
788 .size units.13557, 20
789 units.13557:
790 .string " kmgtpezy"
791 .string " KMGTPEZY"
792 .section .rodata.cst16,"aM",@progbits,16
793 .align 16
794 .LC4:
795 .long 4294967295
796 .long 4294967295
797 .long 4294967295
798 .long 2147483647
799 .align 16
800 .LC5:
801 .long 4294967295
802 .long 4294967295
803 .long 4294967295
804 .long 2147418111
805 .align 16
806 .LC6:
807 .long 4294967295
808 .long 2147483647
809 .long 0
810 .long 0
811 .section .rodata.cst8,"aM",@progbits,8
812 .align 8
813 .LC7:
814 .long 4294967295
815 .long 2146435071