array IntList_elements432 array IntList_nextFree196 integer IntList_firstFree206 integer IntList_maxIndex198 array IntList_typeId205 array IntListIterator_nextFree204 integer IntListIterator_firstFree568 integer IntListIterator_maxIndex166 array IntListIterator_typeId199 array IntList_size136 array IntListIterator_list963 array IntListIterator_pos159 integer IntList_firstFree206 = 0 integer IntList_maxIndex198 = 0 integer IntListIterator_firstFree568 = 0 integer IntListIterator_maxIndex166 = 0 function initGlobals200() { } function main210() { initGlobals200(); init_test204(); } function config131() { } function init_test204() { local integer sum391 local integer iterator153 sum_391 = 0; iterator_153 = IntList_iterator109(dispatch_IntList_test_IntList_add241(dispatch_IntList_test_IntList_add241(dispatch_IntList_test_IntList_add241(new_IntList159(), 7), 3), 5)); loop { exitwhen (not IntListIterator_hasNext194(iterator_153)); sum_391 = (sum_391 + IntListIterator_next156(iterator_153)); }; IntListIterator_close798(iterator_153); if (sum_391 == 15) { testSuccess206(); } else { }; } IS_NATIVE function testSuccess206() { } function IntList_getOffset197(integer this204) returns integer { return (64 * ((this_204 castTo integer) - 1)); } function IntList_add130(integer this391, integer x790) returns integer { IntList_elements_432[(dispatch_IntList_test_IntList_getOffset176(this_391) + IntList_size_136[this_391])] = x_790; IntList_size_136[this_391] = (IntList_size_136[this_391] + 1); return this_391; } function IntList_get671(integer this140, integer i472) returns integer { return IntList_elements_432[(dispatch_IntList_test_IntList_getOffset176(this_140) + i_472)]; } function IntList_iterator109(integer this359) returns integer { return new_IntListIterator175(this_359); } function IntList_init117(integer this181) { IntList_size_136[this_181] = 0; } function new_IntList159() returns integer { local integer this257 this_257 = alloc_IntList204(); construct_IntList819(this_257); return this_257; } function construct_IntList819(integer this556) { IntList_init117(this_556); } function new_IntListIterator175(integer list161) returns integer { local integer this889 this_889 = alloc_IntListIterator434(); construct_IntListIterator169(this_889, list_161); return this_889; } function IntListIterator_hasNext194(integer this291) returns boolean { return (IntListIterator_pos_159[this_291] < IntList_size_136[IntListIterator_list_963[this_291]]); } function IntListIterator_next156(integer this932) returns integer { IntListIterator_pos_159[this_932] = (IntListIterator_pos_159[this_932] + 1); return dispatch_IntList_test_IntList_get145(IntListIterator_list_963[this_932], (IntListIterator_pos_159[this_932] - 1)); } function IntListIterator_close798(integer this156) { dispatch_IntListIterator_destroyIntListIterator188(this_156); } function destroyIntListIterator180(integer this151) { IntListIterator_onDestroy959(this_151); dealloc_IntListIterator634(this_151); } function IntListIterator_init283(integer this406) { IntListIterator_pos_159[this_406] = 0; } function construct_IntListIterator169(integer this172, integer list327) { IntListIterator_init283(this_172); IntListIterator_list_963[this_172] = list_327; } function IntListIterator_onDestroy959(integer this101) { } function alloc_IntList204() returns integer { local integer this280 if (IntList_firstFree_206 == 0) { if (IntList_maxIndex_198 < 32768) { IntList_maxIndex_198 = (IntList_maxIndex_198 + 1); this_280 = IntList_maxIndex_198; IntList_typeId_205[this_280] = 1; } else { error491("Out of memory: Could not create IntList."); this_280 = 0; }; } else { IntList_firstFree_206 = (IntList_firstFree_206 - 1); this_280 = IntList_nextFree_196[IntList_firstFree_206]; IntList_typeId_205[this_280] = 1; }; return this_280; } function error491(string msg132) { $debugPrint108((msg_132 + (" " + #getStackTrace()))); } function alloc_IntListIterator434() returns integer { local integer this560 if (IntListIterator_firstFree_568 == 0) { if (IntListIterator_maxIndex_166 < 32768) { IntListIterator_maxIndex_166 = (IntListIterator_maxIndex_166 + 1); this_560 = IntListIterator_maxIndex_166; IntListIterator_typeId_199[this_560] = 2; } else { error491("Out of memory: Could not create IntListIterator."); this_560 = 0; }; } else { IntListIterator_firstFree_568 = (IntListIterator_firstFree_568 - 1); this_560 = IntListIterator_nextFree_204[IntListIterator_firstFree_568]; IntListIterator_typeId_199[this_560] = 2; }; return this_560; } function dealloc_IntListIterator634(integer obj915) { if (IntListIterator_typeId_199[obj_915] == 0) { error491("Double free: object of type IntListIterator"); } else { IntListIterator_nextFree_204[IntListIterator_firstFree_568] = obj_915; IntListIterator_firstFree_568 = (IntListIterator_firstFree_568 + 1); IntListIterator_typeId_199[obj_915] = 0; }; } function dispatch_IntList_test_IntList_getOffset176(integer this979) returns integer { if (IntList_typeId_205[this_979] == 0) { if (this_979 == 0) { error491("Nullpointer exception when calling IntList.getOffset"); } else { error491("Called IntList.getOffset on invalid object."); }; } else { }; return IntList_getOffset197(this_979); } function dispatch_IntList_test_IntList_add241(integer this978, integer x268) returns integer { if (IntList_typeId_205[this_978] == 0) { if (this_978 == 0) { error491("Nullpointer exception when calling IntList.add"); } else { error491("Called IntList.add on invalid object."); }; } else { }; return IntList_add130(this_978, x_268); } function dispatch_IntList_test_IntList_get145(integer this140, integer i152) returns integer { if (IntList_typeId_205[this_140] == 0) { if (this_140 == 0) { error491("Nullpointer exception when calling IntList.get"); } else { error491("Called IntList.get on invalid object."); }; } else { }; return IntList_get671(this_140, i_152); } function dispatch_IntListIterator_destroyIntListIterator188(integer this111) { if (IntListIterator_typeId_199[this_111] == 0) { if (this_111 == 0) { error491("Nullpointer exception when calling IntListIterator.IntListIterator"); } else { error491("Called IntListIterator.IntListIterator on invalid object."); }; } else { }; destroyIntListIterator180(this_111); }