array B_nextFree553 integer B_firstFree115 integer B_maxIndex418 array B_typeId869 integer B_firstFree115 = 0 integer B_maxIndex418 = 0 function initGlobals176() { B_firstFree_115 = 0; B_maxIndex_418 = 0; } function main198() { initGlobals176(); init_A416(); } function config190() { } function init_A416() { local integer clVar762 local integer b2732 local integer clVar968 clVar_762 = alloc_B_bar_A185(); bar199(clVar_762); clVar_968 = alloc_B_A123(); b2_732 = clVar_968; if ((b2_732 castTo integer) == 1) { testSuccess786(); } else { }; } function bar199(integer b556) { dispatch_B_destroyB799(b_556); } IS_NATIVE function testSuccess786() { } function destroyB322(integer this150) { dealloc_B155(this_150); } function alloc_B_bar_A185() returns integer { local integer this177 if (B_firstFree_115 == 0) { if (B_maxIndex_418 < 32768) { B_maxIndex_418 = (B_maxIndex_418 + 1); this_177 = B_maxIndex_418; B_typeId_869[this_177] = 3; } else { error289("Out of memory: Could not create B_bar_A."); this_177 = 0; }; } else { B_firstFree_115 = (B_firstFree_115 - 1); this_177 = B_nextFree_553[B_firstFree_115]; B_typeId_869[this_177] = 3; }; return this_177; } function error289(string msg173) { $debugPrint408((msg_173 + (" " + #getStackTrace()))); } function alloc_B_A123() returns integer { local integer this707 if (B_firstFree_115 == 0) { if (B_maxIndex_418 < 32768) { B_maxIndex_418 = (B_maxIndex_418 + 1); this_707 = B_maxIndex_418; B_typeId_869[this_707] = 2; } else { error289("Out of memory: Could not create B_A."); this_707 = 0; }; } else { B_firstFree_115 = (B_firstFree_115 - 1); this_707 = B_nextFree_553[B_firstFree_115]; B_typeId_869[this_707] = 2; }; return this_707; } function dealloc_B155(integer obj126) { if (B_typeId_869[obj_126] == 0) { error289("Double free: object of type B"); } else { B_nextFree_553[B_firstFree_115] = obj_126; B_firstFree_115 = (B_firstFree_115 + 1); B_typeId_869[obj_126] = 0; }; } function dispatch_B_destroyB799(integer this761) { if (B_typeId_869[this_761] == 0) { if (this_761 == 0) { error289("Nullpointer exception when calling B.B"); } else { error289("Called B.B on invalid object."); }; } else { }; destroyB322(this_761); }