array A_nextFree161 integer A_firstFree111 integer A_maxIndex124 array A_typeId388 array Cell_nextFree616 integer Cell_firstFree894 integer Cell_maxIndex121 array Cell_o206 integer A_firstFree111 = 0 integer A_maxIndex124 = 0 integer Cell_firstFree894 = 0 integer Cell_maxIndex121 = 0 function initGlobals172() { A_firstFree_111 = 0; A_maxIndex_124 = 0; Cell_firstFree_894 = 0; Cell_maxIndex_121 = 0; } function main143() { initGlobals172(); init_Test157(); } function config209() { } function init_Test157() { local integer c196 c_196 = new_Cell190(); Cell_o_206[c_196] = new_B698(); if (dispatch_A_Test_A_foo899(Cell_o_206[c_196]) == 6) { testSuccess192(); } else { }; } IS_NATIVE function testSuccess192() { } function A_foo869(integer this145) returns integer { return 5; } function A_init204(integer this147) { } function construct_A156(integer this806) { A_init204(this_806); } function B_foo884(integer this154) returns integer { return 6; } function B_init205(integer this166) { } function new_B698() returns integer { local integer this164 this_164 = alloc_B187(); construct_B371(this_164); return this_164; } function construct_B371(integer this139) { construct_A156(this_139); B_init205(this_139); } function Cell_init193(integer this172) { } function new_Cell190() returns integer { local integer this937 this_937 = alloc_Cell428(); construct_Cell133(this_937); return this_937; } function construct_Cell133(integer this148) { Cell_init193(this_148); } function error736(string msg165) { $debugPrint181((msg_165 + (" " + #getStackTrace()))); } function alloc_B187() returns integer { local integer this114 if (A_firstFree_111 == 0) { if (A_maxIndex_124 < 32768) { A_maxIndex_124 = (A_maxIndex_124 + 1); this_114 = A_maxIndex_124; A_typeId_388[this_114] = 2; } else { error736("Out of memory: Could not create B."); this_114 = 0; }; } else { A_firstFree_111 = (A_firstFree_111 - 1); this_114 = A_nextFree_161[A_firstFree_111]; A_typeId_388[this_114] = 2; }; return this_114; } function alloc_Cell428() returns integer { local integer this184 if (Cell_firstFree_894 == 0) { if (Cell_maxIndex_121 < 32768) { Cell_maxIndex_121 = (Cell_maxIndex_121 + 1); this_184 = Cell_maxIndex_121; } else { error736("Out of memory: Could not create Cell."); this_184 = 0; }; } else { Cell_firstFree_894 = (Cell_firstFree_894 - 1); this_184 = Cell_nextFree_616[Cell_firstFree_894]; }; return this_184; } function dispatch_A_Test_A_foo899(integer this197) returns integer { local integer Test_A_foo_result118 if (A_typeId_388[this_197] == 0) { if (this_197 == 0) { error736("Nullpointer exception when calling A.foo"); } else { error736("Called A.foo on invalid object."); }; } else { }; if (A_typeId_388[this_197] <= 1) { Test_A_foo_result_118 = A_foo869(this_197); } else { Test_A_foo_result_118 = B_foo884(this_197); }; return Test_A_foo_result_118; }