clarify the purpose of this project
[nyanglibc.git] / stdlib / mbtowc.shared.s
blobbf2acf86590156d68bcb881af6ae5a2572d062fb
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 mbtowc
9 .type mbtowc, @function
10 mbtowc:
11 testq %rsi, %rsi
12 pushq %rbx
13 je .L12
14 cmpb $0, (%rsi)
15 jne .L6
16 xorl %eax, %eax
17 testq %rdi, %rdi
18 je .L1
19 movl $0, (%rdi)
20 .L1:
21 popq %rbx
22 ret
23 .p2align 4,,10
24 .p2align 3
25 .L6:
26 leaq state.9330(%rip), %rcx
27 call __GI___mbrtowc
28 movl $-1, %edx
29 testl %eax, %eax
30 cmovs %edx, %eax
31 popq %rbx
32 ret
33 .p2align 4,,10
34 .p2align 3
35 .L12:
36 movq __libc_tsd_LOCALE@gottpoff(%rip), %rax
37 movq %fs:(%rax), %rax
38 movq (%rax), %rbx
39 movq 40(%rbx), %rax
40 testq %rax, %rax
41 je .L13
42 .L4:
43 movq $0, state.9330(%rip)
44 movq (%rax), %rax
45 popq %rbx
46 movl 88(%rax), %eax
47 ret
48 .p2align 4,,10
49 .p2align 3
50 .L13:
51 leaq _nl_C_LC_CTYPE(%rip), %rax
52 cmpq %rax, %rbx
53 je .L7
54 movq %rbx, %rdi
55 call __wcsmbs_load_conv
56 movq 40(%rbx), %rax
57 jmp .L4
58 .L7:
59 leaq __wcsmbs_gconv_fcts_c(%rip), %rax
60 jmp .L4
61 .size mbtowc, .-mbtowc
62 .local state.9330
63 .comm state.9330,8,8
64 .hidden __wcsmbs_gconv_fcts_c
65 .hidden __wcsmbs_load_conv
66 .hidden _nl_C_LC_CTYPE