clarify the purpose of this project
[nyanglibc.git] / stdlib / wctomb.s
blob4877c1949c0145444577a6b23afb68f7f50cd7e7
1 .text
2 .p2align 4,,15
3 .globl wctomb
4 .hidden wctomb
5 .type wctomb, @function
6 wctomb:
7 testq %rdi, %rdi
8 pushq %rbx
9 je .L9
10 leaq __wctomb_state(%rip), %rdx
11 call __wcrtomb
12 popq %rbx
13 ret
14 .p2align 4,,10
15 .p2align 3
16 .L9:
17 movq _nl_current_LC_CTYPE@gottpoff(%rip), %rax
18 movq %fs:(%rax), %rax
19 movq (%rax), %rbx
20 movq 40(%rbx), %rax
21 testq %rax, %rax
22 je .L10
23 .L4:
24 movq 16(%rax), %rax
25 movq $0, __wctomb_state(%rip)
26 popq %rbx
27 movl 88(%rax), %eax
28 ret
29 .p2align 4,,10
30 .p2align 3
31 .L10:
32 leaq _nl_C_LC_CTYPE(%rip), %rax
33 cmpq %rax, %rbx
34 je .L6
35 movq %rbx, %rdi
36 call __wcsmbs_load_conv
37 movq 40(%rbx), %rax
38 jmp .L4
39 .L6:
40 leaq __wcsmbs_gconv_fcts_c(%rip), %rax
41 jmp .L4
42 .size wctomb, .-wctomb
43 .hidden __wctomb_state
44 .comm __wctomb_state,8,8
45 .hidden __wcsmbs_gconv_fcts_c
46 .hidden __wcsmbs_load_conv
47 .hidden _nl_C_LC_CTYPE
48 .hidden _nl_current_LC_CTYPE
49 .hidden __wcrtomb