1 /* This C file is generated by NIT to compile module utils. */
2 #include "utils._sep.h"
3 val_t
utils___Object___cmangle(val_t p0
, val_t p1
){
4 struct {struct stack_frame_t me
; val_t MORE_REG
[6];} fra
;
8 static val_t once_value_1
; /* Once value */
9 fra
.me
.prev
= stack_frame_head
; stack_frame_head
= &fra
.me
;
10 fra
.me
.file
= LOCATE_utils
;
12 fra
.me
.meth
= LOCATE_utils___Object___cmangle
;
15 fra
.me
.REG
[0] = NIT_NULL
;
16 fra
.me
.REG
[1] = NIT_NULL
;
17 fra
.me
.REG
[2] = NIT_NULL
;
18 fra
.me
.REG
[3] = NIT_NULL
;
19 fra
.me
.REG
[4] = NIT_NULL
;
20 fra
.me
.REG
[5] = NIT_NULL
;
21 fra
.me
.REG
[6] = NIT_NULL
;
25 REGB0
= TAG_Bool(VAL_ISA(fra
.me
.REG
[1], COLOR_Array
, ID_Array
)) /*cast Array[Symbol]*/;
26 if (UNTAG_Bool(REGB0
)) {
28 nit_abort("Cast failed", NULL
, LOCATE_utils
, 21);
32 fra
.me
.REG
[0] = CALL_utils___Object___cmangle_table(fra
.me
.REG
[0])(fra
.me
.REG
[0]);
33 once_value_1
= fra
.me
.REG
[0];
34 register_static_object(&once_value_1
);
35 } else fra
.me
.REG
[0] = once_value_1
;
36 fra
.me
.REG
[0] = fra
.me
.REG
[0];
38 fra
.me
.REG
[2] = NEW_Buffer_string___Buffer___init();
39 /* ./../lib/standard//collection//array.nit:234 */
41 /* ./../lib/standard//collection//array.nit:235 */
42 REGB1
= TAG_Bool(ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[1])!=NIT_NULL
);
43 if (UNTAG_Bool(REGB1
)) {
45 nit_abort("Uninitialized attribute %s", "_length", LOCATE_array
, 235);
47 REGB1
= ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[1]);
48 /* ./../lib/standard//collection//array.nit:236 */
49 fra
.me
.REG
[3] = ATTR_array___Array____items(fra
.me
.REG
[1]);
50 /* ./../lib/standard//collection//array.nit:237 */
52 /* ./../lib/standard//collection//array.nit:23 */
53 REGB1
= TAG_Bool(ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[1])!=NIT_NULL
);
54 if (UNTAG_Bool(REGB1
)) {
56 nit_abort("Uninitialized attribute %s", "_length", LOCATE_array
, 23);
58 REGB1
= ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[1]);
59 /* ./../lib/standard//kernel.nit:212 */
60 REGB1
= TAG_Bool(UNTAG_Int(REGB0
)<UNTAG_Int(REGB1
));
61 /* ./../lib/standard//collection//array.nit:237 */
62 if (UNTAG_Bool(REGB1
)) {
63 /* ./../lib/standard//collection//array.nit:238 */
64 REGB1
= TAG_Bool(fra
.me
.REG
[3]==NIT_NULL
);
65 if (UNTAG_Bool(REGB1
)) {
66 nit_abort("Reciever is null", NULL
, LOCATE_array
, 238);
68 /* ./../lib/standard//collection//array.nit:654 */
69 fra
.me
.REG
[4] = ((Nit_NativeArray
)fra
.me
.REG
[3])->val
[UNTAG_Int(REGB0
)];
71 REGB1
= CALL_abstract_collection___Collection___is_empty(fra
.me
.REG
[2])(fra
.me
.REG
[2]);
72 REGB1
= TAG_Bool(!UNTAG_Bool(REGB1
));
73 if (UNTAG_Bool(REGB1
)) {
75 REGB1
= TAG_Char('_');
76 CALL_abstract_collection___SimpleCollection___add(fra
.me
.REG
[2])(fra
.me
.REG
[2], REGB1
);
78 REGB1
= TAG_Char('_');
79 CALL_abstract_collection___SimpleCollection___add(fra
.me
.REG
[2])(fra
.me
.REG
[2], REGB1
);
81 REGB1
= TAG_Char('_');
82 CALL_abstract_collection___SimpleCollection___add(fra
.me
.REG
[2])(fra
.me
.REG
[2], REGB1
);
85 REGB1
= TAG_Bool(false);
86 fra
.me
.REG
[5] = REGB1
;
88 REGB1
= TAG_Bool(true);
89 fra
.me
.REG
[6] = REGB1
;
91 fra
.me
.REG
[4] = CALL_string___Object___to_s(fra
.me
.REG
[4])(fra
.me
.REG
[4]);
92 CALL_abstract_collection___Collection___iterate(fra
.me
.REG
[4])(fra
.me
.REG
[4], (&(fra
.me
)), ((fun_t
)OC_utils___Object___cmangle_2
));
93 /* ./../lib/standard//collection//array.nit:239 */
95 /* ./../lib/standard//kernel.nit:215 */
96 REGB1
= TAG_Int(UNTAG_Int(REGB0
)+UNTAG_Int(REGB1
));
97 /* ./../lib/standard//collection//array.nit:239 */
100 /* ./../lib/standard//collection//array.nit:237 */
106 fra
.me
.REG
[2] = CALL_string___Object___to_s(fra
.me
.REG
[2])(fra
.me
.REG
[2]);
109 stack_frame_head
= fra
.me
.prev
;
110 return fra
.me
.REG
[2];
112 void OC_utils___Object___cmangle_2(struct stack_frame_t
*closctx
, val_t p0
){
113 struct {struct stack_frame_t me
;} fra
;
120 fra
.me
.prev
= stack_frame_head
; stack_frame_head
= &fra
.me
;
121 fra
.me
.file
= LOCATE_utils
;
123 fra
.me
.meth
= LOCATE_utils___Object___cmangle
;
124 fra
.me
.has_broke
= 0;
126 fra
.me
.REG
[0] = NIT_NULL
;
128 REGB0
= fra
.me
.REG
[0];
130 REGB1
= TAG_Char('a');
131 /* ./../lib/standard//kernel.nit:353 */
132 REGB1
= TAG_Bool(UNTAG_Char(REGB0
)>=UNTAG_Char(REGB1
));
134 if (UNTAG_Bool(REGB1
)) {
135 REGB1
= TAG_Char('z');
136 /* ./../lib/standard//kernel.nit:351 */
137 REGB1
= TAG_Bool(UNTAG_Char(REGB0
)<=UNTAG_Char(REGB1
));
140 REGB2
= TAG_Bool(false);
143 if (UNTAG_Bool(REGB1
)) {
144 REGB1
= TAG_Bool(true);
146 REGB2
= TAG_Char('A');
147 /* ./../lib/standard//kernel.nit:353 */
148 REGB2
= TAG_Bool(UNTAG_Char(REGB0
)>=UNTAG_Char(REGB2
));
150 if (UNTAG_Bool(REGB2
)) {
151 REGB2
= TAG_Char('Z');
152 /* ./../lib/standard//kernel.nit:351 */
153 REGB2
= TAG_Bool(UNTAG_Char(REGB0
)<=UNTAG_Char(REGB2
));
156 REGB3
= TAG_Bool(false);
161 if (UNTAG_Bool(REGB1
)) {
162 REGB1
= TAG_Bool(true);
164 REGB2
= TAG_Char('0');
165 /* ./../lib/standard//kernel.nit:353 */
166 REGB2
= TAG_Bool(UNTAG_Char(REGB0
)>=UNTAG_Char(REGB2
));
168 if (UNTAG_Bool(REGB2
)) {
169 REGB2
= TAG_Char('9');
170 /* ./../lib/standard//kernel.nit:351 */
171 REGB2
= TAG_Bool(UNTAG_Char(REGB0
)<=UNTAG_Char(REGB2
));
174 REGB3
= TAG_Bool(false);
179 if (UNTAG_Bool(REGB1
)) {
181 CALL_abstract_collection___SimpleCollection___add(closctx
->REG
[2])(closctx
->REG
[2], REGB0
);
183 REGB1
= TAG_Bool(false);
184 closctx
->REG
[5] = REGB1
;
186 REGB1
= TAG_Bool(true);
187 closctx
->REG
[6] = REGB1
;
190 REGB1
= TAG_Char('_');
191 REGB2
= TAG_Bool(IS_EQUAL_OO(REGB0
,REGB1
));
192 if (UNTAG_Bool(REGB2
)) {
194 /* ./../lib/standard//kernel.nit:347 */
195 REGB1
= TAG_Bool((REGB0
)==(REGB1
));
199 if (UNTAG_Bool(REGB2
)) {
200 REGB2
= TAG_Bool(!UNTAG_Bool(closctx
->REG
[5]));
202 REGB1
= TAG_Bool(false);
205 if (UNTAG_Bool(REGB2
)) {
207 CALL_abstract_collection___SimpleCollection___add(closctx
->REG
[2])(closctx
->REG
[2], REGB0
);
209 REGB2
= TAG_Bool(true);
210 closctx
->REG
[5] = REGB2
;
212 REGB2
= TAG_Bool(true);
213 closctx
->REG
[6] = REGB2
;
216 REGB2
= CALL_abstract_collection___MapRead___has_key(closctx
->REG
[0])(closctx
->REG
[0], REGB0
);
217 if (UNTAG_Bool(REGB2
)) {
219 if (UNTAG_Bool(closctx
->REG
[6])) {
221 REGB2
= TAG_Char('_');
222 CALL_abstract_collection___SimpleCollection___add(closctx
->REG
[2])(closctx
->REG
[2], REGB2
);
224 REGB2
= TAG_Char('_');
225 CALL_abstract_collection___SimpleCollection___add(closctx
->REG
[2])(closctx
->REG
[2], REGB2
);
228 fra
.me
.REG
[0] = CALL_abstract_collection___MapRead_____bra(closctx
->REG
[0])(closctx
->REG
[0], REGB0
);
229 CALL_abstract_collection___Sequence___append(closctx
->REG
[2])(closctx
->REG
[2], fra
.me
.REG
[0]);
231 REGB0
= TAG_Bool(false);
232 closctx
->REG
[6] = REGB0
;
234 REGB0
= TAG_Bool(false);
235 closctx
->REG
[5] = REGB0
;
239 stack_frame_head
= fra
.me
.prev
;
242 val_t
utils___Object___cmangle_table(val_t p0
){
243 struct {struct stack_frame_t me
; val_t MORE_REG
[1];} fra
;
247 static val_t once_value_1
; /* Once value */
248 static val_t once_value_2
; /* Once value */
249 static val_t once_value_3
; /* Once value */
250 static val_t once_value_4
; /* Once value */
251 static val_t once_value_5
; /* Once value */
252 static val_t once_value_6
; /* Once value */
253 static val_t once_value_7
; /* Once value */
254 static val_t once_value_8
; /* Once value */
255 static val_t once_value_9
; /* Once value */
256 static val_t once_value_10
; /* Once value */
257 static val_t once_value_11
; /* Once value */
258 static val_t once_value_12
; /* Once value */
259 fra
.me
.prev
= stack_frame_head
; stack_frame_head
= &fra
.me
;
260 fra
.me
.file
= LOCATE_utils
;
262 fra
.me
.meth
= LOCATE_utils___Object___cmangle_table
;
263 fra
.me
.has_broke
= 0;
265 fra
.me
.REG
[0] = NIT_NULL
;
266 fra
.me
.REG
[1] = NIT_NULL
;
269 fra
.me
.REG
[0] = NEW_HashMap_hash_collection___HashMap___init();
271 REGB0
= TAG_Char('+');
273 fra
.me
.REG
[1] = BOX_NativeString("plus");
275 fra
.me
.REG
[1] = NEW_String_string___String___with_native(fra
.me
.REG
[1], REGB1
);
276 once_value_1
= fra
.me
.REG
[1];
277 register_static_object(&once_value_1
);
278 } else fra
.me
.REG
[1] = once_value_1
;
279 fra
.me
.REG
[1] = fra
.me
.REG
[1];
280 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[0])(fra
.me
.REG
[0], REGB0
, fra
.me
.REG
[1]);
282 REGB0
= TAG_Char('-');
284 fra
.me
.REG
[1] = BOX_NativeString("minus");
286 fra
.me
.REG
[1] = NEW_String_string___String___with_native(fra
.me
.REG
[1], REGB1
);
287 once_value_2
= fra
.me
.REG
[1];
288 register_static_object(&once_value_2
);
289 } else fra
.me
.REG
[1] = once_value_2
;
290 fra
.me
.REG
[1] = fra
.me
.REG
[1];
291 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[0])(fra
.me
.REG
[0], REGB0
, fra
.me
.REG
[1]);
293 REGB0
= TAG_Char('*');
295 fra
.me
.REG
[1] = BOX_NativeString("star");
297 fra
.me
.REG
[1] = NEW_String_string___String___with_native(fra
.me
.REG
[1], REGB1
);
298 once_value_3
= fra
.me
.REG
[1];
299 register_static_object(&once_value_3
);
300 } else fra
.me
.REG
[1] = once_value_3
;
301 fra
.me
.REG
[1] = fra
.me
.REG
[1];
302 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[0])(fra
.me
.REG
[0], REGB0
, fra
.me
.REG
[1]);
304 REGB0
= TAG_Char('/');
306 fra
.me
.REG
[1] = BOX_NativeString("slash");
308 fra
.me
.REG
[1] = NEW_String_string___String___with_native(fra
.me
.REG
[1], REGB1
);
309 once_value_4
= fra
.me
.REG
[1];
310 register_static_object(&once_value_4
);
311 } else fra
.me
.REG
[1] = once_value_4
;
312 fra
.me
.REG
[1] = fra
.me
.REG
[1];
313 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[0])(fra
.me
.REG
[0], REGB0
, fra
.me
.REG
[1]);
315 REGB0
= TAG_Char('%');
317 fra
.me
.REG
[1] = BOX_NativeString("percent");
319 fra
.me
.REG
[1] = NEW_String_string___String___with_native(fra
.me
.REG
[1], REGB1
);
320 once_value_5
= fra
.me
.REG
[1];
321 register_static_object(&once_value_5
);
322 } else fra
.me
.REG
[1] = once_value_5
;
323 fra
.me
.REG
[1] = fra
.me
.REG
[1];
324 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[0])(fra
.me
.REG
[0], REGB0
, fra
.me
.REG
[1]);
326 REGB0
= TAG_Char('[');
328 fra
.me
.REG
[1] = BOX_NativeString("bra");
330 fra
.me
.REG
[1] = NEW_String_string___String___with_native(fra
.me
.REG
[1], REGB1
);
331 once_value_6
= fra
.me
.REG
[1];
332 register_static_object(&once_value_6
);
333 } else fra
.me
.REG
[1] = once_value_6
;
334 fra
.me
.REG
[1] = fra
.me
.REG
[1];
335 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[0])(fra
.me
.REG
[0], REGB0
, fra
.me
.REG
[1]);
337 REGB0
= TAG_Char('=');
339 fra
.me
.REG
[1] = BOX_NativeString("eq");
341 fra
.me
.REG
[1] = NEW_String_string___String___with_native(fra
.me
.REG
[1], REGB1
);
342 once_value_7
= fra
.me
.REG
[1];
343 register_static_object(&once_value_7
);
344 } else fra
.me
.REG
[1] = once_value_7
;
345 fra
.me
.REG
[1] = fra
.me
.REG
[1];
346 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[0])(fra
.me
.REG
[0], REGB0
, fra
.me
.REG
[1]);
348 REGB0
= TAG_Char('<');
350 fra
.me
.REG
[1] = BOX_NativeString("l");
352 fra
.me
.REG
[1] = NEW_String_string___String___with_native(fra
.me
.REG
[1], REGB1
);
353 once_value_8
= fra
.me
.REG
[1];
354 register_static_object(&once_value_8
);
355 } else fra
.me
.REG
[1] = once_value_8
;
356 fra
.me
.REG
[1] = fra
.me
.REG
[1];
357 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[0])(fra
.me
.REG
[0], REGB0
, fra
.me
.REG
[1]);
359 REGB0
= TAG_Char('>');
361 fra
.me
.REG
[1] = BOX_NativeString("g");
363 fra
.me
.REG
[1] = NEW_String_string___String___with_native(fra
.me
.REG
[1], REGB1
);
364 once_value_9
= fra
.me
.REG
[1];
365 register_static_object(&once_value_9
);
366 } else fra
.me
.REG
[1] = once_value_9
;
367 fra
.me
.REG
[1] = fra
.me
.REG
[1];
368 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[0])(fra
.me
.REG
[0], REGB0
, fra
.me
.REG
[1]);
370 REGB0
= TAG_Char('!');
371 if (!once_value_10
) {
372 fra
.me
.REG
[1] = BOX_NativeString("n");
374 fra
.me
.REG
[1] = NEW_String_string___String___with_native(fra
.me
.REG
[1], REGB1
);
375 once_value_10
= fra
.me
.REG
[1];
376 register_static_object(&once_value_10
);
377 } else fra
.me
.REG
[1] = once_value_10
;
378 fra
.me
.REG
[1] = fra
.me
.REG
[1];
379 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[0])(fra
.me
.REG
[0], REGB0
, fra
.me
.REG
[1]);
381 REGB0
= TAG_Char('_');
382 if (!once_value_11
) {
383 fra
.me
.REG
[1] = BOX_NativeString("u");
385 fra
.me
.REG
[1] = NEW_String_string___String___with_native(fra
.me
.REG
[1], REGB1
);
386 once_value_11
= fra
.me
.REG
[1];
387 register_static_object(&once_value_11
);
388 } else fra
.me
.REG
[1] = once_value_11
;
389 fra
.me
.REG
[1] = fra
.me
.REG
[1];
390 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[0])(fra
.me
.REG
[0], REGB0
, fra
.me
.REG
[1]);
392 REGB0
= TAG_Char('@');
393 if (!once_value_12
) {
394 fra
.me
.REG
[1] = BOX_NativeString("at");
396 fra
.me
.REG
[1] = NEW_String_string___String___with_native(fra
.me
.REG
[1], REGB1
);
397 once_value_12
= fra
.me
.REG
[1];
398 register_static_object(&once_value_12
);
399 } else fra
.me
.REG
[1] = once_value_12
;
400 fra
.me
.REG
[1] = fra
.me
.REG
[1];
401 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[0])(fra
.me
.REG
[0], REGB0
, fra
.me
.REG
[1]);
405 stack_frame_head
= fra
.me
.prev
;
406 return fra
.me
.REG
[0];