array A_nextFree178 integer A_firstFree787 integer A_maxIndex823 array A_typeId140 integer A_firstFree787 = 0 integer A_maxIndex823 = 0 function initGlobals101() { A_firstFree_787 = 0; A_maxIndex_823 = 0; } function main155() { initGlobals101(); init_test839(); } function config160() { } function init_test839() { local integer b191 b_191 = new_B184(); if (dispatch_A_test_A_foo173(b_191) == 8) { testSuccess986(); } else { }; } IS_NATIVE function testSuccess986() { } function A_foo164(integer this149) returns integer { return 7; } function A_init164(integer this132) { } function construct_A252(integer this710) { A_init164(this_710); } function B_foo118(integer this127) returns integer { return 8; } function B_init192(integer this148) { } function new_B184() returns integer { local integer this138 this_138 = alloc_B978(); construct_B847(this_138); return this_138; } function construct_B847(integer this994) { construct_A252(this_994); B_init192(this_994); } function error171(string msg825) { $debugPrint185((msg_825 + (" " + #getStackTrace()))); } function alloc_B978() returns integer { local integer this163 if (A_firstFree_787 == 0) { if (A_maxIndex_823 < 32768) { A_maxIndex_823 = (A_maxIndex_823 + 1); this_163 = A_maxIndex_823; A_typeId_140[this_163] = 2; } else { error171("Out of memory: Could not create B."); this_163 = 0; }; } else { A_firstFree_787 = (A_firstFree_787 - 1); this_163 = A_nextFree_178[A_firstFree_787]; A_typeId_140[this_163] = 2; }; return this_163; } function dispatch_A_test_A_foo173(integer this726) returns integer { local integer test_A_foo_result685 if (A_typeId_140[this_726] == 0) { if (this_726 == 0) { error171("Nullpointer exception when calling A.foo"); } else { error171("Called A.foo on invalid object."); }; } else { }; if (A_typeId_140[this_726] <= 1) { test_A_foo_result_685 = A_foo164(this_726); } else { test_A_foo_result_685 = B_foo118(this_726); }; return test_A_foo_result_685; }