array D_nextFree145 integer D_firstFree163 integer D_maxIndex104 array D_typeId116 array D_B_A_x209 array D_C_A_x793 integer D_firstFree163 = 0 integer D_maxIndex104 = 0 function initGlobals666() { } function main158() { initGlobals666(); init_test110(); } function config387() { } function init_test110() { local integer d477 d_477 = new_D657(); if (D_typeId_116[d_477] == 0) { if (d_477 == 0) { error188("Nullpointer exception when calling D.setX"); } else { error188("Called D.setX on invalid object."); }; } else { }; D_setX658(d_477, 5); if (dispatch_D_test_D_getX169(d_477) != 5) { testFail373(("foo fail" + I2S111(dispatch_D_test_D_getX169(d_477)))); } else { }; testSuccess198(); } IS_NATIVE IS_EXTERN @extern function I2S111(integer x109) returns string { } IS_NATIVE function println127(string s987) { } IS_NATIVE function testFail373(string msg205) { } IS_NATIVE function testSuccess198() { } function D_setX658(integer this652, integer x206) { local integer x186 x_186 = (x_206 div 2); println127(("set x " + I2S111(x_186))); D_B_A_x_209[this_652] = x_186; println127(("get x " + I2S111(D_B_A_x_209[this_652]))); x_206 = (x_206 - D_B_A_x_209[this_652]); println127(("set x " + I2S111(x_206))); D_C_A_x_793[this_652] = x_206; } function new_D657() returns integer { local integer this158 if (D_firstFree_163 == 0) { if (D_maxIndex_104 < 32768) { D_maxIndex_104 = (D_maxIndex_104 + 1); this_158 = D_maxIndex_104; D_typeId_116[this_158] = 1; } else { error188("Out of memory: Could not create D."); this_158 = 0; }; } else { D_firstFree_163 = (D_firstFree_163 - 1); this_158 = D_nextFree_145[D_firstFree_163]; D_typeId_116[this_158] = 1; }; return this_158; } function error188(string msg948) { $debugPrint138((msg_948 + (" " + #getStackTrace()))); } function dispatch_D_test_D_getX169(integer this707) returns integer { local integer temp131 if (D_typeId_116[this_707] == 0) { if (this_707 == 0) { error188("Nullpointer exception when calling D.getX"); } else { error188("Called D.getX on invalid object."); }; } else { }; println127(("get x " + I2S111(D_B_A_x_209[this_707]))); temp_131 = D_B_A_x_209[this_707]; println127(("get x " + I2S111(D_C_A_x_793[this_707]))); return (temp_131 + D_C_A_x_793[this_707]); }