array A_nextFree199 integer A_firstFree119 integer A_maxIndex737 array A_typeId201 array D_c693 integer A_firstFree119 = 0 integer A_maxIndex737 = 0 function initGlobals163() { } function main115() { local integer d174 initGlobals163(); d_174 = new_D101(0); if (A_typeId_201[d_174] == 0) { if (d_174 == 0) { error909("Nullpointer exception when calling D.D"); } else { error909("Called D.D on invalid object."); }; } else { }; destroyD153(d_174); } function config212() { } IS_NATIVE function testSuccess594() { } function destroyD153(integer this112) { local integer this185 this_185 = this_112; loop { exitwhen (D_c_693[this_185] >= 4); D_c_693[this_185] = (D_c_693[this_185] + 1); }; testSuccess594(); if (A_typeId_201[this_112] == 0) { error909("Double free: object of type D"); } else { A_nextFree_199[A_firstFree_119] = this_112; A_firstFree_119 = (A_firstFree_119 + 1); A_typeId_201[this_112] = 0; }; } function new_D101(integer i105) returns integer { local integer this177 if (A_firstFree_119 == 0) { if (A_maxIndex_737 < 32768) { A_maxIndex_737 = (A_maxIndex_737 + 1); this_177 = A_maxIndex_737; A_typeId_201[this_177] = 4; } else { error909("Out of memory: Could not create D."); this_177 = 0; }; } else { A_firstFree_119 = (A_firstFree_119 - 1); this_177 = A_nextFree_199[A_firstFree_119]; A_typeId_201[this_177] = 4; }; D_c_693[this_177] = i_105; return this_177; } function error909(string msg155) { $debugPrint145((msg_155 + (" " + #getStackTrace()))); }