array test_ar137 array I_nextFree199 integer I_firstFree182 integer I_maxIndex432 array I_typeId145 integer I_firstFree182 = 0 integer I_maxIndex432 = 0 function initGlobals410() { I_firstFree_182 = 0; I_maxIndex_432 = 0; } function main202() { initGlobals410(); init_test146(); } function config119() { } function init_test146() { local integer temp385 test_ar_137[5] = new_B201(); test_ar_137[6] = new_C141(); temp_385 = test_ar_137[6]; test_ar_137[6] = test_ar_137[5]; test_ar_137[5] = temp_385; if ((dispatch_I_test_I_foo194(test_ar_137[5]) == 3) and (dispatch_I_test_I_foo194(test_ar_137[6]) == 2)) { testSuccess133(); } else { }; } IS_NATIVE function testSuccess133() { } function B_foo107(integer this118) returns integer { return 2; } function B_init138(integer this989) { } function new_B201() returns integer { local integer this668 this_668 = alloc_B106(); construct_B713(this_668); return this_668; } function construct_B713(integer this118) { B_init138(this_118); } function C_foo394(integer this186) returns integer { return 3; } function C_init670(integer this119) { } function new_C141() returns integer { local integer this161 this_161 = alloc_C694(); construct_C123(this_161); return this_161; } function construct_C123(integer this194) { C_init670(this_194); } function alloc_B106() returns integer { local integer this143 if (I_firstFree_182 == 0) { if (I_maxIndex_432 < 32768) { I_maxIndex_432 = (I_maxIndex_432 + 1); this_143 = I_maxIndex_432; I_typeId_145[this_143] = 2; } else { error209("Out of memory: Could not create B."); this_143 = 0; }; } else { I_firstFree_182 = (I_firstFree_182 - 1); this_143 = I_nextFree_199[I_firstFree_182]; I_typeId_145[this_143] = 2; }; return this_143; } function error209(string msg863) { $debugPrint144((msg_863 + (" " + #getStackTrace()))); } function alloc_C694() returns integer { local integer this188 if (I_firstFree_182 == 0) { if (I_maxIndex_432 < 32768) { I_maxIndex_432 = (I_maxIndex_432 + 1); this_188 = I_maxIndex_432; I_typeId_145[this_188] = 3; } else { error209("Out of memory: Could not create C."); this_188 = 0; }; } else { I_firstFree_182 = (I_firstFree_182 - 1); this_188 = I_nextFree_199[I_firstFree_182]; I_typeId_145[this_188] = 3; }; return this_188; } function dispatch_I_test_I_foo194(integer this121) returns integer { local integer test_I_foo_result733 if (I_typeId_145[this_121] == 0) { if (this_121 == 0) { error209("Nullpointer exception when calling I.foo"); } else { error209("Called I.foo on invalid object."); }; } else { }; if (I_typeId_145[this_121] <= 2) { test_I_foo_result_733 = B_foo107(this_121); } else { test_I_foo_result_733 = C_foo394(this_121); }; return test_I_foo_result_733; }