array C_nextFree124 integer C_firstFree140 integer C_maxIndex107 array C_typeId201 integer C_firstFree140 = 0 integer C_maxIndex107 = 0 function initGlobals126() { C_firstFree_140 = 0; C_maxIndex_107 = 0; } function main200() { initGlobals126(); init_test382(); } function config372() { } function init_test382() { local integer c157 c_157 = new_C135(); if (dispatch_C_test_C_B_foo291(c_157) != 3) { testFail137("foo fail"); } else { }; if (dispatch_C_test_C_B_A_bar203(c_157) != 2) { testFail137("bar fail"); } else { }; testSuccess197(); } IS_NATIVE function testFail137(string msg255) { } IS_NATIVE function testSuccess197() { } function C_B_foo147(integer this208) returns integer { return 3; } function C_B_A_bar139(integer this172) returns integer { return 2; } function C_init164(integer this409) { construct_C_B544(this_409); } function construct_C_B544(integer this161) { construct_C_B_A120(this_161); } function construct_C_B_A120(integer this184) { } function new_C135() returns integer { local integer this953 this_953 = alloc_C176(); construct_C919(this_953); return this_953; } function construct_C919(integer this140) { C_init164(this_140); } function alloc_C176() returns integer { local integer this143 if (C_firstFree_140 == 0) { if (C_maxIndex_107 < 32768) { C_maxIndex_107 = (C_maxIndex_107 + 1); this_143 = C_maxIndex_107; C_typeId_201[this_143] = 1; } else { error121("Out of memory: Could not create C."); this_143 = 0; }; } else { C_firstFree_140 = (C_firstFree_140 - 1); this_143 = C_nextFree_124[C_firstFree_140]; C_typeId_201[this_143] = 1; }; return this_143; } function error121(string msg324) { $debugPrint363((msg_324 + (" " + #getStackTrace()))); } function dispatch_C_test_C_B_foo291(integer this950) returns integer { local integer test_C_B_foo_result167 if (C_typeId_201[this_950] == 0) { if (this_950 == 0) { error121("Nullpointer exception when calling C.foo"); } else { error121("Called C.foo on invalid object."); }; } else { }; test_C_B_foo_result_167 = C_B_foo147(this_950); return test_C_B_foo_result_167; } function dispatch_C_test_C_B_A_bar203(integer this123) returns integer { local integer test_C_B_A_bar_result168 if (C_typeId_201[this_123] == 0) { if (this_123 == 0) { error121("Nullpointer exception when calling C.bar"); } else { error121("Called C.bar on invalid object."); }; } else { }; test_C_B_A_bar_result_168 = C_B_A_bar139(this_123); return test_C_B_A_bar_result_168; }