array I_nextFree143 integer I_firstFree838 integer I_maxIndex130 array I_typeId258 integer I_firstFree838 = 0 integer I_maxIndex130 = 0 function initGlobals204() { } function main527() { initGlobals204(); init_test475(); } function config186() { } function init_test475() { local integer b617 local integer c199 local integer d508 b_617 = new_B152(); c_199 = new_C161(); d_508 = new_D383(); if (((dispatch_B_test_B_foo155(b_617) == 2) and (dispatch_I_test_I_foo191(c_199) == 5)) and (dispatch_D_test_D_foo154(d_508) == 3)) { testSuccess865(); } else { }; } IS_NATIVE function testSuccess865() { } function B_foo920(integer this150) returns integer { return 2; } function B_init187(integer this176) { } function new_B152() returns integer { local integer this130 this_130 = alloc_B584(); construct_B119(this_130); return this_130; } function construct_B119(integer this649) { B_init187(this_649); } function C_init135(integer this978) { } function new_C161() returns integer { local integer this385 this_385 = alloc_C153(); construct_C150(this_385); return this_385; } function construct_C150(integer this126) { C_init135(this_126); } function D_foo390(integer this408) returns integer { return 3; } function D_init112(integer this500) { } function new_D383() returns integer { local integer this148 this_148 = alloc_D150(); construct_D404(this_148); return this_148; } function construct_D404(integer this142) { D_init112(this_142); } function I_foo962(integer this193) returns integer { return 5; } function alloc_B584() returns integer { local integer this460 if (I_firstFree_838 == 0) { if (I_maxIndex_130 < 32768) { I_maxIndex_130 = (I_maxIndex_130 + 1); this_460 = I_maxIndex_130; I_typeId_258[this_460] = 2; } else { error133("Out of memory: Could not create B."); this_460 = 0; }; } else { I_firstFree_838 = (I_firstFree_838 - 1); this_460 = I_nextFree_143[I_firstFree_838]; I_typeId_258[this_460] = 2; }; return this_460; } function error133(string msg557) { $debugPrint209((msg_557 + (" " + #getStackTrace()))); } function alloc_C153() returns integer { local integer this133 if (I_firstFree_838 == 0) { if (I_maxIndex_130 < 32768) { I_maxIndex_130 = (I_maxIndex_130 + 1); this_133 = I_maxIndex_130; I_typeId_258[this_133] = 3; } else { error133("Out of memory: Could not create C."); this_133 = 0; }; } else { I_firstFree_838 = (I_firstFree_838 - 1); this_133 = I_nextFree_143[I_firstFree_838]; I_typeId_258[this_133] = 3; }; return this_133; } function alloc_D150() returns integer { local integer this100 if (I_firstFree_838 == 0) { if (I_maxIndex_130 < 32768) { I_maxIndex_130 = (I_maxIndex_130 + 1); this_100 = I_maxIndex_130; I_typeId_258[this_100] = 4; } else { error133("Out of memory: Could not create D."); this_100 = 0; }; } else { I_firstFree_838 = (I_firstFree_838 - 1); this_100 = I_nextFree_143[I_firstFree_838]; I_typeId_258[this_100] = 4; }; return this_100; } function dispatch_B_test_B_foo155(integer this107) returns integer { if (I_typeId_258[this_107] == 0) { if (this_107 == 0) { error133("Nullpointer exception when calling B.foo"); } else { error133("Called B.foo on invalid object."); }; } else { }; return B_foo920(this_107); } function dispatch_D_test_D_foo154(integer this730) returns integer { if (I_typeId_258[this_730] == 0) { if (this_730 == 0) { error133("Nullpointer exception when calling D.foo"); } else { error133("Called D.foo on invalid object."); }; } else { }; return D_foo390(this_730); } function dispatch_I_test_I_foo191(integer this113) returns integer { if (I_typeId_258[this_113] == 0) { if (this_113 == 0) { error133("Nullpointer exception when calling I.foo"); } else { error133("Called I.foo on invalid object."); }; } else { }; if (I_typeId_258[this_113] <= 2) { if (I_typeId_258[this_113] <= 1) { this_113 = I_foo962(this_113); } else { this_113 = B_foo920(this_113); }; } else { if (I_typeId_258[this_113] <= 3) { this_113 = I_foo962(this_113); } else { this_113 = D_foo390(this_113); }; }; return this_113; }