array A_nextFree192 integer A_firstFree567 integer A_maxIndex153 array A_typeId123 integer A_firstFree567 = 0 integer A_maxIndex153 = 0 function initGlobals181() { } function main142() { initGlobals181(); dispatch_A_destroyA321(new_B337()); } function config124() { } IS_NATIVE function testSuccess102() { } function destroyB129(integer this189) { testSuccess102(); if (A_typeId_123[this_189] == 0) { error554("Double free: object of type B"); } else { A_nextFree_192[A_firstFree_567] = this_189; A_firstFree_567 = (A_firstFree_567 + 1); A_typeId_123[this_189] = 0; }; } function new_B337() returns integer { local integer this116 if (A_firstFree_567 == 0) { if (A_maxIndex_153 < 32768) { A_maxIndex_153 = (A_maxIndex_153 + 1); this_116 = A_maxIndex_153; A_typeId_123[this_116] = 2; } else { error554("Out of memory: Could not create B."); this_116 = 0; }; } else { A_firstFree_567 = (A_firstFree_567 - 1); this_116 = A_nextFree_192[A_firstFree_567]; A_typeId_123[this_116] = 2; }; return this_116; } function error554(string msg213) { $debugPrint104((msg_213 + (" " + #getStackTrace()))); } function dispatch_A_destroyA321(integer this100) { if (A_typeId_123[this_100] == 0) { if (this_100 == 0) { error554("Nullpointer exception when calling A.A"); } else { error554("Called A.A on invalid object."); }; } else { }; if (A_typeId_123[this_100] <= 1) { if (A_typeId_123[this_100] == 0) { error554("Double free: object of type A"); } else { A_nextFree_192[A_firstFree_567] = this_100; A_firstFree_567 = (A_firstFree_567 + 1); A_typeId_123[this_100] = 0; }; } else { destroyB129(this_100); }; }