clarify the purpose of this project
[nyanglibc.git] / stdio-common / printf-parsemb.s
blobb7a22a5b31bd066d84f2db20c4dcfb52dc07985f
1 .text
2 .p2align 4,,15
3 .type read_int, @function
4 read_int:
5 movq (%rdi), %rcx
6 movl $-1, %esi
7 movl $2147483647, %r9d
8 movzbl (%rcx), %edx
9 addq $1, %rcx
10 leal -48(%rdx), %eax
11 jmp .L2
12 .p2align 4,,10
13 .p2align 3
14 .L9:
15 leal (%rax,%rax,4), %eax
16 movl %r9d, %r8d
17 subl %edx, %r8d
18 addl %eax, %eax
19 addl %eax, %edx
20 cmpl %eax, %r8d
21 movl %edx, %eax
22 cmovl %esi, %eax
23 .L3:
24 addq $1, %rcx
25 .L2:
26 movq %rcx, (%rdi)
27 movzbl (%rcx), %edx
28 subl $48, %edx
29 cmpl $9, %edx
30 ja .L8
31 testl %eax, %eax
32 js .L3
33 cmpl $214748364, %eax
34 jle .L9
35 movl %esi, %eax
36 jmp .L3
37 .p2align 4,,10
38 .p2align 3
39 .L8:
40 rep ret
41 .size read_int, .-read_int
42 .p2align 4,,15
43 .globl __parse_one_specmb
44 .hidden __parse_one_specmb
45 .type __parse_one_specmb, @function
46 __parse_one_specmb:
47 pushq %r13
48 pushq %r12
49 leaq 1(%rdi), %r10
50 pushq %rbp
51 pushq %rbx
52 movq %rdx, %rbx
53 movq %rsi, %rbp
54 movq %rcx, %r11
55 subq $24, %rsp
56 andb $7, 12(%rdx)
57 movl $-1, 48(%rdx)
58 movq %r10, 8(%rsp)
59 movzbl 13(%rdx), %eax
60 movl $32, 16(%rdx)
61 andl $-30, %eax
62 movb %al, 13(%rdx)
63 movzbl 1(%rdi), %edx
64 movl %edx, %eax
65 subl $48, %edx
66 cmpl $9, %edx
67 jbe .L107
68 .L11:
69 leaq .L17(%rip), %rdx
70 .p2align 4,,10
71 .p2align 3
72 .L14:
73 subl $32, %eax
74 cmpb $41, %al
75 ja .L15
76 movzbl %al, %eax
77 movslq (%rdx,%rax,4), %rax
78 addq %rdx, %rax
79 jmp *%rax
80 .section .rodata
81 .align 4
82 .align 4
83 .L17:
84 .long .L16-.L17
85 .long .L15-.L17
86 .long .L15-.L17
87 .long .L18-.L17
88 .long .L15-.L17
89 .long .L15-.L17
90 .long .L15-.L17
91 .long .L19-.L17
92 .long .L15-.L17
93 .long .L15-.L17
94 .long .L15-.L17
95 .long .L20-.L17
96 .long .L15-.L17
97 .long .L21-.L17
98 .long .L15-.L17
99 .long .L15-.L17
100 .long .L22-.L17
101 .long .L15-.L17
102 .long .L15-.L17
103 .long .L15-.L17
104 .long .L15-.L17
105 .long .L15-.L17
106 .long .L15-.L17
107 .long .L15-.L17
108 .long .L15-.L17
109 .long .L15-.L17
110 .long .L15-.L17
111 .long .L15-.L17
112 .long .L15-.L17
113 .long .L15-.L17
114 .long .L15-.L17
115 .long .L15-.L17
116 .long .L15-.L17
117 .long .L15-.L17
118 .long .L15-.L17
119 .long .L15-.L17
120 .long .L15-.L17
121 .long .L15-.L17
122 .long .L15-.L17
123 .long .L15-.L17
124 .long .L15-.L17
125 .long .L23-.L17
126 .text
127 .p2align 4,,10
128 .p2align 3
129 .L23:
130 orb $8, 13(%rbx)
131 .p2align 4,,10
132 .p2align 3
133 .L24:
134 addq $1, %r10
135 movq %r10, 8(%rsp)
136 movzbl (%r10), %eax
137 testb %al, %al
138 jne .L14
139 .L15:
140 testb $32, 12(%rbx)
141 je .L25
142 movl $32, 16(%rbx)
143 .L25:
144 movl $-1, 44(%rbx)
145 movl $0, 4(%rbx)
146 movzbl (%r10), %eax
147 cmpb $42, %al
148 je .L108
149 subl $48, %eax
150 xorl %r12d, %r12d
151 cmpl $9, %eax
152 jbe .L109
153 .L28:
154 movl $-1, 40(%rbx)
155 movl $-1, (%rbx)
156 cmpb $46, (%r10)
157 je .L110
158 .L36:
159 xorl %eax, %eax
160 andb $-3, 13(%rbx)
161 andb $-8, 12(%rbx)
162 movw %ax, 14(%rbx)
163 movq __printf_modifier_table(%rip), %rax
164 testq %rax, %rax
165 jne .L111
166 .L47:
167 leaq 1(%r10), %rdx
168 movq %rdx, 8(%rsp)
169 movzbl (%r10), %eax
170 subl $76, %eax
171 cmpb $46, %al
172 ja .L81
173 leaq .L51(%rip), %rcx
174 movzbl %al, %eax
175 movslq (%rcx,%rax,4), %rax
176 addq %rcx, %rax
177 jmp *%rax
178 .section .rodata
179 .align 4
180 .align 4
181 .L51:
182 .long .L50-.L51
183 .long .L81-.L51
184 .long .L81-.L51
185 .long .L81-.L51
186 .long .L81-.L51
187 .long .L81-.L51
188 .long .L81-.L51
189 .long .L81-.L51
190 .long .L81-.L51
191 .long .L81-.L51
192 .long .L81-.L51
193 .long .L81-.L51
194 .long .L81-.L51
195 .long .L81-.L51
196 .long .L52-.L51
197 .long .L81-.L51
198 .long .L81-.L51
199 .long .L81-.L51
200 .long .L81-.L51
201 .long .L81-.L51
202 .long .L81-.L51
203 .long .L81-.L51
204 .long .L81-.L51
205 .long .L81-.L51
206 .long .L81-.L51
207 .long .L81-.L51
208 .long .L81-.L51
209 .long .L81-.L51
210 .long .L53-.L51
211 .long .L81-.L51
212 .long .L52-.L51
213 .long .L81-.L51
214 .long .L54-.L51
215 .long .L81-.L51
216 .long .L81-.L51
217 .long .L81-.L51
218 .long .L81-.L51
219 .long .L50-.L51
220 .long .L81-.L51
221 .long .L81-.L51
222 .long .L52-.L51
223 .long .L81-.L51
224 .long .L81-.L51
225 .long .L81-.L51
226 .long .L81-.L51
227 .long .L81-.L51
228 .long .L52-.L51
229 .text
230 .p2align 4,,10
231 .p2align 3
232 .L22:
233 movl $48, 16(%rbx)
234 jmp .L24
235 .p2align 4,,10
236 .p2align 3
237 .L21:
238 orb $32, 12(%rbx)
239 jmp .L24
240 .p2align 4,,10
241 .p2align 3
242 .L20:
243 orb $64, 12(%rbx)
244 jmp .L24
245 .p2align 4,,10
246 .p2align 3
247 .L19:
248 orb $-128, 12(%rbx)
249 jmp .L24
250 .p2align 4,,10
251 .p2align 3
252 .L18:
253 orb $8, 12(%rbx)
254 jmp .L24
255 .p2align 4,,10
256 .p2align 3
257 .L16:
258 orb $16, 12(%rbx)
259 jmp .L24
260 .p2align 4,,10
261 .p2align 3
262 .L52:
263 orb $4, 12(%rbx)
264 .L106:
265 leaq 2(%r10), %rax
266 .L49:
267 movq %rax, 8(%rsp)
268 cmpq $0, __printf_function_table(%rip)
269 movzbl (%rdx), %edx
270 movl $-1, 64(%rbx)
271 movl %edx, 8(%rbx)
272 jne .L112
273 .L57:
274 leal -65(%rdx), %eax
275 movq $1, 56(%rbx)
276 movl 48(%rbx), %esi
277 cmpl $55, %eax
278 ja .L59
279 leaq .L61(%rip), %rcx
280 movslq (%rcx,%rax,4), %rax
281 addq %rcx, %rax
282 jmp *%rax
283 .section .rodata
284 .align 4
285 .align 4
286 .L61:
287 .long .L60-.L61
288 .long .L59-.L61
289 .long .L62-.L61
290 .long .L59-.L61
291 .long .L60-.L61
292 .long .L60-.L61
293 .long .L60-.L61
294 .long .L59-.L61
295 .long .L59-.L61
296 .long .L59-.L61
297 .long .L59-.L61
298 .long .L59-.L61
299 .long .L59-.L61
300 .long .L59-.L61
301 .long .L59-.L61
302 .long .L59-.L61
303 .long .L59-.L61
304 .long .L59-.L61
305 .long .L63-.L61
306 .long .L59-.L61
307 .long .L59-.L61
308 .long .L59-.L61
309 .long .L59-.L61
310 .long .L64-.L61
311 .long .L59-.L61
312 .long .L59-.L61
313 .long .L59-.L61
314 .long .L59-.L61
315 .long .L59-.L61
316 .long .L59-.L61
317 .long .L59-.L61
318 .long .L59-.L61
319 .long .L60-.L61
320 .long .L59-.L61
321 .long .L65-.L61
322 .long .L64-.L61
323 .long .L60-.L61
324 .long .L60-.L61
325 .long .L60-.L61
326 .long .L59-.L61
327 .long .L64-.L61
328 .long .L59-.L61
329 .long .L59-.L61
330 .long .L59-.L61
331 .long .L59-.L61
332 .long .L66-.L61
333 .long .L64-.L61
334 .long .L67-.L61
335 .long .L59-.L61
336 .long .L59-.L61
337 .long .L68-.L61
338 .long .L59-.L61
339 .long .L64-.L61
340 .long .L59-.L61
341 .long .L59-.L61
342 .long .L64-.L61
343 .text
344 .p2align 4,,10
345 .p2align 3
346 .L109:
347 leaq 8(%rsp), %rdi
348 call read_int
349 cmpl $-1, %eax
350 je .L103
351 movl %eax, 4(%rbx)
352 .L103:
353 movq 8(%rsp), %r10
354 jmp .L28
355 .p2align 4,,10
356 .p2align 3
357 .L110:
358 leaq 1(%r10), %rdx
359 movq %rdx, 8(%rsp)
360 movzbl 1(%r10), %eax
361 cmpb $42, %al
362 je .L113
363 subl $48, %eax
364 cmpl $9, %eax
365 jbe .L114
366 movl $0, (%rbx)
367 movq %rdx, %r10
368 jmp .L36
369 .p2align 4,,10
370 .p2align 3
371 .L108:
372 leaq 1(%r10), %r12
373 movq %r12, 8(%rsp)
374 movzbl 1(%r10), %eax
375 subl $48, %eax
376 cmpl $9, %eax
377 jbe .L27
378 .L34:
379 movl %ebp, 44(%rbx)
380 movq %r12, 8(%rsp)
381 movq %r12, %r10
382 addq $1, %rbp
383 movl $1, %r12d
384 jmp .L28
385 .p2align 4,,10
386 .p2align 3
387 .L107:
388 movq %rdi, %r12
389 leaq 8(%rsp), %rdi
390 call read_int
391 testl %eax, %eax
392 je .L12
393 movq 8(%rsp), %rdx
394 cmpb $36, (%rdx)
395 jne .L12
396 leaq 1(%rdx), %r10
397 cmpl $-1, %eax
398 movq %r10, 8(%rsp)
399 je .L102
400 leal -1(%rax), %ecx
401 movl %eax, %eax
402 cmpq %rax, (%r11)
403 cmovnb (%r11), %rax
404 movl %ecx, 48(%rbx)
405 movq %rax, (%r11)
406 .L102:
407 movzbl 1(%rdx), %eax
408 jmp .L11
409 .p2align 4,,10
410 .p2align 3
411 .L12:
412 movq %r10, 8(%rsp)
413 movzbl 1(%r12), %eax
414 jmp .L11
415 .p2align 4,,10
416 .p2align 3
417 .L54:
418 orb $4, 12(%rbx)
419 cmpb $108, 1(%r10)
420 jne .L106
421 leaq 2(%r10), %rdx
422 .L50:
423 orb $1, 12(%rbx)
424 leaq 1(%rdx), %rax
425 jmp .L49
426 .p2align 4,,10
427 .p2align 3
428 .L53:
429 cmpb $104, 1(%r10)
430 je .L55
431 orb $2, 12(%rbx)
432 leaq 2(%r10), %rax
433 jmp .L49
434 .p2align 4,,10
435 .p2align 3
436 .L68:
437 movl $3, 52(%rbx)
438 .L74:
439 cmpl $-1, %esi
440 movq 8(%rsp), %rdi
441 je .L83
442 .L75:
443 movq %rdi, 24(%rbx)
444 movl $37, %esi
445 call __strchrnul@PLT
446 movq %rax, 32(%rbx)
447 addq $24, %rsp
448 movq %r12, %rax
449 popq %rbx
450 popq %rbp
451 popq %r12
452 popq %r13
454 .p2align 4,,10
455 .p2align 3
456 .L67:
457 cmpl $-1, %esi
458 movl $5, 52(%rbx)
459 movq 8(%rsp), %rdi
460 jne .L75
461 .p2align 4,,10
462 .p2align 3
463 .L83:
464 movl $1, %ecx
465 .L78:
466 movl %ebp, 48(%rbx)
467 addq %rcx, %r12
468 jmp .L76
469 .p2align 4,,10
470 .p2align 3
471 .L66:
472 movl $2048, 52(%rbx)
473 jmp .L74
474 .p2align 4,,10
475 .p2align 3
476 .L65:
477 movl $1, 52(%rbx)
478 jmp .L74
479 .p2align 4,,10
480 .p2align 3
481 .L64:
482 movzbl 12(%rbx), %eax
483 testb $4, %al
484 je .L69
485 movl $512, 52(%rbx)
486 .L70:
487 cmpl $-1, %esi
488 je .L83
489 .L76:
490 testl %edx, %edx
491 movq 8(%rsp), %rdi
492 jne .L75
493 subq $1, %rdi
494 movq %r12, %rax
495 movq %rdi, 32(%rbx)
496 movq %rdi, 24(%rbx)
497 addq $24, %rsp
498 popq %rbx
499 popq %rbp
500 popq %r12
501 popq %r13
503 .p2align 4,,10
504 .p2align 3
505 .L63:
506 movl $4, 52(%rbx)
507 jmp .L74
508 .p2align 4,,10
509 .p2align 3
510 .L60:
511 movzbl 12(%rbx), %eax
512 andl $1, %eax
513 cmpb $1, %al
514 sbbl %eax, %eax
515 xorb %al, %al
516 addl $263, %eax
517 movl %eax, 52(%rbx)
518 jmp .L70
519 .p2align 4,,10
520 .p2align 3
521 .L62:
522 cmpl $-1, %esi
523 movl $2, 52(%rbx)
524 movq 8(%rsp), %rdi
525 jne .L75
526 movl %ebp, 48(%rbx)
527 addq $1, %r12
528 jmp .L75
529 .p2align 4,,10
530 .p2align 3
531 .L114:
532 leaq 8(%rsp), %rdi
533 call read_int
534 cmpl $-1, %eax
535 je .L105
536 movl %eax, (%rbx)
537 .L105:
538 movq 8(%rsp), %r10
539 jmp .L36
540 .p2align 4,,10
541 .p2align 3
542 .L81:
543 movq %rdx, %rax
544 movq %r10, %rdx
545 jmp .L49
546 .p2align 4,,10
547 .p2align 3
548 .L59:
549 movq $0, 56(%rbx)
550 jmp .L76
551 .p2align 4,,10
552 .p2align 3
553 .L113:
554 leaq 2(%r10), %r13
555 movq %r13, 8(%rsp)
556 movzbl 2(%r10), %eax
557 subl $48, %eax
558 cmpl $9, %eax
559 jbe .L38
560 .L44:
561 movl %ebp, 40(%rbx)
562 addq $1, %r12
563 movq %r13, 8(%rsp)
564 movq %r13, %r10
565 addq $1, %rbp
566 jmp .L36
567 .p2align 4,,10
568 .p2align 3
569 .L27:
570 leaq 8(%rsp), %rdi
571 call read_int
572 testl %eax, %eax
573 je .L31
574 movq 8(%rsp), %rcx
575 cmpb $36, (%rcx)
576 je .L115
577 .L31:
578 movl 44(%rbx), %edx
579 .L30:
580 testl %edx, %edx
581 js .L34
582 movq 8(%rsp), %r10
583 xorl %r12d, %r12d
584 jmp .L28
585 .p2align 4,,10
586 .p2align 3
587 .L112:
588 movq __printf_arginfo_table(%rip), %rcx
589 movq (%rcx,%rdx,8), %rax
590 testq %rax, %rax
591 je .L57
592 leaq 64(%rbx), %rcx
593 leaq 52(%rbx), %rdx
594 movl $1, %esi
595 movq %rbx, %rdi
596 call *%rax
597 movslq %eax, %rcx
598 testl %eax, %eax
599 movl 8(%rbx), %edx
600 movq %rcx, 56(%rbx)
601 js .L57
602 cmpl $-1, 48(%rbx)
603 jne .L76
604 testq %rcx, %rcx
605 je .L76
606 jmp .L78
607 .p2align 4,,10
608 .p2align 3
609 .L111:
610 movzbl (%r10), %edx
611 cmpq $0, (%rax,%rdx,8)
612 je .L47
613 leaq 8(%rsp), %rdi
614 movq %rbx, %rsi
615 call __handle_registered_modifier_mb
616 testl %eax, %eax
617 je .L116
618 movq 8(%rsp), %r10
619 jmp .L47
620 .L69:
621 testb $2, %al
622 je .L71
623 movl $1024, 52(%rbx)
624 jmp .L70
625 .L116:
626 movq 8(%rsp), %rdx
627 leaq 1(%rdx), %rax
628 jmp .L49
629 .L71:
630 xorl %eax, %eax
631 testb $2, 13(%rbx)
632 setne %al
633 movl %eax, 52(%rbx)
634 jmp .L70
635 .L115:
636 cmpl $-1, %eax
637 je .L117
638 leal -1(%rax), %edx
639 movl %eax, %eax
640 cmpq %rax, (%r11)
641 cmovnb (%r11), %rax
642 movl %edx, 44(%rbx)
643 movq %rax, (%r11)
644 .L33:
645 addq $1, %rcx
646 movq %rcx, 8(%rsp)
647 jmp .L30
648 .L55:
649 leaq 2(%r10), %rdx
650 orb $2, 13(%rbx)
651 leaq 3(%r10), %rax
652 jmp .L49
653 .L38:
654 leaq 8(%rsp), %rdi
655 call read_int
656 testl %eax, %eax
657 je .L41
658 movq 8(%rsp), %rcx
659 cmpb $36, (%rcx)
660 je .L118
661 .L41:
662 movl 40(%rbx), %edx
663 .L40:
664 testl %edx, %edx
665 jns .L105
666 jmp .L44
667 .p2align 4,,10
668 .p2align 3
669 .L118:
670 cmpl $-1, %eax
671 je .L119
672 leal -1(%rax), %edx
673 movl %eax, %eax
674 cmpq %rax, (%r11)
675 cmovnb (%r11), %rax
676 movl %edx, 40(%rbx)
677 movq %rax, (%r11)
678 .L43:
679 addq $1, %rcx
680 movq %rcx, 8(%rsp)
681 jmp .L40
682 .L117:
683 movl 44(%rbx), %edx
684 jmp .L33
685 .L119:
686 movl 40(%rbx), %edx
687 jmp .L43
688 .size __parse_one_specmb, .-__parse_one_specmb
689 .hidden __handle_registered_modifier_mb
690 .hidden __printf_arginfo_table
691 .hidden __printf_function_table
692 .hidden __printf_modifier_table