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