array A_nextFree852 integer A_firstFree547 integer A_maxIndex199 array A_typeId704 array A_M_i173 integer A_firstFree547 = 0 integer A_maxIndex199 = 0 function initGlobals116() { A_firstFree_547 = 0; A_maxIndex_199 = 0; } function main203() { initGlobals116(); init_Test110(); } function config124() { } function init_Test110() { local integer b687 local integer a484 b_687 = new_B417(); a_484 = b_687; dispatch_A_Test_A_f366(a_484); dispatch_B_Test_B_g129(b_687); if (A_M_i_173[a_484] != 5) { testFail123("foo"); } else { }; testSuccess503(); } IS_NATIVE function testFail123(string message125) { } IS_NATIVE function testSuccess503() { } function A_f868(integer this156) { A_M_i_173[this_156] = (A_M_i_173[this_156] + 1); A_M_i_173[this_156] = (A_M_i_173[this_156] + 1); } function A_init111(integer this973) { A_M_i_173[this_973] = 0; construct_A_M150(this_973); } function construct_A_M150(integer this125) { } function construct_A658(integer this264) { A_init111(this_264); } function B_g201(integer this176) { A_M_i_173[this_176] = (A_M_i_173[this_176] + 1); A_M_i_173[this_176] = (A_M_i_173[this_176] + 1); A_M_i_173[this_176] = (A_M_i_173[this_176] + 1); } function B_init149(integer this136) { } function new_B417() returns integer { local integer this290 this_290 = alloc_B965(); construct_B144(this_290); return this_290; } function construct_B144(integer this206) { construct_A658(this_206); B_init149(this_206); } function error447(string msg167) { $debugPrint163((msg_167 + (" " + #getStackTrace()))); } function alloc_B965() returns integer { local integer this937 if (A_firstFree_547 == 0) { if (A_maxIndex_199 < 32768) { A_maxIndex_199 = (A_maxIndex_199 + 1); this_937 = A_maxIndex_199; A_typeId_704[this_937] = 2; } else { error447("Out of memory: Could not create B."); this_937 = 0; }; } else { A_firstFree_547 = (A_firstFree_547 - 1); this_937 = A_nextFree_852[A_firstFree_547]; A_typeId_704[this_937] = 2; }; return this_937; } function dispatch_A_Test_A_f366(integer this596) { if (A_typeId_704[this_596] == 0) { if (this_596 == 0) { error447("Nullpointer exception when calling A.f"); } else { error447("Called A.f on invalid object."); }; } else { }; A_f868(this_596); } function dispatch_B_Test_B_g129(integer this130) { if (A_typeId_704[this_130] == 0) { if (this_130 == 0) { error447("Nullpointer exception when calling B.g"); } else { error447("Called B.g on invalid object."); }; } else { }; B_g201(this_130); }