array D_nextFree854 integer D_firstFree143 integer D_maxIndex301 array D_typeId205 array D_B_A_x117 array D_C_A_x119 integer D_firstFree143 = 0 integer D_maxIndex301 = 0 function initGlobals867() { } function main119() { initGlobals867(); init_test667(); } function config611() { } function init_test667() { local integer d799 d_799 = new_D115(); dispatch_D_test_D_setX834(d_799, 5); if (dispatch_D_test_D_getX160(d_799) != 5) { testFail359(("foo fail" + I2S374(dispatch_D_test_D_getX160(d_799)))); } else { }; testSuccess172(); } IS_NATIVE IS_EXTERN @extern function I2S374(integer x157) returns string { } IS_NATIVE function println823(string s989) { } IS_NATIVE function testFail359(string msg799) { } IS_NATIVE function testSuccess172() { } function D_setX668(integer this663, integer x853) { D_B_A_setX188(this_663, (x_853 div 2)); D_C_A_setX210(this_663, (x_853 - D_B_A_getX482(this_663))); } function D_B_A_setX188(integer this100, integer x187) { println823(("set x " + I2S374(x_187))); D_B_A_x_117[this_100] = x_187; } function D_B_A_getX482(integer this173) returns integer { println823(("get x " + I2S374(D_B_A_x_117[this_173]))); return D_B_A_x_117[this_173]; } function D_C_A_setX210(integer this126, integer x252) { println823(("set x " + I2S374(x_252))); D_C_A_x_119[this_126] = x_252; } function D_getX129(integer this797) returns integer { return (D_B_A_getX482(this_797) + D_C_A_getX305(this_797)); } function D_C_A_getX305(integer this892) returns integer { println823(("get x " + I2S374(D_C_A_x_119[this_892]))); return D_C_A_x_119[this_892]; } function D_init142(integer this163) { construct_D_B170(this_163); construct_D_C841(this_163); } function construct_D_B170(integer this947) { construct_D_B_A580(this_947); } function construct_D_C841(integer this107) { construct_D_C_A196(this_107); } function construct_D_B_A580(integer this195) { } function construct_D_C_A196(integer this744) { } function new_D115() returns integer { local integer this114 this_114 = alloc_D146(); construct_D195(this_114); return this_114; } function construct_D195(integer this815) { D_init142(this_815); } function alloc_D146() returns integer { local integer this327 if (D_firstFree_143 == 0) { if (D_maxIndex_301 < 32768) { D_maxIndex_301 = (D_maxIndex_301 + 1); this_327 = D_maxIndex_301; D_typeId_205[this_327] = 1; } else { error165("Out of memory: Could not create D."); this_327 = 0; }; } else { D_firstFree_143 = (D_firstFree_143 - 1); this_327 = D_nextFree_854[D_firstFree_143]; D_typeId_205[this_327] = 1; }; return this_327; } function error165(string msg855) { $debugPrint140((msg_855 + (" " + #getStackTrace()))); } function dispatch_D_test_D_setX834(integer this926, integer x191) { if (D_typeId_205[this_926] == 0) { if (this_926 == 0) { error165("Nullpointer exception when calling D.setX"); } else { error165("Called D.setX on invalid object."); }; } else { }; D_setX668(this_926, x_191); } function dispatch_D_test_D_getX160(integer this856) returns integer { if (D_typeId_205[this_856] == 0) { if (this_856 == 0) { error165("Nullpointer exception when calling D.getX"); } else { error165("Called D.getX on invalid object."); }; } else { }; return D_getX129(this_856); }