array IntList_elements193 array IntList_nextFree119 integer IntList_firstFree114 integer IntList_maxIndex154 array IntList_typeId133 array IntListIterator_nextFree145 integer IntListIterator_firstFree120 integer IntListIterator_maxIndex134 array IntListIterator_typeId149 array IntList_size549 array IntListIterator_list131 array IntListIterator_pos196 integer IntList_firstFree114 = 0 integer IntList_maxIndex154 = 0 integer IntListIterator_firstFree120 = 0 integer IntListIterator_maxIndex134 = 0 function initGlobals212() { IntList_firstFree_114 = 0; IntList_maxIndex_154 = 0; IntListIterator_firstFree_120 = 0; IntListIterator_maxIndex_134 = 0; } function main202() { initGlobals212(); init_test857(); } function config181() { } function init_test857() { local integer list856 local integer sum742 local integer listIterator132 local integer i791 local integer from249 list_856 = dispatch_IntList_test_IntList_add664(dispatch_IntList_test_IntList_add664(dispatch_IntList_test_IntList_add664(new_IntList106(), 7), 3), 5); sum_742 = 0; listIterator_132 = dispatch_IntList_test_IntList_iterator640(list_856); from_249 = listIterator_132; loop { exitwhen (not IntListIterator_hasNext126(from_249)); i_791 = IntListIterator_next908(from_249); sum_742 = (sum_742 + i_791); }; dispatch_IntListIterator_test_IntListIterator_close242(listIterator_132); if (sum_742 == 15) { testSuccess115(); } else { }; } IS_NATIVE function testSuccess115() { } function IntList_getOffset550(integer this991) returns integer { return (64 * ((this_991 castTo integer) - 1)); } function IntList_add852(integer this168, integer x431) returns integer { IntList_elements_193[(dispatch_IntList_test_IntList_getOffset138(this_168) + IntList_size_549[this_168])] = x_431; IntList_size_549[this_168] = (IntList_size_549[this_168] + 1); return this_168; } function IntList_get846(integer this103, integer i190) returns integer { return IntList_elements_193[(dispatch_IntList_test_IntList_getOffset138(this_103) + i_190)]; } function IntList_iterator195(integer this179) returns integer { return new_IntListIterator148(this_179); } function IntList_init167(integer this107) { IntList_size_549[this_107] = 0; } function new_IntList106() returns integer { local integer this128 this_128 = alloc_IntList104(); construct_IntList200(this_128); return this_128; } function construct_IntList200(integer this331) { IntList_init167(this_331); } function new_IntListIterator148(integer list119) returns integer { local integer this110 this_110 = alloc_IntListIterator386(); construct_IntListIterator972(this_110, list_119); return this_110; } function IntListIterator_hasNext126(integer this165) returns boolean { return (IntListIterator_pos_196[this_165] < IntList_size_549[IntListIterator_list_131[this_165]]); } function IntListIterator_next908(integer this589) returns integer { IntListIterator_pos_196[this_589] = (IntListIterator_pos_196[this_589] + 1); return dispatch_IntList_test_IntList_get119(IntListIterator_list_131[this_589], (IntListIterator_pos_196[this_589] - 1)); } function IntListIterator_close916(integer this357) { dispatch_IntListIterator_destroyIntListIterator757(this_357); } function destroyIntListIterator119(integer this398) { IntListIterator_onDestroy983(this_398); dealloc_IntListIterator780(this_398); } function IntListIterator_init137(integer this560) { IntListIterator_pos_196[this_560] = 0; } function construct_IntListIterator972(integer this125, integer list235) { IntListIterator_init137(this_125); IntListIterator_list_131[this_125] = list_235; } function IntListIterator_onDestroy983(integer this157) { } function alloc_IntList104() returns integer { local integer this159 if (IntList_firstFree_114 == 0) { if (IntList_maxIndex_154 < 32768) { IntList_maxIndex_154 = (IntList_maxIndex_154 + 1); this_159 = IntList_maxIndex_154; IntList_typeId_133[this_159] = 1; } else { error187("Out of memory: Could not create IntList."); this_159 = 0; }; } else { IntList_firstFree_114 = (IntList_firstFree_114 - 1); this_159 = IntList_nextFree_119[IntList_firstFree_114]; IntList_typeId_133[this_159] = 1; }; return this_159; } function error187(string msg855) { $debugPrint447((msg_855 + (" " + #getStackTrace()))); } function alloc_IntListIterator386() returns integer { local integer this168 if (IntListIterator_firstFree_120 == 0) { if (IntListIterator_maxIndex_134 < 32768) { IntListIterator_maxIndex_134 = (IntListIterator_maxIndex_134 + 1); this_168 = IntListIterator_maxIndex_134; IntListIterator_typeId_149[this_168] = 2; } else { error187("Out of memory: Could not create IntListIterator."); this_168 = 0; }; } else { IntListIterator_firstFree_120 = (IntListIterator_firstFree_120 - 1); this_168 = IntListIterator_nextFree_145[IntListIterator_firstFree_120]; IntListIterator_typeId_149[this_168] = 2; }; return this_168; } function dealloc_IntListIterator780(integer obj180) { if (IntListIterator_typeId_149[obj_180] == 0) { error187("Double free: object of type IntListIterator"); } else { IntListIterator_nextFree_145[IntListIterator_firstFree_120] = obj_180; IntListIterator_firstFree_120 = (IntListIterator_firstFree_120 + 1); IntListIterator_typeId_149[obj_180] = 0; }; } function dispatch_IntList_test_IntList_getOffset138(integer this614) returns integer { local integer test_IntList_getOffset_result100 if (IntList_typeId_133[this_614] == 0) { if (this_614 == 0) { error187("Nullpointer exception when calling IntList.getOffset"); } else { error187("Called IntList.getOffset on invalid object."); }; } else { }; test_IntList_getOffset_result_100 = IntList_getOffset550(this_614); return test_IntList_getOffset_result_100; } function dispatch_IntList_test_IntList_add664(integer this123, integer x907) returns integer { local integer test_IntList_add_result146 if (IntList_typeId_133[this_123] == 0) { if (this_123 == 0) { error187("Nullpointer exception when calling IntList.add"); } else { error187("Called IntList.add on invalid object."); }; } else { }; test_IntList_add_result_146 = IntList_add852(this_123, x_907); return test_IntList_add_result_146; } function dispatch_IntList_test_IntList_get119(integer this214, integer i165) returns integer { local integer test_IntList_get_result572 if (IntList_typeId_133[this_214] == 0) { if (this_214 == 0) { error187("Nullpointer exception when calling IntList.get"); } else { error187("Called IntList.get on invalid object."); }; } else { }; test_IntList_get_result_572 = IntList_get846(this_214, i_165); return test_IntList_get_result_572; } function dispatch_IntList_test_IntList_iterator640(integer this153) returns integer { local integer test_IntList_iterator_result128 if (IntList_typeId_133[this_153] == 0) { if (this_153 == 0) { error187("Nullpointer exception when calling IntList.iterator"); } else { error187("Called IntList.iterator on invalid object."); }; } else { }; test_IntList_iterator_result_128 = IntList_iterator195(this_153); return test_IntList_iterator_result_128; } function dispatch_IntListIterator_destroyIntListIterator757(integer this241) { if (IntListIterator_typeId_149[this_241] == 0) { if (this_241 == 0) { error187("Nullpointer exception when calling IntListIterator.IntListIterator"); } else { error187("Called IntListIterator.IntListIterator on invalid object."); }; } else { }; destroyIntListIterator119(this_241); } function dispatch_IntListIterator_test_IntListIterator_close242(integer this227) { if (IntListIterator_typeId_149[this_227] == 0) { if (this_227 == 0) { error187("Nullpointer exception when calling IntListIterator.close"); } else { error187("Called IntListIterator.close on invalid object."); }; } else { }; IntListIterator_close916(this_227); }