array<integer> D_nextFree275
integer D_firstFree830
integer D_maxIndex134
array<integer> D_typeId173
array<integer> D_B_A_x225


integer D_firstFree830 = 0
integer D_maxIndex134 = 0


function initGlobals100() { 
}


function main918() { 
    initGlobals100();
    init_test163();
}


function config155() { 
}


function init_test163() { 
    local integer d816
    d_816 = new_D937();
    dispatch_D_test_D_setX222(d_816, 4);
    if (dispatch_D_test_D_getX102(d_816) != 4) {
        testFail344("foo fail");
    } else {
    };
    testSuccess161();
}


IS_NATIVE function testFail344(string msg623) { 
}


IS_NATIVE function testSuccess161() { 
}


function D_setX196(integer this160, integer x158) { 
    D_B_A_setX188(this_160, x_158);
}


function D_B_A_setX188(integer this112, integer x629) { 
    D_B_A_x_225[this_112] = x_629;
}


function D_getX455(integer this576) returns integer { 
    return D_B_A_getX840(this_576);
}


function D_B_A_getX840(integer this730) returns integer { 
    return D_B_A_x_225[this_730];
}


function D_init909(integer this121) { 
    construct_D_B956(this_121);
    construct_D_C147(this_121);
}


function construct_D_B956(integer this209) { 
    construct_D_B_A101(this_209);
}


function construct_D_C147(integer this418) { 
    construct_D_C_A163(this_418);
}


function construct_D_B_A101(integer this128) { 
}


function construct_D_C_A163(integer this758) { 
}


function new_D937() returns integer { 
    local integer this128
    this_128 = alloc_D103();
    construct_D178(this_128);
    return this_128;
}


function construct_D178(integer this194) { 
    D_init909(this_194);
}


function alloc_D103() returns integer { 
    local integer this181
    if (D_firstFree_830 == 0) {
        if (D_maxIndex_134 < 32768) {
            D_maxIndex_134 = (D_maxIndex_134 + 1);
            this_181 = D_maxIndex_134;
            D_typeId_173[this_181] = 1;
        } else {
            error139("Out of memory: Could not create D.");
            this_181 = 0;
        };
    } else {
        D_firstFree_830 = (D_firstFree_830 - 1);
        this_181 = D_nextFree_275[D_firstFree_830];
        D_typeId_173[this_181] = 1;
    };
    return this_181;
}


function error139(string msg188) { 
    $debugPrint435((msg_188 + ("
" + #getStackTrace())));
}


function dispatch_D_test_D_setX222(integer this186, integer x910) { 
    if (D_typeId_173[this_186] == 0) {
        if (this_186 == 0) {
            error139("Nullpointer exception when calling D.setX");
        } else {
            error139("Called D.setX on invalid object.");
        };
    } else {
    };
    D_setX196(this_186, x_910);
}


function dispatch_D_test_D_getX102(integer this315) returns integer { 
    if (D_typeId_173[this_315] == 0) {
        if (this_315 == 0) {
            error139("Nullpointer exception when calling D.getX");
        } else {
            error139("Called D.getX on invalid object.");
        };
    } else {
    };
    return D_getX455(this_315);
}