array I_nextFree103 integer I_firstFree179 integer I_maxIndex739 array I_typeId834 integer I_firstFree179 = 0 integer I_maxIndex739 = 0 function initGlobals449() { I_firstFree_179 = 0; I_maxIndex_739 = 0; } function main169() { initGlobals449(); init_test105(); } function config531() { } function init_test105() { local integer i132 i_132 = new_C119(); if (dispatch_I_test_I_foo135(i_132, 1) == 43) { testSuccess862(); } else { }; } IS_NATIVE function testSuccess862() { } function C_init185(integer this104) { } function new_C119() returns integer { local integer this404 this_404 = alloc_C117(); construct_C116(this_404); return this_404; } function construct_C116(integer this139) { C_init185(this_139); } function I_foo757(integer this197, integer x400) returns integer { return (x_400 + 42); } function alloc_C117() returns integer { local integer this576 if (I_firstFree_179 == 0) { if (I_maxIndex_739 < 32768) { I_maxIndex_739 = (I_maxIndex_739 + 1); this_576 = I_maxIndex_739; I_typeId_834[this_576] = 2; } else { error132("Out of memory: Could not create C."); this_576 = 0; }; } else { I_firstFree_179 = (I_firstFree_179 - 1); this_576 = I_nextFree_103[I_firstFree_179]; I_typeId_834[this_576] = 2; }; return this_576; } function error132(string msg693) { $debugPrint206((msg_693 + (" " + #getStackTrace()))); } function dispatch_I_test_I_foo135(integer this192, integer x177) returns integer { local integer test_I_foo_result187 if (I_typeId_834[this_192] == 0) { if (this_192 == 0) { error132("Nullpointer exception when calling I.foo"); } else { error132("Called I.foo on invalid object."); }; } else { }; test_I_foo_result_187 = I_foo757(this_192, x_177); return test_I_foo_result_187; }