array I_nextFree360 integer I_firstFree198 integer I_maxIndex133 array I_typeId461 integer I_firstFree198 = 0 integer I_maxIndex133 = 0 function initGlobals100() { } function main154() { initGlobals100(); init_test124(); } function config632() { } function init_test124() { local integer i1153 local integer i2972 i1_153 = new_B197(); i2_972 = new_C115(); if ((dispatch_I_test_I_foo610(i1_153) == 2) and (dispatch_I_test_I_foo610(i2_972) == 3)) { testSuccess587(); } else { }; } IS_NATIVE function testSuccess587() { } function B_foo357(integer this136) returns integer { return 2; } function B_init142(integer this221) { } function new_B197() returns integer { local integer this104 this_104 = alloc_B531(); construct_B111(this_104); return this_104; } function construct_B111(integer this657) { B_init142(this_657); } function C_foo176(integer this815) returns integer { return 3; } function C_init132(integer this203) { } function new_C115() returns integer { local integer this460 this_460 = alloc_C119(); construct_C181(this_460); return this_460; } function construct_C181(integer this210) { C_init132(this_210); } function alloc_B531() returns integer { local integer this201 if (I_firstFree_198 == 0) { if (I_maxIndex_133 < 32768) { I_maxIndex_133 = (I_maxIndex_133 + 1); this_201 = I_maxIndex_133; I_typeId_461[this_201] = 2; } else { error176("Out of memory: Could not create B."); this_201 = 0; }; } else { I_firstFree_198 = (I_firstFree_198 - 1); this_201 = I_nextFree_360[I_firstFree_198]; I_typeId_461[this_201] = 2; }; return this_201; } function error176(string msg102) { $debugPrint136((msg_102 + (" " + #getStackTrace()))); } function alloc_C119() returns integer { local integer this994 if (I_firstFree_198 == 0) { if (I_maxIndex_133 < 32768) { I_maxIndex_133 = (I_maxIndex_133 + 1); this_994 = I_maxIndex_133; I_typeId_461[this_994] = 3; } else { error176("Out of memory: Could not create C."); this_994 = 0; }; } else { I_firstFree_198 = (I_firstFree_198 - 1); this_994 = I_nextFree_360[I_firstFree_198]; I_typeId_461[this_994] = 3; }; return this_994; } function dispatch_I_test_I_foo610(integer this125) returns integer { if (I_typeId_461[this_125] == 0) { if (this_125 == 0) { error176("Nullpointer exception when calling I.foo"); } else { error176("Called I.foo on invalid object."); }; } else { }; if (I_typeId_461[this_125] <= 2) { this_125 = B_foo357(this_125); } else { this_125 = C_foo176(this_125); }; return this_125; }