array A_nextFree341 integer A_firstFree661 integer A_maxIndex172 array A_typeId189 array Cell_nextFree152 integer Cell_firstFree882 integer Cell_maxIndex144 array Cell_o109 integer A_firstFree661 = 0 integer A_maxIndex172 = 0 integer Cell_firstFree882 = 0 integer Cell_maxIndex144 = 0 function initGlobals848() { } function main323() { initGlobals848(); init_Test210(); } function config933() { } function init_Test210() { local integer c590 c_590 = new_Cell495(); Cell_o_109[c_590] = new_B550(); if (dispatch_A_Test_A_foo208(Cell_o_109[c_590]) == 6) { testSuccess194(); } else { }; } IS_NATIVE function testSuccess194() { } function new_B550() returns integer { local integer this126 local integer this141 if (A_firstFree_661 == 0) { if (A_maxIndex_172 < 32768) { A_maxIndex_172 = (A_maxIndex_172 + 1); this_141 = A_maxIndex_172; A_typeId_189[this_141] = 2; } else { error143("Out of memory: Could not create B."); this_141 = 0; }; } else { A_firstFree_661 = (A_firstFree_661 - 1); this_141 = A_nextFree_341[A_firstFree_661]; A_typeId_189[this_141] = 2; }; this_126 = this_141; return this_126; } function new_Cell495() returns integer { local integer this123 local integer this209 if (Cell_firstFree_882 == 0) { if (Cell_maxIndex_144 < 32768) { Cell_maxIndex_144 = (Cell_maxIndex_144 + 1); this_209 = Cell_maxIndex_144; } else { error143("Out of memory: Could not create Cell."); this_209 = 0; }; } else { Cell_firstFree_882 = (Cell_firstFree_882 - 1); this_209 = Cell_nextFree_152[Cell_firstFree_882]; }; this_123 = this_209; return this_123; } function error143(string msg187) { $debugPrint106((msg_187 + (" " + #getStackTrace()))); } function dispatch_A_Test_A_foo208(integer this202) returns integer { local integer Test_A_foo_result630 if (A_typeId_189[this_202] == 0) { if (this_202 == 0) { error143("Nullpointer exception when calling A.foo"); } else { error143("Called A.foo on invalid object."); }; } else { }; if (A_typeId_189[this_202] <= 1) { Test_A_foo_result_630 = 5; } else { Test_A_foo_result_630 = 6; }; return Test_A_foo_result_630; }