array C_nextFree944 integer C_firstFree548 integer C_maxIndex878 array C_typeId171 array C_i111 integer C_firstFree548 = 0 integer C_maxIndex878 = 0 function initGlobals352() { } function main130() { local integer this160 initGlobals352(); this_160 = new_C802(); if (C_typeId_171[this_160] == 0) { if (this_160 == 0) { error173("Nullpointer exception when calling C.C"); } else { error173("Called C.C on invalid object."); }; } else { }; destroyC844(this_160); } function config166() { } IS_NATIVE function testSuccess181() { } function new_C802() returns integer { local integer this801 local integer this622 local integer this905 local integer this130 if (C_firstFree_548 == 0) { if (C_maxIndex_878 < 32768) { C_maxIndex_878 = (C_maxIndex_878 + 1); this_622 = C_maxIndex_878; C_typeId_171[this_622] = 1; } else { error173("Out of memory: Could not create C."); this_622 = 0; }; } else { C_firstFree_548 = (C_firstFree_548 - 1); this_622 = C_nextFree_944[C_firstFree_548]; C_typeId_171[this_622] = 1; }; this_801 = this_622; this_905 = this_801; this_130 = this_905; C_i_111[this_130] = 3; return this_801; } function destroyC844(integer this147) { local integer this230 local integer obj147 this_230 = this_147; C_i_111[this_230] = (C_i_111[this_230] + 1); testSuccess181(); obj_147 = this_147; if (C_typeId_171[obj_147] == 0) { error173("Double free: object of type C"); } else { C_nextFree_944[C_firstFree_548] = obj_147; C_firstFree_548 = (C_firstFree_548 + 1); C_typeId_171[obj_147] = 0; }; } function error173(string msg120) { $debugPrint869((msg_120 + (" " + #getStackTrace()))); }