array A_nextFree160 integer A_firstFree718 integer A_maxIndex171 array A_typeId148 integer A_firstFree718 = 0 integer A_maxIndex171 = 0 function initGlobals192() { } function main727() { local integer b707 initGlobals192(); b_707 = new_B134(); dispatch_A_destroyA240(b_707); } function config125() { } IS_NATIVE function testSuccess197() { } function destroyB155(integer this182) { local integer obj731 testSuccess197(); obj_731 = this_182; if (A_typeId_148[obj_731] == 0) { error208("Double free: object of type B"); } else { A_nextFree_160[A_firstFree_718] = obj_731; A_firstFree_718 = (A_firstFree_718 + 1); A_typeId_148[obj_731] = 0; }; } function new_B134() returns integer { local integer this178 local integer this212 if (A_firstFree_718 == 0) { if (A_maxIndex_171 < 32768) { A_maxIndex_171 = (A_maxIndex_171 + 1); this_212 = A_maxIndex_171; A_typeId_148[this_212] = 2; } else { error208("Out of memory: Could not create B."); this_212 = 0; }; } else { A_firstFree_718 = (A_firstFree_718 - 1); this_212 = A_nextFree_160[A_firstFree_718]; A_typeId_148[this_212] = 2; }; this_178 = this_212; return this_178; } function error208(string msg129) { $debugPrint103((msg_129 + (" " + #getStackTrace()))); } function dispatch_A_destroyA240(integer this294) { local integer this114 local integer obj173 if (A_typeId_148[this_294] == 0) { if (this_294 == 0) { error208("Nullpointer exception when calling A.A"); } else { error208("Called A.A on invalid object."); }; } else { }; if (A_typeId_148[this_294] <= 1) { this_114 = this_294; obj_173 = this_114; if (A_typeId_148[obj_173] == 0) { error208("Double free: object of type A"); } else { A_nextFree_160[A_firstFree_718] = obj_173; A_firstFree_718 = (A_firstFree_718 + 1); A_typeId_148[obj_173] = 0; }; } else { destroyB155(this_294); }; }