array I_nextFree166 integer I_firstFree844 integer I_maxIndex107 array I_typeId162 integer I_firstFree844 = 0 integer I_maxIndex107 = 0 function initGlobals314() { I_firstFree_844 = 0; I_maxIndex_107 = 0; } function main155() { initGlobals314(); init_test118(); } function config149() { } function init_test118() { local integer c1885 local integer c2144 c1_885 = new_C121(); c2_144 = new_D870(); if ((dispatch_B_test1_B_foo179(c1_885) == 2) and (dispatch_B_test1_B_foo179(c2_144) == 2)) { testSuccess157(); } else { }; } IS_NATIVE function testSuccess157() { } function B_foo115(integer this178) returns integer { return 2; } function B_init974(integer this155) { } function construct_B132(integer this152) { B_init974(this_152); } function C_init964(integer this170) { } function new_C121() returns integer { local integer this148 this_148 = alloc_C155(); construct_C966(this_148); return this_148; } function construct_C966(integer this147) { construct_B132(this_147); C_init964(this_147); } function D_init527(integer this563) { } function new_D870() returns integer { local integer this127 this_127 = alloc_D105(); construct_D627(this_127); return this_127; } function construct_D627(integer this331) { construct_C966(this_331); D_init527(this_331); } function error140(string msg209) { $debugPrint141((msg_209 + (" " + #getStackTrace()))); } function alloc_C155() returns integer { local integer this178 if (I_firstFree_844 == 0) { if (I_maxIndex_107 < 32768) { I_maxIndex_107 = (I_maxIndex_107 + 1); this_178 = I_maxIndex_107; I_typeId_162[this_178] = 3; } else { error140("Out of memory: Could not create C."); this_178 = 0; }; } else { I_firstFree_844 = (I_firstFree_844 - 1); this_178 = I_nextFree_166[I_firstFree_844]; I_typeId_162[this_178] = 3; }; return this_178; } function alloc_D105() returns integer { local integer this312 if (I_firstFree_844 == 0) { if (I_maxIndex_107 < 32768) { I_maxIndex_107 = (I_maxIndex_107 + 1); this_312 = I_maxIndex_107; I_typeId_162[this_312] = 4; } else { error140("Out of memory: Could not create D."); this_312 = 0; }; } else { I_firstFree_844 = (I_firstFree_844 - 1); this_312 = I_nextFree_166[I_firstFree_844]; I_typeId_162[this_312] = 4; }; return this_312; } function dispatch_B_test1_B_foo179(integer this105) returns integer { local integer test1_B_foo_result775 if (I_typeId_162[this_105] == 0) { if (this_105 == 0) { error140("Nullpointer exception when calling B.foo"); } else { error140("Called B.foo on invalid object."); }; } else { }; test1_B_foo_result_775 = B_foo115(this_105); return test1_B_foo_result_775; }