clarify the purpose of this project
[nyanglibc.git] / string / envz.shared.s
blob979e0172419cf84f6e7a4757db01be3f5c92acaf
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_envz_entry
9 .hidden __GI_envz_entry
10 .type __GI_envz_entry, @function
11 __GI_envz_entry:
12 testq %rsi, %rsi
13 je .L33
14 pushq %rbx
15 movq %rdi, %rax
16 .p2align 4,,10
17 .p2align 3
18 .L2:
19 movq %rdx, %r9
20 movq %rax, %rcx
21 jmp .L4
22 .p2align 4,,10
23 .p2align 3
24 .L35:
25 cmpb $61, %r8b
26 je .L16
27 addq $1, %r9
28 subq $1, %rsi
29 leaq 1(%rcx), %r8
30 je .L34
31 movq %r8, %rcx
32 .L4:
33 movzbl (%r9), %r8d
34 movzbl (%rcx), %r10d
35 testb %r8b, %r8b
36 setne %bl
37 cmpb %r10b, %r8b
38 sete %r11b
39 testb %r11b, %bl
40 jne .L35
41 .L16:
42 testb %r10b, %r10b
43 je .L8
44 cmpb $61, %r10b
45 je .L8
46 .L11:
47 testb %r10b, %r10b
48 jne .L10
49 jmp .L9
50 .p2align 4,,10
51 .p2align 3
52 .L36:
53 cmpb $0, (%rcx)
54 je .L9
55 .L10:
56 addq $1, %rcx
57 subq $1, %rsi
58 jne .L36
59 .L31:
60 xorl %eax, %eax
61 .L19:
62 popq %rbx
63 ret
64 .p2align 4,,10
65 .p2align 3
66 .L9:
67 subq $1, %rsi
68 leaq 1(%rcx), %rax
69 jne .L2
70 xorl %eax, %eax
71 jmp .L19
72 .p2align 4,,10
73 .p2align 3
74 .L8:
75 movzbl (%r9), %edi
76 testb %dil, %dil
77 je .L19
78 cmpb $61, %dil
79 jne .L11
80 popq %rbx
81 ret
82 .p2align 4,,10
83 .p2align 3
84 .L34:
85 movzbl 1(%rcx), %edx
86 cmpb $61, %dl
87 je .L5
88 testb %dl, %dl
89 jne .L31
90 .L5:
91 movzbl (%r9), %edx
92 testb %dl, %dl
93 je .L19
94 cmpb $61, %dl
95 movl $0, %edx
96 cmovne %rdx, %rax
97 popq %rbx
98 ret
99 .L33:
100 xorl %eax, %eax
102 .size __GI_envz_entry, .-__GI_envz_entry
103 .globl envz_entry
104 .set envz_entry,__GI_envz_entry
105 .p2align 4,,15
106 .globl envz_get
107 .type envz_get, @function
108 envz_get:
109 call __GI_envz_entry
110 testq %rax, %rax
111 jne .L57
112 jmp .L37
113 .p2align 4,,10
114 .p2align 3
115 .L58:
116 cmpb $61, %dl
117 je .L39
118 addq $1, %rax
119 .L57:
120 movzbl (%rax), %edx
121 testb %dl, %dl
122 jne .L58
123 .L39:
124 addq $1, %rax
125 testb %dl, %dl
126 movl $0, %edx
127 cmove %rdx, %rax
128 .L37:
129 rep ret
130 .size envz_get, .-envz_get
131 .p2align 4,,15
132 .globl __GI_envz_remove
133 .hidden __GI_envz_remove
134 .type __GI_envz_remove, @function
135 __GI_envz_remove:
136 pushq %rbp
137 pushq %rbx
138 movq %rsi, %rbp
139 movq %rdi, %rbx
140 subq $8, %rsp
141 movq (%rsi), %rsi
142 movq (%rdi), %rdi
143 call __GI_envz_entry
144 testq %rax, %rax
145 je .L59
146 addq $8, %rsp
147 movq %rbp, %rsi
148 movq %rbx, %rdi
149 popq %rbx
150 popq %rbp
151 movq %rax, %rdx
152 jmp __GI_argz_delete
153 .p2align 4,,10
154 .p2align 3
155 .L59:
156 addq $8, %rsp
157 popq %rbx
158 popq %rbp
160 .size __GI_envz_remove, .-__GI_envz_remove
161 .globl envz_remove
162 .set envz_remove,__GI_envz_remove
163 .p2align 4,,15
164 .globl envz_add
165 .type envz_add, @function
166 envz_add:
167 pushq %r15
168 pushq %r14
169 pushq %r13
170 pushq %r12
171 movq %rcx, %r13
172 pushq %rbp
173 pushq %rbx
174 movq %rsi, %rbp
175 movq %rdi, %rbx
176 movq %rdx, %r12
177 subq $56, %rsp
178 call __GI_envz_remove
179 testq %r13, %r13
180 je .L63
181 movq %r12, %rdi
182 call __GI_strlen
183 movq %r13, %rdi
184 movq %rax, %r14
185 call __GI_strlen
186 movq 0(%rbp), %rdx
187 movq %r14, 24(%rsp)
188 movq %rax, 32(%rsp)
189 movq (%rbx), %rdi
190 leaq (%r14,%rdx), %r14
191 movq %rdx, 40(%rsp)
192 addq %r14, %rax
193 leaq 2(%rax), %rsi
194 movq %rax, 8(%rsp)
195 movq %rsi, 16(%rsp)
196 call realloc@PLT
197 movq %rax, %r15
198 movl $12, %eax
199 testq %r15, %r15
200 je .L62
201 movq 40(%rsp), %rdx
202 movq %r12, %rsi
203 leaq (%r15,%rdx), %rdi
204 movq 24(%rsp), %rdx
205 call __GI_memcpy@PLT
206 movq 32(%rsp), %rdx
207 leaq 1(%r15,%r14), %rdi
208 movq %r13, %rsi
209 movb $61, (%r15,%r14)
210 call __GI_memcpy@PLT
211 movq 8(%rsp), %rax
212 movq 16(%rsp), %rsi
213 movb $0, 1(%r15,%rax)
214 movq %r15, (%rbx)
215 xorl %eax, %eax
216 movq %rsi, 0(%rbp)
217 .L62:
218 addq $56, %rsp
219 popq %rbx
220 popq %rbp
221 popq %r12
222 popq %r13
223 popq %r14
224 popq %r15
226 .p2align 4,,10
227 .p2align 3
228 .L63:
229 addq $56, %rsp
230 movq %r12, %rdx
231 movq %rbp, %rsi
232 movq %rbx, %rdi
233 popq %rbx
234 popq %rbp
235 popq %r12
236 popq %r13
237 popq %r14
238 popq %r15
239 jmp __argz_add
240 .size envz_add, .-envz_add
241 .p2align 4,,15
242 .globl envz_merge
243 .type envz_merge, @function
244 envz_merge:
245 pushq %r15
246 pushq %r14
247 pushq %r13
248 pushq %r12
249 pushq %rbp
250 pushq %rbx
251 subq $24, %rsp
252 testq %rcx, %rcx
253 movl %r8d, 12(%rsp)
254 je .L74
255 movq %rdi, %r14
256 movq %rsi, %r13
257 movq %rdx, %rbp
258 movq %rcx, %r12
259 jmp .L72
260 .p2align 4,,10
261 .p2align 3
262 .L71:
263 addq %rbx, %rbp
264 subq %rbx, %r12
265 je .L68
266 .L83:
267 testb %cl, %cl
268 je .L68
269 .L72:
270 movq 0(%r13), %rsi
271 movq (%r14), %rdi
272 movq %rbp, %rdx
273 call __GI_envz_entry
274 movq %rbp, %rdi
275 movq %rax, %r15
276 call __GI_strlen
277 testq %r15, %r15
278 leaq 1(%rax), %rbx
279 je .L82
280 movl 12(%rsp), %edx
281 xorl %eax, %eax
282 movl $1, %ecx
283 testl %edx, %edx
284 je .L71
285 movq %r15, %rdx
286 movq %r13, %rsi
287 movq %r14, %rdi
288 call __GI_argz_delete
289 .L82:
290 movq %rbx, %rcx
291 movq %rbp, %rdx
292 movq %r13, %rsi
293 movq %r14, %rdi
294 call __argz_append
295 testl %eax, %eax
296 sete %cl
297 addq %rbx, %rbp
298 subq %rbx, %r12
299 jne .L83
300 .L68:
301 addq $24, %rsp
302 popq %rbx
303 popq %rbp
304 popq %r12
305 popq %r13
306 popq %r14
307 popq %r15
309 .p2align 4,,10
310 .p2align 3
311 .L74:
312 addq $24, %rsp
313 xorl %eax, %eax
314 popq %rbx
315 popq %rbp
316 popq %r12
317 popq %r13
318 popq %r14
319 popq %r15
321 .size envz_merge, .-envz_merge
322 .p2align 4,,15
323 .globl envz_strip
324 .type envz_strip, @function
325 envz_strip:
326 pushq %r14
327 pushq %r13
328 movq %rsi, %r13
329 pushq %r12
330 pushq %rbp
331 pushq %rbx
332 movq (%rsi), %r12
333 movq (%rdi), %rbp
334 testq %r12, %r12
335 je .L88
336 movq %rdi, %r14
337 jmp .L87
338 .p2align 4,,10
339 .p2align 3
340 .L89:
341 testq %r12, %r12
342 movq %rsi, %rbp
343 je .L92
344 .L87:
345 movq %rbp, %rdi
346 call __GI_strlen
347 leaq 1(%rax), %rbx
348 movl $61, %esi
349 movq %rbp, %rdi
350 call __GI_strchr
351 subq %rbx, %r12
352 testq %rax, %rax
353 leaq 0(%rbp,%rbx), %rsi
354 jne .L89
355 movq %r12, %rdx
356 movq %rbp, %rdi
357 call __GI_memmove
358 testq %r12, %r12
359 jne .L87
360 .L92:
361 subq (%r14), %rbp
362 popq %rbx
363 movq %rbp, 0(%r13)
364 popq %rbp
365 popq %r12
366 popq %r13
367 popq %r14
369 .p2align 4,,10
370 .p2align 3
371 .L88:
372 xorl %ebp, %ebp
373 popq %rbx
374 movq %rbp, 0(%r13)
375 popq %rbp
376 popq %r12
377 popq %r13
378 popq %r14
380 .size envz_strip, .-envz_strip
381 .hidden __argz_append
382 .hidden __argz_add