array C_nextFree158 integer C_firstFree996 integer C_maxIndex182 array C_typeId171 array C_i106 integer C_firstFree996 = 0 integer C_maxIndex182 = 0 function initGlobals157() { } function main183() { local integer this100 initGlobals157(); this_100 = new_C324(); if (C_typeId_171[this_100] == 0) { if (this_100 == 0) { error400("Nullpointer exception when calling C.C"); } else { error400("Called C.C on invalid object."); }; } else { }; destroyC910(this_100); } function config145() { } IS_NATIVE function testSuccess130() { } function new_C324() returns integer { local integer this803 local integer this136 local integer this274 local integer this140 if (C_firstFree_996 == 0) { if (C_maxIndex_182 < 32768) { C_maxIndex_182 = (C_maxIndex_182 + 1); this_136 = C_maxIndex_182; C_typeId_171[this_136] = 1; } else { error400("Out of memory: Could not create C."); this_136 = 0; }; } else { C_firstFree_996 = (C_firstFree_996 - 1); this_136 = C_nextFree_158[C_firstFree_996]; C_typeId_171[this_136] = 1; }; this_803 = this_136; this_274 = this_803; this_140 = this_274; C_i_106[this_140] = 3; return this_803; } function destroyC910(integer this151) { local integer this126 local integer obj181 this_126 = this_151; C_i_106[this_126] = (C_i_106[this_126] + 1); testSuccess130(); obj_181 = this_151; if (C_typeId_171[obj_181] == 0) { error400("Double free: object of type C"); } else { C_nextFree_158[C_firstFree_996] = obj_181; C_firstFree_996 = (C_firstFree_996 + 1); C_typeId_171[obj_181] = 0; }; } function error400(string msg197) { $debugPrint751((msg_197 + (" " + #getStackTrace()))); }