array IntList_elements169 array IntList_nextFree131 integer IntList_firstFree610 integer IntList_maxIndex177 array IntList_typeId112 array IntListIterator_nextFree133 integer IntListIterator_firstFree117 integer IntListIterator_maxIndex164 array IntListIterator_typeId295 array IntList_size726 array IntListIterator_list155 array IntListIterator_pos181 integer IntList_firstFree610 = 0 integer IntList_maxIndex177 = 0 integer IntListIterator_firstFree117 = 0 integer IntListIterator_maxIndex164 = 0 function initGlobals506() { } function main597() { initGlobals506(); init_test211(); } function config981() { } function init_test211() { local integer sum199 local integer listIterator363 local integer from169 sum_199 = 0; listIterator_363 = dispatch_IntList_test_IntList_iterator491(dispatch_IntList_test_IntList_add104(dispatch_IntList_test_IntList_add104(dispatch_IntList_test_IntList_add104(new_IntList124(), 7), 3), 5)); from_169 = listIterator_363; loop { exitwhen (not IntListIterator_hasNext183(from_169)); sum_199 = (sum_199 + IntListIterator_next101(from_169)); }; dispatch_IntListIterator_test_IntListIterator_close210(listIterator_363); if (sum_199 == 15) { testSuccess309(); } else { }; } IS_NATIVE function testSuccess309() { } function IntList_getOffset184(integer this141) returns integer { return (64 * ((this_141 castTo integer) - 1)); } function IntList_add775(integer this181, integer x747) returns integer { IntList_elements_169[(dispatch_IntList_test_IntList_getOffset183(this_181) + IntList_size_726[this_181])] = x_747; IntList_size_726[this_181] = (IntList_size_726[this_181] + 1); return this_181; } function IntList_get148(integer this772, integer i173) returns integer { return IntList_elements_169[(dispatch_IntList_test_IntList_getOffset183(this_772) + i_173)]; } function IntList_iterator912(integer this146) returns integer { return new_IntListIterator171(this_146); } function IntList_init156(integer this197) { IntList_size_726[this_197] = 0; } function new_IntList124() returns integer { local integer this334 this_334 = alloc_IntList330(); construct_IntList295(this_334); return this_334; } function construct_IntList295(integer this507) { IntList_init156(this_507); } function new_IntListIterator171(integer list357) returns integer { local integer this175 this_175 = alloc_IntListIterator570(); construct_IntListIterator132(this_175, list_357); return this_175; } function IntListIterator_hasNext183(integer this125) returns boolean { return (IntListIterator_pos_181[this_125] < IntList_size_726[IntListIterator_list_155[this_125]]); } function IntListIterator_next101(integer this158) returns integer { IntListIterator_pos_181[this_158] = (IntListIterator_pos_181[this_158] + 1); return dispatch_IntList_test_IntList_get123(IntListIterator_list_155[this_158], (IntListIterator_pos_181[this_158] - 1)); } function IntListIterator_close106(integer this106) { dispatch_IntListIterator_destroyIntListIterator426(this_106); } function destroyIntListIterator119(integer this477) { IntListIterator_onDestroy938(this_477); dealloc_IntListIterator275(this_477); } function IntListIterator_init882(integer this203) { IntListIterator_pos_181[this_203] = 0; } function construct_IntListIterator132(integer this181, integer list216) { IntListIterator_init882(this_181); IntListIterator_list_155[this_181] = list_216; } function IntListIterator_onDestroy938(integer this101) { } function alloc_IntList330() returns integer { local integer this582 if (IntList_firstFree_610 == 0) { if (IntList_maxIndex_177 < 32768) { IntList_maxIndex_177 = (IntList_maxIndex_177 + 1); this_582 = IntList_maxIndex_177; IntList_typeId_112[this_582] = 1; } else { error124("Out of memory: Could not create IntList."); this_582 = 0; }; } else { IntList_firstFree_610 = (IntList_firstFree_610 - 1); this_582 = IntList_nextFree_131[IntList_firstFree_610]; IntList_typeId_112[this_582] = 1; }; return this_582; } function error124(string msg113) { $debugPrint665((msg_113 + (" " + #getStackTrace()))); } function alloc_IntListIterator570() returns integer { local integer this156 if (IntListIterator_firstFree_117 == 0) { if (IntListIterator_maxIndex_164 < 32768) { IntListIterator_maxIndex_164 = (IntListIterator_maxIndex_164 + 1); this_156 = IntListIterator_maxIndex_164; IntListIterator_typeId_295[this_156] = 2; } else { error124("Out of memory: Could not create IntListIterator."); this_156 = 0; }; } else { IntListIterator_firstFree_117 = (IntListIterator_firstFree_117 - 1); this_156 = IntListIterator_nextFree_133[IntListIterator_firstFree_117]; IntListIterator_typeId_295[this_156] = 2; }; return this_156; } function dealloc_IntListIterator275(integer obj132) { if (IntListIterator_typeId_295[obj_132] == 0) { error124("Double free: object of type IntListIterator"); } else { IntListIterator_nextFree_133[IntListIterator_firstFree_117] = obj_132; IntListIterator_firstFree_117 = (IntListIterator_firstFree_117 + 1); IntListIterator_typeId_295[obj_132] = 0; }; } function dispatch_IntList_test_IntList_getOffset183(integer this178) returns integer { if (IntList_typeId_112[this_178] == 0) { if (this_178 == 0) { error124("Nullpointer exception when calling IntList.getOffset"); } else { error124("Called IntList.getOffset on invalid object."); }; } else { }; return IntList_getOffset184(this_178); } function dispatch_IntList_test_IntList_add104(integer this134, integer x133) returns integer { if (IntList_typeId_112[this_134] == 0) { if (this_134 == 0) { error124("Nullpointer exception when calling IntList.add"); } else { error124("Called IntList.add on invalid object."); }; } else { }; return IntList_add775(this_134, x_133); } function dispatch_IntList_test_IntList_get123(integer this471, integer i161) returns integer { if (IntList_typeId_112[this_471] == 0) { if (this_471 == 0) { error124("Nullpointer exception when calling IntList.get"); } else { error124("Called IntList.get on invalid object."); }; } else { }; return IntList_get148(this_471, i_161); } function dispatch_IntList_test_IntList_iterator491(integer this840) returns integer { if (IntList_typeId_112[this_840] == 0) { if (this_840 == 0) { error124("Nullpointer exception when calling IntList.iterator"); } else { error124("Called IntList.iterator on invalid object."); }; } else { }; return IntList_iterator912(this_840); } function dispatch_IntListIterator_destroyIntListIterator426(integer this336) { if (IntListIterator_typeId_295[this_336] == 0) { if (this_336 == 0) { error124("Nullpointer exception when calling IntListIterator.IntListIterator"); } else { error124("Called IntListIterator.IntListIterator on invalid object."); }; } else { }; destroyIntListIterator119(this_336); } function dispatch_IntListIterator_test_IntListIterator_close210(integer this894) { if (IntListIterator_typeId_295[this_894] == 0) { if (this_894 == 0) { error124("Nullpointer exception when calling IntListIterator.close"); } else { error124("Called IntListIterator.close on invalid object."); }; } else { }; IntListIterator_close106(this_894); }