array C_nextFree803 integer C_firstFree910 integer C_maxIndex183 array C_typeId126 array C_i155 integer C_firstFree910 = 0 integer C_maxIndex183 = 0 function initGlobals150() { } function main115() { initGlobals150(); init_test191(); } function config580() { } function init_test191() { dispatch_C_destroyC151(new_C143()); } IS_NATIVE function testSuccess674() { } function C_init175(integer this117) { C_i_155[this_117] = 3; } function new_C143() returns integer { local integer this145 this_145 = alloc_C996(); construct_C139(this_145); return this_145; } function construct_C139(integer this191) { C_init175(this_191); } function C_onDestroy157(integer this140) { C_i_155[this_140] = (C_i_155[this_140] + 1); testSuccess674(); } function destroyC183(integer this747) { C_onDestroy157(this_747); dealloc_C182(this_747); } function alloc_C996() returns integer { local integer this399 if (C_firstFree_910 == 0) { if (C_maxIndex_183 < 32768) { C_maxIndex_183 = (C_maxIndex_183 + 1); this_399 = C_maxIndex_183; C_typeId_126[this_399] = 1; } else { error207("Out of memory: Could not create C."); this_399 = 0; }; } else { C_firstFree_910 = (C_firstFree_910 - 1); this_399 = C_nextFree_803[C_firstFree_910]; C_typeId_126[this_399] = 1; }; return this_399; } function error207(string msg786) { $debugPrint167((msg_786 + (" " + #getStackTrace()))); } function dealloc_C182(integer obj230) { if (C_typeId_126[obj_230] == 0) { error207("Double free: object of type C"); } else { C_nextFree_803[C_firstFree_910] = obj_230; C_firstFree_910 = (C_firstFree_910 + 1); C_typeId_126[obj_230] = 0; }; } function dispatch_C_destroyC151(integer this177) { if (C_typeId_126[this_177] == 0) { if (this_177 == 0) { error207("Nullpointer exception when calling C.C"); } else { error207("Called C.C on invalid object."); }; } else { }; destroyC183(this_177); }