array I_nextFree105 integer I_firstFree427 integer I_maxIndex163 array I_typeId154 integer I_firstFree427 = 0 integer I_maxIndex163 = 0 function initGlobals204() { I_firstFree_427 = 0; I_maxIndex_163 = 0; } function main157() { initGlobals204(); init_test118(); } function config123() { } function init_test118() { local integer b671 local integer c338 local integer d363 b_671 = new_B106(); c_338 = new_C106(); d_363 = new_D197(); if (((dispatch_B_test_B_foo700(b_671) == 2) and (dispatch_I_test_I_foo866(c_338) == 5)) and (dispatch_D_test_D_foo582(d_363) == 3)) { testSuccess196(); } else { }; } IS_NATIVE function testSuccess196() { } function B_foo122(integer this974) returns integer { return 2; } function B_init107(integer this183) { } function new_B106() returns integer { local integer this378 this_378 = alloc_B347(); construct_B122(this_378); return this_378; } function construct_B122(integer this761) { B_init107(this_761); } function C_init640(integer this198) { } function new_C106() returns integer { local integer this686 this_686 = alloc_C211(); construct_C646(this_686); return this_686; } function construct_C646(integer this768) { C_init640(this_768); } function D_foo184(integer this205) returns integer { return 3; } function D_init736(integer this775) { } function new_D197() returns integer { local integer this150 this_150 = alloc_D104(); construct_D204(this_150); return this_150; } function construct_D204(integer this578) { D_init736(this_578); } function I_foo258(integer this102) returns integer { return 5; } function alloc_B347() returns integer { local integer this126 if (I_firstFree_427 == 0) { if (I_maxIndex_163 < 32768) { I_maxIndex_163 = (I_maxIndex_163 + 1); this_126 = I_maxIndex_163; I_typeId_154[this_126] = 2; } else { error175("Out of memory: Could not create B."); this_126 = 0; }; } else { I_firstFree_427 = (I_firstFree_427 - 1); this_126 = I_nextFree_105[I_firstFree_427]; I_typeId_154[this_126] = 2; }; return this_126; } function error175(string msg206) { $debugPrint241((msg_206 + (" " + #getStackTrace()))); } function alloc_C211() returns integer { local integer this854 if (I_firstFree_427 == 0) { if (I_maxIndex_163 < 32768) { I_maxIndex_163 = (I_maxIndex_163 + 1); this_854 = I_maxIndex_163; I_typeId_154[this_854] = 3; } else { error175("Out of memory: Could not create C."); this_854 = 0; }; } else { I_firstFree_427 = (I_firstFree_427 - 1); this_854 = I_nextFree_105[I_firstFree_427]; I_typeId_154[this_854] = 3; }; return this_854; } function alloc_D104() returns integer { local integer this184 if (I_firstFree_427 == 0) { if (I_maxIndex_163 < 32768) { I_maxIndex_163 = (I_maxIndex_163 + 1); this_184 = I_maxIndex_163; I_typeId_154[this_184] = 4; } else { error175("Out of memory: Could not create D."); this_184 = 0; }; } else { I_firstFree_427 = (I_firstFree_427 - 1); this_184 = I_nextFree_105[I_firstFree_427]; I_typeId_154[this_184] = 4; }; return this_184; } function dispatch_B_test_B_foo700(integer this199) returns integer { local integer test_B_foo_result164 if (I_typeId_154[this_199] == 0) { if (this_199 == 0) { error175("Nullpointer exception when calling B.foo"); } else { error175("Called B.foo on invalid object."); }; } else { }; test_B_foo_result_164 = B_foo122(this_199); return test_B_foo_result_164; } function dispatch_D_test_D_foo582(integer this817) returns integer { local integer test_D_foo_result162 if (I_typeId_154[this_817] == 0) { if (this_817 == 0) { error175("Nullpointer exception when calling D.foo"); } else { error175("Called D.foo on invalid object."); }; } else { }; test_D_foo_result_162 = D_foo184(this_817); return test_D_foo_result_162; } function dispatch_I_test_I_foo866(integer this782) returns integer { local integer test_I_foo_result458 if (I_typeId_154[this_782] == 0) { if (this_782 == 0) { error175("Nullpointer exception when calling I.foo"); } else { error175("Called I.foo on invalid object."); }; } else { }; if (I_typeId_154[this_782] <= 2) { if (I_typeId_154[this_782] <= 1) { test_I_foo_result_458 = I_foo258(this_782); } else { test_I_foo_result_458 = B_foo122(this_782); }; } else { if (I_typeId_154[this_782] <= 3) { test_I_foo_result_458 = I_foo258(this_782); } else { test_I_foo_result_458 = D_foo184(this_782); }; }; return test_I_foo_result_458; }