array IntList_elements125 array IntList_nextFree463 integer IntList_firstFree708 integer IntList_maxIndex210 array IntList_typeId166 array IntListIterator_nextFree142 integer IntListIterator_firstFree158 integer IntListIterator_maxIndex137 array IntListIterator_typeId108 array IntList_size346 array IntListIterator_list118 array IntListIterator_pos104 integer IntList_firstFree708 = 0 integer IntList_maxIndex210 = 0 integer IntListIterator_firstFree158 = 0 integer IntListIterator_maxIndex137 = 0 function initGlobals144() { } function main167() { initGlobals144(); init_test125(); } function config337() { } function init_test125() { local integer list118 local integer sum106 local integer iterator183 local integer i101 local integer this269 local integer this207 local integer this102 local integer this498 list_118 = dispatch_IntList_test_IntList_add547(dispatch_IntList_test_IntList_add547(dispatch_IntList_test_IntList_add547(new_IntList179(), 7), 3), 5); sum_106 = 0; this_269 = list_118; iterator_183 = new_IntListIterator107(this_269); loop { this_207 = iterator_183; exitwhen (not (IntListIterator_pos_104[this_207] < IntList_size_346[IntListIterator_list_118[this_207]])); this_102 = iterator_183; IntListIterator_pos_104[this_102] = (IntListIterator_pos_104[this_102] + 1); i_101 = dispatch_IntList_test_IntList_get412(IntListIterator_list_118[this_102], (IntListIterator_pos_104[this_102] - 1)); sum_106 = (sum_106 + i_101); }; this_498 = iterator_183; dispatch_IntListIterator_destroyIntListIterator182(this_498); if (sum_106 == 15) { testSuccess164(); } else { }; } IS_NATIVE function testSuccess164() { } function new_IntList179() returns integer { local integer this985 local integer this144 local integer this118 local integer this202 if (IntList_firstFree_708 == 0) { if (IntList_maxIndex_210 < 32768) { IntList_maxIndex_210 = (IntList_maxIndex_210 + 1); this_144 = IntList_maxIndex_210; IntList_typeId_166[this_144] = 1; } else { error136("Out of memory: Could not create IntList."); this_144 = 0; }; } else { IntList_firstFree_708 = (IntList_firstFree_708 - 1); this_144 = IntList_nextFree_463[IntList_firstFree_708]; IntList_typeId_166[this_144] = 1; }; this_985 = this_144; this_118 = this_985; this_202 = this_118; IntList_size_346[this_202] = 0; return this_985; } function new_IntListIterator107(integer list565) returns integer { local integer this198 local integer this145 local integer this158 local integer list141 local integer this251 if (IntListIterator_firstFree_158 == 0) { if (IntListIterator_maxIndex_137 < 32768) { IntListIterator_maxIndex_137 = (IntListIterator_maxIndex_137 + 1); this_145 = IntListIterator_maxIndex_137; IntListIterator_typeId_108[this_145] = 2; } else { error136("Out of memory: Could not create IntListIterator."); this_145 = 0; }; } else { IntListIterator_firstFree_158 = (IntListIterator_firstFree_158 - 1); this_145 = IntListIterator_nextFree_142[IntListIterator_firstFree_158]; IntListIterator_typeId_108[this_145] = 2; }; this_198 = this_145; this_158 = this_198; list_141 = list_565; this_251 = this_158; IntListIterator_pos_104[this_251] = 0; IntListIterator_list_118[this_158] = list_141; return this_198; } function error136(string msg682) { $debugPrint156((msg_682 + (" " + #getStackTrace()))); } function dispatch_IntList_test_IntList_add547(integer this293, integer x201) returns integer { local integer test_IntList_add_result164 local integer this167 local integer x176 local integer this164 local integer test_IntList_getOffset_result158 local integer this386 if (IntList_typeId_166[this_293] == 0) { if (this_293 == 0) { error136("Nullpointer exception when calling IntList.add"); } else { error136("Called IntList.add on invalid object."); }; } else { }; this_167 = this_293; x_176 = x_201; this_164 = this_167; if (IntList_typeId_166[this_164] == 0) { if (this_164 == 0) { error136("Nullpointer exception when calling IntList.getOffset"); } else { error136("Called IntList.getOffset on invalid object."); }; } else { }; this_386 = this_164; test_IntList_getOffset_result_158 = (64 * ((this_386 castTo integer) - 1)); IntList_elements_125[(test_IntList_getOffset_result_158 + IntList_size_346[this_167])] = x_176; IntList_size_346[this_167] = (IntList_size_346[this_167] + 1); test_IntList_add_result_164 = this_167; return test_IntList_add_result_164; } function dispatch_IntList_test_IntList_get412(integer this766, integer i176) returns integer { local integer test_IntList_get_result195 local integer this500 local integer i162 local integer this186 local integer test_IntList_getOffset_result118 local integer this149 if (IntList_typeId_166[this_766] == 0) { if (this_766 == 0) { error136("Nullpointer exception when calling IntList.get"); } else { error136("Called IntList.get on invalid object."); }; } else { }; this_500 = this_766; i_162 = i_176; this_186 = this_500; if (IntList_typeId_166[this_186] == 0) { if (this_186 == 0) { error136("Nullpointer exception when calling IntList.getOffset"); } else { error136("Called IntList.getOffset on invalid object."); }; } else { }; this_149 = this_186; test_IntList_getOffset_result_118 = (64 * ((this_149 castTo integer) - 1)); test_IntList_get_result_195 = IntList_elements_125[(test_IntList_getOffset_result_118 + i_162)]; return test_IntList_get_result_195; } function dispatch_IntListIterator_destroyIntListIterator182(integer this463) { local integer this171 local integer obj132 if (IntListIterator_typeId_108[this_463] == 0) { if (this_463 == 0) { error136("Nullpointer exception when calling IntListIterator.IntListIterator"); } else { error136("Called IntListIterator.IntListIterator on invalid object."); }; } else { }; this_171 = this_463; obj_132 = this_171; if (IntListIterator_typeId_108[obj_132] == 0) { error136("Double free: object of type IntListIterator"); } else { IntListIterator_nextFree_142[IntListIterator_firstFree_158] = obj_132; IntListIterator_firstFree_158 = (IntListIterator_firstFree_158 + 1); IntListIterator_typeId_108[obj_132] = 0; }; }