array C_nextFree109 integer C_firstFree194 integer C_maxIndex171 array C_typeId615 integer C_firstFree194 = 0 integer C_maxIndex171 = 0 function initGlobals182() { C_firstFree_194 = 0; C_maxIndex_171 = 0; } function main498() { initGlobals182(); init_test127(); } function config451() { } function init_test127() { local integer e373 e_373 = new_E600(); if (dispatch_C_test_C_foo203(e_373) == 4) { testSuccess752(); } else { }; } IS_NATIVE function testSuccess752() { } function C_foo116(integer this911) returns integer { return 3; } function C_init653(integer this180) { } function construct_C212(integer this202) { C_init653(this_202); } function D_init134(integer this146) { } function construct_D196(integer this638) { construct_C212(this_638); D_init134(this_638); } function E_foo665(integer this131) returns integer { return 4; } function E_init202(integer this191) { } function new_E600() returns integer { local integer this816 this_816 = alloc_E208(); construct_E164(this_816); return this_816; } function construct_E164(integer this110) { construct_D196(this_110); E_init202(this_110); } function error136(string msg472) { $debugPrint210((msg_472 + (" " + #getStackTrace()))); } function alloc_E208() returns integer { local integer this224 if (C_firstFree_194 == 0) { if (C_maxIndex_171 < 32768) { C_maxIndex_171 = (C_maxIndex_171 + 1); this_224 = C_maxIndex_171; C_typeId_615[this_224] = 3; } else { error136("Out of memory: Could not create E."); this_224 = 0; }; } else { C_firstFree_194 = (C_firstFree_194 - 1); this_224 = C_nextFree_109[C_firstFree_194]; C_typeId_615[this_224] = 3; }; return this_224; } function dispatch_C_test_C_foo203(integer this173) returns integer { local integer test_C_foo_result132 if (C_typeId_615[this_173] == 0) { if (this_173 == 0) { error136("Nullpointer exception when calling C.foo"); } else { error136("Called C.foo on invalid object."); }; } else { }; if (C_typeId_615[this_173] <= 2) { test_C_foo_result_132 = C_foo116(this_173); } else { test_C_foo_result_132 = E_foo665(this_173); }; return test_C_foo_result_132; }