array D_nextFree118 integer D_firstFree167 integer D_maxIndex135 array D_typeId226 array D_B_A_x110 array D_C_A_x660 integer D_firstFree167 = 0 integer D_maxIndex135 = 0 function initGlobals124() { D_firstFree_167 = 0; D_maxIndex_135 = 0; } function main158() { initGlobals124(); init_test107(); } function config222() { } function init_test107() { local integer d334 d_334 = new_D917(); dispatch_D_test_D_setX982(d_334, 5); if (dispatch_D_test_D_getX955(d_334) != 5) { testFail186(("foo fail" + I2S362(dispatch_D_test_D_getX955(d_334)))); } else { }; testSuccess146(); } IS_NATIVE IS_EXTERN @extern function I2S362(integer x120) returns string { } IS_NATIVE function println147(string s136) { } IS_NATIVE function testFail186(string msg159) { } IS_NATIVE function testSuccess146() { } function D_setX103(integer this577, integer x204) { D_B_A_setX385(this_577, (x_204 div 2)); D_C_A_setX204(this_577, (x_204 - D_B_A_getX129(this_577))); } function D_B_A_setX385(integer this201, integer x153) { println147(("set x " + I2S362(x_153))); D_B_A_x_110[this_201] = x_153; } function D_B_A_getX129(integer this123) returns integer { println147(("get x " + I2S362(D_B_A_x_110[this_123]))); return D_B_A_x_110[this_123]; } function D_C_A_setX204(integer this160, integer x247) { println147(("set x " + I2S362(x_247))); D_C_A_x_660[this_160] = x_247; } function D_getX137(integer this208) returns integer { return (D_B_A_getX129(this_208) + D_C_A_getX316(this_208)); } function D_C_A_getX316(integer this105) returns integer { println147(("get x " + I2S362(D_C_A_x_660[this_105]))); return D_C_A_x_660[this_105]; } function D_init176(integer this157) { construct_D_B395(this_157); construct_D_C159(this_157); } function construct_D_B395(integer this117) { construct_D_B_A173(this_117); } function construct_D_C159(integer this190) { construct_D_C_A470(this_190); } function construct_D_B_A173(integer this203) { } function construct_D_C_A470(integer this832) { } function new_D917() returns integer { local integer this543 this_543 = alloc_D151(); construct_D214(this_543); return this_543; } function construct_D214(integer this155) { D_init176(this_155); } function alloc_D151() returns integer { local integer this151 if (D_firstFree_167 == 0) { if (D_maxIndex_135 < 32768) { D_maxIndex_135 = (D_maxIndex_135 + 1); this_151 = D_maxIndex_135; D_typeId_226[this_151] = 1; } else { error106("Out of memory: Could not create D."); this_151 = 0; }; } else { D_firstFree_167 = (D_firstFree_167 - 1); this_151 = D_nextFree_118[D_firstFree_167]; D_typeId_226[this_151] = 1; }; return this_151; } function error106(string msg698) { $debugPrint185((msg_698 + (" " + #getStackTrace()))); } function dispatch_D_test_D_setX982(integer this202, integer x179) { if (D_typeId_226[this_202] == 0) { if (this_202 == 0) { error106("Nullpointer exception when calling D.setX"); } else { error106("Called D.setX on invalid object."); }; } else { }; D_setX103(this_202, x_179); } function dispatch_D_test_D_getX955(integer this558) returns integer { local integer test_D_getX_result102 if (D_typeId_226[this_558] == 0) { if (this_558 == 0) { error106("Nullpointer exception when calling D.getX"); } else { error106("Called D.getX on invalid object."); }; } else { }; test_D_getX_result_102 = D_getX137(this_558); return test_D_getX_result_102; }