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