array C_nextFree130 integer C_firstFree148 integer C_maxIndex147 array Iterator_nextFree102 integer Iterator_firstFree146 integer Iterator_maxIndex964 array Iterator_typeId632 array Iterator_i165 integer C_firstFree148 = 0 integer C_maxIndex147 = 0 integer Iterator_firstFree146 = 0 integer Iterator_maxIndex964 = 0 function initGlobals176() { } function main572() { initGlobals176(); init_test152(); } function config213() { } function init_test152() { local integer iterator102 iterator_102 = C_iterator271(new_C185()); loop { exitwhen (not Iterator_hasNext409(iterator_102)); if (Iterator_next300(iterator_102) == 5) { testSuccess126(); } else { }; }; Iterator_close607(iterator_102); } IS_NATIVE function testSuccess126() { } function C_iterator271(integer this206) returns integer { return new_Iterator769(); } function C_init881(integer this139) { } function new_C185() returns integer { local integer this110 this_110 = alloc_C115(); construct_C212(this_110); return this_110; } function construct_C212(integer this343) { C_init881(this_343); } function new_Iterator769() returns integer { local integer this126 this_126 = alloc_Iterator209(); construct_Iterator251(this_126); return this_126; } function Iterator_next300(integer this100) returns any { Iterator_i_165[this_100] = (Iterator_i_165[this_100] + 1); return (Iterator_i_165[this_100] castTo any); } function Iterator_hasNext409(integer this101) returns boolean { return (Iterator_i_165[this_101] < 10); } function Iterator_close607(integer this568) { dispatch_Iterator_destroyIterator507(this_568); } function destroyIterator417(integer this222) { Iterator_onDestroy171(this_222); dealloc_Iterator724(this_222); } function Iterator_init235(integer this209) { Iterator_i_165[this_209] = 0; } function construct_Iterator251(integer this175) { Iterator_init235(this_175); } function Iterator_onDestroy171(integer this110) { } function alloc_C115() returns integer { local integer this459 if (C_firstFree_148 == 0) { if (C_maxIndex_147 < 32768) { C_maxIndex_147 = (C_maxIndex_147 + 1); this_459 = C_maxIndex_147; } else { error931("Out of memory: Could not create C."); this_459 = 0; }; } else { C_firstFree_148 = (C_firstFree_148 - 1); this_459 = C_nextFree_130[C_firstFree_148]; }; return this_459; } function error931(string msg205) { $debugPrint576((msg_205 + (" " + #getStackTrace()))); } function alloc_Iterator209() returns integer { local integer this791 if (Iterator_firstFree_146 == 0) { if (Iterator_maxIndex_964 < 32768) { Iterator_maxIndex_964 = (Iterator_maxIndex_964 + 1); this_791 = Iterator_maxIndex_964; Iterator_typeId_632[this_791] = 2; } else { error931("Out of memory: Could not create Iterator."); this_791 = 0; }; } else { Iterator_firstFree_146 = (Iterator_firstFree_146 - 1); this_791 = Iterator_nextFree_102[Iterator_firstFree_146]; Iterator_typeId_632[this_791] = 2; }; return this_791; } function dealloc_Iterator724(integer obj626) { if (Iterator_typeId_632[obj_626] == 0) { error931("Double free: object of type Iterator"); } else { Iterator_nextFree_102[Iterator_firstFree_146] = obj_626; Iterator_firstFree_146 = (Iterator_firstFree_146 + 1); Iterator_typeId_632[obj_626] = 0; }; } function dispatch_Iterator_destroyIterator507(integer this714) { if (Iterator_typeId_632[this_714] == 0) { if (this_714 == 0) { error931("Nullpointer exception when calling Iterator.Iterator"); } else { error931("Called Iterator.Iterator on invalid object."); }; } else { }; destroyIterator417(this_714); }