array A_nextFree133 integer A_firstFree119 integer A_maxIndex826 array A_typeId116 array B_nextFree140 integer B_firstFree185 integer B_maxIndex135 array B_typeId145 integer A_firstFree119 = 0 integer A_maxIndex826 = 0 integer B_firstFree185 = 0 integer B_maxIndex135 = 0 function initGlobals124() { } function main122() { initGlobals124(); init_test105(); } function config168() { } function init_test105() { local integer i503 local integer this276 local integer test_A_bar_result857 this_276 = new_A485(); if (A_typeId_116[this_276] == 0) { if (this_276 == 0) { error335("Nullpointer exception when calling A.bar"); } else { error335("Called A.bar on invalid object."); }; } else { }; test_A_bar_result_857 = A_bar167(this_276); i_503 = test_A_bar_result_857; if (i_503 == 42) { testSuccess168(); } else { }; } IS_NATIVE function testSuccess168() { } function A_bar167(integer this140) returns integer { local integer b567 local integer this334 local integer test_A_B_foo_result129 b_567 = new_B122(); this_334 = b_567; if (B_typeId_145[this_334] == 0) { if (this_334 == 0) { error335("Nullpointer exception when calling B.foo"); } else { error335("Called B.foo on invalid object."); }; } else { }; test_A_B_foo_result_129 = 4; return ((test_A_B_foo_result_129 * 10) + 2); } function new_A485() returns integer { local integer this171 local integer this660 if (A_firstFree_119 == 0) { if (A_maxIndex_826 < 32768) { A_maxIndex_826 = (A_maxIndex_826 + 1); this_660 = A_maxIndex_826; A_typeId_116[this_660] = 1; } else { error335("Out of memory: Could not create A."); this_660 = 0; }; } else { A_firstFree_119 = (A_firstFree_119 - 1); this_660 = A_nextFree_133[A_firstFree_119]; A_typeId_116[this_660] = 1; }; this_171 = this_660; return this_171; } function new_B122() returns integer { local integer this169 local integer this127 if (B_firstFree_185 == 0) { if (B_maxIndex_135 < 32768) { B_maxIndex_135 = (B_maxIndex_135 + 1); this_127 = B_maxIndex_135; B_typeId_145[this_127] = 2; } else { error335("Out of memory: Could not create B."); this_127 = 0; }; } else { B_firstFree_185 = (B_firstFree_185 - 1); this_127 = B_nextFree_140[B_firstFree_185]; B_typeId_145[this_127] = 2; }; this_169 = this_127; return this_169; } function error335(string msg172) { $debugPrint151((msg_172 + (" " + #getStackTrace()))); }