array A_nextFree209 integer A_firstFree133 integer A_maxIndex107 array A_typeId883 integer A_firstFree133 = 0 integer A_maxIndex107 = 0 function initGlobals184() { A_firstFree_133 = 0; A_maxIndex_107 = 0; } function main842() { initGlobals184(); init_test988(); } function config214() { } function init_test988() { local integer a133 a_133 = new_C11290(); if (dispatch_A_test_A_foo100(a_133) != 9) { testFail551("c11"); } else { }; a_133 = new_B11913(); if (dispatch_A_test_A_foo100(a_133) != 8) { testFail551("b11"); } else { }; a_133 = new_C136(); if (dispatch_A_test_A_foo100(a_133) != 9) { testFail551("C"); } else { }; a_133 = new_A110(); if (dispatch_A_test_A_foo100(a_133) != 7) { testFail551("A"); } else { }; testSuccess376(); } IS_NATIVE function testFail551(string msg144) { } IS_NATIVE function testSuccess376() { } function A_foo411(integer this528) returns integer { return 7; } function A_init492(integer this784) { } function new_A110() returns integer { local integer this209 this_209 = alloc_A927(); construct_A163(this_209); return this_209; } function construct_A163(integer this478) { A_init492(this_478); } function B_foo874(integer this366) returns integer { return 8; } function B_init204(integer this114) { } function construct_B428(integer this577) { construct_A163(this_577); B_init204(this_577); } function B1_init183(integer this353) { } function construct_B1656(integer this128) { construct_B428(this_128); B1_init183(this_128); } function B11_init156(integer this124) { } function new_B11913() returns integer { local integer this209 this_209 = alloc_B11599(); construct_B11517(this_209); return this_209; } function construct_B11517(integer this135) { construct_B1656(this_135); B11_init156(this_135); } function C_foo113(integer this198) returns integer { return 9; } function C_init191(integer this119) { } function new_C136() returns integer { local integer this684 this_684 = alloc_C600(); construct_C143(this_684); return this_684; } function construct_C143(integer this251) { construct_A163(this_251); C_init191(this_251); } function C1_init200(integer this201) { } function construct_C1129(integer this135) { construct_C143(this_135); C1_init200(this_135); } function C11_init684(integer this154) { } function new_C11290() returns integer { local integer this101 this_101 = alloc_C11160(); construct_C11112(this_101); return this_101; } function construct_C11112(integer this156) { construct_C1129(this_156); C11_init684(this_156); } function alloc_A927() returns integer { local integer this869 if (A_firstFree_133 == 0) { if (A_maxIndex_107 < 32768) { A_maxIndex_107 = (A_maxIndex_107 + 1); this_869 = A_maxIndex_107; A_typeId_883[this_869] = 1; } else { error355("Out of memory: Could not create A."); this_869 = 0; }; } else { A_firstFree_133 = (A_firstFree_133 - 1); this_869 = A_nextFree_209[A_firstFree_133]; A_typeId_883[this_869] = 1; }; return this_869; } function error355(string msg610) { $debugPrint152((msg_610 + (" " + #getStackTrace()))); } function alloc_B11599() returns integer { local integer this154 if (A_firstFree_133 == 0) { if (A_maxIndex_107 < 32768) { A_maxIndex_107 = (A_maxIndex_107 + 1); this_154 = A_maxIndex_107; A_typeId_883[this_154] = 4; } else { error355("Out of memory: Could not create B11."); this_154 = 0; }; } else { A_firstFree_133 = (A_firstFree_133 - 1); this_154 = A_nextFree_209[A_firstFree_133]; A_typeId_883[this_154] = 4; }; return this_154; } function alloc_C600() returns integer { local integer this958 if (A_firstFree_133 == 0) { if (A_maxIndex_107 < 32768) { A_maxIndex_107 = (A_maxIndex_107 + 1); this_958 = A_maxIndex_107; A_typeId_883[this_958] = 7; } else { error355("Out of memory: Could not create C."); this_958 = 0; }; } else { A_firstFree_133 = (A_firstFree_133 - 1); this_958 = A_nextFree_209[A_firstFree_133]; A_typeId_883[this_958] = 7; }; return this_958; } function alloc_C11160() returns integer { local integer this924 if (A_firstFree_133 == 0) { if (A_maxIndex_107 < 32768) { A_maxIndex_107 = (A_maxIndex_107 + 1); this_924 = A_maxIndex_107; A_typeId_883[this_924] = 9; } else { error355("Out of memory: Could not create C11."); this_924 = 0; }; } else { A_firstFree_133 = (A_firstFree_133 - 1); this_924 = A_nextFree_209[A_firstFree_133]; A_typeId_883[this_924] = 9; }; return this_924; } function dispatch_A_test_A_foo100(integer this186) returns integer { local integer test_A_foo_result119 if (A_typeId_883[this_186] == 0) { if (this_186 == 0) { error355("Nullpointer exception when calling A.foo"); } else { error355("Called A.foo on invalid object."); }; } else { }; if (A_typeId_883[this_186] <= 6) { if (A_typeId_883[this_186] <= 1) { test_A_foo_result_119 = A_foo411(this_186); } else { test_A_foo_result_119 = B_foo874(this_186); }; } else { test_A_foo_result_119 = C_foo113(this_186); }; return test_A_foo_result_119; }