array test_cs939 integer test_count952 array C_nextFree784 integer C_firstFree158 integer C_maxIndex113 array C_typeId970 array C_alive823 integer wurst_stack_depth661 array wurst_stack817 integer test_count952 = 0 integer C_firstFree158 = 0 integer C_maxIndex113 = 0 integer wurst_stack_depth661 = 0 function initGlobals520() { } function main152() { initGlobals520(); init_test101("when calling init_test in recyling_random, line 1"); } function config886() { } function init_test101(string __wurst_stackPos131) { local integer i114 local integer j230 wurst_stack_817[wurst_stack_depth_661] = __wurst_stackPos_131; wurst_stack_depth_661 = (wurst_stack_depth_661 + 1); test_count_952 = 0; i_114 = 0; loop { exitwhen (i_114 > 1000); if ((test_count_952 < 100) and (GetRandomReal389(0., 1.) <= 0.5)) { test_cs_939[test_count_952] = new_C963("when calling new_C in recyling_random, line 21"); test_count_952 = (test_count_952 + 1); } else { }; if ((test_count_952 > 0) and (GetRandomReal389(0., 1.) <= 0.1)) { j_230 = GetRandomInt831(0, (test_count_952 - 1)); dispatch_C_destroyC432(test_cs_939[j_230], "when calling dispatch_C_destroyC in recyling_random, line 25"); test_count_952 = (test_count_952 - 1); test_cs_939[j_230] = test_cs_939[test_count_952]; } else { }; i_114 = (i_114 + 1); }; testSuccess425(); wurst_stack_depth_661 = (wurst_stack_depth_661 - 1); } IS_NATIVE function testFail137(string msg210) { } IS_NATIVE IS_EXTERN @extern function GetRandomReal389(real a177, real b219) returns real { } IS_NATIVE IS_EXTERN @extern function GetRandomInt831(integer a140, integer b152) returns integer { } IS_NATIVE function testSuccess425() { } function new_C963(string __wurst_stackPos155) returns integer { local integer this101 wurst_stack_817[wurst_stack_depth_661] = __wurst_stackPos_155; wurst_stack_depth_661 = (wurst_stack_depth_661 + 1); wurst_stack_817[wurst_stack_depth_661] = "when calling alloc_C in recyling_random, line 10"; wurst_stack_depth_661 = (wurst_stack_depth_661 + 1); if (C_firstFree_158 == 0) { if (C_maxIndex_113 < 32768) { C_maxIndex_113 = (C_maxIndex_113 + 1); this_101 = C_maxIndex_113; C_typeId_970[this_101] = 1; } else { error120("Out of memory: Could not create C.", "when calling error in recyling_random, line 8"); this_101 = 0; }; } else { C_firstFree_158 = (C_firstFree_158 - 1); this_101 = C_nextFree_784[C_firstFree_158]; C_typeId_970[this_101] = 1; }; wurst_stack_depth_661 = (wurst_stack_depth_661 - 1); if (C_alive_823[this_101] == 1) { testFail137("already alive"); } else { }; C_alive_823[this_101] = 1; wurst_stack_depth_661 = (wurst_stack_depth_661 - 1); return this_101; } function error120(string msg571, string __wurst_stackPos147) { local integer stacktraceIndex315 local integer stacktraceLimit183 wurst_stack_817[wurst_stack_depth_661] = __wurst_stackPos_147; wurst_stack_depth_661 = (wurst_stack_depth_661 + 1); __wurst_stackPos_147 = ""; stacktraceIndex_315 = wurst_stack_depth_661; stacktraceLimit_183 = 0; loop { stacktraceIndex_315 = (stacktraceIndex_315 - 1); stacktraceLimit_183 = (stacktraceLimit_183 + 1); exitwhen ((stacktraceLimit_183 > 20) or (stacktraceIndex_315 < 0)); __wurst_stackPos_147 = (__wurst_stackPos_147 + (" " + wurst_stack_817[stacktraceIndex_315])); }; $debugPrint654((msg_571 + (" " + __wurst_stackPos_147))); wurst_stack_depth_661 = (wurst_stack_depth_661 - 1); } function dispatch_C_destroyC432(integer this370, string __wurst_stackPos162) { wurst_stack_817[wurst_stack_depth_661] = __wurst_stackPos_162; wurst_stack_depth_661 = (wurst_stack_depth_661 + 1); if (C_typeId_970[this_370] == 0) { if (this_370 == 0) { error120("Nullpointer exception when calling C.C", "when calling error in recyling_random, line 8"); } else { error120("Called C.C on invalid object.", "when calling error in recyling_random, line 8"); }; } else { }; wurst_stack_817[wurst_stack_depth_661] = "when calling destroyC in recyling_random, line 8"; wurst_stack_depth_661 = (wurst_stack_depth_661 + 1); C_alive_823[this_370] = 2; wurst_stack_817[wurst_stack_depth_661] = "when calling dealloc_C in recyling_random, line 14"; wurst_stack_depth_661 = (wurst_stack_depth_661 + 1); if (C_typeId_970[this_370] == 0) { error120("Double free: object of type C", "when calling error in recyling_random, line 8"); } else { C_nextFree_784[C_firstFree_158] = this_370; C_firstFree_158 = (C_firstFree_158 + 1); C_typeId_970[this_370] = 0; }; wurst_stack_depth_661 = (((wurst_stack_depth_661 - 1) - 1) - 1); }