clarify the purpose of this project
[nyanglibc.git] / stdlib / groupingwc.shared.s
blob4f0907d8deeb183a5bc0528aaf18d0da7c730373
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 __correctly_grouped_prefixwc
9 .hidden __correctly_grouped_prefixwc
10 .type __correctly_grouped_prefixwc, @function
11 __correctly_grouped_prefixwc:
12 testq %rcx, %rcx
13 movq %rsi, %rax
14 je .L34
15 cmpq %rdi, %rsi
16 jbe .L35
17 leaq -4(%rax), %r8
18 movl $4, %esi
19 subq %rdi, %rsi
20 cmpq %r8, %rdi
21 ja .L34
22 pushq %rbp
23 pushq %rbx
24 .p2align 4,,10
25 .p2align 3
26 .L37:
27 cmpl -4(%rax), %edx
28 je .L4
29 leaq -8(%rax,%rsi), %r9
30 andq $-4, %r9
31 negq %r9
32 leaq -8(%rax,%r9), %r9
33 jmp .L5
34 .p2align 4,,10
35 .p2align 3
36 .L6:
37 cmpl %edx, (%r8)
38 je .L4
39 .L5:
40 subq $4, %r8
41 cmpq %r9, %r8
42 jne .L6
43 .L28:
44 popq %rbx
45 popq %rbp
46 ret
47 .p2align 4,,10
48 .p2align 3
49 .L4:
50 movsbq (%rcx), %r11
51 movq %rax, %r10
52 subq %r8, %r10
53 sarq $2, %r10
54 movsbl %r11b, %r9d
55 addl $1, %r9d
56 movslq %r9d, %r9
57 cmpq %r9, %r10
58 je .L42
59 movq %r8, %rax
60 jle .L18
61 leaq 4(%r8,%r11,4), %rax
62 .L18:
63 cmpq %rdi, %rax
64 jbe .L43
65 .L20:
66 leaq -4(%rax), %r8
67 cmpq %r8, %rdi
68 jbe .L37
69 popq %rbx
70 popq %rbp
71 ret
72 .p2align 4,,10
73 .p2align 3
74 .L42:
75 leaq -4(%r8), %r10
76 movq %rcx, %rbp
77 movq %r10, %rbx
78 .p2align 4,,10
79 .p2align 3
80 .L7:
81 movsbq 1(%rbp), %r11
82 testb %r11b, %r11b
83 je .L8
84 addq $1, %rbp
85 cmpb $127, %r11b
86 movq %r10, %r9
87 je .L10
88 .L44:
89 testb %r11b, %r11b
90 js .L10
91 cmpq %r10, %rdi
92 ja .L28
93 cmpl %edx, -4(%r8)
94 je .L23
95 leaq -8(%r8,%rsi), %r9
96 andq $-4, %r9
97 negq %r9
98 leaq -8(%r8,%r9), %r9
99 movq %r10, %r8
100 jmp .L12
101 .p2align 4,,10
102 .p2align 3
103 .L17:
104 cmpl %edx, (%r8)
105 je .L16
106 .L12:
107 subq $4, %r8
108 cmpq %r9, %r8
109 jne .L17
110 subq %r8, %r10
111 sarq $2, %r10
112 cmpq %r10, %r11
113 jge .L28
114 .L26:
115 movq %rbx, %rax
116 cmpq %rdi, %rax
117 ja .L20
118 .L43:
119 cmpq %rdi, %rax
120 cmovb %rdi, %rax
121 popq %rbx
122 popq %rbp
124 .p2align 4,,10
125 .p2align 3
126 .L8:
127 movsbq 0(%rbp), %r11
128 movq %r10, %r9
129 cmpb $127, %r11b
130 jne .L44
131 .L10:
132 cmpq %r10, %rdi
133 ja .L28
134 cmpl %edx, -4(%r8)
135 je .L13
136 leaq -8(%r8,%rsi), %r10
137 andq $-4, %r10
138 negq %r10
139 leaq -8(%r8,%r10), %r8
140 jmp .L14
141 .p2align 4,,10
142 .p2align 3
143 .L15:
144 cmpl %edx, (%r9)
145 je .L13
146 .L14:
147 subq $4, %r9
148 cmpq %r8, %r9
149 jne .L15
150 jmp .L28
151 .p2align 4,,10
152 .p2align 3
153 .L13:
154 movq %r9, %r8
155 .L19:
156 leaq -4(%r8), %r10
157 jmp .L7
158 .p2align 4,,10
159 .p2align 3
160 .L16:
161 cmpq %r8, %rdi
162 ja .L26
163 .L11:
164 subq %r8, %r10
165 sarq $2, %r10
166 cmpq %r11, %r10
167 je .L19
168 jmp .L26
169 .p2align 4,,10
170 .p2align 3
171 .L23:
172 movq %r10, %r8
173 jmp .L11
174 .L35:
175 cmpq %rdi, %rsi
176 cmovb %rdi, %rax
177 .L34:
178 rep ret
179 .size __correctly_grouped_prefixwc, .-__correctly_grouped_prefixwc