array I_nextFree206 integer I_firstFree725 integer I_maxIndex787 array I_typeId110 integer I_firstFree725 = 0 integer I_maxIndex787 = 0 function initGlobals378() { I_firstFree_725 = 0; I_maxIndex_787 = 0; } function main168() { initGlobals378(); init_test144(); } function config176() { } function init_test144() { local integer b185 local integer c655 local integer d594 b_185 = new_B331(); c_655 = new_C883(); d_594 = new_D183(); if (((dispatch_B_test_B_foo446(b_185) == 2) and (dispatch_I_test_I_foo206(c_655) == 5)) and (dispatch_I_test_I_foo206(d_594) == 3)) { testSuccess837(); } else { }; } IS_NATIVE function testSuccess837() { } function B_foo137(integer this172) returns integer { return 2; } function B_init204(integer this665) { } function new_B331() returns integer { local integer this102 this_102 = alloc_B101(); construct_B415(this_102); return this_102; } function construct_B415(integer this445) { B_init204(this_445); } function C_init322(integer this657) { } function new_C883() returns integer { local integer this171 this_171 = alloc_C104(); construct_C114(this_171); return this_171; } function construct_C114(integer this708) { C_init322(this_708); } function D_bar686(integer this108) returns integer { return 3; } function D_init122(integer this198) { } function new_D183() returns integer { local integer this137 this_137 = alloc_D122(); construct_D169(this_137); return this_137; } function construct_D169(integer this769) { D_init122(this_769); } function I_foo873(integer this580) returns integer { return dispatch_I_test_I_bar191(this_580); } function I_bar141(integer this145) returns integer { return 5; } function alloc_B101() returns integer { local integer this146 if (I_firstFree_725 == 0) { if (I_maxIndex_787 < 32768) { I_maxIndex_787 = (I_maxIndex_787 + 1); this_146 = I_maxIndex_787; I_typeId_110[this_146] = 2; } else { error506("Out of memory: Could not create B."); this_146 = 0; }; } else { I_firstFree_725 = (I_firstFree_725 - 1); this_146 = I_nextFree_206[I_firstFree_725]; I_typeId_110[this_146] = 2; }; return this_146; } function error506(string msg616) { $debugPrint157((msg_616 + (" " + #getStackTrace()))); } function alloc_C104() returns integer { local integer this208 if (I_firstFree_725 == 0) { if (I_maxIndex_787 < 32768) { I_maxIndex_787 = (I_maxIndex_787 + 1); this_208 = I_maxIndex_787; I_typeId_110[this_208] = 3; } else { error506("Out of memory: Could not create C."); this_208 = 0; }; } else { I_firstFree_725 = (I_firstFree_725 - 1); this_208 = I_nextFree_206[I_firstFree_725]; I_typeId_110[this_208] = 3; }; return this_208; } function alloc_D122() returns integer { local integer this166 if (I_firstFree_725 == 0) { if (I_maxIndex_787 < 32768) { I_maxIndex_787 = (I_maxIndex_787 + 1); this_166 = I_maxIndex_787; I_typeId_110[this_166] = 4; } else { error506("Out of memory: Could not create D."); this_166 = 0; }; } else { I_firstFree_725 = (I_firstFree_725 - 1); this_166 = I_nextFree_206[I_firstFree_725]; I_typeId_110[this_166] = 4; }; return this_166; } function dispatch_B_test_B_foo446(integer this131) returns integer { local integer test_B_foo_result330 if (I_typeId_110[this_131] == 0) { if (this_131 == 0) { error506("Nullpointer exception when calling B.foo"); } else { error506("Called B.foo on invalid object."); }; } else { }; test_B_foo_result_330 = B_foo137(this_131); return test_B_foo_result_330; } function dispatch_I_test_I_foo206(integer this885) returns integer { local integer test_I_foo_result530 if (I_typeId_110[this_885] == 0) { if (this_885 == 0) { error506("Nullpointer exception when calling I.foo"); } else { error506("Called I.foo on invalid object."); }; } else { }; if (I_typeId_110[this_885] <= 2) { if (I_typeId_110[this_885] <= 1) { test_I_foo_result_530 = I_foo873(this_885); } else { test_I_foo_result_530 = B_foo137(this_885); }; } else { test_I_foo_result_530 = I_foo873(this_885); }; return test_I_foo_result_530; } function dispatch_I_test_I_bar191(integer this109) returns integer { local integer test_I_bar_result202 if (I_typeId_110[this_109] == 0) { if (this_109 == 0) { error506("Nullpointer exception when calling I.bar"); } else { error506("Called I.bar on invalid object."); }; } else { }; if (I_typeId_110[this_109] <= 3) { test_I_bar_result_202 = I_bar141(this_109); } else { test_I_bar_result_202 = D_bar686(this_109); }; return test_I_bar_result_202; }