array test_b181 array Blub_nextFree181 integer Blub_firstFree167 integer Blub_maxIndex564 array Blub_typeId193 array Blub_x184 integer Blub_firstFree167 = 0 integer Blub_maxIndex564 = 0 function initGlobals120() { } function main868() { initGlobals120(); init_test776(); } function config184() { } function init_test776() { local integer i150 test_b_181[0] = new_Blub841(0); test_b_181[1] = new_Blub841(1); test_b_181[2] = new_Blub841(2); test_b_181[3] = new_Blub841(3); test_b_181[4] = new_Blub841(4); test_b_181[5] = new_Blub841(5); test_b_181[6] = new_Blub841(6); test_b_181[7] = new_Blub841(7); dispatch_Blub_destroyBlub189(test_b_181[0]); dispatch_Blub_destroyBlub189(test_b_181[6]); dispatch_Blub_destroyBlub189(test_b_181[2]); dispatch_Blub_destroyBlub189(test_b_181[4]); test_b_181[8] = new_Blub841(8); test_b_181[9] = new_Blub841(9); i_150 = 0; loop { exitwhen (i_150 >= 10); if (((i_150 mod 2) == 1) and (Blub_x_184[test_b_181[i_150]] != i_150)) { testFail187(((("fail " + I2S630(i_150)) + ", ") + I2S630(Blub_x_184[test_b_181[i_150]]))); } else { }; i_150 = (i_150 + 1); }; testSuccess175(); } IS_NATIVE IS_EXTERN @extern function I2S630(integer i189) returns string { } IS_NATIVE function testFail187(string msg169) { } IS_NATIVE function testSuccess175() { } function Blub_init108(integer this151) { } function new_Blub841(integer x580) returns integer { local integer this838 this_838 = alloc_Blub635(); construct_Blub123(this_838, x_580); return this_838; } function construct_Blub123(integer this106, integer x998) { Blub_init108(this_106); Blub_x_184[this_106] = x_998; } function Blub_onDestroy939(integer this644) { } function destroyBlub136(integer this119) { Blub_onDestroy939(this_119); dealloc_Blub146(this_119); } function alloc_Blub635() returns integer { local integer this169 if (Blub_firstFree_167 == 0) { if (Blub_maxIndex_564 < 32768) { Blub_maxIndex_564 = (Blub_maxIndex_564 + 1); this_169 = Blub_maxIndex_564; Blub_typeId_193[this_169] = 1; } else { error898("Out of memory: Could not create Blub."); this_169 = 0; }; } else { Blub_firstFree_167 = (Blub_firstFree_167 - 1); this_169 = Blub_nextFree_181[Blub_firstFree_167]; Blub_typeId_193[this_169] = 1; }; return this_169; } function error898(string msg144) { $debugPrint132((msg_144 + (" " + #getStackTrace()))); } function dealloc_Blub146(integer obj113) { if (Blub_typeId_193[obj_113] == 0) { error898("Double free: object of type Blub"); } else { Blub_nextFree_181[Blub_firstFree_167] = obj_113; Blub_firstFree_167 = (Blub_firstFree_167 + 1); Blub_typeId_193[obj_113] = 0; }; } function dispatch_Blub_destroyBlub189(integer this440) { if (Blub_typeId_193[this_440] == 0) { if (this_440 == 0) { error898("Nullpointer exception when calling Blub.Blub"); } else { error898("Called Blub.Blub on invalid object."); }; } else { }; destroyBlub136(this_440); }