array A_nextFree192 integer A_firstFree931 integer A_maxIndex252 array A_typeId152 array D_c134 integer A_firstFree931 = 0 integer A_maxIndex252 = 0 function initGlobals107() { } function main436() { local integer d726 initGlobals107(); d_726 = new_D121(0); if (A_typeId_152[d_726] == 0) { if (d_726 == 0) { error156("Nullpointer exception when calling D.D"); } else { error156("Called D.D on invalid object."); }; } else { }; destroyD116(d_726); } function config155() { } IS_NATIVE function testSuccess195() { } function destroyD116(integer this874) { local integer this199 this_199 = this_874; loop { exitwhen (D_c_134[this_199] >= 4); D_c_134[this_199] = (D_c_134[this_199] + 1); }; testSuccess195(); if (A_typeId_152[this_874] == 0) { error156("Double free: object of type D"); } else { A_nextFree_192[A_firstFree_931] = this_874; A_firstFree_931 = (A_firstFree_931 + 1); A_typeId_152[this_874] = 0; }; } function new_D121(integer i140) returns integer { local integer this130 if (A_firstFree_931 == 0) { if (A_maxIndex_252 < 32768) { A_maxIndex_252 = (A_maxIndex_252 + 1); this_130 = A_maxIndex_252; A_typeId_152[this_130] = 4; } else { error156("Out of memory: Could not create D."); this_130 = 0; }; } else { A_firstFree_931 = (A_firstFree_931 - 1); this_130 = A_nextFree_192[A_firstFree_931]; A_typeId_152[this_130] = 4; }; D_c_134[this_130] = i_140; return this_130; } function error156(string msg435) { $debugPrint568((msg_435 + (" " + #getStackTrace()))); }