array A_nextFree211 integer A_firstFree675 integer A_maxIndex635 array A_typeId749 array Cell_nextFree190 integer Cell_firstFree150 integer Cell_maxIndex207 array Cell_o694 integer A_firstFree675 = 0 integer A_maxIndex635 = 0 integer Cell_firstFree150 = 0 integer Cell_maxIndex207 = 0 function initGlobals203() { } function main178() { initGlobals203(); init_Test135(); } function config165() { } function init_Test135() { local integer c915 c_915 = new_Cell969(); Cell_o_694[c_915] = new_B183(); if (dispatch_A_Test_A_foo166(Cell_o_694[c_915]) == 6) { testSuccess171(); } else { }; } IS_NATIVE function testSuccess171() { } function A_foo342(integer this421) returns integer { return 5; } function A_init896(integer this112) { } function construct_A255(integer this119) { A_init896(this_119); } function B_foo141(integer this454) returns integer { return 6; } function B_init128(integer this180) { } function new_B183() returns integer { local integer this174 this_174 = alloc_B209(); construct_B885(this_174); return this_174; } function construct_B885(integer this217) { construct_A255(this_217); B_init128(this_217); } function Cell_init111(integer this136) { } function new_Cell969() returns integer { local integer this167 this_167 = alloc_Cell221(); construct_Cell192(this_167); return this_167; } function construct_Cell192(integer this204) { Cell_init111(this_204); } function error302(string msg150) { $debugPrint768((msg_150 + (" " + #getStackTrace()))); } function alloc_B209() returns integer { local integer this326 if (A_firstFree_675 == 0) { if (A_maxIndex_635 < 32768) { A_maxIndex_635 = (A_maxIndex_635 + 1); this_326 = A_maxIndex_635; A_typeId_749[this_326] = 2; } else { error302("Out of memory: Could not create B."); this_326 = 0; }; } else { A_firstFree_675 = (A_firstFree_675 - 1); this_326 = A_nextFree_211[A_firstFree_675]; A_typeId_749[this_326] = 2; }; return this_326; } function alloc_Cell221() returns integer { local integer this199 if (Cell_firstFree_150 == 0) { if (Cell_maxIndex_207 < 32768) { Cell_maxIndex_207 = (Cell_maxIndex_207 + 1); this_199 = Cell_maxIndex_207; } else { error302("Out of memory: Could not create Cell."); this_199 = 0; }; } else { Cell_firstFree_150 = (Cell_firstFree_150 - 1); this_199 = Cell_nextFree_190[Cell_firstFree_150]; }; return this_199; } function dispatch_A_Test_A_foo166(integer this136) returns integer { if (A_typeId_749[this_136] == 0) { if (this_136 == 0) { error302("Nullpointer exception when calling A.foo"); } else { error302("Called A.foo on invalid object."); }; } else { }; if (A_typeId_749[this_136] <= 1) { this_136 = A_foo342(this_136); } else { this_136 = B_foo141(this_136); }; return this_136; }