array I_nextFree144 integer I_firstFree137 integer I_maxIndex699 array I_typeId312 integer I_firstFree137 = 0 integer I_maxIndex699 = 0 function initGlobals105() { } function main137() { initGlobals105(); init_test548(); } function config423() { } function init_test548() { local integer i1187 i1_187 = new_B944(); if ((dispatch_I_test_I_foo201(new_C207()) == 3) and (dispatch_I_test_I_foo201(i1_187) == 2)) { testSuccess185(); } else { }; } IS_NATIVE function testSuccess185() { } function B_foo758(integer this123) returns integer { return 2; } function B_init202(integer this193) { } function new_B944() returns integer { local integer this152 this_152 = alloc_B188(); construct_B186(this_152); return this_152; } function construct_B186(integer this781) { B_init202(this_781); } function C_foo779(integer this562) returns integer { return 3; } function C_init673(integer this182) { } function new_C207() returns integer { local integer this172 this_172 = alloc_C132(); construct_C207(this_172); return this_172; } function construct_C207(integer this855) { C_init673(this_855); } function alloc_B188() returns integer { local integer this145 if (I_firstFree_137 == 0) { if (I_maxIndex_699 < 32768) { I_maxIndex_699 = (I_maxIndex_699 + 1); this_145 = I_maxIndex_699; I_typeId_312[this_145] = 2; } else { error165("Out of memory: Could not create B."); this_145 = 0; }; } else { I_firstFree_137 = (I_firstFree_137 - 1); this_145 = I_nextFree_144[I_firstFree_137]; I_typeId_312[this_145] = 2; }; return this_145; } function error165(string msg124) { $debugPrint102((msg_124 + (" " + #getStackTrace()))); } function alloc_C132() returns integer { local integer this394 if (I_firstFree_137 == 0) { if (I_maxIndex_699 < 32768) { I_maxIndex_699 = (I_maxIndex_699 + 1); this_394 = I_maxIndex_699; I_typeId_312[this_394] = 3; } else { error165("Out of memory: Could not create C."); this_394 = 0; }; } else { I_firstFree_137 = (I_firstFree_137 - 1); this_394 = I_nextFree_144[I_firstFree_137]; I_typeId_312[this_394] = 3; }; return this_394; } function dispatch_I_test_I_foo201(integer this660) returns integer { if (I_typeId_312[this_660] == 0) { if (this_660 == 0) { error165("Nullpointer exception when calling I.foo"); } else { error165("Called I.foo on invalid object."); }; } else { }; if (I_typeId_312[this_660] <= 2) { this_660 = B_foo758(this_660); } else { this_660 = C_foo779(this_660); }; return this_660; }