array C_nextFree143 integer C_firstFree143 integer C_maxIndex181 array Iterator_nextFree166 integer Iterator_firstFree746 integer Iterator_maxIndex176 array Iterator_typeId489 array Iterator_i133 integer C_firstFree143 = 0 integer C_maxIndex181 = 0 integer Iterator_firstFree746 = 0 integer Iterator_maxIndex176 = 0 function initGlobals117() { C_firstFree_143 = 0; C_maxIndex_181 = 0; Iterator_firstFree_746 = 0; Iterator_maxIndex_176 = 0; } function main165() { initGlobals117(); init_test212(); } function config365() { } function init_test212() { local integer c146 local integer iterator455 local integer i768 c_146 = new_C142(); iterator_455 = C_iterator188(c_146); loop { exitwhen (not Iterator_hasNext765(iterator_455)); i_768 = Iterator_next137(iterator_455); if (i_768 == 5) { testSuccess400(); } else { }; }; Iterator_close183(iterator_455); } IS_NATIVE function testSuccess400() { } function C_iterator188(integer this797) returns integer { return new_Iterator364(); } function C_init108(integer this117) { } function new_C142() returns integer { local integer this142 this_142 = alloc_C780(); construct_C149(this_142); return this_142; } function construct_C149(integer this148) { C_init108(this_148); } function new_Iterator364() returns integer { local integer this757 this_757 = alloc_Iterator180(); construct_Iterator386(this_757); return this_757; } function Iterator_next137(integer this112) returns any { Iterator_i_133[this_112] = (Iterator_i_133[this_112] + 1); return (Iterator_i_133[this_112] castTo any); } function Iterator_hasNext765(integer this177) returns boolean { return (Iterator_i_133[this_177] < 10); } function Iterator_close183(integer this516) { dispatch_Iterator_destroyIterator981(this_516); } function destroyIterator180(integer this101) { Iterator_onDestroy814(this_101); dealloc_Iterator200(this_101); } function Iterator_init194(integer this845) { Iterator_i_133[this_845] = 0; } function construct_Iterator386(integer this110) { Iterator_init194(this_110); } function Iterator_onDestroy814(integer this741) { } function alloc_C780() returns integer { local integer this175 if (C_firstFree_143 == 0) { if (C_maxIndex_181 < 32768) { C_maxIndex_181 = (C_maxIndex_181 + 1); this_175 = C_maxIndex_181; } else { error187("Out of memory: Could not create C."); this_175 = 0; }; } else { C_firstFree_143 = (C_firstFree_143 - 1); this_175 = C_nextFree_143[C_firstFree_143]; }; return this_175; } function error187(string msg104) { $debugPrint211((msg_104 + (" " + #getStackTrace()))); } function alloc_Iterator180() returns integer { local integer this193 if (Iterator_firstFree_746 == 0) { if (Iterator_maxIndex_176 < 32768) { Iterator_maxIndex_176 = (Iterator_maxIndex_176 + 1); this_193 = Iterator_maxIndex_176; Iterator_typeId_489[this_193] = 2; } else { error187("Out of memory: Could not create Iterator."); this_193 = 0; }; } else { Iterator_firstFree_746 = (Iterator_firstFree_746 - 1); this_193 = Iterator_nextFree_166[Iterator_firstFree_746]; Iterator_typeId_489[this_193] = 2; }; return this_193; } function dealloc_Iterator200(integer obj145) { if (Iterator_typeId_489[obj_145] == 0) { error187("Double free: object of type Iterator"); } else { Iterator_nextFree_166[Iterator_firstFree_746] = obj_145; Iterator_firstFree_746 = (Iterator_firstFree_746 + 1); Iterator_typeId_489[obj_145] = 0; }; } function dispatch_Iterator_destroyIterator981(integer this660) { if (Iterator_typeId_489[this_660] == 0) { if (this_660 == 0) { error187("Nullpointer exception when calling Iterator.Iterator"); } else { error187("Called Iterator.Iterator on invalid object."); }; } else { }; destroyIterator180(this_660); }