clarify the purpose of this project
[nyanglibc.git] / iconv / gconv_open.s
blob6ad6b3c130274d723d87cb8a9a4785135c3fb14c
1 .text
2 .section .rodata.str1.1,"aMS",@progbits,1
3 .LC0:
4 .string "//"
5 .LC1:
6 .string "INTERNAL"
7 .text
8 .p2align 4,,15
9 .globl __gconv_open
10 .hidden __gconv_open
11 .type __gconv_open, @function
12 __gconv_open:
13 pushq %rbp
14 movl $3, %ecx
15 movq %rsp, %rbp
16 pushq %r15
17 pushq %r14
18 pushq %r13
19 pushq %r12
20 leaq .LC0(%rip), %r14
21 pushq %rbx
22 xorl %ebx, %ebx
23 movl %edx, %r15d
24 subq $72, %rsp
25 cmpb $0, 17(%rdi)
26 movzbl 16(%rdi), %eax
27 movq 8(%rdi), %r12
28 movq %rsi, -112(%rbp)
29 movq (%rdi), %r13
30 movq %r14, %rdi
31 setne %bl
32 movb %al, -97(%rbp)
33 movq %r12, %rsi
34 addl %ebx, %ebx
35 repz cmpsb
36 je .L28
37 .L3:
38 movl $3, %ecx
39 movq %r13, %rsi
40 movq %r14, %rdi
41 repz cmpsb
42 je .L29
43 .L4:
44 leaq -56(%rbp), %rcx
45 leaq -64(%rbp), %rdx
46 movl %r15d, %r8d
47 movq %r13, %rsi
48 movq %r12, %rdi
49 call __gconv_find_transform
50 testl %eax, %eax
51 movl %eax, -104(%rbp)
52 movq $0, -96(%rbp)
53 je .L30
54 .L5:
55 movq -112(%rbp), %rax
56 movq -96(%rbp), %rbx
57 movq %rbx, (%rax)
58 movl -104(%rbp), %eax
59 leaq -40(%rbp), %rsp
60 popq %rbx
61 popq %r12
62 popq %r13
63 popq %r14
64 popq %r15
65 popq %rbp
66 ret
67 .p2align 4,,10
68 .p2align 3
69 .L30:
70 movq -56(%rbp), %r12
71 leaq (%r12,%r12,2), %r13
72 salq $4, %r13
73 leaq 16(%r13), %rdi
74 call malloc@PLT
75 testq %rax, %rax
76 movq %rax, %r14
77 movq %rax, -96(%rbp)
78 movq -64(%rbp), %rcx
79 je .L6
80 leaq 16(%rax), %rdi
81 xorl %esi, %esi
82 movq %rcx, 8(%rax)
83 movq %r12, (%rax)
84 movq %r13, %rdx
85 call memset@PLT
86 testq %r12, %r12
87 je .L5
88 leaq 56(%r14), %r15
89 xorl %r13d, %r13d
90 xorl %r14d, %r14d
91 jmp .L10
92 .p2align 4,,10
93 .p2align 3
94 .L7:
95 movq -56(%rbp), %r12
96 leaq -1(%r12), %rax
97 cmpq %r13, %rax
98 jbe .L8
99 movq -64(%rbp), %rcx
100 movl %ebx, -24(%r15)
101 imull $8160, 84(%rcx,%r14), %eax
102 movq %rcx, -80(%rbp)
103 movslq %eax, %rdx
104 movq %rdx, %rdi
105 movq %rdx, -88(%rbp)
106 call malloc@PLT
107 testq %rax, %rax
108 movq %rax, -40(%r15)
109 movq -80(%rbp), %rcx
110 je .L9
111 movq -88(%rbp), %rdx
112 movq -72(%rbp), %r13
113 addq $48, %r15
114 addq $104, %r14
115 addq %rdx, %rax
116 movq %rax, -80(%r15)
117 cmpq %r13, %r12
118 jbe .L5
119 .L10:
120 cmpb $0, -97(%rbp)
121 leaq 1(%r13), %rax
122 movq %r15, -8(%r15)
123 movq %rax, -72(%rbp)
124 je .L7
125 movq -64(%rbp), %rax
126 leaq _nl_C_locobj(%rip), %rdx
127 leaq .LC1(%rip), %rsi
128 movq 24(%rax,%r14), %rdi
129 call __strcasecmp_l
130 movl %ebx, %edx
131 orl $8, %edx
132 testl %eax, %eax
133 cmove %edx, %ebx
134 jmp .L7
135 .p2align 4,,10
136 .p2align 3
137 .L29:
138 movq _nl_current_LC_CTYPE@gottpoff(%rip), %rax
139 movq %fs:(%rax), %rax
140 movq (%rax), %rax
141 movq 176(%rax), %r14
142 movq %r14, %rdi
143 call strlen
144 leaq 33(%rax), %rcx
145 movq %rax, %rdx
146 movq %r14, %rsi
147 andq $-16, %rcx
148 subq %rcx, %rsp
149 leaq 15(%rsp), %r13
150 andq $-16, %r13
151 movq %r13, %rdi
152 call __mempcpy@PLT
153 movl $12079, %edx
154 movb $0, 2(%rax)
155 movw %dx, (%rax)
156 jmp .L4
157 .p2align 4,,10
158 .p2align 3
159 .L28:
160 movq _nl_current_LC_CTYPE@gottpoff(%rip), %rax
161 movq %fs:(%rax), %rax
162 movq (%rax), %rax
163 movq 176(%rax), %rsi
164 movq %rsi, %rdi
165 movq %rsi, -72(%rbp)
166 call strlen
167 leaq 33(%rax), %rcx
168 movq -72(%rbp), %rsi
169 movq %rax, %rdx
170 andq $-16, %rcx
171 subq %rcx, %rsp
172 leaq 15(%rsp), %r12
173 andq $-16, %r12
174 movq %r12, %rdi
175 call __mempcpy@PLT
176 movl $12079, %ecx
177 movb $0, 2(%rax)
178 movw %cx, (%rax)
179 jmp .L3
180 .p2align 4,,10
181 .p2align 3
182 .L6:
183 movq __libc_errno@gottpoff(%rip), %rbx
184 movl %fs:(%rbx), %eax
185 movl %eax, -72(%rbp)
186 .L12:
187 movq %r12, %rsi
188 movq %rcx, %rdi
189 call __gconv_close_transform
190 movl -72(%rbp), %eax
191 movl $3, -104(%rbp)
192 movq $0, -96(%rbp)
193 movl %eax, %fs:(%rbx)
194 jmp .L5
195 .p2align 4,,10
196 .p2align 3
197 .L8:
198 leaq 0(%r13,%r13,2), %rax
199 movq -96(%rbp), %rsi
200 orl $1, %ebx
201 salq $4, %rax
202 movl %ebx, 32(%rsi,%rax)
203 jmp .L5
204 .p2align 4,,10
205 .p2align 3
206 .L9:
207 movq __libc_errno@gottpoff(%rip), %rbx
208 testq %r13, %r13
209 leaq -1(%r13), %r14
210 movl %fs:(%rbx), %eax
211 movl %eax, -72(%rbp)
212 je .L14
213 leaq 0(%r13,%r13,2), %rax
214 movq -96(%rbp), %rsi
215 salq $4, %rax
216 leaq -32(%rsi,%rax), %r15
217 .p2align 4,,10
218 .p2align 3
219 .L11:
220 movq (%r15), %rdi
221 subq $1, %r14
222 subq $48, %r15
223 call free@PLT
224 cmpq $-1, %r14
225 jne .L11
226 movq -56(%rbp), %r12
227 movq -64(%rbp), %rcx
228 .L14:
229 movq -96(%rbp), %rdi
230 movq %rcx, -80(%rbp)
231 call free@PLT
232 movq -80(%rbp), %rcx
233 jmp .L12
234 .size __gconv_open, .-__gconv_open
235 .hidden __gconv_close_transform
236 .hidden strlen
237 .hidden _nl_current_LC_CTYPE
238 .hidden __strcasecmp_l
239 .hidden _nl_C_locobj
240 .hidden __gconv_find_transform