array I_nextFree190 integer I_firstFree323 integer I_maxIndex347 array I_typeId322 integer I_firstFree323 = 0 integer I_maxIndex347 = 0 function initGlobals111() { } function main165() { initGlobals111(); init_test161(); } function config162() { } function init_test161() { local integer i1122 local integer i2102 i1_122 = new_B144(); i2_102 = new_C204(); if ((dispatch_I_test_I_foo923(i1_122) == 2) and (dispatch_I_test_I_foo923(i2_102) == 3)) { testSuccess124(); } else { }; } IS_NATIVE function testSuccess124() { } function B_foo157(integer this205) returns integer { return 2; } function B_init774(integer this214) { } function new_B144() returns integer { local integer this140 this_140 = alloc_B114(); construct_B160(this_140); return this_140; } function construct_B160(integer this172) { B_init774(this_172); } function C_foo725(integer this151) returns integer { return 3; } function C_init166(integer this146) { } function new_C204() returns integer { local integer this103 this_103 = alloc_C140(); construct_C439(this_103); return this_103; } function construct_C439(integer this893) { C_init166(this_893); } function alloc_B114() returns integer { local integer this368 if (I_firstFree_323 == 0) { if (I_maxIndex_347 < 32768) { I_maxIndex_347 = (I_maxIndex_347 + 1); this_368 = I_maxIndex_347; I_typeId_322[this_368] = 2; } else { error730("Out of memory: Could not create B."); this_368 = 0; }; } else { I_firstFree_323 = (I_firstFree_323 - 1); this_368 = I_nextFree_190[I_firstFree_323]; I_typeId_322[this_368] = 2; }; return this_368; } function error730(string msg546) { $debugPrint143((msg_546 + (" " + #getStackTrace()))); } function alloc_C140() returns integer { local integer this107 if (I_firstFree_323 == 0) { if (I_maxIndex_347 < 32768) { I_maxIndex_347 = (I_maxIndex_347 + 1); this_107 = I_maxIndex_347; I_typeId_322[this_107] = 3; } else { error730("Out of memory: Could not create C."); this_107 = 0; }; } else { I_firstFree_323 = (I_firstFree_323 - 1); this_107 = I_nextFree_190[I_firstFree_323]; I_typeId_322[this_107] = 3; }; return this_107; } function dispatch_I_test_I_foo923(integer this253) returns integer { if (I_typeId_322[this_253] == 0) { if (this_253 == 0) { error730("Nullpointer exception when calling I.foo"); } else { error730("Called I.foo on invalid object."); }; } else { }; if (I_typeId_322[this_253] <= 2) { this_253 = B_foo157(this_253); } else { this_253 = C_foo725(this_253); }; return this_253; }