array IntList_elements162 array IntList_nextFree840 integer IntList_firstFree904 integer IntList_maxIndex494 array IntList_typeId698 array IntListIterator_nextFree163 integer IntListIterator_firstFree198 integer IntListIterator_maxIndex113 array IntListIterator_typeId140 array IntList_size852 array IntListIterator_list628 array IntListIterator_pos624 integer IntList_firstFree904 = 0 integer IntList_maxIndex494 = 0 integer IntListIterator_firstFree198 = 0 integer IntListIterator_maxIndex113 = 0 function initGlobals155() { } function main134() { initGlobals155(); init_test215(); } function config144() { } function init_test215() { local integer sum604 local integer iterator170 sum_604 = 0; iterator_170 = IntList_iterator188(dispatch_IntList_test_IntList_add155(dispatch_IntList_test_IntList_add155(dispatch_IntList_test_IntList_add155(new_IntList881(), 7), 3), 5)); loop { exitwhen (not IntListIterator_hasNext211(iterator_170)); sum_604 = (sum_604 + IntListIterator_next604(iterator_170)); }; IntListIterator_close146(iterator_170); if (sum_604 == 15) { testSuccess292(); } else { }; } IS_NATIVE function testSuccess292() { } function IntList_getOffset129(integer this152) returns integer { return (64 * ((this_152 castTo integer) - 1)); } function IntList_add189(integer this497, integer x191) returns integer { IntList_elements_162[(dispatch_IntList_test_IntList_getOffset566(this_497) + IntList_size_852[this_497])] = x_191; IntList_size_852[this_497] = (IntList_size_852[this_497] + 1); return this_497; } function IntList_get139(integer this171, integer i197) returns integer { return IntList_elements_162[(dispatch_IntList_test_IntList_getOffset566(this_171) + i_197)]; } function IntList_iterator188(integer this714) returns integer { return new_IntListIterator943(this_714); } function IntList_init111(integer this744) { IntList_size_852[this_744] = 0; } function new_IntList881() returns integer { local integer this172 this_172 = alloc_IntList146(); construct_IntList192(this_172); return this_172; } function construct_IntList192(integer this805) { IntList_init111(this_805); } function new_IntListIterator943(integer list181) returns integer { local integer this109 this_109 = alloc_IntListIterator607(); construct_IntListIterator190(this_109, list_181); return this_109; } function IntListIterator_hasNext211(integer this771) returns boolean { return (IntListIterator_pos_624[this_771] < IntList_size_852[IntListIterator_list_628[this_771]]); } function IntListIterator_next604(integer this126) returns integer { IntListIterator_pos_624[this_126] = (IntListIterator_pos_624[this_126] + 1); return dispatch_IntList_test_IntList_get181(IntListIterator_list_628[this_126], (IntListIterator_pos_624[this_126] - 1)); } function IntListIterator_close146(integer this210) { dispatch_IntListIterator_destroyIntListIterator335(this_210); } function destroyIntListIterator167(integer this742) { IntListIterator_onDestroy177(this_742); dealloc_IntListIterator129(this_742); } function IntListIterator_init205(integer this102) { IntListIterator_pos_624[this_102] = 0; } function construct_IntListIterator190(integer this961, integer list156) { IntListIterator_init205(this_961); IntListIterator_list_628[this_961] = list_156; } function IntListIterator_onDestroy177(integer this179) { } function alloc_IntList146() returns integer { local integer this191 if (IntList_firstFree_904 == 0) { if (IntList_maxIndex_494 < 32768) { IntList_maxIndex_494 = (IntList_maxIndex_494 + 1); this_191 = IntList_maxIndex_494; IntList_typeId_698[this_191] = 1; } else { error372("Out of memory: Could not create IntList."); this_191 = 0; }; } else { IntList_firstFree_904 = (IntList_firstFree_904 - 1); this_191 = IntList_nextFree_840[IntList_firstFree_904]; IntList_typeId_698[this_191] = 1; }; return this_191; } function error372(string msg195) { $debugPrint626((msg_195 + (" " + #getStackTrace()))); } function alloc_IntListIterator607() returns integer { local integer this839 if (IntListIterator_firstFree_198 == 0) { if (IntListIterator_maxIndex_113 < 32768) { IntListIterator_maxIndex_113 = (IntListIterator_maxIndex_113 + 1); this_839 = IntListIterator_maxIndex_113; IntListIterator_typeId_140[this_839] = 2; } else { error372("Out of memory: Could not create IntListIterator."); this_839 = 0; }; } else { IntListIterator_firstFree_198 = (IntListIterator_firstFree_198 - 1); this_839 = IntListIterator_nextFree_163[IntListIterator_firstFree_198]; IntListIterator_typeId_140[this_839] = 2; }; return this_839; } function dealloc_IntListIterator129(integer obj111) { if (IntListIterator_typeId_140[obj_111] == 0) { error372("Double free: object of type IntListIterator"); } else { IntListIterator_nextFree_163[IntListIterator_firstFree_198] = obj_111; IntListIterator_firstFree_198 = (IntListIterator_firstFree_198 + 1); IntListIterator_typeId_140[obj_111] = 0; }; } function dispatch_IntList_test_IntList_getOffset566(integer this135) returns integer { if (IntList_typeId_698[this_135] == 0) { if (this_135 == 0) { error372("Nullpointer exception when calling IntList.getOffset"); } else { error372("Called IntList.getOffset on invalid object."); }; } else { }; return IntList_getOffset129(this_135); } function dispatch_IntList_test_IntList_add155(integer this522, integer x835) returns integer { if (IntList_typeId_698[this_522] == 0) { if (this_522 == 0) { error372("Nullpointer exception when calling IntList.add"); } else { error372("Called IntList.add on invalid object."); }; } else { }; return IntList_add189(this_522, x_835); } function dispatch_IntList_test_IntList_get181(integer this101, integer i113) returns integer { if (IntList_typeId_698[this_101] == 0) { if (this_101 == 0) { error372("Nullpointer exception when calling IntList.get"); } else { error372("Called IntList.get on invalid object."); }; } else { }; return IntList_get139(this_101, i_113); } function dispatch_IntListIterator_destroyIntListIterator335(integer this251) { if (IntListIterator_typeId_140[this_251] == 0) { if (this_251 == 0) { error372("Nullpointer exception when calling IntListIterator.IntListIterator"); } else { error372("Called IntListIterator.IntListIterator on invalid object."); }; } else { }; destroyIntListIterator167(this_251); }