array A_nextFree502 integer A_firstFree260 integer A_maxIndex473 array A_typeId124 integer A_firstFree260 = 0 integer A_maxIndex473 = 0 function initGlobals201() { } function main214() { initGlobals201(); init_test725(); } function config711() { } function init_test725() { local integer a121 local integer b191 a_121 = new_A109(); b_191 = new_B406(); if (A_typeId_124[a_121] == 0) { if (a_121 == 0) { error542("Nullpointer exception when calling A.foo"); } else { error542("Called A.foo on invalid object."); }; } else { }; if (A_typeId_124[b_191] == 0) { if (b_191 == 0) { error542("Nullpointer exception when calling B.foo"); } else { error542("Called B.foo on invalid object."); }; } else { }; } function new_A109() returns integer { local integer this197 if (A_firstFree_260 == 0) { if (A_maxIndex_473 < 32768) { A_maxIndex_473 = (A_maxIndex_473 + 1); this_197 = A_maxIndex_473; A_typeId_124[this_197] = 1; } else { error542("Out of memory: Could not create A."); this_197 = 0; }; } else { A_firstFree_260 = (A_firstFree_260 - 1); this_197 = A_nextFree_502[A_firstFree_260]; A_typeId_124[this_197] = 1; }; return this_197; } function new_B406() returns integer { local integer this199 if (A_firstFree_260 == 0) { if (A_maxIndex_473 < 32768) { A_maxIndex_473 = (A_maxIndex_473 + 1); this_199 = A_maxIndex_473; A_typeId_124[this_199] = 2; } else { error542("Out of memory: Could not create B."); this_199 = 0; }; } else { A_firstFree_260 = (A_firstFree_260 - 1); this_199 = A_nextFree_502[A_firstFree_260]; A_typeId_124[this_199] = 2; }; return this_199; } function error542(string msg835) { $debugPrint185((msg_835 + (" " + #getStackTrace()))); }