array B_nextFree200 integer B_firstFree843 integer B_maxIndex136 array B_typeId122 integer B_firstFree843 = 0 integer B_maxIndex136 = 0 function initGlobals412() { } function main445() { initGlobals412(); init_test343(); } function config466() { } function init_test343() { local integer x1787 local integer x2399 local integer x3221 local integer x4399 x1_787 = new_C192(); x2_399 = new_D131(); x3_221 = new_C192(); x4_399 = new_D131(); if (dispatch_A_test_A_foo120(x1_787) != 1) { testFail210("1"); } else { }; if (dispatch_A_test_A_foo120(x2_399) != 2) { testFail210("2"); } else { }; if (dispatch_B_test_B_bar119(x3_221) != 3) { testFail210("3"); } else { }; if (dispatch_B_test_B_bar119(x4_399) != 4) { testFail210("4"); } else { }; testSuccess547(); } IS_NATIVE function testFail210(string s474) { } IS_NATIVE function testSuccess547() { } function new_C192() returns integer { local integer this202 local integer this186 if (B_firstFree_843 == 0) { if (B_maxIndex_136 < 32768) { B_maxIndex_136 = (B_maxIndex_136 + 1); this_186 = B_maxIndex_136; B_typeId_122[this_186] = 2; } else { error188("Out of memory: Could not create C."); this_186 = 0; }; } else { B_firstFree_843 = (B_firstFree_843 - 1); this_186 = B_nextFree_200[B_firstFree_843]; B_typeId_122[this_186] = 2; }; this_202 = this_186; return this_202; } function new_D131() returns integer { local integer this396 local integer this145 if (B_firstFree_843 == 0) { if (B_maxIndex_136 < 32768) { B_maxIndex_136 = (B_maxIndex_136 + 1); this_145 = B_maxIndex_136; B_typeId_122[this_145] = 3; } else { error188("Out of memory: Could not create D."); this_145 = 0; }; } else { B_firstFree_843 = (B_firstFree_843 - 1); this_145 = B_nextFree_200[B_firstFree_843]; B_typeId_122[this_145] = 3; }; this_396 = this_145; return this_396; } function error188(string msg130) { $debugPrint826((msg_130 + (" " + #getStackTrace()))); } function dispatch_A_test_A_foo120(integer this357) returns integer { local integer test_A_foo_result158 if (B_typeId_122[this_357] == 0) { if (this_357 == 0) { error188("Nullpointer exception when calling A.foo"); } else { error188("Called A.foo on invalid object."); }; } else { }; if (B_typeId_122[this_357] <= 2) { test_A_foo_result_158 = 1; } else { test_A_foo_result_158 = 2; }; return test_A_foo_result_158; } function dispatch_B_test_B_bar119(integer this910) returns integer { local integer test_B_bar_result129 if (B_typeId_122[this_910] == 0) { if (this_910 == 0) { error188("Nullpointer exception when calling B.bar"); } else { error188("Called B.bar on invalid object."); }; } else { }; if (B_typeId_122[this_910] <= 2) { test_B_bar_result_129 = 3; } else { test_B_bar_result_129 = 4; }; return test_B_bar_result_129; }