integer test_x894 array B_nextFree124 integer B_firstFree212 integer B_maxIndex212 array B_typeId736 array B_y695 integer test_x894 = 2 integer B_firstFree212 = 0 integer B_maxIndex212 = 0 function initGlobals137() { B_firstFree_212 = 0; B_maxIndex_212 = 0; } function main108() { initGlobals137(); init_test982(); } function config785() { } function init_test982() { local integer a143 test_x_894 = 2; a_143 = new_A199(); dispatch_A_destroyA617(a_143); if (test_x_894 == 8) { testSuccess636(); } else { }; } IS_NATIVE function testSuccess636() { } function destroyA614(integer this200) { A_onDestroy194(this_200); dealloc_A606(this_200); } function A_init586(integer this207) { } function new_A199() returns integer { local integer this396 this_396 = alloc_A124(); construct_A811(this_396); return this_396; } function construct_A811(integer this181) { construct_B132(this_181); A_init586(this_181); } function A_onDestroy194(integer this177) { test_x_894 = (test_x_894 + B_y_695[this_177]); B_onDestroy106(this_177); } function B_init202(integer this130) { B_y_695[this_130] = 2; } function construct_B132(integer this474) { B_init202(this_474); } function B_onDestroy106(integer this178) { test_x_894 = (test_x_894 * B_y_695[this_178]); } function alloc_A124() returns integer { local integer this905 if (B_firstFree_212 == 0) { if (B_maxIndex_212 < 32768) { B_maxIndex_212 = (B_maxIndex_212 + 1); this_905 = B_maxIndex_212; B_typeId_736[this_905] = 2; } else { error553("Out of memory: Could not create A."); this_905 = 0; }; } else { B_firstFree_212 = (B_firstFree_212 - 1); this_905 = B_nextFree_124[B_firstFree_212]; B_typeId_736[this_905] = 2; }; return this_905; } function error553(string msg789) { $debugPrint117((msg_789 + (" " + #getStackTrace()))); } function dealloc_A606(integer obj137) { if (B_typeId_736[obj_137] == 0) { error553("Double free: object of type A"); } else { B_nextFree_124[B_firstFree_212] = obj_137; B_firstFree_212 = (B_firstFree_212 + 1); B_typeId_736[obj_137] = 0; }; } function dispatch_A_destroyA617(integer this207) { if (B_typeId_736[this_207] == 0) { if (this_207 == 0) { error553("Nullpointer exception when calling A.A"); } else { error553("Called A.A on invalid object."); }; } else { }; destroyA614(this_207); }