array D_nextFree123 integer D_firstFree156 integer D_maxIndex165 array D_typeId172 array D_B_A_x124 array D_C_A_x213 integer D_firstFree156 = 0 integer D_maxIndex165 = 0 function initGlobals136() { D_firstFree_156 = 0; D_maxIndex_165 = 0; } function main665() { initGlobals136(); init_test126(); } function config487() { } function init_test126() { local integer d606 d_606 = new_D462(); dispatch_D_test_D_setX178(d_606, 5); if (dispatch_D_test_D_getX703(d_606) != 5) { testFail232(("foo fail" + I2S860(dispatch_D_test_D_getX703(d_606)))); } else { }; testSuccess345(); } IS_NATIVE IS_EXTERN @extern function I2S860(integer x142) returns string { } IS_NATIVE function println328(string s210) { } IS_NATIVE function testFail232(string msg271) { } IS_NATIVE function testSuccess345() { } function D_setX340(integer this362, integer x144) { D_B_A_setX786(this_362, (x_144 div 2)); D_C_A_setX794(this_362, (x_144 - D_B_A_getX104(this_362))); } function D_B_A_setX786(integer this963, integer x141) { println328(("set x " + I2S860(x_141))); D_B_A_x_124[this_963] = x_141; } function D_B_A_getX104(integer this198) returns integer { println328(("get x " + I2S860(D_B_A_x_124[this_198]))); return D_B_A_x_124[this_198]; } function D_C_A_setX794(integer this203, integer x192) { println328(("set x " + I2S860(x_192))); D_C_A_x_213[this_203] = x_192; } function D_getX154(integer this181) returns integer { return (D_B_A_getX104(this_181) + D_C_A_getX110(this_181)); } function D_C_A_getX110(integer this369) returns integer { println328(("get x " + I2S860(D_C_A_x_213[this_369]))); return D_C_A_x_213[this_369]; } function D_init468(integer this185) { construct_D_B121(this_185); construct_D_C332(this_185); } function construct_D_B121(integer this574) { construct_D_B_A149(this_574); } function construct_D_C332(integer this140) { construct_D_C_A214(this_140); } function construct_D_B_A149(integer this163) { } function construct_D_C_A214(integer this675) { } function new_D462() returns integer { local integer this385 this_385 = alloc_D128(); construct_D987(this_385); return this_385; } function construct_D987(integer this732) { D_init468(this_732); } function alloc_D128() returns integer { local integer this184 if (D_firstFree_156 == 0) { if (D_maxIndex_165 < 32768) { D_maxIndex_165 = (D_maxIndex_165 + 1); this_184 = D_maxIndex_165; D_typeId_172[this_184] = 1; } else { error165("Out of memory: Could not create D."); this_184 = 0; }; } else { D_firstFree_156 = (D_firstFree_156 - 1); this_184 = D_nextFree_123[D_firstFree_156]; D_typeId_172[this_184] = 1; }; return this_184; } function error165(string msg516) { $debugPrint181((msg_516 + (" " + #getStackTrace()))); } function dispatch_D_test_D_setX178(integer this717, integer x137) { if (D_typeId_172[this_717] == 0) { if (this_717 == 0) { error165("Nullpointer exception when calling D.setX"); } else { error165("Called D.setX on invalid object."); }; } else { }; D_setX340(this_717, x_137); } function dispatch_D_test_D_getX703(integer this426) returns integer { local integer test_D_getX_result172 if (D_typeId_172[this_426] == 0) { if (this_426 == 0) { error165("Nullpointer exception when calling D.getX"); } else { error165("Called D.getX on invalid object."); }; } else { }; test_D_getX_result_172 = D_getX154(this_426); return test_D_getX_result_172; }