array C_nextFree212 integer C_firstFree225 integer C_maxIndex145 array C_typeId315 integer C_firstFree225 = 0 integer C_maxIndex145 = 0 function initGlobals122() { C_firstFree_225 = 0; C_maxIndex_145 = 0; } function main993() { initGlobals122(); init_test903(); } function config855() { } function init_test903() { local integer c802 c_802 = new_C105(); if (dispatch_C_test_C_foo608(c_802) != 4) { testFail640("foo fail"); } else { }; testSuccess148(); } IS_NATIVE function testFail640(string msg172) { } IS_NATIVE function testSuccess148() { } function C_foo297(integer this423) returns integer { return 4; } function C_init853(integer this119) { construct_C_A193(this_119); construct_C_B341(this_119); } function construct_C_A193(integer this204) { } function construct_C_B341(integer this208) { } function new_C105() returns integer { local integer this572 this_572 = alloc_C666(); construct_C823(this_572); return this_572; } function construct_C823(integer this142) { C_init853(this_142); } function alloc_C666() returns integer { local integer this223 if (C_firstFree_225 == 0) { if (C_maxIndex_145 < 32768) { C_maxIndex_145 = (C_maxIndex_145 + 1); this_223 = C_maxIndex_145; C_typeId_315[this_223] = 1; } else { error205("Out of memory: Could not create C."); this_223 = 0; }; } else { C_firstFree_225 = (C_firstFree_225 - 1); this_223 = C_nextFree_212[C_firstFree_225]; C_typeId_315[this_223] = 1; }; return this_223; } function error205(string msg932) { $debugPrint191((msg_932 + (" " + #getStackTrace()))); } function dispatch_C_test_C_foo608(integer this163) returns integer { local integer test_C_foo_result946 if (C_typeId_315[this_163] == 0) { if (this_163 == 0) { error205("Nullpointer exception when calling C.foo"); } else { error205("Called C.foo on invalid object."); }; } else { }; test_C_foo_result_946 = C_foo297(this_163); return test_C_foo_result_946; }