array test_cs128 integer test_count875 array C_nextFree157 integer C_firstFree670 integer C_maxIndex225 array C_typeId786 array C_alive406 integer wurst_stack_depth337 array wurst_stack129 integer test_count875 = 0 integer C_firstFree670 = 0 integer C_maxIndex225 = 0 integer wurst_stack_depth337 = 0 function initGlobals209() { } function main169() { initGlobals209(); init_test983("when calling init_test in recyling_random, line 1"); } function config175() { } function init_test983(string __wurst_stackPos125) { local integer i748 local integer j874 wurst_stack_129[wurst_stack_depth_337] = __wurst_stackPos_125; wurst_stack_depth_337 = (wurst_stack_depth_337 + 1); test_count_875 = 0; i_748 = 0; loop { exitwhen (i_748 > 1000); if ((test_count_875 < 100) and (GetRandomReal210(0., 1.) <= 0.5)) { test_cs_128[test_count_875] = new_C119("when calling new_C in recyling_random, line 21"); test_count_875 = (test_count_875 + 1); } else { }; if ((test_count_875 > 0) and (GetRandomReal210(0., 1.) <= 0.1)) { j_874 = GetRandomInt309(0, (test_count_875 - 1)); dispatch_C_destroyC151(test_cs_128[j_874], "when calling dispatch_C_destroyC in recyling_random, line 25"); test_count_875 = (test_count_875 - 1); test_cs_128[j_874] = test_cs_128[test_count_875]; } else { }; i_748 = (i_748 + 1); }; testSuccess145(); wurst_stack_depth_337 = (wurst_stack_depth_337 - 1); } IS_NATIVE function testFail554(string msg131) { } IS_NATIVE IS_EXTERN @extern function GetRandomReal210(real a957, real b161) returns real { } IS_NATIVE IS_EXTERN @extern function GetRandomInt309(integer a833, integer b123) returns integer { } IS_NATIVE function testSuccess145() { } function new_C119(string __wurst_stackPos327) returns integer { local integer this837 wurst_stack_129[wurst_stack_depth_337] = __wurst_stackPos_327; wurst_stack_depth_337 = (wurst_stack_depth_337 + 1); wurst_stack_129[wurst_stack_depth_337] = "when calling alloc_C in recyling_random, line 10"; wurst_stack_depth_337 = (wurst_stack_depth_337 + 1); if (C_firstFree_670 == 0) { if (C_maxIndex_225 < 32768) { C_maxIndex_225 = (C_maxIndex_225 + 1); this_837 = C_maxIndex_225; C_typeId_786[this_837] = 1; } else { error165("Out of memory: Could not create C.", "when calling error in recyling_random, line 8"); this_837 = 0; }; } else { C_firstFree_670 = (C_firstFree_670 - 1); this_837 = C_nextFree_157[C_firstFree_670]; C_typeId_786[this_837] = 1; }; wurst_stack_depth_337 = (wurst_stack_depth_337 - 1); if (C_alive_406[this_837] == 1) { testFail554("already alive"); } else { }; C_alive_406[this_837] = 1; wurst_stack_depth_337 = (wurst_stack_depth_337 - 1); return this_837; } function error165(string msg157, string __wurst_stackPos126) { local integer stacktraceIndex162 local integer stacktraceLimit691 wurst_stack_129[wurst_stack_depth_337] = __wurst_stackPos_126; wurst_stack_depth_337 = (wurst_stack_depth_337 + 1); __wurst_stackPos_126 = ""; stacktraceIndex_162 = wurst_stack_depth_337; stacktraceLimit_691 = 0; loop { stacktraceIndex_162 = (stacktraceIndex_162 - 1); stacktraceLimit_691 = (stacktraceLimit_691 + 1); exitwhen ((stacktraceLimit_691 > 20) or (stacktraceIndex_162 < 0)); __wurst_stackPos_126 = (__wurst_stackPos_126 + (" " + wurst_stack_129[stacktraceIndex_162])); }; $debugPrint161((msg_157 + (" " + __wurst_stackPos_126))); wurst_stack_depth_337 = (wurst_stack_depth_337 - 1); } function dispatch_C_destroyC151(integer this773, string __wurst_stackPos971) { wurst_stack_129[wurst_stack_depth_337] = __wurst_stackPos_971; wurst_stack_depth_337 = (wurst_stack_depth_337 + 1); if (C_typeId_786[this_773] == 0) { if (this_773 == 0) { error165("Nullpointer exception when calling C.C", "when calling error in recyling_random, line 8"); } else { error165("Called C.C on invalid object.", "when calling error in recyling_random, line 8"); }; } else { }; wurst_stack_129[wurst_stack_depth_337] = "when calling destroyC in recyling_random, line 8"; wurst_stack_depth_337 = (wurst_stack_depth_337 + 1); C_alive_406[this_773] = 2; wurst_stack_129[wurst_stack_depth_337] = "when calling dealloc_C in recyling_random, line 14"; wurst_stack_depth_337 = (wurst_stack_depth_337 + 1); if (C_typeId_786[this_773] == 0) { error165("Double free: object of type C", "when calling error in recyling_random, line 8"); } else { C_nextFree_157[C_firstFree_670] = this_773; C_firstFree_670 = (C_firstFree_670 + 1); C_typeId_786[this_773] = 0; }; wurst_stack_depth_337 = (((wurst_stack_depth_337 - 1) - 1) - 1); }