array D_nextFree189 integer D_firstFree944 integer D_maxIndex137 array D_typeId200 array D_B_A_x418 array D_C_A_x387 integer D_firstFree944 = 0 integer D_maxIndex137 = 0 function initGlobals915() { } function main400() { initGlobals915(); init_test895(); } function config179() { } function init_test895() { local integer d306 d_306 = new_D199(); if (D_typeId_200[d_306] == 0) { if (d_306 == 0) { error156("Nullpointer exception when calling D.setX"); } else { error156("Called D.setX on invalid object."); }; } else { }; D_setX135(d_306, 5); if (dispatch_D_test_D_getX193(d_306) != 5) { testFail199(("foo fail" + I2S899(dispatch_D_test_D_getX193(d_306)))); } else { }; testSuccess539(); } IS_NATIVE IS_EXTERN @extern function I2S899(integer x202) returns string { } IS_NATIVE function println214(string s123) { } IS_NATIVE function testFail199(string msg206) { } IS_NATIVE function testSuccess539() { } function D_setX135(integer this148, integer x904) { local integer x821 x_821 = (x_904 div 2); println214(("set x " + I2S899(x_821))); D_B_A_x_418[this_148] = x_821; println214(("get x " + I2S899(D_B_A_x_418[this_148]))); x_904 = (x_904 - D_B_A_x_418[this_148]); println214(("set x " + I2S899(x_904))); D_C_A_x_387[this_148] = x_904; } function new_D199() returns integer { local integer this407 if (D_firstFree_944 == 0) { if (D_maxIndex_137 < 32768) { D_maxIndex_137 = (D_maxIndex_137 + 1); this_407 = D_maxIndex_137; D_typeId_200[this_407] = 1; } else { error156("Out of memory: Could not create D."); this_407 = 0; }; } else { D_firstFree_944 = (D_firstFree_944 - 1); this_407 = D_nextFree_189[D_firstFree_944]; D_typeId_200[this_407] = 1; }; return this_407; } function error156(string msg207) { $debugPrint188((msg_207 + (" " + #getStackTrace()))); } function dispatch_D_test_D_getX193(integer this670) returns integer { local integer temp198 if (D_typeId_200[this_670] == 0) { if (this_670 == 0) { error156("Nullpointer exception when calling D.getX"); } else { error156("Called D.getX on invalid object."); }; } else { }; println214(("get x " + I2S899(D_B_A_x_418[this_670]))); temp_198 = D_B_A_x_418[this_670]; println214(("get x " + I2S899(D_C_A_x_387[this_670]))); return (temp_198 + D_C_A_x_387[this_670]); }