clarify the purpose of this project
[nyanglibc.git] / libio / vasprintf.s
blob170b667536a33a2ff0d42e1e6759898b715ff0cf
1 .text
2 .p2align 4,,15
3 .globl __vasprintf_internal
4 .hidden __vasprintf_internal
5 .type __vasprintf_internal, @function
6 __vasprintf_internal:
7 pushq %r15
8 pushq %r14
9 movl %ecx, %r15d
10 pushq %r13
11 pushq %r12
12 movq %rdi, %r12
13 pushq %rbp
14 pushq %rbx
15 movl $100, %edi
16 movq %rsi, %r13
17 movq %rdx, %r14
18 subq $248, %rsp
19 call malloc@PLT
20 testq %rax, %rax
21 je .L8
22 movq %rsp, %rbp
23 xorl %r8d, %r8d
24 xorl %ecx, %ecx
25 movq %rbp, %rdi
26 movl $-1, %edx
27 movl $32768, %esi
28 movq %rax, %rbx
29 movq $0, 136(%rsp)
30 call _IO_no_init@PLT
31 leaq _IO_str_jumps(%rip), %rax
32 movq %rbp, %rdi
33 movq %rbx, %rcx
34 movl $100, %edx
35 movq %rbx, %rsi
36 movq %rax, 216(%rsp)
37 call _IO_str_init_static_internal@PLT
38 movq malloc@GOTPCREL(%rip), %rax
39 movq %rbp, %rdi
40 movl %r15d, %ecx
41 movq %r14, %rdx
42 movq %r13, %rsi
43 andl $-2, (%rsp)
44 movq %rax, 224(%rsp)
45 movq free@GOTPCREL(%rip), %rax
46 movq %rax, 232(%rsp)
47 call __vfprintf_internal
48 testl %eax, %eax
49 movl %eax, %ebp
50 js .L11
51 movq 32(%rsp), %rax
52 movq 40(%rsp), %rbx
53 movq 48(%rsp), %rcx
54 movq 56(%rsp), %r14
55 subq %rax, %rbx
56 subq %rax, %rcx
57 leaq 1(%rbx), %r13
58 movq %rcx, %rax
59 shrq %rax
60 cmpq %r13, %rax
61 ja .L4
62 .L6:
63 movq %r13, %rsi
64 movq %r14, %rdi
65 call realloc@PLT
66 testq %rax, %rax
67 movq %rax, (%r12)
68 je .L12
69 .L7:
70 movb $0, (%rax,%rbx)
71 .L1:
72 addq $248, %rsp
73 movl %ebp, %eax
74 popq %rbx
75 popq %rbp
76 popq %r12
77 popq %r13
78 popq %r14
79 popq %r15
80 ret
81 .p2align 4,,10
82 .p2align 3
83 .L4:
84 movq %r13, %rdi
85 call malloc@PLT
86 testq %rax, %rax
87 movq %rax, (%r12)
88 je .L6
89 movq %rbx, %rdx
90 movq %r14, %rsi
91 movq %rax, %rdi
92 call memcpy@PLT
93 movq %r14, %rdi
94 call free@PLT
95 movq (%r12), %rax
96 testq %rax, %rax
97 jne .L7
98 .L12:
99 movq 56(%rsp), %rax
100 movq %rax, (%r12)
101 jmp .L7
102 .p2align 4,,10
103 .p2align 3
104 .L11:
105 movq 56(%rsp), %rdi
106 call free@PLT
107 jmp .L1
108 .p2align 4,,10
109 .p2align 3
110 .L8:
111 movl $-1, %ebp
112 jmp .L1
113 .size __vasprintf_internal, .-__vasprintf_internal
114 .p2align 4,,15
115 .globl __vasprintf
116 .type __vasprintf, @function
117 __vasprintf:
118 xorl %ecx, %ecx
119 jmp __vasprintf_internal
120 .size __vasprintf, .-__vasprintf
121 .weak vasprintf
122 .set vasprintf,__vasprintf
123 .hidden __vfprintf_internal
124 .hidden _IO_str_jumps