array D_nextFree135 integer D_firstFree125 integer D_maxIndex206 array D_typeId139 array D_B_A_x154 array D_C_A_x190 integer D_firstFree125 = 0 integer D_maxIndex206 = 0 function initGlobals120() { } function main104() { initGlobals120(); init_test544(); } function config465() { } function init_test544() { local integer d472 d_472 = new_D187(); if (D_typeId_139[d_472] == 0) { if (d_472 == 0) { error105("Nullpointer exception when calling D.setX"); } else { error105("Called D.setX on invalid object."); }; } else { }; D_setX160(d_472, 5); if (dispatch_D_test_D_getX188(d_472) != 5) { testFail139(("foo fail" + I2S160(dispatch_D_test_D_getX188(d_472)))); } else { }; testSuccess917(); } IS_NATIVE IS_EXTERN @extern function I2S160(integer x449) returns string { } IS_NATIVE function println441(string s145) { } IS_NATIVE function testFail139(string msg176) { } IS_NATIVE function testSuccess917() { } function D_setX160(integer this201, integer x140) { local integer x113 x_113 = (x_140 div 2); println441(("set x " + I2S160(x_113))); D_B_A_x_154[this_201] = x_113; println441(("get x " + I2S160(D_B_A_x_154[this_201]))); x_140 = (x_140 - D_B_A_x_154[this_201]); println441(("set x " + I2S160(x_140))); D_C_A_x_190[this_201] = x_140; } function new_D187() returns integer { local integer this783 if (D_firstFree_125 == 0) { if (D_maxIndex_206 < 32768) { D_maxIndex_206 = (D_maxIndex_206 + 1); this_783 = D_maxIndex_206; D_typeId_139[this_783] = 1; } else { error105("Out of memory: Could not create D."); this_783 = 0; }; } else { D_firstFree_125 = (D_firstFree_125 - 1); this_783 = D_nextFree_135[D_firstFree_125]; D_typeId_139[this_783] = 1; }; return this_783; } function error105(string msg417) { $debugPrint169((msg_417 + (" " + #getStackTrace()))); } function dispatch_D_test_D_getX188(integer this100) returns integer { local integer temp132 if (D_typeId_139[this_100] == 0) { if (this_100 == 0) { error105("Nullpointer exception when calling D.getX"); } else { error105("Called D.getX on invalid object."); }; } else { }; println441(("get x " + I2S160(D_B_A_x_154[this_100]))); temp_132 = D_B_A_x_154[this_100]; println441(("get x " + I2S160(D_C_A_x_190[this_100]))); return (temp_132 + D_C_A_x_190[this_100]); }