1 /* This C file is generated by NIT to compile module string_search. */
2 #include "string_search._sep.h"
3 val_t
string_search___Pattern___search_index_in(val_t self
, val_t param0
, val_t param1
) {
4 struct trace_t trace
= {NULL
, NULL
, 21, LOCATE_string_search___Pattern___search_index_in
};
5 val_t
*variable
= NULL
;
6 struct WBT_
**closurevariable
= NULL
;
7 trace
.prev
= tracehead
; tracehead
= &trace
;
8 trace
.file
= LOCATE_string_search
;
9 fprintf(stderr
, "Deferred method called");
10 fprintf(stderr
, " (%s:%d)\n", LOCATE_string_search
, 21);
12 tracehead
= trace
.prev
;
15 val_t
string_search___Pattern___search_in(val_t self
, val_t param0
, val_t param1
) {
16 struct trace_t trace
= {NULL
, NULL
, 26, LOCATE_string_search___Pattern___search_in
};
17 val_t
*variable
= NULL
;
18 struct WBT_
**closurevariable
= NULL
;
19 trace
.prev
= tracehead
; tracehead
= &trace
;
20 trace
.file
= LOCATE_string_search
;
21 fprintf(stderr
, "Deferred method called");
22 fprintf(stderr
, " (%s:%d)\n", LOCATE_string_search
, 26);
24 tracehead
= trace
.prev
;
27 val_t
string_search___Pattern___search_all_in(val_t self
, val_t param0
) {
28 struct trace_t trace
= {NULL
, NULL
, 30, LOCATE_string_search___Pattern___search_all_in
};
30 struct WBT_
**closurevariable
= NULL
;
31 trace
.prev
= tracehead
; tracehead
= &trace
;
32 trace
.file
= LOCATE_string_search
;
33 /* Register variable[0]: Local variable */
35 /* Register variable[1]: Local variable */
37 /* Register variable[2]: Method return value and escape marker */
38 /* Register variable[3]: Local variable */
39 /* Register variable[4]: Result */
40 variable
[4] = NEW_Array_array___Array___init() /*new Array[Match]*/;
41 variable
[3] = variable
[4];
42 /* Register variable[4]: Local variable */
43 /* Register variable[5]: Result */
44 variable
[5] = CALL_string_search___Pattern___search_in(variable
[0])(variable
[0], variable
[1] /*s*/, TAG_Int(0)) /*Pattern::search_in*/;
45 variable
[4] = variable
[5];
46 while (true) { /*while*/
47 /* Register variable[5]: Result */
48 variable
[5] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable
[4] /*match*/ == NIT_NULL
/*null*/) || (( variable
[4] /*match*/ != NIT_NULL
) && ((CALL_kernel___Object_____eqeq( variable
[4] /*match*/)==kernel___Object_____eqeq
)?
(IS_EQUAL_NN( variable
[4] /*match*/, NIT_NULL
/*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable
[4] /*match*/)( variable
[4] /*match*/, NIT_NULL
/*null*/) /*Object::==*/)))))));
49 if (!UNTAG_Bool(variable
[5])) break; /* while*/
50 CALL_abstract_collection___SimpleCollection___add( variable
[3] /*res*/)( variable
[3] /*res*/, variable
[4] /*match*/) /*AbstractArray::add*/;
51 /* Register variable[5]: Result */
52 variable
[5] = CALL_string_search___Match___after( variable
[4] /*match*/)( variable
[4] /*match*/) /*Match::after*/;
53 /* Register variable[5]: Result */
54 variable
[5] = CALL_string_search___Pattern___search_in(variable
[0])(variable
[0], variable
[1] /*s*/, variable
[5]) /*Pattern::search_in*/;
55 variable
[4] = variable
[5] /*match=*/;
59 variable
[2] = variable
[3] /*res*/;
61 return_label0
: while(false);
62 tracehead
= trace
.prev
;
65 val_t
string_search___Pattern___split_in(val_t self
, val_t param0
) {
66 struct trace_t trace
= {NULL
, NULL
, 42, LOCATE_string_search___Pattern___split_in
};
68 struct WBT_
**closurevariable
= NULL
;
69 trace
.prev
= tracehead
; tracehead
= &trace
;
70 trace
.file
= LOCATE_string_search
;
71 /* Register variable[0]: Local variable */
73 /* Register variable[1]: Local variable */
75 /* Register variable[2]: Method return value and escape marker */
76 /* Register variable[3]: Local variable */
77 /* Register variable[4]: Result */
78 variable
[4] = NEW_Array_array___Array___init() /*new Array[Match]*/;
79 variable
[3] = variable
[4];
80 /* Register variable[4]: Local variable */
81 variable
[4] = TAG_Int(0);
82 /* Register variable[5]: Local variable */
83 /* Register variable[6]: Result */
84 variable
[6] = CALL_string_search___Pattern___search_in(variable
[0])(variable
[0], variable
[1] /*s*/, TAG_Int(0)) /*Pattern::search_in*/;
85 variable
[5] = variable
[6];
86 while (true) { /*while*/
87 /* Register variable[6]: Result */
88 variable
[6] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable
[5] /*match*/ == NIT_NULL
/*null*/) || (( variable
[5] /*match*/ != NIT_NULL
) && ((CALL_kernel___Object_____eqeq( variable
[5] /*match*/)==kernel___Object_____eqeq
)?
(IS_EQUAL_NN( variable
[5] /*match*/, NIT_NULL
/*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable
[5] /*match*/)( variable
[5] /*match*/, NIT_NULL
/*null*/) /*Object::==*/)))))));
89 if (!UNTAG_Bool(variable
[6])) break; /* while*/
90 /* Register variable[6]: Local variable */
91 /* Register variable[7]: Result */
92 variable
[7] = CALL_string_search___Match___from( variable
[5] /*match*/)( variable
[5] /*match*/) /*Match::from*/;
93 /* Register variable[7]: Result */
94 variable
[7] = TAG_Int(UNTAG_Int(variable
[7])-UNTAG_Int( variable
[4] /*i*/));
95 variable
[6] = variable
[7];
96 /* Register variable[7]: Result */
97 variable
[7] = NEW_Match_string_search___Match___init( variable
[1] /*s*/, variable
[4] /*i*/, variable
[6] /*len*/) /*new Match*/;
98 CALL_abstract_collection___SimpleCollection___add( variable
[3] /*res*/)( variable
[3] /*res*/, variable
[7]) /*AbstractArray::add*/;
99 /* Register variable[7]: Result */
100 variable
[7] = CALL_string_search___Match___after( variable
[5] /*match*/)( variable
[5] /*match*/) /*Match::after*/;
101 variable
[4] = variable
[7] /*i=*/;
102 /* Register variable[7]: Result */
103 variable
[7] = CALL_string_search___Pattern___search_in(variable
[0])(variable
[0], variable
[1] /*s*/, variable
[4] /*i*/) /*Pattern::search_in*/;
104 variable
[5] = variable
[7] /*match=*/;
105 continue_3
: while(0);
108 /* Register variable[6]: Result */
109 variable
[6] = CALL_abstract_collection___Collection___length( variable
[1] /*s*/)( variable
[1] /*s*/) /*AbstractArrayRead::length*/;
110 /* Register variable[6]: Result */
111 variable
[6] = TAG_Int(UNTAG_Int(variable
[6])-UNTAG_Int( variable
[4] /*i*/));
112 /* Register variable[6]: Result */
113 variable
[6] = NEW_Match_string_search___Match___init( variable
[1] /*s*/, variable
[4] /*i*/, variable
[6]) /*new Match*/;
114 CALL_abstract_collection___SimpleCollection___add( variable
[3] /*res*/)( variable
[3] /*res*/, variable
[6]) /*AbstractArray::add*/;
115 variable
[2] = variable
[3] /*res*/;
117 return_label2
: while(false);
118 tracehead
= trace
.prev
;
121 void string_search___Pattern___init(val_t self
, int* init_table
) {
122 struct trace_t trace
= {NULL
, NULL
, 0, LOCATE_string_search___Pattern___init
};
123 val_t
*variable
= NULL
;
124 struct WBT_
**closurevariable
= NULL
;
125 trace
.prev
= tracehead
; tracehead
= &trace
;
126 trace
.file
= LOCATE_string_search
;
127 tracehead
= trace
.prev
;
130 val_t
string_search___BM_Pattern___to_s(val_t self
) {
131 struct trace_t trace
= {NULL
, NULL
, 67, LOCATE_string_search___BM_Pattern___to_s
};
133 struct WBT_
**closurevariable
= NULL
;
134 trace
.prev
= tracehead
; tracehead
= &trace
;
135 trace
.file
= LOCATE_string_search
;
136 /* Register variable[0]: Local variable */
138 /* Register variable[1]: Method return value and escape marker */
139 /* Register variable[2]: Result */
140 variable
[2] = ATTR_string_search___BM_Pattern____motif(variable
[0]) /*BM_Pattern::_motif*/;
141 variable
[1] = variable
[2];
143 return_label4
: while(false);
144 tracehead
= trace
.prev
;
147 val_t
string_search___BM_Pattern___search_index_in(val_t self
, val_t param0
, val_t param1
) {
148 struct trace_t trace
= {NULL
, NULL
, 69, LOCATE_string_search___BM_Pattern___search_index_in
};
150 struct WBT_
**closurevariable
= NULL
;
151 trace
.prev
= tracehead
; tracehead
= &trace
;
152 trace
.file
= LOCATE_string_search
;
153 /* Register variable[0]: Local variable */
155 /* Register variable[1]: Local variable */
156 variable
[1] = param0
;
157 /* Register variable[2]: Local variable */
158 variable
[2] = param1
;
159 /* Register variable[3]: Method return value and escape marker */
160 /* Register variable[4]: Result */
161 variable
[4] = TAG_Bool(UNTAG_Int( variable
[2] /*from*/)>=UNTAG_Int( TAG_Int(0)));
162 if (!UNTAG_Bool(variable
[4])) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_string_search___BM_Pattern___search_index_in
, LOCATE_string_search
, 72); nit_exit(1);}
163 /* Register variable[4]: Local variable */
164 /* Register variable[5]: Result */
165 variable
[5] = CALL_abstract_collection___Collection___length( variable
[1] /*s*/)( variable
[1] /*s*/) /*AbstractArrayRead::length*/;
166 variable
[4] = variable
[5];
167 /* Register variable[5]: Local variable */
168 /* Register variable[6]: Result */
169 variable
[6] = ATTR_string_search___BM_Pattern____length(variable
[0]) /*BM_Pattern::_length*/;
170 variable
[5] = variable
[6];
171 /* Register variable[6]: Local variable */
172 variable
[6] = variable
[2] /*from*/;
173 while (true) { /*while*/
174 /* Register variable[7]: Result */
175 variable
[7] = TAG_Int(UNTAG_Int( variable
[4] /*n*/)-UNTAG_Int( variable
[5] /*m*/));
176 /* Register variable[7]: Result */
177 variable
[7] = TAG_Int(UNTAG_Int(variable
[7])+UNTAG_Int( TAG_Int(1)));
178 /* Register variable[7]: Result */
179 variable
[7] = TAG_Bool(UNTAG_Int( variable
[6] /*j*/)<UNTAG_Int(variable
[7]));
180 if (!UNTAG_Bool(variable
[7])) break; /* while*/
181 /* Register variable[7]: Local variable */
182 /* Register variable[8]: Result */
183 variable
[8] = TAG_Int(UNTAG_Int( variable
[5] /*m*/)-UNTAG_Int( TAG_Int(1)));
184 variable
[7] = variable
[8];
185 while (true) { /*while*/
186 /* Register variable[8]: Result */
187 variable
[8] = TAG_Bool(UNTAG_Int( variable
[7] /*i*/)>=UNTAG_Int( TAG_Int(0)));
188 /* Ensure var variable[8]: Left 'and' operand*/
189 if (UNTAG_Bool(variable
[8])) { /* and */
190 /* Register variable[8]: Result */
191 variable
[8] = ATTR_string_search___BM_Pattern____motif(variable
[0]) /*BM_Pattern::_motif*/;
192 /* Register variable[8]: Result */
193 variable
[8] = CALL_abstract_collection___MapRead_____bra(variable
[8])(variable
[8], variable
[7] /*i*/) /*AbstractString::[]*/;
194 /* Register variable[9]: Result */
195 variable
[9] = TAG_Int(UNTAG_Int( variable
[7] /*i*/)+UNTAG_Int( variable
[6] /*j*/));
196 /* Register variable[9]: Result */
197 variable
[9] = CALL_abstract_collection___MapRead_____bra( variable
[1] /*s*/)( variable
[1] /*s*/, variable
[9]) /*AbstractString::[]*/;
198 /* Register variable[8]: Result */
199 variable
[8] = TAG_Bool((variable
[8])==(variable
[9]));
201 /* Register variable[8]: Result */
202 if (!UNTAG_Bool(variable
[8])) break; /* while*/
203 variable
[7] = TAG_Int(UNTAG_Int(variable
[7])-UNTAG_Int( TAG_Int(1))) /*i*/;
204 continue_7
: while(0);
207 /* Register variable[8]: Result */
208 variable
[8] = TAG_Bool(UNTAG_Int( variable
[7] /*i*/)<UNTAG_Int( TAG_Int(0)));
209 if (UNTAG_Bool(variable
[8])) { /*if*/
210 variable
[3] = variable
[6] /*j*/;
213 /* Register variable[8]: Local variable */
214 /* Register variable[9]: Result */
215 variable
[9] = ATTR_string_search___BM_Pattern____gs(variable
[0]) /*BM_Pattern::_gs*/;
216 /* Register variable[10]: Local variable */
217 variable
[10] = variable
[9];
218 /* Register variable[11]: Local variable */
219 variable
[11] = variable
[7] /*i*/;
220 /* Register variable[12]: Method return value and escape marker */
221 /* Register variable[13]: Result */
222 variable
[13] = TAG_Bool(UNTAG_Int( variable
[11] /*index*/)>=UNTAG_Int( TAG_Int(0)));
223 /* Ensure var variable[13]: Left 'and' operand*/
224 if (UNTAG_Bool(variable
[13])) { /* and */
225 /* Register variable[13]: Result */
226 variable
[13] = ATTR_array___AbstractArrayRead____length(variable
[10]) /*AbstractArrayRead::_length*/;
227 /* Register variable[13]: Result */
228 variable
[13] = TAG_Bool(UNTAG_Int( variable
[11] /*index*/)<UNTAG_Int(variable
[13]));
230 /* Register variable[13]: Result */
231 if (!UNTAG_Bool(variable
[13])) { fprintf(stderr
, "Assert%s failed", " 'index' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_string_search
, 234); nit_exit(1);}
232 /* Register variable[13]: Result */
233 variable
[13] = ATTR_array___Array____items(variable
[10]) /*Array::_items*/;
234 /* Register variable[13]: Result */
235 variable
[13] = UNBOX_NativeArray(variable
[13])[UNTAG_Int( variable
[11] /*index*/)];
236 variable
[12] = variable
[13];
238 return_label8
: while(false);
239 /* Register variable[9]: Result */
240 variable
[9] = variable
[12];
241 variable
[8] = variable
[9];
242 /* Register variable[9]: Local variable */
243 /* Register variable[10]: Result */
244 variable
[10] = TAG_Int(UNTAG_Int( variable
[7] /*i*/)+UNTAG_Int( variable
[6] /*j*/));
245 /* Register variable[10]: Result */
246 variable
[10] = CALL_abstract_collection___MapRead_____bra( variable
[1] /*s*/)( variable
[1] /*s*/, variable
[10]) /*AbstractString::[]*/;
247 /* Register variable[10]: Result */
248 variable
[10] = CALL_string_search___BM_Pattern___bc(variable
[0])(variable
[0], variable
[10]) /*BM_Pattern::bc*/;
249 /* Register variable[10]: Result */
250 variable
[10] = TAG_Int(UNTAG_Int(variable
[10])-UNTAG_Int( variable
[5] /*m*/));
251 /* Register variable[10]: Result */
252 variable
[10] = TAG_Int(UNTAG_Int(variable
[10])+UNTAG_Int( TAG_Int(1)));
253 /* Register variable[10]: Result */
254 variable
[10] = TAG_Int(UNTAG_Int(variable
[10])+UNTAG_Int( variable
[7] /*i*/));
255 variable
[9] = variable
[10];
256 /* Register variable[10]: Result */
257 variable
[10] = TAG_Bool(UNTAG_Int( variable
[8] /*gs*/)>UNTAG_Int( variable
[9] /*bc*/));
258 if (UNTAG_Bool(variable
[10])) { /*if*/
259 variable
[6] = TAG_Int(UNTAG_Int(variable
[6])+UNTAG_Int( variable
[8] /*gs*/)) /*j*/;
261 variable
[6] = TAG_Int(UNTAG_Int(variable
[6])+UNTAG_Int( variable
[9] /*bc*/)) /*j*/;
264 continue_6
: while(0);
267 /* Register variable[7]: Result */
268 variable
[7] = TAG_Int(-UNTAG_Int( TAG_Int(1)));
269 variable
[3] = variable
[7];
271 return_label5
: while(false);
272 tracehead
= trace
.prev
;
275 val_t
string_search___BM_Pattern___search_in(val_t self
, val_t param0
, val_t param1
) {
276 struct trace_t trace
= {NULL
, NULL
, 96, LOCATE_string_search___BM_Pattern___search_in
};
278 struct WBT_
**closurevariable
= NULL
;
279 trace
.prev
= tracehead
; tracehead
= &trace
;
280 trace
.file
= LOCATE_string_search
;
281 /* Register variable[0]: Local variable */
283 /* Register variable[1]: Local variable */
284 variable
[1] = param0
;
285 /* Register variable[2]: Local variable */
286 variable
[2] = param1
;
287 /* Register variable[3]: Method return value and escape marker */
288 /* Register variable[4]: Local variable */
289 /* Register variable[5]: Result */
290 variable
[5] = CALL_string_search___Pattern___search_index_in(variable
[0])(variable
[0], variable
[1] /*s*/, variable
[2] /*from*/) /*BM_Pattern::search_index_in*/;
291 variable
[4] = variable
[5];
292 /* Register variable[5]: Result */
293 variable
[5] = TAG_Bool(UNTAG_Int( variable
[4] /*to*/)<UNTAG_Int( TAG_Int(0)));
294 if (UNTAG_Bool(variable
[5])) { /*if*/
295 variable
[3] = NIT_NULL
/*null*/;
298 /* Register variable[5]: Result */
299 variable
[5] = ATTR_string_search___BM_Pattern____length(variable
[0]) /*BM_Pattern::_length*/;
300 /* Register variable[5]: Result */
301 variable
[5] = NEW_Match_string_search___Match___init( variable
[1] /*s*/, variable
[4] /*to*/, variable
[5]) /*new Match*/;
302 variable
[3] = variable
[5];
305 return_label9
: while(false);
306 tracehead
= trace
.prev
;
309 void string_search___BM_Pattern___init(val_t self
, val_t param0
, int* init_table
) {
310 struct trace_t trace
= {NULL
, NULL
, 107, LOCATE_string_search___BM_Pattern___init
};
312 struct WBT_
**closurevariable
= NULL
;
313 trace
.prev
= tracehead
; tracehead
= &trace
;
314 trace
.file
= LOCATE_string_search
;
315 /* Register variable[0]: Local variable */
317 /* Register variable[1]: Local variable */
318 variable
[1] = param0
;
319 if (init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_BM_Pattern
].i
]) return;
320 /* Register variable[2]: Method return value and escape marker */
321 ATTR_string_search___BM_Pattern____motif(variable
[0]) /*BM_Pattern::_motif*/ = variable
[1] /*motif*/;
322 /* Register variable[3]: Result */
323 variable
[3] = CALL_abstract_collection___Collection___length( variable
[1] /*motif*/)( variable
[1] /*motif*/) /*AbstractArrayRead::length*/;
324 ATTR_string_search___BM_Pattern____length(variable
[0]) /*BM_Pattern::_length*/ = variable
[3];
325 /* Register variable[3]: Result */
326 variable
[3] = ATTR_string_search___BM_Pattern____length(variable
[0]) /*BM_Pattern::_length*/;
327 /* Register variable[3]: Result */
328 variable
[3] = NEW_Array_array___Array___with_capacity(variable
[3]) /*new Array[Int]*/;
329 ATTR_string_search___BM_Pattern____gs(variable
[0]) /*BM_Pattern::_gs*/ = variable
[3];
330 /* Register variable[3]: Result */
331 variable
[3] = NEW_ArrayMap_array___ArrayMap___init() /*new ArrayMap[Char, Int]*/;
332 ATTR_string_search___BM_Pattern____bc_table(variable
[0]) /*BM_Pattern::_bc_table*/ = variable
[3];
333 CALL_string_search___BM_Pattern___compute_gs(variable
[0])(variable
[0]) /*BM_Pattern::compute_gs*/;
334 CALL_string_search___BM_Pattern___compute_bc(variable
[0])(variable
[0]) /*BM_Pattern::compute_bc*/;
335 return_label10
: while(false);
336 init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_BM_Pattern
].i
] = 1;
337 tracehead
= trace
.prev
;
340 val_t
string_search___BM_Pattern___bc(val_t self
, val_t param0
) {
341 struct trace_t trace
= {NULL
, NULL
, 124, LOCATE_string_search___BM_Pattern___bc
};
343 struct WBT_
**closurevariable
= NULL
;
344 trace
.prev
= tracehead
; tracehead
= &trace
;
345 trace
.file
= LOCATE_string_search
;
346 /* Register variable[0]: Local variable */
348 /* Register variable[1]: Local variable */
349 variable
[1] = param0
;
350 /* Register variable[2]: Method return value and escape marker */
351 /* Register variable[3]: Result */
352 variable
[3] = ATTR_string_search___BM_Pattern____bc_table(variable
[0]) /*BM_Pattern::_bc_table*/;
353 /* Register variable[3]: Result */
354 variable
[3] = CALL_abstract_collection___MapRead___has_key(variable
[3])(variable
[3], variable
[1] /*e*/) /*MapRead::has_key*/;
355 if (UNTAG_Bool(variable
[3])) { /*if*/
356 /* Register variable[3]: Result */
357 variable
[3] = ATTR_string_search___BM_Pattern____bc_table(variable
[0]) /*BM_Pattern::_bc_table*/;
358 /* Register variable[3]: Result */
359 variable
[3] = CALL_abstract_collection___MapRead_____bra(variable
[3])(variable
[3], variable
[1] /*e*/) /*MapRead::[]*/;
360 variable
[2] = variable
[3];
363 /* Register variable[3]: Result */
364 variable
[3] = ATTR_string_search___BM_Pattern____length(variable
[0]) /*BM_Pattern::_length*/;
365 variable
[2] = variable
[3];
368 return_label11
: while(false);
369 tracehead
= trace
.prev
;
372 void string_search___BM_Pattern___compute_bc(val_t self
) {
373 struct trace_t trace
= {NULL
, NULL
, 139, LOCATE_string_search___BM_Pattern___compute_bc
};
375 struct WBT_
**closurevariable
= NULL
;
376 trace
.prev
= tracehead
; tracehead
= &trace
;
377 trace
.file
= LOCATE_string_search
;
378 /* Register variable[0]: Local variable */
380 /* Register variable[1]: Method return value and escape marker */
381 /* Register variable[2]: Local variable */
382 /* Register variable[3]: Result */
383 variable
[3] = ATTR_string_search___BM_Pattern____motif(variable
[0]) /*BM_Pattern::_motif*/;
384 variable
[2] = variable
[3];
385 /* Register variable[3]: Local variable */
386 /* Register variable[4]: Result */
387 variable
[4] = ATTR_string_search___BM_Pattern____length(variable
[0]) /*BM_Pattern::_length*/;
388 variable
[3] = variable
[4];
389 /* Register variable[4]: Local variable */
390 variable
[4] = TAG_Int(0);
391 while (true) { /*while*/
392 /* Register variable[5]: Result */
393 variable
[5] = TAG_Int(UNTAG_Int( variable
[3] /*m*/)-UNTAG_Int( TAG_Int(1)));
394 /* Register variable[5]: Result */
395 variable
[5] = TAG_Bool(UNTAG_Int( variable
[4] /*i*/)<UNTAG_Int(variable
[5]));
396 if (!UNTAG_Bool(variable
[5])) break; /* while*/
397 /* Register variable[5]: Result */
398 variable
[5] = ATTR_string_search___BM_Pattern____bc_table(variable
[0]) /*BM_Pattern::_bc_table*/;
399 /* Register variable[6]: Result */
400 variable
[6] = CALL_abstract_collection___MapRead_____bra( variable
[2] /*x*/)( variable
[2] /*x*/, variable
[4] /*i*/) /*AbstractString::[]*/;
401 /* Register variable[7]: Result */
402 variable
[7] = TAG_Int(UNTAG_Int( variable
[3] /*m*/)-UNTAG_Int( variable
[4] /*i*/));
403 /* Register variable[7]: Result */
404 variable
[7] = TAG_Int(UNTAG_Int(variable
[7])-UNTAG_Int( TAG_Int(1)));
405 CALL_abstract_collection___Map_____braeq(variable
[5])(variable
[5], variable
[6], variable
[7]) /*Map::[]=*/;
406 variable
[4] = TAG_Int(UNTAG_Int(variable
[4])+UNTAG_Int( TAG_Int(1))) /*i*/;
407 continue_13
: while(0);
410 return_label12
: while(false);
411 tracehead
= trace
.prev
;
414 val_t
string_search___BM_Pattern___suffixes(val_t self
) {
415 struct trace_t trace
= {NULL
, NULL
, 150, LOCATE_string_search___BM_Pattern___suffixes
};
417 struct WBT_
**closurevariable
= NULL
;
418 trace
.prev
= tracehead
; tracehead
= &trace
;
419 trace
.file
= LOCATE_string_search
;
420 /* Register variable[0]: Local variable */
422 /* Register variable[1]: Method return value and escape marker */
423 /* Register variable[2]: Local variable */
424 /* Register variable[3]: Result */
425 variable
[3] = ATTR_string_search___BM_Pattern____motif(variable
[0]) /*BM_Pattern::_motif*/;
426 variable
[2] = variable
[3];
427 /* Register variable[3]: Local variable */
428 /* Register variable[4]: Result */
429 variable
[4] = ATTR_string_search___BM_Pattern____length(variable
[0]) /*BM_Pattern::_length*/;
430 variable
[3] = variable
[4];
431 /* Register variable[4]: Local variable */
432 /* Register variable[5]: Result */
433 variable
[5] = NEW_Array_array___Array___filled_with( variable
[3] /*m*/, variable
[3] /*m*/) /*new Array[Int]*/;
434 variable
[4] = variable
[5];
435 /* Register variable[5]: Local variable */
436 variable
[5] = TAG_Int(0);
437 /* Register variable[6]: Local variable */
438 /* Register variable[7]: Result */
439 variable
[7] = TAG_Int(UNTAG_Int( variable
[3] /*m*/)-UNTAG_Int( TAG_Int(1)));
440 variable
[6] = variable
[7];
441 /* Register variable[7]: Local variable */
442 /* Register variable[8]: Result */
443 variable
[8] = TAG_Int(UNTAG_Int( variable
[3] /*m*/)-UNTAG_Int( TAG_Int(2)));
444 variable
[7] = variable
[8];
445 while (true) { /*while*/
446 /* Register variable[8]: Result */
447 variable
[8] = TAG_Bool(UNTAG_Int( variable
[7] /*i*/)>=UNTAG_Int( TAG_Int(0)));
448 if (!UNTAG_Bool(variable
[8])) break; /* while*/
449 /* Register variable[8]: Result */
450 variable
[8] = TAG_Bool(UNTAG_Int( variable
[7] /*i*/)>UNTAG_Int( variable
[6] /*g*/));
451 /* Ensure var variable[8]: Left 'and' operand*/
452 if (UNTAG_Bool(variable
[8])) { /* and */
453 /* Register variable[8]: Result */
454 variable
[8] = TAG_Int(UNTAG_Int( variable
[7] /*i*/)+UNTAG_Int( variable
[3] /*m*/));
455 /* Register variable[8]: Result */
456 variable
[8] = TAG_Int(UNTAG_Int(variable
[8])-UNTAG_Int( TAG_Int(1)));
457 /* Register variable[8]: Result */
458 variable
[8] = TAG_Int(UNTAG_Int(variable
[8])-UNTAG_Int( variable
[5] /*f*/));
459 /* Register variable[9]: Local variable */
460 variable
[9] = variable
[4] /*suff*/;
461 /* Register variable[10]: Local variable */
462 variable
[10] = variable
[8];
463 /* Register variable[11]: Method return value and escape marker */
464 /* Register variable[12]: Result */
465 variable
[12] = TAG_Bool(UNTAG_Int( variable
[10] /*index*/)>=UNTAG_Int( TAG_Int(0)));
466 /* Ensure var variable[12]: Left 'and' operand*/
467 if (UNTAG_Bool(variable
[12])) { /* and */
468 /* Register variable[12]: Result */
469 variable
[12] = ATTR_array___AbstractArrayRead____length(variable
[9]) /*AbstractArrayRead::_length*/;
470 /* Register variable[12]: Result */
471 variable
[12] = TAG_Bool(UNTAG_Int( variable
[10] /*index*/)<UNTAG_Int(variable
[12]));
473 /* Register variable[12]: Result */
474 if (!UNTAG_Bool(variable
[12])) { fprintf(stderr
, "Assert%s failed", " 'index' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_string_search
, 234); nit_exit(1);}
475 /* Register variable[12]: Result */
476 variable
[12] = ATTR_array___Array____items(variable
[9]) /*Array::_items*/;
477 /* Register variable[12]: Result */
478 variable
[12] = UNBOX_NativeArray(variable
[12])[UNTAG_Int( variable
[10] /*index*/)];
479 variable
[11] = variable
[12];
481 return_label16
: while(false);
482 /* Register variable[8]: Result */
483 variable
[8] = variable
[11];
484 /* Register variable[9]: Result */
485 variable
[9] = TAG_Int(UNTAG_Int( variable
[7] /*i*/)-UNTAG_Int( variable
[6] /*g*/));
486 /* Register variable[8]: Result */
487 variable
[8] = TAG_Bool(UNTAG_Int(variable
[8])<UNTAG_Int(variable
[9]));
489 /* Register variable[8]: Result */
490 if (UNTAG_Bool(variable
[8])) { /*if*/
491 /* Register variable[8]: Result */
492 variable
[8] = TAG_Int(UNTAG_Int( variable
[7] /*i*/)+UNTAG_Int( variable
[3] /*m*/));
493 /* Register variable[8]: Result */
494 variable
[8] = TAG_Int(UNTAG_Int(variable
[8])-UNTAG_Int( TAG_Int(1)));
495 /* Register variable[8]: Result */
496 variable
[8] = TAG_Int(UNTAG_Int(variable
[8])-UNTAG_Int( variable
[5] /*f*/));
497 /* Register variable[9]: Local variable */
498 variable
[9] = variable
[4] /*suff*/;
499 /* Register variable[10]: Local variable */
500 variable
[10] = variable
[8];
501 /* Register variable[11]: Method return value and escape marker */
502 /* Register variable[12]: Result */
503 variable
[12] = TAG_Bool(UNTAG_Int( variable
[10] /*index*/)>=UNTAG_Int( TAG_Int(0)));
504 /* Ensure var variable[12]: Left 'and' operand*/
505 if (UNTAG_Bool(variable
[12])) { /* and */
506 /* Register variable[12]: Result */
507 variable
[12] = ATTR_array___AbstractArrayRead____length(variable
[9]) /*AbstractArrayRead::_length*/;
508 /* Register variable[12]: Result */
509 variable
[12] = TAG_Bool(UNTAG_Int( variable
[10] /*index*/)<UNTAG_Int(variable
[12]));
511 /* Register variable[12]: Result */
512 if (!UNTAG_Bool(variable
[12])) { fprintf(stderr
, "Assert%s failed", " 'index' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_string_search
, 234); nit_exit(1);}
513 /* Register variable[12]: Result */
514 variable
[12] = ATTR_array___Array____items(variable
[9]) /*Array::_items*/;
515 /* Register variable[12]: Result */
516 variable
[12] = UNBOX_NativeArray(variable
[12])[UNTAG_Int( variable
[10] /*index*/)];
517 variable
[11] = variable
[12];
519 return_label17
: while(false);
520 /* Register variable[8]: Result */
521 variable
[8] = variable
[11];
522 CALL_abstract_collection___Map_____braeq( variable
[4] /*suff*/)( variable
[4] /*suff*/, variable
[7] /*i*/, variable
[8]) /*Array::[]=*/;
524 /* Register variable[8]: Result */
525 variable
[8] = TAG_Bool(UNTAG_Int( variable
[7] /*i*/)<UNTAG_Int( variable
[6] /*g*/));
526 if (UNTAG_Bool(variable
[8])) { /*if*/
527 variable
[6] = variable
[7] /*i*/ /*g=*/;
529 variable
[5] = variable
[7] /*i*/ /*f=*/;
530 while (true) { /*while*/
531 /* Register variable[8]: Result */
532 variable
[8] = TAG_Bool(UNTAG_Int( variable
[6] /*g*/)>=UNTAG_Int( TAG_Int(0)));
533 /* Ensure var variable[8]: Left 'and' operand*/
534 if (UNTAG_Bool(variable
[8])) { /* and */
535 /* Register variable[8]: Result */
536 variable
[8] = CALL_abstract_collection___MapRead_____bra( variable
[2] /*x*/)( variable
[2] /*x*/, variable
[6] /*g*/) /*AbstractString::[]*/;
537 /* Register variable[9]: Result */
538 variable
[9] = TAG_Int(UNTAG_Int( variable
[6] /*g*/)+UNTAG_Int( variable
[3] /*m*/));
539 /* Register variable[9]: Result */
540 variable
[9] = TAG_Int(UNTAG_Int(variable
[9])-UNTAG_Int( TAG_Int(1)));
541 /* Register variable[9]: Result */
542 variable
[9] = TAG_Int(UNTAG_Int(variable
[9])-UNTAG_Int( variable
[5] /*f*/));
543 /* Register variable[9]: Result */
544 variable
[9] = CALL_abstract_collection___MapRead_____bra( variable
[2] /*x*/)( variable
[2] /*x*/, variable
[9]) /*AbstractString::[]*/;
545 /* Register variable[8]: Result */
546 variable
[8] = TAG_Bool((variable
[8])==(variable
[9]));
548 /* Register variable[8]: Result */
549 if (!UNTAG_Bool(variable
[8])) break; /* while*/
550 variable
[6] = TAG_Int(UNTAG_Int(variable
[6])-UNTAG_Int( TAG_Int(1))) /*g*/;
551 continue_18
: while(0);
554 /* Register variable[8]: Result */
555 variable
[8] = TAG_Int(UNTAG_Int( variable
[5] /*f*/)-UNTAG_Int( variable
[6] /*g*/));
556 CALL_abstract_collection___Map_____braeq( variable
[4] /*suff*/)( variable
[4] /*suff*/, variable
[7] /*i*/, variable
[8]) /*Array::[]=*/;
558 variable
[7] = TAG_Int(UNTAG_Int(variable
[7])-UNTAG_Int( TAG_Int(1))) /*i*/;
559 continue_15
: while(0);
562 variable
[1] = variable
[4] /*suff*/;
564 return_label14
: while(false);
565 tracehead
= trace
.prev
;
568 void string_search___BM_Pattern___compute_gs(val_t self
) {
569 struct trace_t trace
= {NULL
, NULL
, 173, LOCATE_string_search___BM_Pattern___compute_gs
};
571 struct WBT_
**closurevariable
= NULL
;
572 trace
.prev
= tracehead
; tracehead
= &trace
;
573 trace
.file
= LOCATE_string_search
;
574 /* Register variable[0]: Local variable */
576 /* Register variable[1]: Method return value and escape marker */
577 /* Register variable[2]: Local variable */
578 /* Register variable[3]: Result */
579 variable
[3] = ATTR_string_search___BM_Pattern____motif(variable
[0]) /*BM_Pattern::_motif*/;
580 variable
[2] = variable
[3];
581 /* Register variable[3]: Local variable */
582 /* Register variable[4]: Result */
583 variable
[4] = ATTR_string_search___BM_Pattern____length(variable
[0]) /*BM_Pattern::_length*/;
584 variable
[3] = variable
[4];
585 /* Register variable[4]: Local variable */
586 /* Register variable[5]: Result */
587 variable
[5] = CALL_string_search___BM_Pattern___suffixes(variable
[0])(variable
[0]) /*BM_Pattern::suffixes*/;
588 variable
[4] = variable
[5];
589 /* Register variable[5]: Local variable */
590 variable
[5] = TAG_Int(0);
591 while (true) { /*while*/
592 /* Register variable[6]: Result */
593 variable
[6] = TAG_Bool(UNTAG_Int( variable
[5] /*i*/)<UNTAG_Int( variable
[3] /*m*/));
594 if (!UNTAG_Bool(variable
[6])) break; /* while*/
595 /* Register variable[6]: Result */
596 variable
[6] = ATTR_string_search___BM_Pattern____gs(variable
[0]) /*BM_Pattern::_gs*/;
597 CALL_abstract_collection___Map_____braeq(variable
[6])(variable
[6], variable
[5] /*i*/, variable
[3] /*m*/) /*Array::[]=*/;
598 variable
[5] = TAG_Int(UNTAG_Int(variable
[5])+UNTAG_Int( TAG_Int(1))) /*i*/;
599 continue_20
: while(0);
602 /* Register variable[6]: Local variable */
603 variable
[6] = TAG_Int(0);
604 /* Register variable[7]: Result */
605 variable
[7] = TAG_Int(UNTAG_Int( variable
[3] /*m*/)-UNTAG_Int( TAG_Int(1)));
606 variable
[5] = variable
[7] /*i=*/;
607 while (true) { /*while*/
608 /* Register variable[7]: Result */
609 variable
[7] = TAG_Int(-UNTAG_Int( TAG_Int(1)));
610 /* Register variable[7]: Result */
611 variable
[7] = TAG_Bool(UNTAG_Int( variable
[5] /*i*/)>=UNTAG_Int(variable
[7]));
612 if (!UNTAG_Bool(variable
[7])) break; /* while*/
613 /* Register variable[7]: Result */
614 variable
[7] = TAG_Int(-UNTAG_Int( TAG_Int(1)));
615 /* Register variable[7]: Result */
616 variable
[7] = TAG_Bool(( variable
[5] /*i*/)==(variable
[7]));
617 /* Ensure var variable[7]: Left 'or' operand*/
618 if (!UNTAG_Bool(variable
[7])) { /* or */
619 /* Register variable[7]: Local variable */
620 variable
[7] = variable
[4] /*suff*/;
621 /* Register variable[8]: Local variable */
622 variable
[8] = variable
[5] /*i*/;
623 /* Register variable[9]: Method return value and escape marker */
624 /* Register variable[10]: Result */
625 variable
[10] = TAG_Bool(UNTAG_Int( variable
[8] /*index*/)>=UNTAG_Int( TAG_Int(0)));
626 /* Ensure var variable[10]: Left 'and' operand*/
627 if (UNTAG_Bool(variable
[10])) { /* and */
628 /* Register variable[10]: Result */
629 variable
[10] = ATTR_array___AbstractArrayRead____length(variable
[7]) /*AbstractArrayRead::_length*/;
630 /* Register variable[10]: Result */
631 variable
[10] = TAG_Bool(UNTAG_Int( variable
[8] /*index*/)<UNTAG_Int(variable
[10]));
633 /* Register variable[10]: Result */
634 if (!UNTAG_Bool(variable
[10])) { fprintf(stderr
, "Assert%s failed", " 'index' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_string_search
, 234); nit_exit(1);}
635 /* Register variable[10]: Result */
636 variable
[10] = ATTR_array___Array____items(variable
[7]) /*Array::_items*/;
637 /* Register variable[10]: Result */
638 variable
[10] = UNBOX_NativeArray(variable
[10])[UNTAG_Int( variable
[8] /*index*/)];
639 variable
[9] = variable
[10];
641 return_label22
: while(false);
642 /* Register variable[7]: Result */
643 variable
[7] = variable
[9];
644 /* Register variable[8]: Result */
645 variable
[8] = TAG_Int(UNTAG_Int( variable
[5] /*i*/)+UNTAG_Int( TAG_Int(1)));
646 /* Register variable[7]: Result */
647 variable
[7] = TAG_Bool((variable
[7])==(variable
[8]));
649 /* Register variable[7]: Result */
650 if (UNTAG_Bool(variable
[7])) { /*if*/
651 while (true) { /*while*/
652 /* Register variable[7]: Result */
653 variable
[7] = TAG_Int(UNTAG_Int( variable
[3] /*m*/)-UNTAG_Int( TAG_Int(1)));
654 /* Register variable[7]: Result */
655 variable
[7] = TAG_Int(UNTAG_Int(variable
[7])-UNTAG_Int( variable
[5] /*i*/));
656 /* Register variable[7]: Result */
657 variable
[7] = TAG_Bool(UNTAG_Int( variable
[6] /*j*/)<UNTAG_Int(variable
[7]));
658 if (!UNTAG_Bool(variable
[7])) break; /* while*/
659 /* Register variable[7]: Result */
660 variable
[7] = ATTR_string_search___BM_Pattern____gs(variable
[0]) /*BM_Pattern::_gs*/;
661 /* Register variable[8]: Local variable */
662 variable
[8] = variable
[7];
663 /* Register variable[9]: Local variable */
664 variable
[9] = variable
[6] /*j*/;
665 /* Register variable[10]: Method return value and escape marker */
666 /* Register variable[11]: Result */
667 variable
[11] = TAG_Bool(UNTAG_Int( variable
[9] /*index*/)>=UNTAG_Int( TAG_Int(0)));
668 /* Ensure var variable[11]: Left 'and' operand*/
669 if (UNTAG_Bool(variable
[11])) { /* and */
670 /* Register variable[11]: Result */
671 variable
[11] = ATTR_array___AbstractArrayRead____length(variable
[8]) /*AbstractArrayRead::_length*/;
672 /* Register variable[11]: Result */
673 variable
[11] = TAG_Bool(UNTAG_Int( variable
[9] /*index*/)<UNTAG_Int(variable
[11]));
675 /* Register variable[11]: Result */
676 if (!UNTAG_Bool(variable
[11])) { fprintf(stderr
, "Assert%s failed", " 'index' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_string_search
, 234); nit_exit(1);}
677 /* Register variable[11]: Result */
678 variable
[11] = ATTR_array___Array____items(variable
[8]) /*Array::_items*/;
679 /* Register variable[11]: Result */
680 variable
[11] = UNBOX_NativeArray(variable
[11])[UNTAG_Int( variable
[9] /*index*/)];
681 variable
[10] = variable
[11];
683 return_label24
: while(false);
684 /* Register variable[7]: Result */
685 variable
[7] = variable
[10];
686 /* Register variable[7]: Result */
687 variable
[7] = TAG_Bool((variable
[7])==( variable
[3] /*m*/));
688 if (UNTAG_Bool(variable
[7])) { /*if*/
689 /* Register variable[7]: Result */
690 variable
[7] = ATTR_string_search___BM_Pattern____gs(variable
[0]) /*BM_Pattern::_gs*/;
691 /* Register variable[8]: Result */
692 variable
[8] = TAG_Int(UNTAG_Int( variable
[3] /*m*/)-UNTAG_Int( TAG_Int(1)));
693 /* Register variable[8]: Result */
694 variable
[8] = TAG_Int(UNTAG_Int(variable
[8])-UNTAG_Int( variable
[5] /*i*/));
695 CALL_abstract_collection___Map_____braeq(variable
[7])(variable
[7], variable
[6] /*j*/, variable
[8]) /*Array::[]=*/;
697 variable
[6] = TAG_Int(UNTAG_Int(variable
[6])+UNTAG_Int( TAG_Int(1))) /*j*/;
698 continue_23
: while(0);
702 variable
[5] = TAG_Int(UNTAG_Int(variable
[5])-UNTAG_Int( TAG_Int(1))) /*i*/;
703 continue_21
: while(0);
706 variable
[5] = TAG_Int(0) /*i=*/;
707 while (true) { /*while*/
708 /* Register variable[7]: Result */
709 variable
[7] = TAG_Int(UNTAG_Int( variable
[3] /*m*/)-UNTAG_Int( TAG_Int(1)));
710 /* Register variable[7]: Result */
711 variable
[7] = TAG_Bool(UNTAG_Int( variable
[5] /*i*/)<UNTAG_Int(variable
[7]));
712 if (!UNTAG_Bool(variable
[7])) break; /* while*/
713 /* Register variable[7]: Result */
714 variable
[7] = ATTR_string_search___BM_Pattern____gs(variable
[0]) /*BM_Pattern::_gs*/;
715 /* Register variable[8]: Result */
716 variable
[8] = TAG_Int(UNTAG_Int( variable
[3] /*m*/)-UNTAG_Int( TAG_Int(1)));
717 /* Register variable[9]: Local variable */
718 variable
[9] = variable
[4] /*suff*/;
719 /* Register variable[10]: Local variable */
720 variable
[10] = variable
[5] /*i*/;
721 /* Register variable[11]: Method return value and escape marker */
722 /* Register variable[12]: Result */
723 variable
[12] = TAG_Bool(UNTAG_Int( variable
[10] /*index*/)>=UNTAG_Int( TAG_Int(0)));
724 /* Ensure var variable[12]: Left 'and' operand*/
725 if (UNTAG_Bool(variable
[12])) { /* and */
726 /* Register variable[12]: Result */
727 variable
[12] = ATTR_array___AbstractArrayRead____length(variable
[9]) /*AbstractArrayRead::_length*/;
728 /* Register variable[12]: Result */
729 variable
[12] = TAG_Bool(UNTAG_Int( variable
[10] /*index*/)<UNTAG_Int(variable
[12]));
731 /* Register variable[12]: Result */
732 if (!UNTAG_Bool(variable
[12])) { fprintf(stderr
, "Assert%s failed", " 'index' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_string_search
, 234); nit_exit(1);}
733 /* Register variable[12]: Result */
734 variable
[12] = ATTR_array___Array____items(variable
[9]) /*Array::_items*/;
735 /* Register variable[12]: Result */
736 variable
[12] = UNBOX_NativeArray(variable
[12])[UNTAG_Int( variable
[10] /*index*/)];
737 variable
[11] = variable
[12];
739 return_label26
: while(false);
740 /* Register variable[9]: Result */
741 variable
[9] = variable
[11];
742 /* Register variable[8]: Result */
743 variable
[8] = TAG_Int(UNTAG_Int(variable
[8])-UNTAG_Int(variable
[9]));
744 /* Register variable[9]: Result */
745 variable
[9] = TAG_Int(UNTAG_Int( variable
[3] /*m*/)-UNTAG_Int( TAG_Int(1)));
746 /* Register variable[9]: Result */
747 variable
[9] = TAG_Int(UNTAG_Int(variable
[9])-UNTAG_Int( variable
[5] /*i*/));
748 CALL_abstract_collection___Map_____braeq(variable
[7])(variable
[7], variable
[8], variable
[9]) /*Array::[]=*/;
749 variable
[5] = TAG_Int(UNTAG_Int(variable
[5])+UNTAG_Int( TAG_Int(1))) /*i*/;
750 continue_25
: while(0);
753 return_label19
: while(false);
754 tracehead
= trace
.prev
;
757 val_t
string_search___Match___to_s(val_t self
) {
758 struct trace_t trace
= {NULL
, NULL
, 217, LOCATE_string_search___Match___to_s
};
760 struct WBT_
**closurevariable
= NULL
;
761 trace
.prev
= tracehead
; tracehead
= &trace
;
762 trace
.file
= LOCATE_string_search
;
763 /* Register variable[0]: Local variable */
765 /* Register variable[1]: Method return value and escape marker */
766 /* Register variable[2]: Result */
767 variable
[2] = ATTR_string_search___Match____string(variable
[0]) /*Match::_string*/;
768 /* Register variable[3]: Result */
769 variable
[3] = ATTR_string_search___Match____from(variable
[0]) /*Match::_from*/;
770 /* Register variable[4]: Result */
771 variable
[4] = ATTR_string_search___Match____length(variable
[0]) /*Match::_length*/;
772 /* Register variable[2]: Result */
773 variable
[2] = CALL_string___AbstractString___substring(variable
[2])(variable
[2], variable
[3], variable
[4]) /*AbstractString::substring*/;
774 variable
[1] = variable
[2];
776 return_label27
: while(false);
777 tracehead
= trace
.prev
;
780 val_t
string_search___Match___string(val_t self
) {
781 struct trace_t trace
= {NULL
, NULL
, 204, LOCATE_string_search___Match___string
};
782 val_t
*variable
= NULL
;
783 struct WBT_
**closurevariable
= NULL
;
784 trace
.prev
= tracehead
; tracehead
= &trace
;
785 trace
.file
= LOCATE_string_search
;
786 tracehead
= trace
.prev
;
787 return ATTR_string_search___Match____string( self
) /*Match::_string*/;
789 val_t
string_search___Match___from(val_t self
) {
790 struct trace_t trace
= {NULL
, NULL
, 207, LOCATE_string_search___Match___from
};
791 val_t
*variable
= NULL
;
792 struct WBT_
**closurevariable
= NULL
;
793 trace
.prev
= tracehead
; tracehead
= &trace
;
794 trace
.file
= LOCATE_string_search
;
795 tracehead
= trace
.prev
;
796 return ATTR_string_search___Match____from( self
) /*Match::_from*/;
798 val_t
string_search___Match___length(val_t self
) {
799 struct trace_t trace
= {NULL
, NULL
, 210, LOCATE_string_search___Match___length
};
800 val_t
*variable
= NULL
;
801 struct WBT_
**closurevariable
= NULL
;
802 trace
.prev
= tracehead
; tracehead
= &trace
;
803 trace
.file
= LOCATE_string_search
;
804 tracehead
= trace
.prev
;
805 return ATTR_string_search___Match____length( self
) /*Match::_length*/;
807 val_t
string_search___Match___after(val_t self
) {
808 struct trace_t trace
= {NULL
, NULL
, 213, LOCATE_string_search___Match___after
};
810 struct WBT_
**closurevariable
= NULL
;
811 trace
.prev
= tracehead
; tracehead
= &trace
;
812 trace
.file
= LOCATE_string_search
;
813 /* Register variable[0]: Local variable */
815 /* Register variable[1]: Method return value and escape marker */
816 /* Register variable[2]: Result */
817 variable
[2] = ATTR_string_search___Match____from(variable
[0]) /*Match::_from*/;
818 /* Register variable[3]: Result */
819 variable
[3] = ATTR_string_search___Match____length(variable
[0]) /*Match::_length*/;
820 /* Register variable[2]: Result */
821 variable
[2] = TAG_Int(UNTAG_Int(variable
[2])+UNTAG_Int(variable
[3]));
822 variable
[1] = variable
[2];
824 return_label28
: while(false);
825 tracehead
= trace
.prev
;
828 void string_search___Match___init(val_t self
, val_t param0
, val_t param1
, val_t param2
, int* init_table
) {
829 struct trace_t trace
= {NULL
, NULL
, 220, LOCATE_string_search___Match___init
};
831 struct WBT_
**closurevariable
= NULL
;
832 trace
.prev
= tracehead
; tracehead
= &trace
;
833 trace
.file
= LOCATE_string_search
;
834 /* Register variable[0]: Local variable */
836 /* Register variable[1]: Local variable */
837 variable
[1] = param0
;
838 /* Register variable[2]: Local variable */
839 variable
[2] = param1
;
840 /* Register variable[3]: Local variable */
841 variable
[3] = param2
;
842 if (init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_Match
].i
]) return;
843 /* Register variable[4]: Method return value and escape marker */
844 /* Register variable[5]: Result */
845 variable
[5] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable
[1] /*s*/ == NIT_NULL
/*null*/) || (( variable
[1] /*s*/ != NIT_NULL
) && ((CALL_kernel___Object_____eqeq( variable
[1] /*s*/)==kernel___Object_____eqeq
)?
(IS_EQUAL_NN( variable
[1] /*s*/, NIT_NULL
/*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable
[1] /*s*/)( variable
[1] /*s*/, NIT_NULL
/*null*/) /*Object::==*/)))))));
846 if (!UNTAG_Bool(variable
[5])) { fprintf(stderr
, "Assert%s failed", " 'non_null_string' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_string_search___Match___init
, LOCATE_string_search
, 223); nit_exit(1);}
847 /* Register variable[5]: Result */
848 variable
[5] = TAG_Bool(UNTAG_Int( variable
[3] /*len*/)>=UNTAG_Int( TAG_Int(0)));
849 if (!UNTAG_Bool(variable
[5])) { fprintf(stderr
, "Assert%s failed", " 'positive_length' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_string_search___Match___init
, LOCATE_string_search
, 224); nit_exit(1);}
850 /* Register variable[5]: Result */
851 variable
[5] = TAG_Bool(UNTAG_Int( variable
[2] /*f*/)>=UNTAG_Int( TAG_Int(0)));
852 if (!UNTAG_Bool(variable
[5])) { fprintf(stderr
, "Assert%s failed", " 'valid_from' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_string_search___Match___init
, LOCATE_string_search
, 225); nit_exit(1);}
853 /* Register variable[5]: Result */
854 variable
[5] = TAG_Int(UNTAG_Int( variable
[2] /*f*/)+UNTAG_Int( variable
[3] /*len*/));
855 /* Register variable[6]: Result */
856 variable
[6] = CALL_abstract_collection___Collection___length( variable
[1] /*s*/)( variable
[1] /*s*/) /*AbstractArrayRead::length*/;
857 /* Register variable[5]: Result */
858 variable
[5] = TAG_Bool(UNTAG_Int(variable
[5])<=UNTAG_Int(variable
[6]));
859 if (!UNTAG_Bool(variable
[5])) { fprintf(stderr
, "Assert%s failed", " 'valid_after' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_string_search___Match___init
, LOCATE_string_search
, 226); nit_exit(1);}
860 ATTR_string_search___Match____string(variable
[0]) /*Match::_string*/ = variable
[1] /*s*/;
861 ATTR_string_search___Match____from(variable
[0]) /*Match::_from*/ = variable
[2] /*f*/;
862 ATTR_string_search___Match____length(variable
[0]) /*Match::_length*/ = variable
[3] /*len*/;
863 return_label29
: while(false);
864 init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_Match
].i
] = 1;
865 tracehead
= trace
.prev
;
868 val_t
string_search___Char___search_index_in(val_t self
, val_t param0
, val_t param1
) {
869 struct trace_t trace
= {NULL
, NULL
, 235, LOCATE_string_search___Char___search_index_in
};
871 struct WBT_
**closurevariable
= NULL
;
872 trace
.prev
= tracehead
; tracehead
= &trace
;
873 trace
.file
= LOCATE_string_search
;
874 /* Register variable[0]: Local variable */
876 /* Register variable[1]: Local variable */
877 variable
[1] = param0
;
878 /* Register variable[2]: Local variable */
879 variable
[2] = param1
;
880 /* Register variable[3]: Method return value and escape marker */
881 /* Register variable[4]: Local variable */
882 /* Register variable[5]: Result */
883 variable
[5] = CALL_abstract_collection___Collection___length( variable
[1] /*s*/)( variable
[1] /*s*/) /*AbstractArrayRead::length*/;
884 variable
[4] = variable
[5];
885 while (true) { /*while*/
886 /* Register variable[5]: Result */
887 variable
[5] = TAG_Bool(UNTAG_Int( variable
[2] /*from*/)<UNTAG_Int( variable
[4] /*stop*/));
888 if (!UNTAG_Bool(variable
[5])) break; /* while*/
889 /* Register variable[5]: Result */
890 variable
[5] = CALL_abstract_collection___MapRead_____bra( variable
[1] /*s*/)( variable
[1] /*s*/, variable
[2] /*from*/) /*AbstractString::[]*/;
891 /* Register variable[5]: Result */
892 variable
[5] = TAG_Bool((variable
[5])==(variable
[0]));
893 if (UNTAG_Bool(variable
[5])) { /*if*/
894 variable
[3] = variable
[2] /*from*/;
897 variable
[2] = TAG_Int(UNTAG_Int(variable
[2])+UNTAG_Int( TAG_Int(1))) /*from*/;
898 continue_31
: while(0);
901 /* Register variable[5]: Result */
902 variable
[5] = TAG_Int(-UNTAG_Int( TAG_Int(1)));
903 variable
[3] = variable
[5];
905 return_label30
: while(false);
906 tracehead
= trace
.prev
;
909 val_t
string_search___Char___search_in(val_t self
, val_t param0
, val_t param1
) {
910 struct trace_t trace
= {NULL
, NULL
, 245, LOCATE_string_search___Char___search_in
};
912 struct WBT_
**closurevariable
= NULL
;
913 trace
.prev
= tracehead
; tracehead
= &trace
;
914 trace
.file
= LOCATE_string_search
;
915 /* Register variable[0]: Local variable */
917 /* Register variable[1]: Local variable */
918 variable
[1] = param0
;
919 /* Register variable[2]: Local variable */
920 variable
[2] = param1
;
921 /* Register variable[3]: Method return value and escape marker */
922 /* Register variable[4]: Local variable */
923 /* Register variable[5]: Result */
924 variable
[5] = CALL_string_search___Pattern___search_index_in(variable
[0])(variable
[0], variable
[1] /*s*/, variable
[2] /*from*/) /*Char::search_index_in*/;
925 variable
[4] = variable
[5];
926 /* Register variable[5]: Result */
927 variable
[5] = TAG_Bool(UNTAG_Int( variable
[4] /*pos*/)<UNTAG_Int( TAG_Int(0)));
928 if (UNTAG_Bool(variable
[5])) { /*if*/
929 variable
[3] = NIT_NULL
/*null*/;
932 /* Register variable[5]: Result */
933 variable
[5] = NEW_Match_string_search___Match___init( variable
[1] /*s*/, variable
[4] /*pos*/, TAG_Int(1)) /*new Match*/;
934 variable
[3] = variable
[5];
937 return_label32
: while(false);
938 tracehead
= trace
.prev
;
941 val_t
string_search___String___search_index_in(val_t self
, val_t param0
, val_t param1
) {
942 struct trace_t trace
= {NULL
, NULL
, 258, LOCATE_string_search___String___search_index_in
};
944 struct WBT_
**closurevariable
= NULL
;
945 trace
.prev
= tracehead
; tracehead
= &trace
;
946 trace
.file
= LOCATE_string_search
;
947 /* Register variable[0]: Local variable */
949 /* Register variable[1]: Local variable */
950 variable
[1] = param0
;
951 /* Register variable[2]: Local variable */
952 variable
[2] = param1
;
953 /* Register variable[3]: Method return value and escape marker */
954 /* Register variable[4]: Result */
955 variable
[4] = TAG_Bool(UNTAG_Int( variable
[2] /*from*/)>=UNTAG_Int( TAG_Int(0)));
956 if (!UNTAG_Bool(variable
[4])) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_string_search___String___search_index_in
, LOCATE_string_search
, 260); nit_exit(1);}
957 /* Register variable[4]: Local variable */
958 /* Register variable[5]: Result */
959 variable
[5] = CALL_abstract_collection___Collection___length( variable
[1] /*s*/)( variable
[1] /*s*/) /*AbstractArrayRead::length*/;
960 /* Register variable[6]: Result */
961 variable
[6] = CALL_abstract_collection___Collection___length(variable
[0])(variable
[0]) /*AbstractArrayRead::length*/;
962 /* Register variable[5]: Result */
963 variable
[5] = TAG_Int(UNTAG_Int(variable
[5])-UNTAG_Int(variable
[6]));
964 /* Register variable[5]: Result */
965 variable
[5] = TAG_Int(UNTAG_Int(variable
[5])+UNTAG_Int( TAG_Int(1)));
966 variable
[4] = variable
[5];
967 while (true) { /*while*/
968 /* Register variable[5]: Result */
969 variable
[5] = TAG_Bool(UNTAG_Int( variable
[2] /*from*/)<UNTAG_Int( variable
[4] /*stop*/));
970 if (!UNTAG_Bool(variable
[5])) break; /* while*/
971 /* Register variable[5]: Local variable */
972 /* Register variable[6]: Result */
973 variable
[6] = CALL_abstract_collection___Collection___length(variable
[0])(variable
[0]) /*AbstractArrayRead::length*/;
974 /* Register variable[6]: Result */
975 variable
[6] = TAG_Int(UNTAG_Int(variable
[6])-UNTAG_Int( TAG_Int(1)));
976 variable
[5] = variable
[6];
977 while (true) { /*while*/
978 /* Register variable[6]: Result */
979 variable
[6] = TAG_Bool(UNTAG_Int( variable
[5] /*i*/)>=UNTAG_Int( TAG_Int(0)));
980 /* Ensure var variable[6]: Left 'and' operand*/
981 if (UNTAG_Bool(variable
[6])) { /* and */
982 /* Register variable[6]: Result */
983 variable
[6] = CALL_abstract_collection___MapRead_____bra(variable
[0])(variable
[0], variable
[5] /*i*/) /*AbstractString::[]*/;
984 /* Register variable[7]: Result */
985 variable
[7] = TAG_Int(UNTAG_Int( variable
[5] /*i*/)+UNTAG_Int( variable
[2] /*from*/));
986 /* Register variable[7]: Result */
987 variable
[7] = CALL_abstract_collection___MapRead_____bra( variable
[1] /*s*/)( variable
[1] /*s*/, variable
[7]) /*AbstractString::[]*/;
988 /* Register variable[6]: Result */
989 variable
[6] = TAG_Bool((variable
[6])==(variable
[7]));
991 /* Register variable[6]: Result */
992 if (!UNTAG_Bool(variable
[6])) break; /* while*/
993 variable
[5] = TAG_Int(UNTAG_Int(variable
[5])-UNTAG_Int( TAG_Int(1))) /*i*/;
994 continue_35
: while(0);
997 /* Register variable[6]: Result */
998 variable
[6] = TAG_Bool(UNTAG_Int( variable
[5] /*i*/)<UNTAG_Int( TAG_Int(0)));
999 if (UNTAG_Bool(variable
[6])) { /*if*/
1000 variable
[3] = variable
[2] /*from*/;
1001 goto return_label33
;
1003 variable
[2] = TAG_Int(UNTAG_Int(variable
[2])+UNTAG_Int( TAG_Int(1))) /*from*/;
1004 continue_34
: while(0);
1007 /* Register variable[5]: Result */
1008 variable
[5] = TAG_Int(-UNTAG_Int( TAG_Int(1)));
1009 variable
[3] = variable
[5];
1010 goto return_label33
;
1011 return_label33
: while(false);
1012 tracehead
= trace
.prev
;
1015 val_t
string_search___String___search_in(val_t self
, val_t param0
, val_t param1
) {
1016 struct trace_t trace
= {NULL
, NULL
, 273, LOCATE_string_search___String___search_in
};
1018 struct WBT_
**closurevariable
= NULL
;
1019 trace
.prev
= tracehead
; tracehead
= &trace
;
1020 trace
.file
= LOCATE_string_search
;
1021 /* Register variable[0]: Local variable */
1023 /* Register variable[1]: Local variable */
1024 variable
[1] = param0
;
1025 /* Register variable[2]: Local variable */
1026 variable
[2] = param1
;
1027 /* Register variable[3]: Method return value and escape marker */
1028 /* Register variable[4]: Local variable */
1029 /* Register variable[5]: Result */
1030 variable
[5] = CALL_string_search___Pattern___search_index_in(variable
[0])(variable
[0], variable
[1] /*s*/, variable
[2] /*from*/) /*String::search_index_in*/;
1031 variable
[4] = variable
[5];
1032 /* Register variable[5]: Result */
1033 variable
[5] = TAG_Bool(UNTAG_Int( variable
[4] /*pos*/)<UNTAG_Int( TAG_Int(0)));
1034 if (UNTAG_Bool(variable
[5])) { /*if*/
1035 variable
[3] = NIT_NULL
/*null*/;
1036 goto return_label36
;
1038 /* Register variable[5]: Result */
1039 variable
[5] = CALL_abstract_collection___Collection___length(variable
[0])(variable
[0]) /*AbstractArrayRead::length*/;
1040 /* Register variable[5]: Result */
1041 variable
[5] = NEW_Match_string_search___Match___init( variable
[1] /*s*/, variable
[4] /*pos*/, variable
[5]) /*new Match*/;
1042 variable
[3] = variable
[5];
1043 goto return_label36
;
1045 return_label36
: while(false);
1046 tracehead
= trace
.prev
;
1049 val_t
string_search___String___search(val_t self
, val_t param0
) {
1050 struct trace_t trace
= {NULL
, NULL
, 283, LOCATE_string_search___String___search
};
1052 struct WBT_
**closurevariable
= NULL
;
1053 trace
.prev
= tracehead
; tracehead
= &trace
;
1054 trace
.file
= LOCATE_string_search
;
1055 /* Register variable[0]: Local variable */
1057 /* Register variable[1]: Local variable */
1058 variable
[1] = param0
;
1059 /* Register variable[2]: Method return value and escape marker */
1060 /* Register variable[3]: Result */
1061 variable
[3] = CALL_string_search___Pattern___search_in( variable
[1] /*p*/)( variable
[1] /*p*/, variable
[0], TAG_Int(0)) /*Pattern::search_in*/;
1062 variable
[2] = variable
[3];
1063 goto return_label37
;
1064 return_label37
: while(false);
1065 tracehead
= trace
.prev
;
1068 val_t
string_search___String___search_from(val_t self
, val_t param0
, val_t param1
) {
1069 struct trace_t trace
= {NULL
, NULL
, 286, LOCATE_string_search___String___search_from
};
1071 struct WBT_
**closurevariable
= NULL
;
1072 trace
.prev
= tracehead
; tracehead
= &trace
;
1073 trace
.file
= LOCATE_string_search
;
1074 /* Register variable[0]: Local variable */
1076 /* Register variable[1]: Local variable */
1077 variable
[1] = param0
;
1078 /* Register variable[2]: Local variable */
1079 variable
[2] = param1
;
1080 /* Register variable[3]: Method return value and escape marker */
1081 /* Register variable[4]: Result */
1082 variable
[4] = CALL_string_search___Pattern___search_in( variable
[1] /*p*/)( variable
[1] /*p*/, variable
[0], variable
[2] /*from*/) /*Pattern::search_in*/;
1083 variable
[3] = variable
[4];
1084 goto return_label38
;
1085 return_label38
: while(false);
1086 tracehead
= trace
.prev
;
1089 val_t
string_search___String___search_all(val_t self
, val_t param0
) {
1090 struct trace_t trace
= {NULL
, NULL
, 291, LOCATE_string_search___String___search_all
};
1092 struct WBT_
**closurevariable
= NULL
;
1093 trace
.prev
= tracehead
; tracehead
= &trace
;
1094 trace
.file
= LOCATE_string_search
;
1095 /* Register variable[0]: Local variable */
1097 /* Register variable[1]: Local variable */
1098 variable
[1] = param0
;
1099 /* Register variable[2]: Method return value and escape marker */
1100 /* Register variable[3]: Result */
1101 variable
[3] = CALL_string_search___Pattern___search_all_in( variable
[1] /*p*/)( variable
[1] /*p*/, variable
[0]) /*Pattern::search_all_in*/;
1102 variable
[2] = variable
[3];
1103 goto return_label39
;
1104 return_label39
: while(false);
1105 tracehead
= trace
.prev
;
1108 val_t
string_search___String___split_with(val_t self
, val_t param0
) {
1109 struct trace_t trace
= {NULL
, NULL
, 300, LOCATE_string_search___String___split_with
};
1111 struct WBT_
**closurevariable
= NULL
;
1112 trace
.prev
= tracehead
; tracehead
= &trace
;
1113 trace
.file
= LOCATE_string_search
;
1114 /* Register variable[0]: Local variable */
1116 /* Register variable[1]: Local variable */
1117 variable
[1] = param0
;
1118 /* Register variable[2]: Method return value and escape marker */
1119 /* Register variable[3]: Local variable */
1120 /* Register variable[4]: Result */
1121 variable
[4] = CALL_string_search___Pattern___split_in( variable
[1] /*p*/)( variable
[1] /*p*/, variable
[0]) /*Pattern::split_in*/;
1122 variable
[3] = variable
[4];
1123 /* Register variable[4]: Local variable */
1124 /* Register variable[5]: Result */
1125 variable
[5] = CALL_abstract_collection___Collection___length( variable
[3] /*matches*/)( variable
[3] /*matches*/) /*AbstractArrayRead::length*/;
1126 /* Register variable[5]: Result */
1127 variable
[5] = NEW_Array_array___Array___with_capacity(variable
[5]) /*new Array[String]*/;
1128 variable
[4] = variable
[5];
1129 /* Register variable[5]: For iterator */
1130 variable
[5] = CALL_abstract_collection___Collection___iterator( variable
[3] /*matches*/)( variable
[3] /*matches*/) /*AbstractArrayRead::iterator*/;
1131 while (true) { /*for*/
1132 /* Register variable[6]: For 'is_ok' result */
1133 variable
[6] = CALL_abstract_collection___Iterator___is_ok(variable
[5])(variable
[5]) /*ArrayIterator::is_ok*/;
1134 if (!UNTAG_Bool(variable
[6])) break; /*for*/
1135 variable
[6] = CALL_abstract_collection___Iterator___item(variable
[5])(variable
[5]) /*ArrayIterator::item*/ /* Ensure var: For item*/;
1136 /* Register variable[7]: Local variable */
1137 variable
[7] = variable
[6];
1138 /* Register variable[8]: Result */
1139 variable
[8] = CALL_string___Object___to_s( variable
[7] /*m*/)( variable
[7] /*m*/) /*Match::to_s*/;
1140 CALL_abstract_collection___SimpleCollection___add( variable
[4] /*res*/)( variable
[4] /*res*/, variable
[8]) /*AbstractArray::add*/;
1141 continue_41
: while(0);
1142 CALL_abstract_collection___Iterator___next(variable
[5])(variable
[5]) /*ArrayIterator::next*/;
1145 variable
[2] = variable
[4] /*res*/;
1146 goto return_label40
;
1147 return_label40
: while(false);
1148 tracehead
= trace
.prev
;
1151 val_t
string_search___String___split(val_t self
) {
1152 struct trace_t trace
= {NULL
, NULL
, 310, LOCATE_string_search___String___split
};
1154 struct WBT_
**closurevariable
= NULL
;
1155 trace
.prev
= tracehead
; tracehead
= &trace
;
1156 trace
.file
= LOCATE_string_search
;
1157 /* Register variable[0]: Local variable */
1159 /* Register variable[1]: Method return value and escape marker */
1160 /* Register variable[2]: Result */
1161 variable
[2] = CALL_string_search___String___split_with(variable
[0])(variable
[0], TAG_Char('\n')) /*String::split_with*/;
1162 variable
[1] = variable
[2];
1163 goto return_label42
;
1164 return_label42
: while(false);
1165 tracehead
= trace
.prev
;