array I_nextFree123 integer I_firstFree942 integer I_maxIndex180 array I_typeId155 integer wurst_stack_depth788 array wurst_stack141 integer I_firstFree942 = 0 integer I_maxIndex180 = 0 integer wurst_stack_depth788 = 0 function initGlobals113() { } function main119() { initGlobals113(); init_test109("when calling init_test in defaultImpl, line 1"); } function config116() { } function init_test109(string __wurst_stackPos656) { local integer b204 local integer c702 local integer d641 wurst_stack_141[wurst_stack_depth_788] = __wurst_stackPos_656; wurst_stack_depth_788 = (wurst_stack_depth_788 + 1); b_204 = new_B326("when calling new_B in defaultImpl, line 15"); c_702 = new_C119("when calling new_C in defaultImpl, line 16"); d_641 = new_D105("when calling new_D in defaultImpl, line 17"); if (dispatch_I_test_I_foo108(b_204, "when calling foo in defaultImpl, line 18") != 2) { testFail208("b"); } else { }; if (dispatch_I_test_I_foo108(c_702, "when calling foo in defaultImpl, line 20") != 3) { testFail208("c"); } else { }; if (dispatch_I_test_I_foo108(d_641, "when calling foo in defaultImpl, line 22") != 5) { testFail208("d"); } else { }; testSuccess128(); wurst_stack_depth_788 = (wurst_stack_depth_788 - 1); } IS_NATIVE function testFail208(string s480) { } IS_NATIVE function testSuccess128() { } function new_B326(string __wurst_stackPos121) returns integer { local integer this159 wurst_stack_141[wurst_stack_depth_788] = __wurst_stackPos_121; wurst_stack_depth_788 = (wurst_stack_depth_788 + 1); wurst_stack_141[wurst_stack_depth_788] = "when calling alloc_B in defaultImpl, line 7"; wurst_stack_depth_788 = (wurst_stack_depth_788 + 1); if (I_firstFree_942 == 0) { if (I_maxIndex_180 < 32768) { I_maxIndex_180 = (I_maxIndex_180 + 1); this_159 = I_maxIndex_180; I_typeId_155[this_159] = 2; } else { error210("Out of memory: Could not create B.", "when calling error in defaultImpl, line 7"); this_159 = 0; }; } else { I_firstFree_942 = (I_firstFree_942 - 1); this_159 = I_nextFree_123[I_firstFree_942]; I_typeId_155[this_159] = 2; }; wurst_stack_depth_788 = ((wurst_stack_depth_788 - 1) - 1); return this_159; } function new_C119(string __wurst_stackPos132) returns integer { local integer this680 wurst_stack_141[wurst_stack_depth_788] = __wurst_stackPos_132; wurst_stack_depth_788 = (wurst_stack_depth_788 + 1); wurst_stack_141[wurst_stack_depth_788] = "when calling alloc_C in defaultImpl, line 10"; wurst_stack_depth_788 = (wurst_stack_depth_788 + 1); if (I_firstFree_942 == 0) { if (I_maxIndex_180 < 32768) { I_maxIndex_180 = (I_maxIndex_180 + 1); this_680 = I_maxIndex_180; I_typeId_155[this_680] = 3; } else { error210("Out of memory: Could not create C.", "when calling error in defaultImpl, line 10"); this_680 = 0; }; } else { I_firstFree_942 = (I_firstFree_942 - 1); this_680 = I_nextFree_123[I_firstFree_942]; I_typeId_155[this_680] = 3; }; wurst_stack_depth_788 = ((wurst_stack_depth_788 - 1) - 1); return this_680; } function new_D105(string __wurst_stackPos642) returns integer { local integer this462 wurst_stack_141[wurst_stack_depth_788] = __wurst_stackPos_642; wurst_stack_depth_788 = (wurst_stack_depth_788 + 1); wurst_stack_141[wurst_stack_depth_788] = "when calling alloc_D in defaultImpl, line 13"; wurst_stack_depth_788 = (wurst_stack_depth_788 + 1); if (I_firstFree_942 == 0) { if (I_maxIndex_180 < 32768) { I_maxIndex_180 = (I_maxIndex_180 + 1); this_462 = I_maxIndex_180; I_typeId_155[this_462] = 4; } else { error210("Out of memory: Could not create D.", "when calling error in defaultImpl, line 13"); this_462 = 0; }; } else { I_firstFree_942 = (I_firstFree_942 - 1); this_462 = I_nextFree_123[I_firstFree_942]; I_typeId_155[this_462] = 4; }; wurst_stack_depth_788 = ((wurst_stack_depth_788 - 1) - 1); return this_462; } function error210(string msg210, string __wurst_stackPos202) { local integer stacktraceIndex474 local integer stacktraceLimit174 wurst_stack_141[wurst_stack_depth_788] = __wurst_stackPos_202; wurst_stack_depth_788 = (wurst_stack_depth_788 + 1); __wurst_stackPos_202 = ""; stacktraceIndex_474 = wurst_stack_depth_788; stacktraceLimit_174 = 0; loop { stacktraceIndex_474 = (stacktraceIndex_474 - 1); stacktraceLimit_174 = (stacktraceLimit_174 + 1); exitwhen ((stacktraceLimit_174 > 20) or (stacktraceIndex_474 < 0)); __wurst_stackPos_202 = (__wurst_stackPos_202 + (" " + wurst_stack_141[stacktraceIndex_474])); }; $debugPrint129((msg_210 + (" " + __wurst_stackPos_202))); wurst_stack_depth_788 = (wurst_stack_depth_788 - 1); } function dispatch_I_test_I_foo108(integer this135, string __wurst_stackPos175) returns integer { wurst_stack_141[wurst_stack_depth_788] = __wurst_stackPos_175; wurst_stack_depth_788 = (wurst_stack_depth_788 + 1); if (I_typeId_155[this_135] == 0) { if (this_135 == 0) { error210("Nullpointer exception when calling I.foo", "when calling error in defaultImpl, line 5"); } else { error210("Called I.foo on invalid object.", "when calling error in defaultImpl, line 5"); }; } else { }; if (I_typeId_155[this_135] <= 2) { if (I_typeId_155[this_135] <= 1) { this_135 = 5; } else { this_135 = 2; }; } else { if (I_typeId_155[this_135] <= 3) { this_135 = 3; } else { this_135 = 5; }; }; wurst_stack_depth_788 = (wurst_stack_depth_788 - 1); return this_135; }