array C_nextFree126 integer C_firstFree611 integer C_maxIndex131 array Iterator_nextFree270 integer Iterator_firstFree185 integer Iterator_maxIndex108 array Iterator_typeId683 array Iterator_i197 integer C_firstFree611 = 0 integer C_maxIndex131 = 0 integer Iterator_firstFree185 = 0 integer Iterator_maxIndex108 = 0 function initGlobals976() { } function main207() { initGlobals976(); init_test149(); } function config113() { } function init_test149() { local integer iterator633 iterator_633 = C_iterator207(new_C414()); loop { exitwhen (not Iterator_hasNext342(iterator_633)); if (Iterator_next157(iterator_633) == 5) { testSuccess946(); } else { }; }; Iterator_close109(iterator_633); } IS_NATIVE function testSuccess946() { } function C_iterator207(integer this130) returns integer { return new_Iterator128(); } function C_init165(integer this120) { } function new_C414() returns integer { local integer this129 this_129 = alloc_C158(); construct_C301(this_129); return this_129; } function construct_C301(integer this124) { C_init165(this_124); } function new_Iterator128() returns integer { local integer this300 this_300 = alloc_Iterator113(); construct_Iterator139(this_300); return this_300; } function Iterator_next157(integer this469) returns any { Iterator_i_197[this_469] = (Iterator_i_197[this_469] + 1); return (Iterator_i_197[this_469] castTo any); } function Iterator_hasNext342(integer this712) returns boolean { return (Iterator_i_197[this_712] < 10); } function Iterator_close109(integer this717) { dispatch_Iterator_destroyIterator648(this_717); } function destroyIterator116(integer this126) { Iterator_onDestroy977(this_126); dealloc_Iterator490(this_126); } function Iterator_init149(integer this113) { Iterator_i_197[this_113] = 0; } function construct_Iterator139(integer this213) { Iterator_init149(this_213); } function Iterator_onDestroy977(integer this186) { } function alloc_C158() returns integer { local integer this174 if (C_firstFree_611 == 0) { if (C_maxIndex_131 < 32768) { C_maxIndex_131 = (C_maxIndex_131 + 1); this_174 = C_maxIndex_131; } else { error957("Out of memory: Could not create C."); this_174 = 0; }; } else { C_firstFree_611 = (C_firstFree_611 - 1); this_174 = C_nextFree_126[C_firstFree_611]; }; return this_174; } function error957(string msg985) { $debugPrint182((msg_985 + (" " + #getStackTrace()))); } function alloc_Iterator113() returns integer { local integer this110 if (Iterator_firstFree_185 == 0) { if (Iterator_maxIndex_108 < 32768) { Iterator_maxIndex_108 = (Iterator_maxIndex_108 + 1); this_110 = Iterator_maxIndex_108; Iterator_typeId_683[this_110] = 2; } else { error957("Out of memory: Could not create Iterator."); this_110 = 0; }; } else { Iterator_firstFree_185 = (Iterator_firstFree_185 - 1); this_110 = Iterator_nextFree_270[Iterator_firstFree_185]; Iterator_typeId_683[this_110] = 2; }; return this_110; } function dealloc_Iterator490(integer obj994) { if (Iterator_typeId_683[obj_994] == 0) { error957("Double free: object of type Iterator"); } else { Iterator_nextFree_270[Iterator_firstFree_185] = obj_994; Iterator_firstFree_185 = (Iterator_firstFree_185 + 1); Iterator_typeId_683[obj_994] = 0; }; } function dispatch_Iterator_destroyIterator648(integer this162) { if (Iterator_typeId_683[this_162] == 0) { if (this_162 == 0) { error957("Nullpointer exception when calling Iterator.Iterator"); } else { error957("Called Iterator.Iterator on invalid object."); }; } else { }; destroyIterator116(this_162); }