array IntList_elements145 array IntList_nextFree119 integer IntList_firstFree147 integer IntList_maxIndex600 array IntList_typeId167 array IntListIterator_nextFree186 integer IntListIterator_firstFree127 integer IntListIterator_maxIndex150 array IntListIterator_typeId888 array IntList_size115 array IntListIterator_list187 array IntListIterator_pos173 integer IntList_firstFree147 = 0 integer IntList_maxIndex600 = 0 integer IntListIterator_firstFree127 = 0 integer IntListIterator_maxIndex150 = 0 function initGlobals228() { IntList_firstFree_147 = 0; IntList_maxIndex_600 = 0; IntListIterator_firstFree_127 = 0; IntListIterator_maxIndex_150 = 0; } function main213() { initGlobals228(); init_test178(); } function config153() { } function init_test178() { local integer list149 local integer sum471 local integer listIterator743 local integer i178 local integer from759 list_149 = dispatch_IntList_test_IntList_add274(dispatch_IntList_test_IntList_add274(dispatch_IntList_test_IntList_add274(new_IntList524(), 7), 3), 5); sum_471 = 0; listIterator_743 = dispatch_IntList_test_IntList_iterator106(list_149); from_759 = listIterator_743; loop { exitwhen (not IntListIterator_hasNext693(from_759)); i_178 = IntListIterator_next108(from_759); sum_471 = (sum_471 + i_178); }; dispatch_IntListIterator_test_IntListIterator_close964(listIterator_743); if (sum_471 == 15) { testSuccess755(); } else { }; } IS_NATIVE function testSuccess755() { } function IntList_getOffset706(integer this387) returns integer { return (64 * ((this_387 castTo integer) - 1)); } function IntList_add117(integer this180, integer x924) returns integer { IntList_elements_145[(dispatch_IntList_test_IntList_getOffset119(this_180) + IntList_size_115[this_180])] = x_924; IntList_size_115[this_180] = (IntList_size_115[this_180] + 1); return this_180; } function IntList_get141(integer this168, integer i529) returns integer { return IntList_elements_145[(dispatch_IntList_test_IntList_getOffset119(this_168) + i_529)]; } function IntList_iterator190(integer this867) returns integer { return new_IntListIterator178(this_867); } function IntList_init201(integer this173) { IntList_size_115[this_173] = 0; } function new_IntList524() returns integer { local integer this157 this_157 = alloc_IntList102(); construct_IntList591(this_157); return this_157; } function construct_IntList591(integer this719) { IntList_init201(this_719); } function new_IntListIterator178(integer list423) returns integer { local integer this138 this_138 = alloc_IntListIterator202(); construct_IntListIterator134(this_138, list_423); return this_138; } function IntListIterator_hasNext693(integer this128) returns boolean { return (IntListIterator_pos_173[this_128] < IntList_size_115[IntListIterator_list_187[this_128]]); } function IntListIterator_next108(integer this883) returns integer { IntListIterator_pos_173[this_883] = (IntListIterator_pos_173[this_883] + 1); return dispatch_IntList_test_IntList_get283(IntListIterator_list_187[this_883], (IntListIterator_pos_173[this_883] - 1)); } function IntListIterator_close168(integer this995) { dispatch_IntListIterator_destroyIntListIterator175(this_995); } function destroyIntListIterator171(integer this120) { IntListIterator_onDestroy166(this_120); dealloc_IntListIterator160(this_120); } function IntListIterator_init135(integer this714) { IntListIterator_pos_173[this_714] = 0; } function construct_IntListIterator134(integer this869, integer list118) { IntListIterator_init135(this_869); IntListIterator_list_187[this_869] = list_118; } function IntListIterator_onDestroy166(integer this451) { } function alloc_IntList102() returns integer { local integer this872 if (IntList_firstFree_147 == 0) { if (IntList_maxIndex_600 < 32768) { IntList_maxIndex_600 = (IntList_maxIndex_600 + 1); this_872 = IntList_maxIndex_600; IntList_typeId_167[this_872] = 1; } else { error120("Out of memory: Could not create IntList."); this_872 = 0; }; } else { IntList_firstFree_147 = (IntList_firstFree_147 - 1); this_872 = IntList_nextFree_119[IntList_firstFree_147]; IntList_typeId_167[this_872] = 1; }; return this_872; } function error120(string msg153) { $debugPrint474((msg_153 + (" " + #getStackTrace()))); } function alloc_IntListIterator202() returns integer { local integer this384 if (IntListIterator_firstFree_127 == 0) { if (IntListIterator_maxIndex_150 < 32768) { IntListIterator_maxIndex_150 = (IntListIterator_maxIndex_150 + 1); this_384 = IntListIterator_maxIndex_150; IntListIterator_typeId_888[this_384] = 2; } else { error120("Out of memory: Could not create IntListIterator."); this_384 = 0; }; } else { IntListIterator_firstFree_127 = (IntListIterator_firstFree_127 - 1); this_384 = IntListIterator_nextFree_186[IntListIterator_firstFree_127]; IntListIterator_typeId_888[this_384] = 2; }; return this_384; } function dealloc_IntListIterator160(integer obj143) { if (IntListIterator_typeId_888[obj_143] == 0) { error120("Double free: object of type IntListIterator"); } else { IntListIterator_nextFree_186[IntListIterator_firstFree_127] = obj_143; IntListIterator_firstFree_127 = (IntListIterator_firstFree_127 + 1); IntListIterator_typeId_888[obj_143] = 0; }; } function dispatch_IntList_test_IntList_getOffset119(integer this179) returns integer { local integer test_IntList_getOffset_result133 if (IntList_typeId_167[this_179] == 0) { if (this_179 == 0) { error120("Nullpointer exception when calling IntList.getOffset"); } else { error120("Called IntList.getOffset on invalid object."); }; } else { }; test_IntList_getOffset_result_133 = IntList_getOffset706(this_179); return test_IntList_getOffset_result_133; } function dispatch_IntList_test_IntList_add274(integer this578, integer x136) returns integer { local integer test_IntList_add_result172 if (IntList_typeId_167[this_578] == 0) { if (this_578 == 0) { error120("Nullpointer exception when calling IntList.add"); } else { error120("Called IntList.add on invalid object."); }; } else { }; test_IntList_add_result_172 = IntList_add117(this_578, x_136); return test_IntList_add_result_172; } function dispatch_IntList_test_IntList_get283(integer this146, integer i122) returns integer { local integer test_IntList_get_result154 if (IntList_typeId_167[this_146] == 0) { if (this_146 == 0) { error120("Nullpointer exception when calling IntList.get"); } else { error120("Called IntList.get on invalid object."); }; } else { }; test_IntList_get_result_154 = IntList_get141(this_146, i_122); return test_IntList_get_result_154; } function dispatch_IntList_test_IntList_iterator106(integer this580) returns integer { local integer test_IntList_iterator_result181 if (IntList_typeId_167[this_580] == 0) { if (this_580 == 0) { error120("Nullpointer exception when calling IntList.iterator"); } else { error120("Called IntList.iterator on invalid object."); }; } else { }; test_IntList_iterator_result_181 = IntList_iterator190(this_580); return test_IntList_iterator_result_181; } function dispatch_IntListIterator_destroyIntListIterator175(integer this422) { if (IntListIterator_typeId_888[this_422] == 0) { if (this_422 == 0) { error120("Nullpointer exception when calling IntListIterator.IntListIterator"); } else { error120("Called IntListIterator.IntListIterator on invalid object."); }; } else { }; destroyIntListIterator171(this_422); } function dispatch_IntListIterator_test_IntListIterator_close964(integer this488) { if (IntListIterator_typeId_888[this_488] == 0) { if (this_488 == 0) { error120("Nullpointer exception when calling IntListIterator.close"); } else { error120("Called IntListIterator.close on invalid object."); }; } else { }; IntListIterator_close168(this_488); }