array D_nextFree214 integer D_firstFree184 integer D_maxIndex139 array D_typeId133 array D_B_A_x119 array D_C_A_x510 integer D_firstFree184 = 0 integer D_maxIndex139 = 0 function initGlobals131() { D_firstFree_184 = 0; D_maxIndex_139 = 0; } function main135() { initGlobals131(); init_test169(); } function config869() { } function init_test169() { local integer d185 d_185 = new_D154(); dispatch_D_test_D_setX675(d_185, 5); if (dispatch_D_test_D_getX102(d_185) != 5) { testFail996(("foo fail" + I2S152(dispatch_D_test_D_getX102(d_185)))); } else { }; testSuccess803(); } IS_NATIVE IS_EXTERN @extern function I2S152(integer x549) returns string { } IS_NATIVE function println944(string s287) { } IS_NATIVE function testFail996(string msg605) { } IS_NATIVE function testSuccess803() { } function D_setX814(integer this114, integer x334) { D_B_A_setX159(this_114, (x_334 div 2)); D_C_A_setX602(this_114, (x_334 - D_B_A_getX444(this_114))); } function D_B_A_setX159(integer this483, integer x163) { println944(("set x " + I2S152(x_163))); D_B_A_x_119[this_483] = x_163; } function D_B_A_getX444(integer this140) returns integer { println944(("get x " + I2S152(D_B_A_x_119[this_140]))); return D_B_A_x_119[this_140]; } function D_C_A_setX602(integer this784, integer x150) { println944(("set x " + I2S152(x_150))); D_C_A_x_510[this_784] = x_150; } function D_getX136(integer this214) returns integer { return (D_B_A_getX444(this_214) + D_C_A_getX761(this_214)); } function D_C_A_getX761(integer this823) returns integer { println944(("get x " + I2S152(D_C_A_x_510[this_823]))); return D_C_A_x_510[this_823]; } function D_init825(integer this187) { construct_D_B997(this_187); construct_D_C895(this_187); } function construct_D_B997(integer this467) { construct_D_B_A923(this_467); } function construct_D_C895(integer this894) { construct_D_C_A142(this_894); } function construct_D_B_A923(integer this192) { } function construct_D_C_A142(integer this527) { } function new_D154() returns integer { local integer this894 this_894 = alloc_D128(); construct_D180(this_894); return this_894; } function construct_D180(integer this918) { D_init825(this_918); } function alloc_D128() returns integer { local integer this363 if (D_firstFree_184 == 0) { if (D_maxIndex_139 < 32768) { D_maxIndex_139 = (D_maxIndex_139 + 1); this_363 = D_maxIndex_139; D_typeId_133[this_363] = 1; } else { error767("Out of memory: Could not create D."); this_363 = 0; }; } else { D_firstFree_184 = (D_firstFree_184 - 1); this_363 = D_nextFree_214[D_firstFree_184]; D_typeId_133[this_363] = 1; }; return this_363; } function error767(string msg173) { $debugPrint106((msg_173 + (" " + #getStackTrace()))); } function dispatch_D_test_D_setX675(integer this178, integer x110) { if (D_typeId_133[this_178] == 0) { if (this_178 == 0) { error767("Nullpointer exception when calling D.setX"); } else { error767("Called D.setX on invalid object."); }; } else { }; D_setX814(this_178, x_110); } function dispatch_D_test_D_getX102(integer this129) returns integer { local integer test_D_getX_result123 if (D_typeId_133[this_129] == 0) { if (this_129 == 0) { error767("Nullpointer exception when calling D.getX"); } else { error767("Called D.getX on invalid object."); }; } else { }; test_D_getX_result_123 = D_getX136(this_129); return test_D_getX_result_123; }