array I_nextFree280 integer I_firstFree663 integer I_maxIndex927 array I_typeId113 integer I_firstFree663 = 0 integer I_maxIndex927 = 0 function initGlobals916() { I_firstFree_663 = 0; I_maxIndex_927 = 0; } function main756() { initGlobals916(); init_test129(); } function config140() { } function init_test129() { local integer i1501 local integer i2102 i1_501 = new_B145(); i2_102 = new_C135(); if ((dispatch_I_test_I_foo137(i1_501) == 2) and (dispatch_I_test_I_foo137(i2_102) == 3)) { testSuccess686(); } else { }; } IS_NATIVE function testSuccess686() { } function B_foo211(integer this200) returns integer { return 2; } function B_init159(integer this568) { } function new_B145() returns integer { local integer this371 this_371 = alloc_B180(); construct_B134(this_371); return this_371; } function construct_B134(integer this576) { B_init159(this_576); } function C_foo350(integer this170) returns integer { return 3; } function C_init145(integer this737) { } function new_C135() returns integer { local integer this115 this_115 = alloc_C819(); construct_C166(this_115); return this_115; } function construct_C166(integer this150) { C_init145(this_150); } function alloc_B180() returns integer { local integer this785 if (I_firstFree_663 == 0) { if (I_maxIndex_927 < 32768) { I_maxIndex_927 = (I_maxIndex_927 + 1); this_785 = I_maxIndex_927; I_typeId_113[this_785] = 2; } else { error212("Out of memory: Could not create B."); this_785 = 0; }; } else { I_firstFree_663 = (I_firstFree_663 - 1); this_785 = I_nextFree_280[I_firstFree_663]; I_typeId_113[this_785] = 2; }; return this_785; } function error212(string msg848) { $debugPrint206((msg_848 + (" " + #getStackTrace()))); } function alloc_C819() returns integer { local integer this113 if (I_firstFree_663 == 0) { if (I_maxIndex_927 < 32768) { I_maxIndex_927 = (I_maxIndex_927 + 1); this_113 = I_maxIndex_927; I_typeId_113[this_113] = 3; } else { error212("Out of memory: Could not create C."); this_113 = 0; }; } else { I_firstFree_663 = (I_firstFree_663 - 1); this_113 = I_nextFree_280[I_firstFree_663]; I_typeId_113[this_113] = 3; }; return this_113; } function dispatch_I_test_I_foo137(integer this146) returns integer { local integer test_I_foo_result767 if (I_typeId_113[this_146] == 0) { if (this_146 == 0) { error212("Nullpointer exception when calling I.foo"); } else { error212("Called I.foo on invalid object."); }; } else { }; if (I_typeId_113[this_146] <= 2) { test_I_foo_result_767 = B_foo211(this_146); } else { test_I_foo_result_767 = C_foo350(this_146); }; return test_I_foo_result_767; }