clarify the purpose of this project
[nyanglibc.git] / grp / grp-merge.shared.s
blobdb49809d8533efec7e7601b02ea8baa0fa6d0f3f
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 __GI___copy_grp
9 .hidden __GI___copy_grp
10 .type __GI___copy_grp, @function
11 __GI___copy_grp:
12 pushq %r15
13 pushq %r14
14 movq %rdx, %r14
15 pushq %r13
16 pushq %r12
17 movq %rdi, %r12
18 pushq %rbp
19 pushq %rbx
20 subq $56, %rsp
21 movl 128(%rsp), %eax
22 movq 112(%rsp), %r15
23 movq %rsi, 24(%rsp)
24 movq %rcx, 32(%rsp)
25 movq 120(%rsp), %rbx
26 movq 136(%rsp), %r13
27 movl %eax, 16(%rsi)
28 movq %r15, %rdi
29 call __GI_strlen
30 leaq 1(%rax), %rbp
31 cmpq %r12, %rbp
32 ja .L28
33 movq %rbp, %rdx
34 movq %r15, %rsi
35 movq %r14, %rdi
36 call __GI_memcpy@PLT
37 movq 24(%rsp), %rax
38 movq %rbx, %rdi
39 movq %r14, (%rax)
40 call __GI_strlen
41 leaq 1(%rax), %rdx
42 leaq 0(%rbp,%rdx), %r15
43 cmpq %r12, %r15
44 ja .L28
45 addq %r14, %rbp
46 movq %rbx, %rsi
47 movq %rbp, %rdi
48 call __GI_memcpy@PLT
49 movq 24(%rsp), %rax
50 movq %rbp, 8(%rax)
51 movq 0(%r13), %rsi
52 testq %rsi, %rsi
53 je .L5
54 xorl %eax, %eax
55 jmp .L6
56 .p2align 4,,10
57 .p2align 3
58 .L14:
59 movq %rbp, %rax
60 .L6:
61 leaq 1(%rax), %rbp
62 cmpq $0, 0(%r13,%rbp,8)
63 jne .L14
64 leaq 16(,%rax,8), %rax
65 movq %rsi, 8(%rsp)
66 xorl %ebx, %ebx
67 movq %rax, %rdi
68 movq %rax, 40(%rsp)
69 call malloc@PLT
70 testq %rax, %rax
71 movq %rax, 16(%rsp)
72 movq 8(%rsp), %rsi
73 jne .L9
74 jmp .L12
75 .p2align 4,,10
76 .p2align 3
77 .L8:
78 addq %r14, %r15
79 movq %r8, 8(%rsp)
80 movq %r15, %rdi
81 call __GI_memcpy@PLT
82 movq 16(%rsp), %rax
83 movq 8(%rsp), %r8
84 movq %r15, (%rax,%rbx)
85 addq $8, %rbx
86 movq %r8, %r15
87 movq 0(%r13,%rbx), %rsi
88 testq %rsi, %rsi
89 je .L13
90 .L9:
91 movq %rsi, %rdi
92 movq %rsi, 8(%rsp)
93 call __GI_strlen
94 leaq 1(%rax), %rdx
95 movq 8(%rsp), %rsi
96 leaq (%rdx,%r15), %r8
97 cmpq %r12, %r8
98 jbe .L8
99 .L29:
100 movq 16(%rsp), %rdi
101 call free@PLT
102 .p2align 4,,10
103 .p2align 3
104 .L28:
105 movl $34, %eax
106 .L1:
107 addq $56, %rsp
108 popq %rbx
109 popq %rbp
110 popq %r12
111 popq %r13
112 popq %r14
113 popq %r15
115 .p2align 4,,10
116 .p2align 3
117 .L5:
118 movl $8, %edi
119 call malloc@PLT
120 testq %rax, %rax
121 movq %rax, 16(%rsp)
122 je .L12
123 movq %r15, %r8
124 xorl %ebp, %ebp
125 movq $8, 40(%rsp)
126 xorl %ebx, %ebx
127 .p2align 4,,10
128 .p2align 3
129 .L13:
130 movq 16(%rsp), %rax
131 leaq (%r14,%r8), %rdi
132 movq $0, (%rax,%rbx)
133 movq %rdi, %rax
134 andl $7, %eax
135 je .L10
136 addq $8, %r8
137 subq %rax, %r8
138 leaq (%r14,%r8), %rdi
139 .L10:
140 movq 24(%rsp), %rax
141 movq %rdi, 24(%rax)
142 movq 40(%rsp), %rax
143 leaq (%r8,%rax), %rbx
144 cmpq %r12, %rbx
145 ja .L29
146 movq 16(%rsp), %r15
147 movq 40(%rsp), %rdx
148 movq %r15, %rsi
149 call __GI_memcpy@PLT
150 movq %r15, %rdi
151 call free@PLT
152 leaq 8(%rbx), %rdx
153 cmpq %r12, %rdx
154 ja .L28
155 movq 32(%rsp), %rcx
156 xorl %eax, %eax
157 movq %rbp, (%r14,%rbx)
158 testq %rcx, %rcx
159 je .L1
160 addq %rdx, %r14
161 movq %r14, (%rcx)
162 jmp .L1
163 .p2align 4,,10
164 .p2align 3
165 .L12:
166 movl $12, %eax
167 jmp .L1
168 .size __GI___copy_grp, .-__GI___copy_grp
169 .globl __copy_grp
170 .set __copy_grp,__GI___copy_grp
171 .p2align 4,,15
172 .globl __GI___merge_grp
173 .hidden __GI___merge_grp
174 .type __GI___merge_grp, @function
175 __GI___merge_grp:
176 pushq %r15
177 pushq %r14
178 pushq %r13
179 pushq %r12
180 movq %rdi, %r12
181 pushq %rbp
182 pushq %rbx
183 movq %r8, %rbp
184 subq $56, %rsp
185 movl 16(%rdi), %eax
186 cmpl %eax, 16(%r8)
187 movq %rsi, 8(%rsp)
188 movq %rcx, (%rsp)
189 movq %r9, 16(%rsp)
190 jne .L52
191 movq (%rdi), %rsi
192 movq (%r8), %rdi
193 movq %rdx, %rbx
194 call __GI_strcmp
195 testl %eax, %eax
196 jne .L52
197 movq 24(%rbp), %rcx
198 movq -8(%rbx), %r15
199 movq (%rcx), %r13
200 testq %r13, %r13
201 je .L42
202 xorl %eax, %eax
203 .p2align 4,,10
204 .p2align 3
205 .L36:
206 addq $1, %rax
207 cmpq $0, (%rcx,%rax,8)
208 jne .L36
209 addq %r15, %rax
210 .L35:
211 leaq 8(,%rax,8), %rax
212 movq %rax, %rdi
213 movq %rax, 40(%rsp)
214 call malloc@PLT
215 movq %rax, %rcx
216 movl $12, %eax
217 testq %rcx, %rcx
218 je .L31
219 movq 24(%r12), %rsi
220 salq $3, %r15
221 movq %rcx, %rdi
222 movq %r15, %rdx
223 movq %rcx, 32(%rsp)
224 call __GI_memcpy@PLT
225 subq 8(%rsp), %rbx
226 subq %r15, %rbx
227 testq %r13, %r13
228 leaq -16(%rbx), %r14
229 je .L44
230 addq 32(%rsp), %r15
231 movl $8, %ebx
232 movq %r15, 24(%rsp)
233 jmp .L39
234 .p2align 4,,10
235 .p2align 3
236 .L38:
237 addq 8(%rsp), %r14
238 movq %r13, %rsi
239 movq %r14, %rdi
240 call __GI_memcpy@PLT
241 movq 24(%rsp), %rax
242 movq %r14, -8(%rax,%rbx)
243 movq 24(%rbp), %rax
244 movq %r15, %r14
245 movq (%rax,%rbx), %r13
246 addq $8, %rbx
247 testq %r13, %r13
248 je .L37
249 .L39:
250 movq %r13, %rdi
251 call __GI_strlen
252 leaq 1(%rax), %rdx
253 leaq (%rdx,%r14), %r15
254 cmpq %r15, (%rsp)
255 jnb .L38
256 .L53:
257 movq 32(%rsp), %rdi
258 call free@PLT
259 addq $56, %rsp
260 movl $34, %eax
261 popq %rbx
262 popq %rbp
263 popq %r12
264 popq %r13
265 popq %r14
266 popq %r15
268 .L44:
269 movq %r14, %r15
270 .p2align 4,,10
271 .p2align 3
272 .L37:
273 movq 32(%rsp), %rax
274 movq 40(%rsp), %rsi
275 movq $0, -8(%rax,%rsi)
276 movq 8(%rsp), %rsi
277 leaq (%rsi,%r15), %rdi
278 movq %rdi, %rax
279 andl $7, %eax
280 je .L40
281 leaq 8(%r15), %r9
282 subq %rax, %r9
283 leaq (%rsi,%r9), %rdi
284 movq %r9, %r15
285 .L40:
286 movq 40(%rsp), %rax
287 movq %rdi, 24(%r12)
288 leaq (%rax,%r15), %r9
289 cmpq %r9, (%rsp)
290 jb .L53
291 movq 32(%rsp), %rbx
292 movq 40(%rsp), %rdx
293 movq %rbx, %rsi
294 call __GI_memcpy@PLT
295 movq %rbx, %rdi
296 call free@PLT
297 .p2align 4,,10
298 .p2align 3
299 .L52:
300 pushq 24(%r12)
301 pushq 16(%r12)
302 xorl %ecx, %ecx
303 pushq 8(%r12)
304 pushq (%r12)
305 movq %rbp, %rsi
306 movq 48(%rsp), %rdx
307 movq 32(%rsp), %rdi
308 call __GI___copy_grp
309 addq $32, %rsp
310 .L31:
311 addq $56, %rsp
312 popq %rbx
313 popq %rbp
314 popq %r12
315 popq %r13
316 popq %r14
317 popq %r15
319 .p2align 4,,10
320 .p2align 3
321 .L42:
322 movq %r15, %rax
323 jmp .L35
324 .size __GI___merge_grp, .-__GI___merge_grp
325 .globl __merge_grp
326 .set __merge_grp,__GI___merge_grp