array A_nextFree937 integer A_firstFree405 integer A_maxIndex344 array A_typeId155 array D_c616 integer A_firstFree405 = 0 integer A_maxIndex344 = 0 function initGlobals704() { } function main125() { local integer d707 local integer this180 initGlobals704(); d_707 = new_D667(0); this_180 = d_707; if (A_typeId_155[this_180] == 0) { if (this_180 == 0) { error831("Nullpointer exception when calling D.D"); } else { error831("Called D.D on invalid object."); }; } else { }; destroyD154(this_180); } function config125() { } IS_NATIVE function testSuccess125() { } function destroyD154(integer this148) { local integer this171 local integer obj829 this_171 = this_148; loop { exitwhen (not (D_c_616[this_171] < 4)); D_c_616[this_171] = (D_c_616[this_171] + 1); }; testSuccess125(); obj_829 = this_148; if (A_typeId_155[obj_829] == 0) { error831("Double free: object of type D"); } else { A_nextFree_937[A_firstFree_405] = obj_829; A_firstFree_405 = (A_firstFree_405 + 1); A_typeId_155[obj_829] = 0; }; } function new_D667(integer i915) returns integer { local integer this120 local integer this185 local integer this112 local integer i138 local integer this354 if (A_firstFree_405 == 0) { if (A_maxIndex_344 < 32768) { A_maxIndex_344 = (A_maxIndex_344 + 1); this_185 = A_maxIndex_344; A_typeId_155[this_185] = 4; } else { error831("Out of memory: Could not create D."); this_185 = 0; }; } else { A_firstFree_405 = (A_firstFree_405 - 1); this_185 = A_nextFree_937[A_firstFree_405]; A_typeId_155[this_185] = 4; }; this_120 = this_185; this_112 = this_120; i_138 = i_915; this_354 = this_112; D_c_616[this_112] = i_138; return this_120; } function error831(string msg811) { $debugPrint135((msg_811 + (" " + #getStackTrace()))); }