array I_nextFree154 integer I_firstFree648 integer I_maxIndex376 array I_typeId528 integer I_firstFree648 = 0 integer I_maxIndex376 = 0 function initGlobals563() { I_firstFree_648 = 0; I_maxIndex_376 = 0; } function main568() { initGlobals563(); init_test700(); } function config412() { } function init_test700() { local integer b187 local integer c205 local integer d126 b_187 = new_B192(); c_205 = new_C194(); d_126 = new_D157(); if (dispatch_I_test_I_foo181(b_187) != 2) { testFail143("b"); } else { }; if (dispatch_I_test_I_foo181(c_205) != 3) { testFail143("c"); } else { }; if (dispatch_I_test_I_foo181(d_126) != 5) { testFail143("d"); } else { }; testSuccess898(); } IS_NATIVE function testFail143(string s164) { } IS_NATIVE function testSuccess898() { } function B_foo701(integer this181) returns integer { return 2; } function B_init210(integer this514) { } function new_B192() returns integer { local integer this187 this_187 = alloc_B601(); construct_B133(this_187); return this_187; } function construct_B133(integer this133) { B_init210(this_133); } function C_foo164(integer this110) returns integer { return 3; } function C_init685(integer this263) { } function new_C194() returns integer { local integer this124 this_124 = alloc_C211(); construct_C373(this_124); return this_124; } function construct_C373(integer this121) { C_init685(this_121); } function D_init320(integer this205) { } function new_D157() returns integer { local integer this203 this_203 = alloc_D151(); construct_D952(this_203); return this_203; } function construct_D952(integer this210) { D_init320(this_210); } function I_foo263(integer this965) returns integer { return 5; } function alloc_B601() returns integer { local integer this153 if (I_firstFree_648 == 0) { if (I_maxIndex_376 < 32768) { I_maxIndex_376 = (I_maxIndex_376 + 1); this_153 = I_maxIndex_376; I_typeId_528[this_153] = 2; } else { error168("Out of memory: Could not create B."); this_153 = 0; }; } else { I_firstFree_648 = (I_firstFree_648 - 1); this_153 = I_nextFree_154[I_firstFree_648]; I_typeId_528[this_153] = 2; }; return this_153; } function error168(string msg102) { $debugPrint412((msg_102 + (" " + #getStackTrace()))); } function alloc_C211() returns integer { local integer this720 if (I_firstFree_648 == 0) { if (I_maxIndex_376 < 32768) { I_maxIndex_376 = (I_maxIndex_376 + 1); this_720 = I_maxIndex_376; I_typeId_528[this_720] = 3; } else { error168("Out of memory: Could not create C."); this_720 = 0; }; } else { I_firstFree_648 = (I_firstFree_648 - 1); this_720 = I_nextFree_154[I_firstFree_648]; I_typeId_528[this_720] = 3; }; return this_720; } function alloc_D151() returns integer { local integer this184 if (I_firstFree_648 == 0) { if (I_maxIndex_376 < 32768) { I_maxIndex_376 = (I_maxIndex_376 + 1); this_184 = I_maxIndex_376; I_typeId_528[this_184] = 4; } else { error168("Out of memory: Could not create D."); this_184 = 0; }; } else { I_firstFree_648 = (I_firstFree_648 - 1); this_184 = I_nextFree_154[I_firstFree_648]; I_typeId_528[this_184] = 4; }; return this_184; } function dispatch_I_test_I_foo181(integer this566) returns integer { local integer test_I_foo_result197 if (I_typeId_528[this_566] == 0) { if (this_566 == 0) { error168("Nullpointer exception when calling I.foo"); } else { error168("Called I.foo on invalid object."); }; } else { }; if (I_typeId_528[this_566] <= 2) { if (I_typeId_528[this_566] <= 1) { test_I_foo_result_197 = I_foo263(this_566); } else { test_I_foo_result_197 = B_foo701(this_566); }; } else { if (I_typeId_528[this_566] <= 3) { test_I_foo_result_197 = C_foo164(this_566); } else { test_I_foo_result_197 = I_foo263(this_566); }; }; return test_I_foo_result_197; }