array I_nextFree906 integer I_firstFree209 integer I_maxIndex205 array I_typeId205 integer wurst_stack_depth106 array wurst_stack142 integer I_firstFree209 = 0 integer I_maxIndex205 = 0 integer wurst_stack_depth106 = 0 function initGlobals398() { } function main422() { initGlobals398(); init_test781("when calling init_test in exampleCode, line 1"); } function config692() { } function init_test781(string __wurst_stackPos174) { local integer i1904 local integer i2194 wurst_stack_142[wurst_stack_depth_106] = __wurst_stackPos_174; wurst_stack_depth_106 = (wurst_stack_depth_106 + 1); i1_904 = new_B116("when calling new_B in exampleCode, line 12"); i2_194 = new_C207("when calling new_C in exampleCode, line 13"); if ((dispatch_I_test_I_foo848(i1_904, "when calling foo in exampleCode, line 14") == 2) and (dispatch_I_test_I_foo848(i2_194, "when calling foo in exampleCode, line 14") == 3)) { testSuccess197(); } else { }; wurst_stack_depth_106 = (wurst_stack_depth_106 - 1); } IS_NATIVE function testSuccess197() { } function new_B116(string __wurst_stackPos116) returns integer { local integer this282 wurst_stack_142[wurst_stack_depth_106] = __wurst_stackPos_116; wurst_stack_depth_106 = (wurst_stack_depth_106 + 1); wurst_stack_142[wurst_stack_depth_106] = "when calling alloc_B in exampleCode, line 5"; wurst_stack_depth_106 = (wurst_stack_depth_106 + 1); if (I_firstFree_209 == 0) { if (I_maxIndex_205 < 32768) { I_maxIndex_205 = (I_maxIndex_205 + 1); this_282 = I_maxIndex_205; I_typeId_205[this_282] = 2; } else { error137("Out of memory: Could not create B.", "when calling error in exampleCode, line 5"); this_282 = 0; }; } else { I_firstFree_209 = (I_firstFree_209 - 1); this_282 = I_nextFree_906[I_firstFree_209]; I_typeId_205[this_282] = 2; }; wurst_stack_depth_106 = ((wurst_stack_depth_106 - 1) - 1); return this_282; } function new_C207(string __wurst_stackPos197) returns integer { local integer this168 wurst_stack_142[wurst_stack_depth_106] = __wurst_stackPos_197; wurst_stack_depth_106 = (wurst_stack_depth_106 + 1); wurst_stack_142[wurst_stack_depth_106] = "when calling alloc_C in exampleCode, line 8"; wurst_stack_depth_106 = (wurst_stack_depth_106 + 1); if (I_firstFree_209 == 0) { if (I_maxIndex_205 < 32768) { I_maxIndex_205 = (I_maxIndex_205 + 1); this_168 = I_maxIndex_205; I_typeId_205[this_168] = 3; } else { error137("Out of memory: Could not create C.", "when calling error in exampleCode, line 8"); this_168 = 0; }; } else { I_firstFree_209 = (I_firstFree_209 - 1); this_168 = I_nextFree_906[I_firstFree_209]; I_typeId_205[this_168] = 3; }; wurst_stack_depth_106 = ((wurst_stack_depth_106 - 1) - 1); return this_168; } function error137(string msg103, string __wurst_stackPos882) { local integer stacktraceIndex190 local integer stacktraceLimit535 wurst_stack_142[wurst_stack_depth_106] = __wurst_stackPos_882; wurst_stack_depth_106 = (wurst_stack_depth_106 + 1); __wurst_stackPos_882 = ""; stacktraceIndex_190 = wurst_stack_depth_106; stacktraceLimit_535 = 0; loop { stacktraceIndex_190 = (stacktraceIndex_190 - 1); stacktraceLimit_535 = (stacktraceLimit_535 + 1); exitwhen ((stacktraceLimit_535 > 20) or (stacktraceIndex_190 < 0)); __wurst_stackPos_882 = (__wurst_stackPos_882 + (" " + wurst_stack_142[stacktraceIndex_190])); }; $debugPrint483((msg_103 + (" " + __wurst_stackPos_882))); wurst_stack_depth_106 = (wurst_stack_depth_106 - 1); } function dispatch_I_test_I_foo848(integer this590, string __wurst_stackPos142) returns integer { wurst_stack_142[wurst_stack_depth_106] = __wurst_stackPos_142; wurst_stack_depth_106 = (wurst_stack_depth_106 + 1); if (I_typeId_205[this_590] == 0) { if (this_590 == 0) { error137("Nullpointer exception when calling I.foo", "when calling error in exampleCode, line 4"); } else { error137("Called I.foo on invalid object.", "when calling error in exampleCode, line 4"); }; } else { }; if (I_typeId_205[this_590] <= 2) { this_590 = 2; } else { this_590 = 3; }; wurst_stack_depth_106 = (wurst_stack_depth_106 - 1); return this_590; }