array A_nextFree632 integer A_firstFree210 integer A_maxIndex738 array A_typeId156 integer A_firstFree210 = 0 integer A_maxIndex738 = 0 function initGlobals312() { } function main162() { initGlobals312(); init_test291(); } function config939() { } function init_test291() { local integer a334 local integer b210 a_334 = new_A773(); b_210 = new_B673(); if (A_typeId_156[a_334] == 0) { if (a_334 == 0) { error427("Nullpointer exception when calling A.foo"); } else { error427("Called A.foo on invalid object."); }; } else { }; if (A_typeId_156[b_210] == 0) { if (b_210 == 0) { error427("Nullpointer exception when calling B.foo"); } else { error427("Called B.foo on invalid object."); }; } else { }; } function new_A773() returns integer { local integer this146 if (A_firstFree_210 == 0) { if (A_maxIndex_738 < 32768) { A_maxIndex_738 = (A_maxIndex_738 + 1); this_146 = A_maxIndex_738; A_typeId_156[this_146] = 1; } else { error427("Out of memory: Could not create A."); this_146 = 0; }; } else { A_firstFree_210 = (A_firstFree_210 - 1); this_146 = A_nextFree_632[A_firstFree_210]; A_typeId_156[this_146] = 1; }; return this_146; } function new_B673() returns integer { local integer this293 if (A_firstFree_210 == 0) { if (A_maxIndex_738 < 32768) { A_maxIndex_738 = (A_maxIndex_738 + 1); this_293 = A_maxIndex_738; A_typeId_156[this_293] = 2; } else { error427("Out of memory: Could not create B."); this_293 = 0; }; } else { A_firstFree_210 = (A_firstFree_210 - 1); this_293 = A_nextFree_632[A_firstFree_210]; A_typeId_156[this_293] = 2; }; return this_293; } function error427(string msg129) { $debugPrint566((msg_129 + (" " + #getStackTrace()))); }