array B_nextFree381 integer B_firstFree138 integer B_maxIndex118 array B_typeId816 integer B_firstFree138 = 0 integer B_maxIndex118 = 0 function initGlobals205() { } function main109() { initGlobals205(); init_test689(); } function config762() { } function init_test689() { local integer x1333 local integer x2504 local integer x3815 local integer x4851 x1_333 = new_C148(); x2_504 = new_D109(); x3_815 = new_C148(); x4_851 = new_D109(); if (dispatch_A_test_A_foo197(x1_333) != 1) { testFail189("1"); } else { }; if (dispatch_A_test_A_foo197(x2_504) != 2) { testFail189("2"); } else { }; if (dispatch_B_test_B_bar155(x3_815) != 3) { testFail189("3"); } else { }; if (dispatch_B_test_B_bar155(x4_851) != 4) { testFail189("4"); } else { }; testSuccess115(); } IS_NATIVE function testFail189(string s126) { } IS_NATIVE function testSuccess115() { } function new_C148() returns integer { local integer this581 if (B_firstFree_138 == 0) { if (B_maxIndex_118 < 32768) { B_maxIndex_118 = (B_maxIndex_118 + 1); this_581 = B_maxIndex_118; B_typeId_816[this_581] = 2; } else { error905("Out of memory: Could not create C."); this_581 = 0; }; } else { B_firstFree_138 = (B_firstFree_138 - 1); this_581 = B_nextFree_381[B_firstFree_138]; B_typeId_816[this_581] = 2; }; return this_581; } function new_D109() returns integer { local integer this189 if (B_firstFree_138 == 0) { if (B_maxIndex_118 < 32768) { B_maxIndex_118 = (B_maxIndex_118 + 1); this_189 = B_maxIndex_118; B_typeId_816[this_189] = 3; } else { error905("Out of memory: Could not create D."); this_189 = 0; }; } else { B_firstFree_138 = (B_firstFree_138 - 1); this_189 = B_nextFree_381[B_firstFree_138]; B_typeId_816[this_189] = 3; }; return this_189; } function error905(string msg926) { $debugPrint972((msg_926 + (" " + #getStackTrace()))); } function dispatch_A_test_A_foo197(integer this170) returns integer { if (B_typeId_816[this_170] == 0) { if (this_170 == 0) { error905("Nullpointer exception when calling A.foo"); } else { error905("Called A.foo on invalid object."); }; } else { }; if (B_typeId_816[this_170] <= 2) { this_170 = 1; } else { this_170 = 2; }; return this_170; } function dispatch_B_test_B_bar155(integer this119) returns integer { if (B_typeId_816[this_119] == 0) { if (this_119 == 0) { error905("Nullpointer exception when calling B.bar"); } else { error905("Called B.bar on invalid object."); }; } else { }; if (B_typeId_816[this_119] <= 2) { this_119 = 3; } else { this_119 = 4; }; return this_119; }