array I_nextFree325 integer I_firstFree143 integer I_maxIndex329 array I_typeId186 integer I_firstFree143 = 0 integer I_maxIndex329 = 0 function initGlobals107() { } function main179() { initGlobals107(); init_test202(); } function config234() { } function init_test202() { local integer i1982 i1_982 = new_B184(); if ((dispatch_I_test_I_foo207(new_C300()) == 3) and (dispatch_I_test_I_foo207(i1_982) == 2)) { testSuccess129(); } else { }; } IS_NATIVE function testSuccess129() { } function B_foo577(integer this132) returns integer { return 2; } function B_init656(integer this209) { } function new_B184() returns integer { local integer this185 this_185 = alloc_B139(); construct_B177(this_185); return this_185; } function construct_B177(integer this162) { B_init656(this_162); } function C_foo125(integer this994) returns integer { return 3; } function C_init714(integer this101) { } function new_C300() returns integer { local integer this900 this_900 = alloc_C728(); construct_C182(this_900); return this_900; } function construct_C182(integer this102) { C_init714(this_102); } function alloc_B139() returns integer { local integer this190 if (I_firstFree_143 == 0) { if (I_maxIndex_329 < 32768) { I_maxIndex_329 = (I_maxIndex_329 + 1); this_190 = I_maxIndex_329; I_typeId_186[this_190] = 2; } else { error597("Out of memory: Could not create B."); this_190 = 0; }; } else { I_firstFree_143 = (I_firstFree_143 - 1); this_190 = I_nextFree_325[I_firstFree_143]; I_typeId_186[this_190] = 2; }; return this_190; } function error597(string msg162) { $debugPrint267((msg_162 + (" " + #getStackTrace()))); } function alloc_C728() returns integer { local integer this797 if (I_firstFree_143 == 0) { if (I_maxIndex_329 < 32768) { I_maxIndex_329 = (I_maxIndex_329 + 1); this_797 = I_maxIndex_329; I_typeId_186[this_797] = 3; } else { error597("Out of memory: Could not create C."); this_797 = 0; }; } else { I_firstFree_143 = (I_firstFree_143 - 1); this_797 = I_nextFree_325[I_firstFree_143]; I_typeId_186[this_797] = 3; }; return this_797; } function dispatch_I_test_I_foo207(integer this928) returns integer { if (I_typeId_186[this_928] == 0) { if (this_928 == 0) { error597("Nullpointer exception when calling I.foo"); } else { error597("Called I.foo on invalid object."); }; } else { }; if (I_typeId_186[this_928] <= 2) { this_928 = B_foo577(this_928); } else { this_928 = C_foo125(this_928); }; return this_928; }