array I_nextFree330 integer I_firstFree127 integer I_maxIndex114 array I_typeId857 integer I_firstFree127 = 0 integer I_maxIndex114 = 0 function initGlobals902() { I_firstFree_127 = 0; I_maxIndex_114 = 0; } function main158() { initGlobals902(); init_test303(); } function config129() { } function init_test303() { local integer i1202 local integer i2917 i1_202 = new_B140(); i2_917 = new_C192(); if ((dispatch_I_test_I_foo821(i1_202) == 2) and (dispatch_I_test_I_foo821(i2_917) == 3)) { testSuccess193(); } else { }; } IS_NATIVE function testSuccess193() { } function B_foo201(integer this104) returns integer { return 2; } function B_init108(integer this198) { } function new_B140() returns integer { local integer this701 this_701 = alloc_B503(); construct_B200(this_701); return this_701; } function construct_B200(integer this856) { B_init108(this_856); } function C_foo162(integer this245) returns integer { return 3; } function C_init384(integer this190) { } function new_C192() returns integer { local integer this176 this_176 = alloc_C899(); construct_C955(this_176); return this_176; } function construct_C955(integer this170) { C_init384(this_170); } function alloc_B503() returns integer { local integer this132 if (I_firstFree_127 == 0) { if (I_maxIndex_114 < 32768) { I_maxIndex_114 = (I_maxIndex_114 + 1); this_132 = I_maxIndex_114; I_typeId_857[this_132] = 2; } else { error154("Out of memory: Could not create B."); this_132 = 0; }; } else { I_firstFree_127 = (I_firstFree_127 - 1); this_132 = I_nextFree_330[I_firstFree_127]; I_typeId_857[this_132] = 2; }; return this_132; } function error154(string msg810) { $debugPrint836((msg_810 + (" " + #getStackTrace()))); } function alloc_C899() returns integer { local integer this882 if (I_firstFree_127 == 0) { if (I_maxIndex_114 < 32768) { I_maxIndex_114 = (I_maxIndex_114 + 1); this_882 = I_maxIndex_114; I_typeId_857[this_882] = 3; } else { error154("Out of memory: Could not create C."); this_882 = 0; }; } else { I_firstFree_127 = (I_firstFree_127 - 1); this_882 = I_nextFree_330[I_firstFree_127]; I_typeId_857[this_882] = 3; }; return this_882; } function dispatch_I_test_I_foo821(integer this671) returns integer { local integer test_I_foo_result172 if (I_typeId_857[this_671] == 0) { if (this_671 == 0) { error154("Nullpointer exception when calling I.foo"); } else { error154("Called I.foo on invalid object."); }; } else { }; if (I_typeId_857[this_671] <= 2) { test_I_foo_result_172 = B_foo201(this_671); } else { test_I_foo_result_172 = C_foo162(this_671); }; return test_I_foo_result_172; }