array I_nextFree112 integer I_firstFree207 integer I_maxIndex175 array I_typeId576 integer I_firstFree207 = 0 integer I_maxIndex175 = 0 function initGlobals211() { } function main179() { initGlobals211(); init_test118(); } function config143() { } function init_test118() { local integer b162 local integer c567 local integer d132 b_162 = new_B114(); c_567 = new_C710(); d_132 = new_D137(); if (dispatch_I_test_I_foo110(b_162) != 2) { testFail768("b"); } else { }; if (dispatch_I_test_I_foo110(c_567) != 3) { testFail768("c"); } else { }; if (dispatch_I_test_I_foo110(d_132) != 5) { testFail768("d"); } else { }; testSuccess805(); } IS_NATIVE function testFail768(string s818) { } IS_NATIVE function testSuccess805() { } function B_foo182(integer this213) returns integer { return 2; } function B_init138(integer this185) { } function new_B114() returns integer { local integer this128 this_128 = alloc_B174(); construct_B546(this_128); return this_128; } function construct_B546(integer this100) { B_init138(this_100); } function C_foo151(integer this153) returns integer { return 3; } function C_init164(integer this456) { } function new_C710() returns integer { local integer this209 this_209 = alloc_C924(); construct_C582(this_209); return this_209; } function construct_C582(integer this133) { C_init164(this_133); } function D_init177(integer this121) { } function new_D137() returns integer { local integer this210 this_210 = alloc_D744(); construct_D801(this_210); return this_210; } function construct_D801(integer this204) { D_init177(this_204); } function I_foo131(integer this113) returns integer { return 5; } function alloc_B174() returns integer { local integer this177 if (I_firstFree_207 == 0) { if (I_maxIndex_175 < 32768) { I_maxIndex_175 = (I_maxIndex_175 + 1); this_177 = I_maxIndex_175; I_typeId_576[this_177] = 2; } else { error937("Out of memory: Could not create B."); this_177 = 0; }; } else { I_firstFree_207 = (I_firstFree_207 - 1); this_177 = I_nextFree_112[I_firstFree_207]; I_typeId_576[this_177] = 2; }; return this_177; } function error937(string msg100) { $debugPrint136((msg_100 + (" " + #getStackTrace()))); } function alloc_C924() returns integer { local integer this177 if (I_firstFree_207 == 0) { if (I_maxIndex_175 < 32768) { I_maxIndex_175 = (I_maxIndex_175 + 1); this_177 = I_maxIndex_175; I_typeId_576[this_177] = 3; } else { error937("Out of memory: Could not create C."); this_177 = 0; }; } else { I_firstFree_207 = (I_firstFree_207 - 1); this_177 = I_nextFree_112[I_firstFree_207]; I_typeId_576[this_177] = 3; }; return this_177; } function alloc_D744() returns integer { local integer this208 if (I_firstFree_207 == 0) { if (I_maxIndex_175 < 32768) { I_maxIndex_175 = (I_maxIndex_175 + 1); this_208 = I_maxIndex_175; I_typeId_576[this_208] = 4; } else { error937("Out of memory: Could not create D."); this_208 = 0; }; } else { I_firstFree_207 = (I_firstFree_207 - 1); this_208 = I_nextFree_112[I_firstFree_207]; I_typeId_576[this_208] = 4; }; return this_208; } function dispatch_I_test_I_foo110(integer this129) returns integer { if (I_typeId_576[this_129] == 0) { if (this_129 == 0) { error937("Nullpointer exception when calling I.foo"); } else { error937("Called I.foo on invalid object."); }; } else { }; if (I_typeId_576[this_129] <= 2) { if (I_typeId_576[this_129] <= 1) { this_129 = I_foo131(this_129); } else { this_129 = B_foo182(this_129); }; } else { if (I_typeId_576[this_129] <= 3) { this_129 = C_foo151(this_129); } else { this_129 = I_foo131(this_129); }; }; return this_129; }