array test_b190 array Blub_nextFree113 integer Blub_firstFree752 integer Blub_maxIndex792 array Blub_typeId125 array Blub_x134 integer Blub_firstFree752 = 0 integer Blub_maxIndex792 = 0 function initGlobals209() { } function main725() { initGlobals209(); init_test382(); } function config792() { } function init_test382() { local integer i379 test_b_190[0] = new_Blub117(0); test_b_190[1] = new_Blub117(1); test_b_190[2] = new_Blub117(2); test_b_190[3] = new_Blub117(3); test_b_190[4] = new_Blub117(4); test_b_190[5] = new_Blub117(5); test_b_190[6] = new_Blub117(6); test_b_190[7] = new_Blub117(7); dispatch_Blub_destroyBlub447(test_b_190[0]); dispatch_Blub_destroyBlub447(test_b_190[6]); dispatch_Blub_destroyBlub447(test_b_190[2]); dispatch_Blub_destroyBlub447(test_b_190[4]); test_b_190[8] = new_Blub117(8); test_b_190[9] = new_Blub117(9); i_379 = 0; loop { exitwhen (i_379 >= 10); if (((i_379 mod 2) == 1) and (Blub_x_134[test_b_190[i_379]] != i_379)) { testFail180(((("fail " + I2S177(i_379)) + ", ") + I2S177(Blub_x_134[test_b_190[i_379]]))); } else { }; i_379 = (i_379 + 1); }; testSuccess867(); } IS_NATIVE IS_EXTERN @extern function I2S177(integer i139) returns string { } IS_NATIVE function testFail180(string msg100) { } IS_NATIVE function testSuccess867() { } function Blub_init183(integer this113) { } function new_Blub117(integer x171) returns integer { local integer this673 this_673 = alloc_Blub987(); construct_Blub802(this_673, x_171); return this_673; } function construct_Blub802(integer this332, integer x148) { Blub_init183(this_332); Blub_x_134[this_332] = x_148; } function Blub_onDestroy319(integer this161) { } function destroyBlub711(integer this378) { Blub_onDestroy319(this_378); dealloc_Blub171(this_378); } function alloc_Blub987() returns integer { local integer this129 if (Blub_firstFree_752 == 0) { if (Blub_maxIndex_792 < 32768) { Blub_maxIndex_792 = (Blub_maxIndex_792 + 1); this_129 = Blub_maxIndex_792; Blub_typeId_125[this_129] = 1; } else { error158("Out of memory: Could not create Blub."); this_129 = 0; }; } else { Blub_firstFree_752 = (Blub_firstFree_752 - 1); this_129 = Blub_nextFree_113[Blub_firstFree_752]; Blub_typeId_125[this_129] = 1; }; return this_129; } function error158(string msg202) { $debugPrint834((msg_202 + (" " + #getStackTrace()))); } function dealloc_Blub171(integer obj409) { if (Blub_typeId_125[obj_409] == 0) { error158("Double free: object of type Blub"); } else { Blub_nextFree_113[Blub_firstFree_752] = obj_409; Blub_firstFree_752 = (Blub_firstFree_752 + 1); Blub_typeId_125[obj_409] = 0; }; } function dispatch_Blub_destroyBlub447(integer this248) { if (Blub_typeId_125[this_248] == 0) { if (this_248 == 0) { error158("Nullpointer exception when calling Blub.Blub"); } else { error158("Called Blub.Blub on invalid object."); }; } else { }; destroyBlub711(this_248); }