integer test_x144 array B_nextFree657 integer B_firstFree231 integer B_maxIndex109 array B_typeId389 integer test_x144 = 2 integer B_firstFree231 = 0 integer B_maxIndex109 = 0 function initGlobals842() { } function main724() { initGlobals842(); init_test120(); } function config197() { } function init_test120() { local integer a825 local integer this981 test_x_144 = 2; a_825 = new_A179(); this_981 = a_825; if (B_typeId_389[this_981] == 0) { if (this_981 == 0) { error130("Nullpointer exception when calling A.A"); } else { error130("Called A.A on invalid object."); }; } else { }; destroyA174(this_981); if (test_x_144 == 6) { testSuccess886(); } else { }; } IS_NATIVE function testSuccess886() { } function destroyA174(integer this239) { local integer obj335 test_x_144 = (test_x_144 + 1); test_x_144 = (test_x_144 * 2); obj_335 = this_239; if (B_typeId_389[obj_335] == 0) { error130("Double free: object of type A"); } else { B_nextFree_657[B_firstFree_231] = obj_335; B_firstFree_231 = (B_firstFree_231 + 1); B_typeId_389[obj_335] = 0; }; } function new_A179() returns integer { local integer this183 local integer this683 if (B_firstFree_231 == 0) { if (B_maxIndex_109 < 32768) { B_maxIndex_109 = (B_maxIndex_109 + 1); this_683 = B_maxIndex_109; B_typeId_389[this_683] = 2; } else { error130("Out of memory: Could not create A."); this_683 = 0; }; } else { B_firstFree_231 = (B_firstFree_231 - 1); this_683 = B_nextFree_657[B_firstFree_231]; B_typeId_389[this_683] = 2; }; this_183 = this_683; return this_183; } function error130(string msg866) { $debugPrint111((msg_866 + (" " + #getStackTrace()))); }