array A_nextFree675 integer A_firstFree686 integer A_maxIndex185 array A_typeId211 array A_M_i174 integer A_firstFree686 = 0 integer A_maxIndex185 = 0 function initGlobals356() { } function main703() { initGlobals356(); init_Test178(); } function config223() { } function init_Test178() { local integer b351 b_351 = new_B263(); dispatch_A_Test_A_f181(b_351); dispatch_B_Test_B_g184(b_351); if (A_M_i_174[b_351] != 5) { testFail184("foo"); } else { }; testSuccess199(); } IS_NATIVE function testFail184(string message110) { } IS_NATIVE function testSuccess199() { } function A_f131(integer this199) { A_M_i_174[this_199] = (A_M_i_174[this_199] + 1); A_M_i_174[this_199] = (A_M_i_174[this_199] + 1); } function A_init177(integer this805) { A_M_i_174[this_805] = 0; construct_A_M980(this_805); } function construct_A_M980(integer this429) { } function construct_A305(integer this508) { A_init177(this_508); } function B_g331(integer this178) { A_M_i_174[this_178] = (A_M_i_174[this_178] + 1); A_M_i_174[this_178] = (A_M_i_174[this_178] + 1); A_M_i_174[this_178] = (A_M_i_174[this_178] + 1); } function B_init572(integer this148) { } function new_B263() returns integer { local integer this168 this_168 = alloc_B874(); construct_B349(this_168); return this_168; } function construct_B349(integer this139) { construct_A305(this_139); B_init572(this_139); } function error207(string msg875) { $debugPrint679((msg_875 + (" " + #getStackTrace()))); } function alloc_B874() returns integer { local integer this215 if (A_firstFree_686 == 0) { if (A_maxIndex_185 < 32768) { A_maxIndex_185 = (A_maxIndex_185 + 1); this_215 = A_maxIndex_185; A_typeId_211[this_215] = 2; } else { error207("Out of memory: Could not create B."); this_215 = 0; }; } else { A_firstFree_686 = (A_firstFree_686 - 1); this_215 = A_nextFree_675[A_firstFree_686]; A_typeId_211[this_215] = 2; }; return this_215; } function dispatch_A_Test_A_f181(integer this164) { if (A_typeId_211[this_164] == 0) { if (this_164 == 0) { error207("Nullpointer exception when calling A.f"); } else { error207("Called A.f on invalid object."); }; } else { }; A_f131(this_164); } function dispatch_B_Test_B_g184(integer this166) { if (A_typeId_211[this_166] == 0) { if (this_166 == 0) { error207("Nullpointer exception when calling B.g"); } else { error207("Called B.g on invalid object."); }; } else { }; B_g331(this_166); }