array I_nextFree536 integer I_firstFree116 integer I_maxIndex157 array I_typeId352 integer I_firstFree116 = 0 integer I_maxIndex157 = 0 function initGlobals194() { I_firstFree_116 = 0; I_maxIndex_157 = 0; } function main152() { initGlobals194(); init_test984(); } function config102() { } function init_test984() { local integer i1117 local integer i2199 i1_117 = new_B140(); i2_199 = new_C979(); if ((dispatch_I_test_I_foo178(i1_117) == 2) and (dispatch_I_test_I_foo178(i2_199) == 3)) { testSuccess706(); } else { }; } IS_NATIVE function testSuccess706() { } function B_foo133(integer this261) returns integer { return 2; } function B_init969(integer this206) { } function new_B140() returns integer { local integer this170 this_170 = alloc_B177(); construct_B200(this_170); return this_170; } function construct_B200(integer this212) { B_init969(this_212); } function C_foo108(integer this152) returns integer { return 3; } function C_init112(integer this105) { } function new_C979() returns integer { local integer this113 this_113 = alloc_C158(); construct_C652(this_113); return this_113; } function construct_C652(integer this129) { C_init112(this_129); } function alloc_B177() returns integer { local integer this706 if (I_firstFree_116 == 0) { if (I_maxIndex_157 < 32768) { I_maxIndex_157 = (I_maxIndex_157 + 1); this_706 = I_maxIndex_157; I_typeId_352[this_706] = 2; } else { error165("Out of memory: Could not create B."); this_706 = 0; }; } else { I_firstFree_116 = (I_firstFree_116 - 1); this_706 = I_nextFree_536[I_firstFree_116]; I_typeId_352[this_706] = 2; }; return this_706; } function error165(string msg126) { $debugPrint687((msg_126 + (" " + #getStackTrace()))); } function alloc_C158() returns integer { local integer this186 if (I_firstFree_116 == 0) { if (I_maxIndex_157 < 32768) { I_maxIndex_157 = (I_maxIndex_157 + 1); this_186 = I_maxIndex_157; I_typeId_352[this_186] = 3; } else { error165("Out of memory: Could not create C."); this_186 = 0; }; } else { I_firstFree_116 = (I_firstFree_116 - 1); this_186 = I_nextFree_536[I_firstFree_116]; I_typeId_352[this_186] = 3; }; return this_186; } function dispatch_I_test_I_foo178(integer this710) returns integer { local integer test_I_foo_result202 if (I_typeId_352[this_710] == 0) { if (this_710 == 0) { error165("Nullpointer exception when calling I.foo"); } else { error165("Called I.foo on invalid object."); }; } else { }; if (I_typeId_352[this_710] <= 2) { test_I_foo_result_202 = B_foo133(this_710); } else { test_I_foo_result_202 = C_foo108(this_710); }; return test_I_foo_result_202; }