Some broken software wants to deal with ld.so.cache.
[nyanglibc.git] / iconv / gconv_charset.s
blob5a628fd7b52dec2012412416ad460d16703d05f5
1 .text
2 .section .rodata.str1.1,"aMS",@progbits,1
3 .LC0:
4 .string "/TRANSLIT"
5 .LC1:
6 .string ",TRANSLIT"
7 .LC2:
8 .string "/IGNORE"
9 .LC3:
10 .string ",IGNORE"
11 .text
12 .p2align 4,,15
13 .type gconv_parse_code, @function
14 gconv_parse_code:
15 pushq %rbp
16 pushq %rbx
17 movq %rdi, %rbx
18 subq $8, %rsp
19 movb $0, 8(%rdi)
20 movb $0, 9(%rdi)
21 .p2align 4,,10
22 .p2align 3
23 .L18:
24 movq (%rbx), %rbp
25 movq %rbp, %rdi
26 call strlen
27 testq %rax, %rax
28 je .L2
29 movq __libc_tsd_CTYPE_B@gottpoff(%rip), %rdx
30 movsbq -1(%rbp,%rax), %rsi
31 movq %fs:(%rdx), %rdi
32 leaq -1(%rax), %rdx
33 movq %rsi, %rcx
34 testb $32, 1(%rdi,%rsi,2)
35 jne .L30
36 cmpb $44, %sil
37 sete %sil
38 cmpb $47, %cl
39 sete %cl
40 orb %cl, %sil
41 jne .L30
42 jmp .L38
43 .p2align 4,,10
44 .p2align 3
45 .L6:
46 movsbq -1(%rbp,%rdx), %rcx
47 leaq -1(%rdx), %rsi
48 testb $32, 1(%rdi,%rcx,2)
49 movq %rcx, %rax
50 jne .L20
51 cmpb $47, %cl
52 sete %cl
53 cmpb $44, %al
54 sete %al
55 orb %al, %cl
56 je .L4
57 .L20:
58 movq %rsi, %rdx
59 .L30:
60 testq %rdx, %rdx
61 jne .L6
62 .L2:
63 movb $0, 0(%rbp)
64 .L1:
65 addq $8, %rsp
66 popq %rbx
67 popq %rbp
68 ret
69 .L38:
70 movq %rax, %rdx
71 .p2align 4,,10
72 .p2align 3
73 .L4:
74 movb $0, 0(%rbp,%rdx)
75 movq (%rbx), %rdx
76 movzbl (%rdx), %eax
77 testb %al, %al
78 je .L1
79 xorl %ebp, %ebp
80 xorl %ecx, %ecx
81 .p2align 4,,10
82 .p2align 3
83 .L10:
84 cmpb $44, %al
85 je .L36
86 cmpb $47, %al
87 jne .L7
88 addl $1, %ecx
89 .L36:
90 movq %rdx, %rbp
91 .L7:
92 addq $1, %rdx
93 movzbl (%rdx), %eax
94 testb %al, %al
95 jne .L10
96 cmpl $1, %ecx
97 jle .L1
98 testq %rbp, %rbp
99 je .L1
100 leaq _nl_C_locobj(%rip), %rdx
101 leaq .LC0(%rip), %rsi
102 movq %rbp, %rdi
103 call __strcasecmp_l
104 testl %eax, %eax
105 jne .L12
106 .L14:
107 movb $1, 8(%rbx)
108 .L13:
109 leaq _nl_C_locobj(%rip), %rdx
110 leaq .LC2(%rip), %rsi
111 movq %rbp, %rdi
112 call __strcasecmp_l
113 testl %eax, %eax
114 jne .L15
115 .L17:
116 movb $1, 9(%rbx)
117 .L16:
118 movb $0, 0(%rbp)
119 jmp .L18
120 .p2align 4,,10
121 .p2align 3
122 .L12:
123 leaq _nl_C_locobj(%rip), %rdx
124 leaq .LC1(%rip), %rsi
125 movq %rbp, %rdi
126 call __strcasecmp_l
127 testl %eax, %eax
128 je .L14
129 jmp .L13
130 .p2align 4,,10
131 .p2align 3
132 .L15:
133 leaq _nl_C_locobj(%rip), %rdx
134 leaq .LC3(%rip), %rsi
135 movq %rbp, %rdi
136 call __strcasecmp_l
137 testl %eax, %eax
138 je .L17
139 jmp .L16
140 .size gconv_parse_code, .-gconv_parse_code
141 .p2align 4,,15
142 .globl __gconv_create_spec
143 .hidden __gconv_create_spec
144 .type __gconv_create_spec, @function
145 __gconv_create_spec:
146 pushq %r14
147 pushq %r13
148 movq %rdx, %r13
149 pushq %r12
150 pushq %rbp
151 movq %rsi, %rbp
152 pushq %rbx
153 movq %rdi, %rbx
154 movq %rsi, %rdi
155 subq $32, %rsp
156 call __strdup
157 movq %r13, %rdi
158 movq %rax, (%rsp)
159 call __strdup
160 testq %rax, %rax
161 movq %rax, 16(%rsp)
162 movq (%rsp), %r12
163 je .L59
164 testq %r12, %r12
165 je .L59
166 movq %rsp, %rdi
167 call gconv_parse_code
168 leaq 16(%rsp), %rdi
169 call gconv_parse_code
170 movzbl 24(%rsp), %eax
171 movq %rbp, %rdi
172 movb %al, 16(%rbx)
173 movzbl 25(%rsp), %eax
174 movb %al, 17(%rbx)
175 call strlen
176 leaq 3(%rax), %rdi
177 call malloc@PLT
178 testq %rax, %rax
179 movq %rax, %rbp
180 movq %rax, (%rbx)
181 je .L71
182 movq %r13, %rdi
183 call strlen
184 leaq 3(%rax), %rdi
185 call malloc@PLT
186 testq %rax, %rax
187 movq %rax, 8(%rbx)
188 movq (%rsp), %r12
189 je .L72
190 movzbl (%r12), %esi
191 testb %sil, %sil
192 je .L73
193 movq 104+_nl_C_locobj(%rip), %r11
194 movq 120+_nl_C_locobj(%rip), %r13
195 movq %r12, %rdi
196 xorl %r9d, %r9d
197 movabsq $2251799813701639, %r10
198 .p2align 4,,10
199 .p2align 3
200 .L49:
201 movsbq %sil, %r8
202 leal -44(%rsi), %ecx
203 movzwl (%r11,%r8,2), %edx
204 shrw $3, %dx
205 andl $1, %edx
206 cmpb $51, %cl
207 ja .L45
208 movq %r10, %r14
209 shrq %cl, %r14
210 movq %r14, %rcx
211 andl $1, %ecx
212 orl %ecx, %edx
213 .L45:
214 testb %dl, %dl
215 leal 1(%r9), %ecx
216 je .L46
217 movl 0(%r13,%r8,4), %edx
218 addq $1, %rbp
219 movb %dl, -1(%rbp)
220 .L47:
221 addq $1, %rdi
222 movzbl (%rdi), %esi
223 testb %sil, %sil
224 jne .L49
225 cmpl $1, %r9d
226 jg .L48
227 cmpl $1, %ecx
228 leaq 1(%rbp), %rdx
229 movb $47, 0(%rbp)
230 jne .L60
231 .L44:
232 leaq 1(%rdx), %rbp
233 movb $47, (%rdx)
234 .L48:
235 movq 16(%rsp), %rdi
236 movb $0, 0(%rbp)
237 movzbl (%rdi), %esi
238 testb %sil, %sil
239 je .L74
240 movq 104+_nl_C_locobj(%rip), %r11
241 movq 120+_nl_C_locobj(%rip), %rbp
242 xorl %r9d, %r9d
243 movabsq $2251799813701639, %r10
244 .p2align 4,,10
245 .p2align 3
246 .L57:
247 movsbq %sil, %r8
248 leal -44(%rsi), %ecx
249 movzwl (%r11,%r8,2), %edx
250 shrw $3, %dx
251 andl $1, %edx
252 cmpb $51, %cl
253 ja .L53
254 movq %r10, %r14
255 shrq %cl, %r14
256 movq %r14, %rcx
257 andl $1, %ecx
258 orl %ecx, %edx
259 .L53:
260 testb %dl, %dl
261 leal 1(%r9), %ecx
262 je .L54
263 movl 0(%rbp,%r8,4), %edx
264 addq $1, %rax
265 movb %dl, -1(%rax)
266 .L55:
267 addq $1, %rdi
268 movzbl (%rdi), %esi
269 testb %sil, %sil
270 jne .L57
271 cmpl $1, %r9d
272 jg .L56
273 cmpl $1, %ecx
274 leaq 1(%rax), %rdx
275 movb $47, (%rax)
276 jne .L61
277 .L52:
278 leaq 1(%rdx), %rax
279 movb $47, (%rdx)
280 .L56:
281 movb $0, (%rax)
282 .L40:
283 movq %r12, %rdi
284 call free@PLT
285 movq 16(%rsp), %rdi
286 call free@PLT
287 addq $32, %rsp
288 movq %rbx, %rax
289 popq %rbx
290 popq %rbp
291 popq %r12
292 popq %r13
293 popq %r14
295 .p2align 4,,10
296 .p2align 3
297 .L54:
298 cmpb $47, %sil
299 jne .L55
300 cmpl $3, %ecx
301 je .L56
302 leal 2(%r9), %edx
303 movb $47, (%rax)
304 movl %ecx, %r9d
305 addq $1, %rax
306 movl %edx, %ecx
307 jmp .L55
308 .p2align 4,,10
309 .p2align 3
310 .L46:
311 cmpb $47, %sil
312 jne .L47
313 cmpl $3, %ecx
314 je .L48
315 leal 2(%r9), %edx
316 movb $47, 0(%rbp)
317 movl %ecx, %r9d
318 addq $1, %rbp
319 movl %edx, %ecx
320 jmp .L47
321 .p2align 4,,10
322 .p2align 3
323 .L59:
324 xorl %ebx, %ebx
325 jmp .L40
326 .p2align 4,,10
327 .p2align 3
328 .L60:
329 movq %rdx, %rbp
330 jmp .L48
331 .p2align 4,,10
332 .p2align 3
333 .L61:
334 movq %rdx, %rax
335 jmp .L56
336 .L71:
337 movq (%rsp), %r12
338 xorl %ebx, %ebx
339 jmp .L40
340 .L73:
341 leaq 1(%rbp), %rdx
342 movb $47, 0(%rbp)
343 jmp .L44
344 .L74:
345 leaq 1(%rax), %rdx
346 movb $47, (%rax)
347 jmp .L52
348 .L72:
349 movq %rbp, %rdi
350 call free@PLT
351 movq $0, (%rbx)
352 xorl %ebx, %ebx
353 jmp .L40
354 .size __gconv_create_spec, .-__gconv_create_spec
355 .p2align 4,,15
356 .globl __gconv_destroy_spec
357 .hidden __gconv_destroy_spec
358 .type __gconv_destroy_spec, @function
359 __gconv_destroy_spec:
360 pushq %rbx
361 movq %rdi, %rbx
362 movq (%rdi), %rdi
363 call free@PLT
364 movq 8(%rbx), %rdi
365 popq %rbx
366 jmp free@PLT
367 .size __gconv_destroy_spec, .-__gconv_destroy_spec
368 .hidden __strdup
369 .hidden __strcasecmp_l
370 .hidden _nl_C_locobj
371 .hidden strlen