array A_nextFree651 integer A_firstFree975 integer A_maxIndex147 array A_typeId125 array D_c127 integer A_firstFree975 = 0 integer A_maxIndex147 = 0 function initGlobals147() { } function main294() { initGlobals147(); init_Test161(); } function config507() { } function init_Test161() { dispatch_D_destroyD337(new_D303(0)); } IS_NATIVE function testSuccess165() { } function A_init140(integer this270) { } function construct_A146(integer this135) { A_init140(this_135); } function A_onDestroy192(integer this263) { } function B_init125(integer this112) { } function construct_B134(integer this831) { construct_A146(this_831); B_init125(this_831); } function B_onDestroy271(integer this125) { A_onDestroy192(this_125); } function C_init119(integer this394) { } function construct_C135(integer this673) { construct_B134(this_673); C_init119(this_673); } function C_onDestroy184(integer this153) { testSuccess165(); B_onDestroy271(this_153); } function destroyD878(integer this691) { D_onDestroy140(this_691); dealloc_D485(this_691); } function D_init200(integer this118) { } function new_D303(integer i148) returns integer { local integer this175 this_175 = alloc_D209(); construct_D530(this_175, i_148); return this_175; } function construct_D530(integer this107, integer i153) { construct_C135(this_107); D_init200(this_107); D_c_127[this_107] = i_153; } function D_onDestroy140(integer this318) { loop { exitwhen (D_c_127[this_318] >= 4); D_c_127[this_318] = (D_c_127[this_318] + 1); }; C_onDestroy184(this_318); } function error108(string msg163) { $debugPrint100((msg_163 + (" " + #getStackTrace()))); } function alloc_D209() returns integer { local integer this494 if (A_firstFree_975 == 0) { if (A_maxIndex_147 < 32768) { A_maxIndex_147 = (A_maxIndex_147 + 1); this_494 = A_maxIndex_147; A_typeId_125[this_494] = 4; } else { error108("Out of memory: Could not create D."); this_494 = 0; }; } else { A_firstFree_975 = (A_firstFree_975 - 1); this_494 = A_nextFree_651[A_firstFree_975]; A_typeId_125[this_494] = 4; }; return this_494; } function dealloc_D485(integer obj138) { if (A_typeId_125[obj_138] == 0) { error108("Double free: object of type D"); } else { A_nextFree_651[A_firstFree_975] = obj_138; A_firstFree_975 = (A_firstFree_975 + 1); A_typeId_125[obj_138] = 0; }; } function dispatch_D_destroyD337(integer this183) { if (A_typeId_125[this_183] == 0) { if (this_183 == 0) { error108("Nullpointer exception when calling D.D"); } else { error108("Called D.D on invalid object."); }; } else { }; destroyD878(this_183); }