array B_nextFree179 integer B_firstFree186 integer B_maxIndex486 array B_typeId212 integer B_firstFree186 = 0 integer B_maxIndex486 = 0 function initGlobals177() { B_firstFree_186 = 0; B_maxIndex_486 = 0; } function main213() { initGlobals177(); init_A208(); } function config183() { } function init_A208() { local integer clVar161 local integer b2208 local integer clVar182 clVar_161 = alloc_B_bar_A903(); bar991(clVar_161); clVar_182 = alloc_B_A601(); b2_208 = clVar_182; if ((b2_208 castTo integer) == 1) { testSuccess206(); } else { }; } function bar991(integer b578) { dispatch_B_destroyB141(b_578); } IS_NATIVE function testSuccess206() { } function destroyB203(integer this106) { dealloc_B101(this_106); } function alloc_B_bar_A903() returns integer { local integer this810 if (B_firstFree_186 == 0) { if (B_maxIndex_486 < 32768) { B_maxIndex_486 = (B_maxIndex_486 + 1); this_810 = B_maxIndex_486; B_typeId_212[this_810] = 3; } else { error199("Out of memory: Could not create B_bar_A."); this_810 = 0; }; } else { B_firstFree_186 = (B_firstFree_186 - 1); this_810 = B_nextFree_179[B_firstFree_186]; B_typeId_212[this_810] = 3; }; return this_810; } function error199(string msg313) { $debugPrint206((msg_313 + (" " + #getStackTrace()))); } function alloc_B_A601() returns integer { local integer this152 if (B_firstFree_186 == 0) { if (B_maxIndex_486 < 32768) { B_maxIndex_486 = (B_maxIndex_486 + 1); this_152 = B_maxIndex_486; B_typeId_212[this_152] = 2; } else { error199("Out of memory: Could not create B_A."); this_152 = 0; }; } else { B_firstFree_186 = (B_firstFree_186 - 1); this_152 = B_nextFree_179[B_firstFree_186]; B_typeId_212[this_152] = 2; }; return this_152; } function dealloc_B101(integer obj664) { if (B_typeId_212[obj_664] == 0) { error199("Double free: object of type B"); } else { B_nextFree_179[B_firstFree_186] = obj_664; B_firstFree_186 = (B_firstFree_186 + 1); B_typeId_212[obj_664] = 0; }; } function dispatch_B_destroyB141(integer this151) { if (B_typeId_212[this_151] == 0) { if (this_151 == 0) { error199("Nullpointer exception when calling B.B"); } else { error199("Called B.B on invalid object."); }; } else { }; destroyB203(this_151); }