array A_nextFree113 integer A_firstFree881 integer A_maxIndex179 array A_typeId195 integer A_firstFree881 = 0 integer A_maxIndex179 = 0 function initGlobals730() { A_firstFree_881 = 0; A_maxIndex_179 = 0; } function main271() { initGlobals730(); init_test112(); } function config210() { } function init_test112() { local integer b126 b_126 = new_A213(); if (dispatch_A_test_A_foo173(b_126) == 7) { testSuccess146(); } else { }; } IS_NATIVE function testSuccess146() { } function A_foo188(integer this116) returns integer { return 7; } function A_init803(integer this206) { } function new_A213() returns integer { local integer this511 this_511 = alloc_A126(); construct_A208(this_511); return this_511; } function construct_A208(integer this933) { A_init803(this_933); } function B_foo204(integer this254) returns integer { return 8; } function alloc_A126() returns integer { local integer this137 if (A_firstFree_881 == 0) { if (A_maxIndex_179 < 32768) { A_maxIndex_179 = (A_maxIndex_179 + 1); this_137 = A_maxIndex_179; A_typeId_195[this_137] = 1; } else { error178("Out of memory: Could not create A."); this_137 = 0; }; } else { A_firstFree_881 = (A_firstFree_881 - 1); this_137 = A_nextFree_113[A_firstFree_881]; A_typeId_195[this_137] = 1; }; return this_137; } function error178(string msg114) { $debugPrint476((msg_114 + (" " + #getStackTrace()))); } function dispatch_A_test_A_foo173(integer this344) returns integer { local integer test_A_foo_result110 if (A_typeId_195[this_344] == 0) { if (this_344 == 0) { error178("Nullpointer exception when calling A.foo"); } else { error178("Called A.foo on invalid object."); }; } else { }; if (A_typeId_195[this_344] <= 1) { test_A_foo_result_110 = A_foo188(this_344); } else { test_A_foo_result_110 = B_foo204(this_344); }; return test_A_foo_result_110; }