clarify the purpose of this project
[nyanglibc.git] / libio / memstream.shared.s
blob82e0463f3f678b6243488f1987994a567966953e
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .type _IO_mem_sync, @function
9 _IO_mem_sync:
10 movq 48(%rdi), %rax
11 cmpq %rax, 40(%rdi)
12 pushq %rbx
13 movq %rdi, %rbx
14 je .L5
15 .L2:
16 movq 32(%rbx), %rdx
17 movq 240(%rbx), %rax
18 movq %rdx, (%rax)
19 movq 40(%rbx), %rax
20 subq 32(%rbx), %rax
21 movq 248(%rbx), %rdx
22 movq %rax, (%rdx)
23 xorl %eax, %eax
24 popq %rbx
25 ret
26 .p2align 4,,10
27 .p2align 3
28 .L5:
29 xorl %esi, %esi
30 call __GI__IO_str_overflow
31 subq $1, 40(%rbx)
32 jmp .L2
33 .size _IO_mem_sync, .-_IO_mem_sync
34 .p2align 4,,15
35 .type _IO_mem_finish, @function
36 _IO_mem_finish:
37 pushq %rbp
38 pushq %rbx
39 movq %rdi, %rbx
40 subq $8, %rsp
41 movq 32(%rdi), %rdi
42 movq 40(%rbx), %rsi
43 movq 240(%rbx), %rbp
44 subq %rdi, %rsi
45 addq $1, %rsi
46 call realloc@PLT
47 movq %rax, 0(%rbp)
48 movq 240(%rbx), %rax
49 movq (%rax), %rdx
50 testq %rdx, %rdx
51 je .L7
52 movq 40(%rbx), %rax
53 subq 32(%rbx), %rax
54 movb $0, (%rdx,%rax)
55 movq 40(%rbx), %rax
56 subq 32(%rbx), %rax
57 movq 248(%rbx), %rdx
58 movq %rax, (%rdx)
59 movq $0, 56(%rbx)
60 .L7:
61 addq $8, %rsp
62 movq %rbx, %rdi
63 xorl %esi, %esi
64 popq %rbx
65 popq %rbp
66 jmp _IO_str_finish@PLT
67 .size _IO_mem_finish, .-_IO_mem_finish
68 .p2align 4,,15
69 .globl __GI___open_memstream
70 .hidden __GI___open_memstream
71 .type __GI___open_memstream, @function
72 __GI___open_memstream:
73 pushq %r13
74 pushq %r12
75 movq %rdi, %r13
76 pushq %rbp
77 pushq %rbx
78 movl $504, %edi
79 movq %rsi, %r12
80 subq $8, %rsp
81 call malloc@PLT
82 testq %rax, %rax
83 je .L15
84 movq %rax, %rbx
85 leaq 256(%rax), %rax
86 movl $8192, %esi
87 movl $1, %edi
88 movq %rax, 136(%rbx)
89 call calloc@PLT
90 testq %rax, %rax
91 movq %rax, %rbp
92 je .L17
93 xorl %esi, %esi
94 movq %rbx, %rdi
95 call _IO_init_internal
96 leaq _IO_mem_jumps(%rip), %rax
97 movq %rbp, %rcx
98 movl $8192, %edx
99 movq %rbp, %rsi
100 movq %rbx, %rdi
101 movq %rax, 216(%rbx)
102 call _IO_str_init_static_internal@PLT
103 movq malloc@GOTPCREL(%rip), %rax
104 andl $-2, (%rbx)
105 orl $128, 116(%rbx)
106 movq %r13, 240(%rbx)
107 movq %r12, 248(%rbx)
108 movq %rax, 224(%rbx)
109 movq free@GOTPCREL(%rip), %rax
110 movq %rax, 232(%rbx)
111 .L12:
112 addq $8, %rsp
113 movq %rbx, %rax
114 popq %rbx
115 popq %rbp
116 popq %r12
117 popq %r13
119 .p2align 4,,10
120 .p2align 3
121 .L15:
122 xorl %ebx, %ebx
123 jmp .L12
124 .p2align 4,,10
125 .p2align 3
126 .L17:
127 movq %rbx, %rdi
128 xorl %ebx, %ebx
129 call free@PLT
130 jmp .L12
131 .size __GI___open_memstream, .-__GI___open_memstream
132 .globl __open_memstream
133 .set __open_memstream,__GI___open_memstream
134 .weak open_memstream
135 .set open_memstream,__open_memstream
136 .section __libc_IO_vtables,"aw",@progbits
137 .align 32
138 .type _IO_mem_jumps, @object
139 .size _IO_mem_jumps, 168
140 _IO_mem_jumps:
141 .quad 0
142 .quad 0
143 .quad _IO_mem_finish
144 .quad __GI__IO_str_overflow
145 .quad __GI__IO_str_underflow
146 .quad __GI__IO_default_uflow
147 .quad __GI__IO_str_pbackfail
148 .quad __GI__IO_default_xsputn
149 .quad __GI__IO_default_xsgetn
150 .quad __GI__IO_str_seekoff
151 .quad _IO_default_seekpos
152 .quad _IO_default_setbuf
153 .quad _IO_mem_sync
154 .quad __GI__IO_default_doallocate
155 .quad _IO_default_read
156 .quad _IO_default_write
157 .quad _IO_default_seek
158 .quad _IO_default_sync
159 .quad _IO_default_stat
160 .quad _IO_default_showmanyc
161 .quad _IO_default_imbue
162 .hidden _IO_init_internal