array A_nextFree492 integer A_firstFree206 integer A_maxIndex702 array A_typeId945 array Cell_nextFree184 integer Cell_firstFree110 integer Cell_maxIndex208 array Cell_o207 integer A_firstFree206 = 0 integer A_maxIndex702 = 0 integer Cell_firstFree110 = 0 integer Cell_maxIndex208 = 0 function initGlobals858() { } function main316() { initGlobals858(); init_Test188(); } function config339() { } function init_Test188() { local integer c831 c_831 = new_Cell137(); Cell_o_207[c_831] = new_B323(); if (dispatch_A_Test_A_foo145(Cell_o_207[c_831]) == 6) { testSuccess153(); } else { }; } IS_NATIVE function testSuccess153() { } function A_foo117(integer this318) returns integer { return 5; } function A_init159(integer this730) { } function construct_A509(integer this243) { A_init159(this_243); } function B_foo123(integer this174) returns integer { return 6; } function B_init338(integer this212) { } function new_B323() returns integer { local integer this661 this_661 = alloc_B143(); construct_B144(this_661); return this_661; } function construct_B144(integer this172) { construct_A509(this_172); B_init338(this_172); } function Cell_init590(integer this152) { } function new_Cell137() returns integer { local integer this149 this_149 = alloc_Cell187(); construct_Cell933(this_149); return this_149; } function construct_Cell933(integer this109) { Cell_init590(this_109); } function error630(string msg299) { $debugPrint197((msg_299 + (" " + #getStackTrace()))); } function alloc_B143() returns integer { local integer this257 if (A_firstFree_206 == 0) { if (A_maxIndex_702 < 32768) { A_maxIndex_702 = (A_maxIndex_702 + 1); this_257 = A_maxIndex_702; A_typeId_945[this_257] = 2; } else { error630("Out of memory: Could not create B."); this_257 = 0; }; } else { A_firstFree_206 = (A_firstFree_206 - 1); this_257 = A_nextFree_492[A_firstFree_206]; A_typeId_945[this_257] = 2; }; return this_257; } function alloc_Cell187() returns integer { local integer this142 if (Cell_firstFree_110 == 0) { if (Cell_maxIndex_208 < 32768) { Cell_maxIndex_208 = (Cell_maxIndex_208 + 1); this_142 = Cell_maxIndex_208; } else { error630("Out of memory: Could not create Cell."); this_142 = 0; }; } else { Cell_firstFree_110 = (Cell_firstFree_110 - 1); this_142 = Cell_nextFree_184[Cell_firstFree_110]; }; return this_142; } function dispatch_A_Test_A_foo145(integer this192) returns integer { if (A_typeId_945[this_192] == 0) { if (this_192 == 0) { error630("Nullpointer exception when calling A.foo"); } else { error630("Called A.foo on invalid object."); }; } else { }; if (A_typeId_945[this_192] <= 1) { this_192 = A_foo117(this_192); } else { this_192 = B_foo123(this_192); }; return this_192; }