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