array A_nextFree210 integer A_firstFree421 integer A_maxIndex634 array A_typeId109 array D_c187 integer A_firstFree421 = 0 integer A_maxIndex634 = 0 function initGlobals383() { A_firstFree_421 = 0; A_maxIndex_634 = 0; } function main200() { initGlobals383(); init_Test121(); } function config170() { } function init_Test121() { local integer d175 d_175 = new_D192(0); dispatch_D_destroyD166(d_175); } IS_NATIVE function testSuccess198() { } function A_init868(integer this956) { } function construct_A207(integer this431) { A_init868(this_431); } function A_onDestroy120(integer this132) { } function B_init203(integer this198) { } function construct_B171(integer this124) { construct_A207(this_124); B_init203(this_124); } function B_onDestroy621(integer this777) { A_onDestroy120(this_777); } function C_init160(integer this140) { } function construct_C989(integer this842) { construct_B171(this_842); C_init160(this_842); } function C_onDestroy119(integer this693) { testSuccess198(); B_onDestroy621(this_693); } function destroyD775(integer this135) { D_onDestroy105(this_135); dealloc_D860(this_135); } function D_init437(integer this240) { } function new_D192(integer i183) returns integer { local integer this176 this_176 = alloc_D636(); construct_D195(this_176, i_183); return this_176; } function construct_D195(integer this214, integer i189) { construct_C989(this_214); D_init437(this_214); D_c_187[this_214] = i_189; } function D_onDestroy105(integer this155) { loop { exitwhen (not (D_c_187[this_155] < 4)); D_c_187[this_155] = (D_c_187[this_155] + 1); }; C_onDestroy119(this_155); } function error760(string msg371) { $debugPrint167((msg_371 + (" " + #getStackTrace()))); } function alloc_D636() returns integer { local integer this100 if (A_firstFree_421 == 0) { if (A_maxIndex_634 < 32768) { A_maxIndex_634 = (A_maxIndex_634 + 1); this_100 = A_maxIndex_634; A_typeId_109[this_100] = 4; } else { error760("Out of memory: Could not create D."); this_100 = 0; }; } else { A_firstFree_421 = (A_firstFree_421 - 1); this_100 = A_nextFree_210[A_firstFree_421]; A_typeId_109[this_100] = 4; }; return this_100; } function dealloc_D860(integer obj174) { if (A_typeId_109[obj_174] == 0) { error760("Double free: object of type D"); } else { A_nextFree_210[A_firstFree_421] = obj_174; A_firstFree_421 = (A_firstFree_421 + 1); A_typeId_109[obj_174] = 0; }; } function dispatch_D_destroyD166(integer this180) { if (A_typeId_109[this_180] == 0) { if (this_180 == 0) { error760("Nullpointer exception when calling D.D"); } else { error760("Called D.D on invalid object."); }; } else { }; destroyD775(this_180); }