string test_s128 array T_nextFree764 integer T_firstFree124 integer T_maxIndex123 array T_typeId915 string test_s128 = "" integer T_firstFree124 = 0 integer T_maxIndex123 = 0 function initGlobals206() { } function main197() { local integer t229 initGlobals206(); test_s_128 = ""; t_229 = new_A181(); dispatch_T_destroyT237(t_229); if (test_s_128 == "") { testSuccess157(); } else { }; } function config171() { } IS_NATIVE function testSuccess157() { } function new_A181() returns integer { local integer this450 local integer this734 if (T_firstFree_124 == 0) { if (T_maxIndex_123 < 32768) { T_maxIndex_123 = (T_maxIndex_123 + 1); this_734 = T_maxIndex_123; T_typeId_915[this_734] = 2; } else { error208("Out of memory: Could not create A."); this_734 = 0; }; } else { T_firstFree_124 = (T_firstFree_124 - 1); this_734 = T_nextFree_764[T_firstFree_124]; T_typeId_915[this_734] = 2; }; this_450 = this_734; return this_450; } function error208(string msg203) { $debugPrint118((msg_203 + (" " + #getStackTrace()))); } function dispatch_T_destroyT237(integer this701) { local integer this156 local integer obj842 local integer this104 local integer obj179 local integer this140 local integer obj211 if (T_typeId_915[this_701] == 0) { if (this_701 == 0) { error208("Nullpointer exception when calling T.T"); } else { error208("Called T.T on invalid object."); }; } else { }; if (T_typeId_915[this_701] <= 2) { if (T_typeId_915[this_701] <= 1) { this_156 = this_701; obj_842 = this_156; if (T_typeId_915[obj_842] == 0) { error208("Double free: object of type T"); } else { T_nextFree_764[T_firstFree_124] = obj_842; T_firstFree_124 = (T_firstFree_124 + 1); T_typeId_915[obj_842] = 0; }; } else { this_104 = this_701; obj_179 = this_104; if (T_typeId_915[obj_179] == 0) { error208("Double free: object of type A"); } else { T_nextFree_764[T_firstFree_124] = obj_179; T_firstFree_124 = (T_firstFree_124 + 1); T_typeId_915[obj_179] = 0; }; }; } else { this_140 = this_701; test_s_128 = (test_s_128 + "B"); obj_211 = this_140; if (T_typeId_915[obj_211] == 0) { error208("Double free: object of type B"); } else { T_nextFree_764[T_firstFree_124] = obj_211; T_firstFree_124 = (T_firstFree_124 + 1); T_typeId_915[obj_211] = 0; }; }; }