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