array test_b188 array Blub_nextFree959 integer Blub_firstFree155 integer Blub_maxIndex164 array Blub_typeId645 array Blub_x213 integer Blub_firstFree155 = 0 integer Blub_maxIndex164 = 0 function initGlobals196() { Blub_firstFree_155 = 0; Blub_maxIndex_164 = 0; } function main715() { initGlobals196(); init_test155(); } function config129() { } function init_test155() { local integer i490 test_b_188[0] = new_Blub185(0); test_b_188[1] = new_Blub185(1); test_b_188[2] = new_Blub185(2); test_b_188[3] = new_Blub185(3); test_b_188[4] = new_Blub185(4); test_b_188[5] = new_Blub185(5); test_b_188[6] = new_Blub185(6); test_b_188[7] = new_Blub185(7); dispatch_Blub_destroyBlub202(test_b_188[0]); dispatch_Blub_destroyBlub202(test_b_188[6]); dispatch_Blub_destroyBlub202(test_b_188[2]); dispatch_Blub_destroyBlub202(test_b_188[4]); test_b_188[8] = new_Blub185(8); test_b_188[9] = new_Blub185(9); i_490 = 0; loop { exitwhen (not (i_490 < 10)); if (((i_490 mod 2) == 1) and (Blub_x_213[test_b_188[i_490]] != i_490)) { testFail167(((("fail " + I2S103(i_490)) + ", ") + I2S103(Blub_x_213[test_b_188[i_490]]))); } else { }; i_490 = (i_490 + 1); }; testSuccess503(); } IS_NATIVE IS_EXTERN @extern function I2S103(integer i126) returns string { } IS_NATIVE function testFail167(string msg332) { } IS_NATIVE function testSuccess503() { } function Blub_init164(integer this365) { } function new_Blub185(integer x984) returns integer { local integer this424 this_424 = alloc_Blub102(); construct_Blub119(this_424, x_984); return this_424; } function construct_Blub119(integer this955, integer x198) { Blub_init164(this_955); Blub_x_213[this_955] = x_198; } function Blub_onDestroy586(integer this205) { } function destroyBlub179(integer this143) { Blub_onDestroy586(this_143); dealloc_Blub132(this_143); } function alloc_Blub102() returns integer { local integer this105 if (Blub_firstFree_155 == 0) { if (Blub_maxIndex_164 < 32768) { Blub_maxIndex_164 = (Blub_maxIndex_164 + 1); this_105 = Blub_maxIndex_164; Blub_typeId_645[this_105] = 1; } else { error582("Out of memory: Could not create Blub."); this_105 = 0; }; } else { Blub_firstFree_155 = (Blub_firstFree_155 - 1); this_105 = Blub_nextFree_959[Blub_firstFree_155]; Blub_typeId_645[this_105] = 1; }; return this_105; } function error582(string msg211) { $debugPrint165((msg_211 + (" " + #getStackTrace()))); } function dealloc_Blub132(integer obj199) { if (Blub_typeId_645[obj_199] == 0) { error582("Double free: object of type Blub"); } else { Blub_nextFree_959[Blub_firstFree_155] = obj_199; Blub_firstFree_155 = (Blub_firstFree_155 + 1); Blub_typeId_645[obj_199] = 0; }; } function dispatch_Blub_destroyBlub202(integer this168) { if (Blub_typeId_645[this_168] == 0) { if (this_168 == 0) { error582("Nullpointer exception when calling Blub.Blub"); } else { error582("Called Blub.Blub on invalid object."); }; } else { }; destroyBlub179(this_168); }