array D_nextFree102 integer D_firstFree510 integer D_maxIndex675 array D_typeId128 array D_B_A_x946 array D_C_A_x332 integer D_firstFree510 = 0 integer D_maxIndex675 = 0 function initGlobals803() { } function main840() { initGlobals803(); init_test159(); } function config287() { } function init_test159() { local integer d605 d_605 = new_D444(); dispatch_D_test_D_setX210(d_605, 5); if (dispatch_D_test_D_getX855(d_605) != 5) { testFail944(("foo fail" + I2S602(dispatch_D_test_D_getX855(d_605)))); } else { }; testSuccess761(); } IS_NATIVE IS_EXTERN @extern function I2S602(integer x107) returns string { } IS_NATIVE function println142(string s200) { } IS_NATIVE function testFail944(string msg818) { } IS_NATIVE function testSuccess761() { } function D_setX797(integer this784, integer x150) { D_B_A_setX997(this_784, (x_150 div 2)); D_C_A_setX923(this_784, (x_150 - D_B_A_getX895(this_784))); } function D_B_A_setX997(integer this214, integer x823) { println142(("set x " + I2S602(x_823))); D_B_A_x_946[this_214] = x_823; } function D_B_A_getX895(integer this187) returns integer { println142(("get x " + I2S602(D_B_A_x_946[this_187]))); return D_B_A_x_946[this_187]; } function D_C_A_setX923(integer this467, integer x894) { println142(("set x " + I2S602(x_894))); D_C_A_x_332[this_467] = x_894; } function D_getX114(integer this192) returns integer { return (D_B_A_getX895(this_192) + D_C_A_getX180(this_192)); } function D_C_A_getX180(integer this527) returns integer { println142(("get x " + I2S602(D_C_A_x_332[this_527]))); return D_C_A_x_332[this_527]; } function D_init185(integer this894) { construct_D_B825(this_894); construct_D_C694(this_894); } function construct_D_B825(integer this918) { construct_D_B_A135(this_918); } function construct_D_C694(integer this265) { construct_D_C_A143(this_265); } function construct_D_B_A135(integer this119) { } function construct_D_C_A143(integer this184) { } function new_D444() returns integer { local integer this139 this_139 = alloc_D388(); construct_D869(this_139); return this_139; } function construct_D869(integer this214) { D_init185(this_214); } function alloc_D388() returns integer { local integer this453 if (D_firstFree_510 == 0) { if (D_maxIndex_675 < 32768) { D_maxIndex_675 = (D_maxIndex_675 + 1); this_453 = D_maxIndex_675; D_typeId_128[this_453] = 1; } else { error173("Out of memory: Could not create D."); this_453 = 0; }; } else { D_firstFree_510 = (D_firstFree_510 - 1); this_453 = D_nextFree_102[D_firstFree_510]; D_typeId_128[this_453] = 1; }; return this_453; } function error173(string msg178) { $debugPrint110((msg_178 + (" " + #getStackTrace()))); } function dispatch_D_test_D_setX210(integer this187, integer x101) { if (D_typeId_128[this_187] == 0) { if (this_187 == 0) { error173("Nullpointer exception when calling D.setX"); } else { error173("Called D.setX on invalid object."); }; } else { }; D_setX797(this_187, x_101); } function dispatch_D_test_D_getX855(integer this181) returns integer { if (D_typeId_128[this_181] == 0) { if (this_181 == 0) { error173("Nullpointer exception when calling D.getX"); } else { error173("Called D.getX on invalid object."); }; } else { }; return D_getX114(this_181); }