array A_nextFree206 integer A_firstFree110 integer A_maxIndex124 array A_typeId972 array B_nextFree143 integer B_firstFree466 integer B_maxIndex129 array B_typeId615 integer A_firstFree110 = 0 integer A_maxIndex124 = 0 integer B_firstFree466 = 0 integer B_maxIndex129 = 0 function initGlobals354() { } function main753() { initGlobals354(); init_test163(); } function config131() { } function init_test163() { local integer b122 local integer this101 local integer test_A_getB_result114 local integer this853 local integer test_A_B_foo_result167 this_101 = new_A100(); if (A_typeId_972[this_101] == 0) { if (this_101 == 0) { error171("Nullpointer exception when calling A.getB"); } else { error171("Called A.getB on invalid object."); }; } else { }; test_A_getB_result_114 = new_B300(); b_122 = test_A_getB_result_114; this_853 = b_122; if (B_typeId_615[this_853] == 0) { if (this_853 == 0) { error171("Nullpointer exception when calling B.foo"); } else { error171("Called B.foo on invalid object."); }; } else { }; test_A_B_foo_result_167 = 4; if (test_A_B_foo_result_167 == 4) { testSuccess167(); } else { }; } IS_NATIVE function testSuccess167() { } function new_A100() returns integer { local integer this151 local integer this796 if (A_firstFree_110 == 0) { if (A_maxIndex_124 < 32768) { A_maxIndex_124 = (A_maxIndex_124 + 1); this_796 = A_maxIndex_124; A_typeId_972[this_796] = 1; } else { error171("Out of memory: Could not create A."); this_796 = 0; }; } else { A_firstFree_110 = (A_firstFree_110 - 1); this_796 = A_nextFree_206[A_firstFree_110]; A_typeId_972[this_796] = 1; }; this_151 = this_796; return this_151; } function new_B300() returns integer { local integer this141 local integer this919 if (B_firstFree_466 == 0) { if (B_maxIndex_129 < 32768) { B_maxIndex_129 = (B_maxIndex_129 + 1); this_919 = B_maxIndex_129; B_typeId_615[this_919] = 2; } else { error171("Out of memory: Could not create B."); this_919 = 0; }; } else { B_firstFree_466 = (B_firstFree_466 - 1); this_919 = B_nextFree_143[B_firstFree_466]; B_typeId_615[this_919] = 2; }; this_141 = this_919; return this_141; } function error171(string msg109) { $debugPrint275((msg_109 + (" " + #getStackTrace()))); }