array B_nextFree186 integer B_firstFree294 integer B_maxIndex204 array B_typeId918 integer B_firstFree294 = 0 integer B_maxIndex204 = 0 function initGlobals370() { B_firstFree_294 = 0; B_maxIndex_204 = 0; } function main127() { initGlobals370(); init_A658(); } function config270() { } function init_A658() { local integer clVar739 local integer b2156 local integer clVar686 clVar_739 = alloc_B_bar_A256(); bar205(clVar_739); clVar_686 = alloc_B_A982(); b2_156 = clVar_686; if ((b2_156 castTo integer) == 1) { testSuccess147(); } else { }; } function bar205(integer b654) { dispatch_B_destroyB173(b_654); } IS_NATIVE function testSuccess147() { } function destroyB547(integer this138) { dealloc_B593(this_138); } function alloc_B_bar_A256() returns integer { local integer this189 if (B_firstFree_294 == 0) { if (B_maxIndex_204 < 32768) { B_maxIndex_204 = (B_maxIndex_204 + 1); this_189 = B_maxIndex_204; B_typeId_918[this_189] = 3; } else { error637("Out of memory: Could not create B_bar_A."); this_189 = 0; }; } else { B_firstFree_294 = (B_firstFree_294 - 1); this_189 = B_nextFree_186[B_firstFree_294]; B_typeId_918[this_189] = 3; }; return this_189; } function error637(string msg209) { $debugPrint967((msg_209 + (" " + #getStackTrace()))); } function alloc_B_A982() returns integer { local integer this183 if (B_firstFree_294 == 0) { if (B_maxIndex_204 < 32768) { B_maxIndex_204 = (B_maxIndex_204 + 1); this_183 = B_maxIndex_204; B_typeId_918[this_183] = 2; } else { error637("Out of memory: Could not create B_A."); this_183 = 0; }; } else { B_firstFree_294 = (B_firstFree_294 - 1); this_183 = B_nextFree_186[B_firstFree_294]; B_typeId_918[this_183] = 2; }; return this_183; } function dealloc_B593(integer obj777) { if (B_typeId_918[obj_777] == 0) { error637("Double free: object of type B"); } else { B_nextFree_186[B_firstFree_294] = obj_777; B_firstFree_294 = (B_firstFree_294 + 1); B_typeId_918[obj_777] = 0; }; } function dispatch_B_destroyB173(integer this171) { if (B_typeId_918[this_171] == 0) { if (this_171 == 0) { error637("Nullpointer exception when calling B.B"); } else { error637("Called B.B on invalid object."); }; } else { }; destroyB547(this_171); }