array C_nextFree114 integer C_firstFree169 integer C_maxIndex573 array C_typeId209 array C_i103 integer C_firstFree169 = 0 integer C_maxIndex573 = 0 function initGlobals188() { } function main693() { initGlobals188(); init_test185(); } function config814() { } function init_test185() { dispatch_C_destroyC234(new_C211()); } IS_NATIVE function testSuccess176() { } function C_init169(integer this424) { C_i_103[this_424] = 3; } function new_C211() returns integer { local integer this203 this_203 = alloc_C462(); construct_C121(this_203); return this_203; } function construct_C121(integer this907) { C_init169(this_907); } function C_onDestroy142(integer this536) { C_i_103[this_536] = (C_i_103[this_536] + 1); testSuccess176(); } function destroyC208(integer this207) { C_onDestroy142(this_207); dealloc_C161(this_207); } function alloc_C462() returns integer { local integer this204 if (C_firstFree_169 == 0) { if (C_maxIndex_573 < 32768) { C_maxIndex_573 = (C_maxIndex_573 + 1); this_204 = C_maxIndex_573; C_typeId_209[this_204] = 1; } else { error143("Out of memory: Could not create C."); this_204 = 0; }; } else { C_firstFree_169 = (C_firstFree_169 - 1); this_204 = C_nextFree_114[C_firstFree_169]; C_typeId_209[this_204] = 1; }; return this_204; } function error143(string msg547) { $debugPrint211((msg_547 + (" " + #getStackTrace()))); } function dealloc_C161(integer obj422) { if (C_typeId_209[obj_422] == 0) { error143("Double free: object of type C"); } else { C_nextFree_114[C_firstFree_169] = obj_422; C_firstFree_169 = (C_firstFree_169 + 1); C_typeId_209[obj_422] = 0; }; } function dispatch_C_destroyC234(integer this185) { if (C_typeId_209[this_185] == 0) { if (this_185 == 0) { error143("Nullpointer exception when calling C.C"); } else { error143("Called C.C on invalid object."); }; } else { }; destroyC208(this_185); }