array A_nextFree105 integer A_firstFree130 integer A_maxIndex518 array A_typeId190 integer A_firstFree130 = 0 integer A_maxIndex518 = 0 function initGlobals197() { A_firstFree_130 = 0; A_maxIndex_518 = 0; } function main152() { initGlobals197(); init_test138(); } function config119() { } function init_test138() { local integer c920 c_920 = new_C867(); if (dispatch_A_test_A_foo195(c_920) == 8) { testSuccess102(); } else { }; } IS_NATIVE function testSuccess102() { } function A_foo172(integer this198) returns integer { return 7; } function A_init200(integer this133) { } function construct_A310(integer this772) { A_init200(this_772); } function B_foo769(integer this665) returns integer { return 8; } function B_init190(integer this229) { } function construct_B585(integer this132) { construct_A310(this_132); B_init190(this_132); } function C_init534(integer this117) { } function new_C867() returns integer { local integer this577 this_577 = alloc_C210(); construct_C104(this_577); return this_577; } function construct_C104(integer this163) { construct_B585(this_163); C_init534(this_163); } function error171(string msg164) { $debugPrint148((msg_164 + (" " + #getStackTrace()))); } function alloc_C210() returns integer { local integer this575 if (A_firstFree_130 == 0) { if (A_maxIndex_518 < 32768) { A_maxIndex_518 = (A_maxIndex_518 + 1); this_575 = A_maxIndex_518; A_typeId_190[this_575] = 3; } else { error171("Out of memory: Could not create C."); this_575 = 0; }; } else { A_firstFree_130 = (A_firstFree_130 - 1); this_575 = A_nextFree_105[A_firstFree_130]; A_typeId_190[this_575] = 3; }; return this_575; } function dispatch_A_test_A_foo195(integer this199) returns integer { local integer test_A_foo_result163 if (A_typeId_190[this_199] == 0) { if (this_199 == 0) { error171("Nullpointer exception when calling A.foo"); } else { error171("Called A.foo on invalid object."); }; } else { }; if (A_typeId_190[this_199] <= 1) { test_A_foo_result_163 = A_foo172(this_199); } else { test_A_foo_result_163 = B_foo769(this_199); }; return test_A_foo_result_163; }