array I_nextFree335 integer I_firstFree778 integer I_maxIndex101 array I_typeId157 integer I_firstFree778 = 0 integer I_maxIndex101 = 0 function initGlobals825() { } function main172() { initGlobals825(); init_test184(); } function config127() { } function init_test184() { local integer b137 local integer c184 local integer d154 b_137 = new_B643(); c_184 = new_C185(); d_154 = new_D158(); if (dispatch_I_test_I_foo248(b_137) != 2) { testFail381("b"); } else { }; if (dispatch_I_test_I_foo248(c_184) != 3) { testFail381("c"); } else { }; if (dispatch_I_test_I_foo248(d_154) != 5) { testFail381("d"); } else { }; testSuccess150(); } IS_NATIVE function testFail381(string s176) { } IS_NATIVE function testSuccess150() { } function B_foo402(integer this174) returns integer { return 2; } function B_init162(integer this195) { } function new_B643() returns integer { local integer this513 this_513 = alloc_B191(); construct_B673(this_513); return this_513; } function construct_B673(integer this755) { B_init162(this_755); } function C_foo635(integer this886) returns integer { return 3; } function C_init203(integer this105) { } function new_C185() returns integer { local integer this319 this_319 = alloc_C142(); construct_C195(this_319); return this_319; } function construct_C195(integer this690) { C_init203(this_690); } function D_init199(integer this948) { } function new_D158() returns integer { local integer this371 this_371 = alloc_D138(); construct_D147(this_371); return this_371; } function construct_D147(integer this181) { D_init199(this_181); } function I_foo729(integer this845) returns integer { return 5; } function alloc_B191() returns integer { local integer this179 if (I_firstFree_778 == 0) { if (I_maxIndex_101 < 32768) { I_maxIndex_101 = (I_maxIndex_101 + 1); this_179 = I_maxIndex_101; I_typeId_157[this_179] = 2; } else { error277("Out of memory: Could not create B."); this_179 = 0; }; } else { I_firstFree_778 = (I_firstFree_778 - 1); this_179 = I_nextFree_335[I_firstFree_778]; I_typeId_157[this_179] = 2; }; return this_179; } function error277(string msg134) { $debugPrint802((msg_134 + (" " + #getStackTrace()))); } function alloc_C142() returns integer { local integer this132 if (I_firstFree_778 == 0) { if (I_maxIndex_101 < 32768) { I_maxIndex_101 = (I_maxIndex_101 + 1); this_132 = I_maxIndex_101; I_typeId_157[this_132] = 3; } else { error277("Out of memory: Could not create C."); this_132 = 0; }; } else { I_firstFree_778 = (I_firstFree_778 - 1); this_132 = I_nextFree_335[I_firstFree_778]; I_typeId_157[this_132] = 3; }; return this_132; } function alloc_D138() returns integer { local integer this204 if (I_firstFree_778 == 0) { if (I_maxIndex_101 < 32768) { I_maxIndex_101 = (I_maxIndex_101 + 1); this_204 = I_maxIndex_101; I_typeId_157[this_204] = 4; } else { error277("Out of memory: Could not create D."); this_204 = 0; }; } else { I_firstFree_778 = (I_firstFree_778 - 1); this_204 = I_nextFree_335[I_firstFree_778]; I_typeId_157[this_204] = 4; }; return this_204; } function dispatch_I_test_I_foo248(integer this197) returns integer { if (I_typeId_157[this_197] == 0) { if (this_197 == 0) { error277("Nullpointer exception when calling I.foo"); } else { error277("Called I.foo on invalid object."); }; } else { }; if (I_typeId_157[this_197] <= 2) { if (I_typeId_157[this_197] <= 1) { this_197 = I_foo729(this_197); } else { this_197 = B_foo402(this_197); }; } else { if (I_typeId_157[this_197] <= 3) { this_197 = C_foo635(this_197); } else { this_197 = I_foo729(this_197); }; }; return this_197; }