array A_nextFree114 integer A_firstFree140 integer A_maxIndex176 array A_typeId699 integer A_firstFree140 = 0 integer A_maxIndex176 = 0 function initGlobals989() { } function main107() { initGlobals989(); init_test201(); } function config142() { } function init_test201() { local integer a164 local integer b914 local integer this751 local integer this291 a_164 = new_A746(); b_914 = new_B171(); this_751 = a_164; if (A_typeId_699[this_751] == 0) { if (this_751 == 0) { error115("Nullpointer exception when calling A.foo"); } else { error115("Called A.foo on invalid object."); }; } else { }; this_291 = b_914; if (A_typeId_699[this_291] == 0) { if (this_291 == 0) { error115("Nullpointer exception when calling B.foo"); } else { error115("Called B.foo on invalid object."); }; } else { }; } function new_A746() returns integer { local integer this572 local integer this430 if (A_firstFree_140 == 0) { if (A_maxIndex_176 < 32768) { A_maxIndex_176 = (A_maxIndex_176 + 1); this_430 = A_maxIndex_176; A_typeId_699[this_430] = 1; } else { error115("Out of memory: Could not create A."); this_430 = 0; }; } else { A_firstFree_140 = (A_firstFree_140 - 1); this_430 = A_nextFree_114[A_firstFree_140]; A_typeId_699[this_430] = 1; }; this_572 = this_430; return this_572; } function new_B171() returns integer { local integer this179 local integer this145 if (A_firstFree_140 == 0) { if (A_maxIndex_176 < 32768) { A_maxIndex_176 = (A_maxIndex_176 + 1); this_145 = A_maxIndex_176; A_typeId_699[this_145] = 2; } else { error115("Out of memory: Could not create B."); this_145 = 0; }; } else { A_firstFree_140 = (A_firstFree_140 - 1); this_145 = A_nextFree_114[A_firstFree_140]; A_typeId_699[this_145] = 2; }; this_179 = this_145; return this_179; } function error115(string msg960) { $debugPrint871((msg_960 + (" " + #getStackTrace()))); }