array A_nextFree130 integer A_firstFree591 integer A_maxIndex165 array A_typeId259 integer A_firstFree591 = 0 integer A_maxIndex165 = 0 function initGlobals749() { A_firstFree_591 = 0; A_maxIndex_165 = 0; } function main312() { initGlobals749(); init_test160(); } function config379() { } function init_test160() { local integer b862 b_862 = new_B123(); if (dispatch_A_test_A_foo199(b_862) == 8) { testSuccess199(); } else { }; } IS_NATIVE function testSuccess199() { } function A_foo212(integer this106) returns integer { return 7; } function A_init201(integer this467) { } function construct_A150(integer this542) { A_init201(this_542); } function B_foo151(integer this148) returns integer { return 8; } function B_init198(integer this145) { } function new_B123() returns integer { local integer this182 this_182 = alloc_B142(); construct_B722(this_182); return this_182; } function construct_B722(integer this165) { construct_A150(this_165); B_init198(this_165); } function error150(string msg445) { $debugPrint140((msg_445 + (" " + #getStackTrace()))); } function alloc_B142() returns integer { local integer this370 if (A_firstFree_591 == 0) { if (A_maxIndex_165 < 32768) { A_maxIndex_165 = (A_maxIndex_165 + 1); this_370 = A_maxIndex_165; A_typeId_259[this_370] = 2; } else { error150("Out of memory: Could not create B."); this_370 = 0; }; } else { A_firstFree_591 = (A_firstFree_591 - 1); this_370 = A_nextFree_130[A_firstFree_591]; A_typeId_259[this_370] = 2; }; return this_370; } function dispatch_A_test_A_foo199(integer this142) returns integer { local integer test_A_foo_result103 if (A_typeId_259[this_142] == 0) { if (this_142 == 0) { error150("Nullpointer exception when calling A.foo"); } else { error150("Called A.foo on invalid object."); }; } else { }; if (A_typeId_259[this_142] <= 1) { test_A_foo_result_103 = A_foo212(this_142); } else { test_A_foo_result_103 = B_foo151(this_142); }; return test_A_foo_result_103; }