clarify the purpose of this project
[nyanglibc.git] / stdlib / grouping.s
blob6fcc31f4ba62fd6efe474589a900b33f55c72a2b
1 .text
2 .p2align 4,,15
3 .globl __correctly_grouped_prefixmb
4 .hidden __correctly_grouped_prefixmb
5 .type __correctly_grouped_prefixmb, @function
6 __correctly_grouped_prefixmb:
7 pushq %r15
8 pushq %r14
9 pushq %r13
10 pushq %r12
11 pushq %rbp
12 pushq %rbx
13 movq %rsi, %rbp
14 subq $40, %rsp
15 testq %rcx, %rcx
16 movq %rcx, 16(%rsp)
17 je .L36
18 movq %rdi, %r15
19 movq %rdx, %rdi
20 movq %rdx, 24(%rsp)
21 call strlen
22 cmpq %r15, %rbp
23 jbe .L3
24 leaq -3(%rax), %rbx
25 movq 24(%rsp), %rdx
26 leaq -1(%r15), %rsi
27 leaq -2(%rax), %r12
28 movq %rbx, 8(%rsp)
29 .p2align 4,,10
30 .p2align 3
31 .L26:
32 leaq -1(%rbp), %r9
33 cmpq %r9, %r15
34 ja .L36
35 movzbl (%rdx), %ebx
36 jmp .L8
37 .p2align 4,,10
38 .p2align 3
39 .L4:
40 subq $1, %r9
41 cmpq %rsi, %r9
42 je .L36
43 .L8:
44 movzbl -1(%r9,%rax), %r11d
45 cmpb %bl, %r11b
46 jne .L4
47 movzbl 1(%rdx), %ecx
48 testb %cl, %cl
49 je .L5
50 cmpb %cl, -2(%r9,%rax)
51 jne .L4
52 movq 8(%rsp), %rdi
53 leaq 2(%rdx), %rcx
54 leaq (%r9,%rdi), %r8
55 jmp .L6
56 .p2align 4,,10
57 .p2align 3
58 .L7:
59 movzbl (%r8), %r10d
60 addq $1, %rcx
61 subq $1, %r8
62 cmpb %dil, %r10b
63 jne .L4
64 .L6:
65 movzbl (%rcx), %edi
66 testb %dil, %dil
67 jne .L7
68 .L5:
69 cmpq %r9, %r15
70 ja .L36
71 movq 16(%rsp), %rbx
72 movq %rbp, %r8
73 subq %r9, %r8
74 movsbq (%rbx), %rcx
75 movq %rcx, %rdi
76 addl $1, %ecx
77 movslq %ecx, %rcx
78 cmpq %rcx, %r8
79 je .L63
80 leaq 1(%r9,%rdi), %rbp
81 cmovle %r9, %rbp
82 .L25:
83 cmpq %r15, %rbp
84 ja .L26
85 .L3:
86 cmpq %r15, %rbp
87 cmovb %r15, %rbp
88 .L36:
89 addq $40, %rsp
90 movq %rbp, %rax
91 popq %rbx
92 popq %rbp
93 popq %r12
94 popq %r13
95 popq %r14
96 popq %r15
97 ret
98 .L63:
99 movq %rbx, %r14
100 leaq -1(%r9), %r13
101 movsbq 1(%r14), %rbx
102 movq %r13, 24(%rsp)
103 testb %bl, %bl
104 je .L11
105 .p2align 4,,10
106 .p2align 3
107 .L64:
108 addq $1, %r14
109 cmpb $127, %bl
110 movq %r13, %r10
111 je .L13
112 .L65:
113 testb %bl, %bl
114 js .L13
115 cmpq %r13, %r15
116 ja .L36
117 movq %r13, %r9
118 .p2align 4,,10
119 .p2align 3
120 .L28:
121 testb %r11b, %r11b
122 je .L22
123 cmpb -1(%r9,%rax), %r11b
124 jne .L20
125 leaq 1(%rdx), %rcx
126 leaq (%r9,%r12), %r8
127 jmp .L23
128 .p2align 4,,10
129 .p2align 3
130 .L21:
131 movzbl (%r8), %r10d
132 addq $1, %rcx
133 subq $1, %r8
134 cmpb %dil, %r10b
135 jne .L20
136 .L23:
137 movzbl (%rcx), %edi
138 testb %dil, %dil
139 jne .L21
140 .L22:
141 subq %r9, %r13
142 cmpq %r9, %r15
143 ja .L29
144 cmpq %rbx, %r13
145 jne .L30
146 .L19:
147 movsbq 1(%r14), %rbx
148 leaq -1(%r9), %r13
149 testb %bl, %bl
150 jne .L64
151 .L11:
152 movsbq (%r14), %rbx
153 movq %r13, %r10
154 cmpb $127, %bl
155 jne .L65
156 .L13:
157 cmpq %r13, %r15
158 ja .L36
159 .p2align 4,,10
160 .p2align 3
161 .L27:
162 testb %r11b, %r11b
163 je .L17
164 cmpb -1(%r10,%rax), %r11b
165 jne .L15
166 leaq 1(%rdx), %rcx
167 leaq (%r10,%r12), %r8
168 jmp .L18
169 .p2align 4,,10
170 .p2align 3
171 .L16:
172 movzbl (%r8), %r9d
173 addq $1, %rcx
174 subq $1, %r8
175 cmpb %dil, %r9b
176 jne .L15
177 .L18:
178 movzbl (%rcx), %edi
179 testb %dil, %dil
180 jne .L16
181 .L17:
182 cmpq %r10, %r15
183 ja .L36
184 movq %r10, %r9
185 jmp .L19
186 .p2align 4,,10
187 .p2align 3
188 .L20:
189 subq $1, %r9
190 cmpq %rsi, %r9
191 jne .L28
192 subq %rsi, %r13
193 .L29:
194 cmpq %r13, %rbx
195 jge .L36
196 .L30:
197 movq 24(%rsp), %rbp
198 jmp .L25
199 .p2align 4,,10
200 .p2align 3
201 .L15:
202 subq $1, %r10
203 cmpq %rsi, %r10
204 jne .L27
205 jmp .L36
206 .size __correctly_grouped_prefixmb, .-__correctly_grouped_prefixmb
207 .hidden strlen