array A_nextFree192 integer A_firstFree443 integer A_maxIndex163 array A_typeId751 array A_M_i807 integer A_firstFree443 = 0 integer A_maxIndex163 = 0 function initGlobals198() { A_firstFree_443 = 0; A_maxIndex_163 = 0; } function main309() { initGlobals198(); init_Test109(); } function config103() { } function init_Test109() { local integer b141 local integer a176 b_141 = new_B933(); a_176 = b_141; dispatch_A_Test_A_f145(a_176); dispatch_B_Test_B_g102(b_141); if (A_M_i_807[a_176] != 5) { testFail493("foo"); } else { }; testSuccess418(); } IS_NATIVE function testFail493(string message142) { } IS_NATIVE function testSuccess418() { } function A_f182(integer this929) { A_M_i_807[this_929] = (A_M_i_807[this_929] + 1); A_M_i_807[this_929] = (A_M_i_807[this_929] + 1); } function A_init400(integer this147) { A_M_i_807[this_147] = 0; construct_A_M177(this_147); } function construct_A_M177(integer this150) { } function construct_A528(integer this105) { A_init400(this_105); } function B_g143(integer this129) { A_M_i_807[this_129] = (A_M_i_807[this_129] + 1); A_M_i_807[this_129] = (A_M_i_807[this_129] + 1); A_M_i_807[this_129] = (A_M_i_807[this_129] + 1); } function B_init188(integer this662) { } function new_B933() returns integer { local integer this120 this_120 = alloc_B866(); construct_B294(this_120); return this_120; } function construct_B294(integer this125) { construct_A528(this_125); B_init188(this_125); } function error575(string msg191) { $debugPrint214((msg_191 + (" " + #getStackTrace()))); } function alloc_B866() returns integer { local integer this139 if (A_firstFree_443 == 0) { if (A_maxIndex_163 < 32768) { A_maxIndex_163 = (A_maxIndex_163 + 1); this_139 = A_maxIndex_163; A_typeId_751[this_139] = 2; } else { error575("Out of memory: Could not create B."); this_139 = 0; }; } else { A_firstFree_443 = (A_firstFree_443 - 1); this_139 = A_nextFree_192[A_firstFree_443]; A_typeId_751[this_139] = 2; }; return this_139; } function dispatch_A_Test_A_f145(integer this134) { if (A_typeId_751[this_134] == 0) { if (this_134 == 0) { error575("Nullpointer exception when calling A.f"); } else { error575("Called A.f on invalid object."); }; } else { }; A_f182(this_134); } function dispatch_B_Test_B_g102(integer this548) { if (A_typeId_751[this_548] == 0) { if (this_548 == 0) { error575("Nullpointer exception when calling B.g"); } else { error575("Called B.g on invalid object."); }; } else { }; B_g143(this_548); }