array C_nextFree163 integer C_firstFree151 integer C_maxIndex325 array C_typeId112 integer C_firstFree151 = 0 integer C_maxIndex325 = 0 function initGlobals207() { C_firstFree_151 = 0; C_maxIndex_325 = 0; } function main139() { initGlobals207(); init_test204(); } function config167() { } function init_test204() { local integer c631 c_631 = new_C144(); if (dispatch_C_test_C_A_getBar114(c_631) != 3) { testFail184("fail"); } else { }; testSuccess127(); } IS_NATIVE function testFail184(string msg147) { } IS_NATIVE function testSuccess127() { } function C_getFoo494(integer this719) returns integer { return 2; } function C_A_getBar110(integer this408) returns integer { return (dispatch_C_test_C_getFoo208(this_408) + 1); } function C_init137(integer this194) { construct_C_A130(this_194); } function construct_C_A130(integer this217) { } function new_C144() returns integer { local integer this647 this_647 = alloc_C834(); construct_C675(this_647); return this_647; } function construct_C675(integer this189) { C_init137(this_189); } function alloc_C834() returns integer { local integer this151 if (C_firstFree_151 == 0) { if (C_maxIndex_325 < 32768) { C_maxIndex_325 = (C_maxIndex_325 + 1); this_151 = C_maxIndex_325; C_typeId_112[this_151] = 1; } else { error163("Out of memory: Could not create C."); this_151 = 0; }; } else { C_firstFree_151 = (C_firstFree_151 - 1); this_151 = C_nextFree_163[C_firstFree_151]; C_typeId_112[this_151] = 1; }; return this_151; } function error163(string msg148) { $debugPrint493((msg_148 + (" " + #getStackTrace()))); } function dispatch_C_test_C_getFoo208(integer this103) returns integer { local integer test_C_getFoo_result144 if (C_typeId_112[this_103] == 0) { if (this_103 == 0) { error163("Nullpointer exception when calling C.getFoo"); } else { error163("Called C.getFoo on invalid object."); }; } else { }; test_C_getFoo_result_144 = C_getFoo494(this_103); return test_C_getFoo_result_144; } function dispatch_C_test_C_A_getBar114(integer this160) returns integer { local integer test_C_A_getBar_result157 if (C_typeId_112[this_160] == 0) { if (this_160 == 0) { error163("Nullpointer exception when calling C.getBar"); } else { error163("Called C.getBar on invalid object."); }; } else { }; test_C_A_getBar_result_157 = C_A_getBar110(this_160); return test_C_A_getBar_result_157; }