array<integer> C_nextFree106
integer C_firstFree214
integer C_maxIndex745
array<integer> C_typeId139
array<any> C_x117


integer C_firstFree214 = 0
integer C_maxIndex745 = 0


function initGlobals220() { 
    C_firstFree_214 = 0;
    C_maxIndex_745 = 0;
}


function main140() { 
    initGlobals220();
    init_test136();
}


function config159() { 
}


function init_test136() { 
    local integer c162
    local string s197
    c_162 = new_C180();
    dispatch_C_test_C_setX_1889(c_162, stringToIndex206("42"));
    s_197 = stringFromIndex114(dispatch_C_test_C_getX132(c_162));
    if (s_197 == "42") {
        testSuccess494();
    } else {
    };
}


function stringToIndex206(string s143) returns integer { 
    return 42;
}


function stringFromIndex114(integer i173) returns string { 
    return "42";
}


IS_NATIVE function testSuccess494() { 
}


function C_getX423(integer this207) returns any { 
    return C_x_117[this_207];
}


function C_init179(integer this101) { 
}


function new_C180() returns integer { 
    local integer this124
    this_124 = alloc_C576();
    construct_C359(this_124);
    return this_124;
}


function construct_C359(integer this601) { 
    C_init179(this_601);
}


function alloc_C576() returns integer { 
    local integer this154
    if (C_firstFree_214 == 0) {
        if (C_maxIndex_745 < 32768) {
            C_maxIndex_745 = (C_maxIndex_745 + 1);
            this_154 = C_maxIndex_745;
            C_typeId_139[this_154] = 1;
        } else {
            error887("Out of memory: Could not create C.");
            this_154 = 0;
        };
    } else {
        C_firstFree_214 = (C_firstFree_214 - 1);
        this_154 = C_nextFree_106[C_firstFree_214];
        C_typeId_139[this_154] = 1;
    };
    return this_154;
}


function error887(string msg669) { 
    $debugPrint474((msg_669 + ("
" + #getStackTrace())));
}


function dispatch_C_test_C_getX132(integer this463) returns any { 
    local any test_C_getX_result138
    if (C_typeId_139[this_463] == 0) {
        if (this_463 == 0) {
            error887("Nullpointer exception when calling C.getX");
        } else {
            error887("Called C.getX on invalid object.");
        };
    } else {
    };
    test_C_getX_result_138 = C_getX423(this_463);
    return test_C_getX_result_138;
}


function C_setX_1136(integer this115, any xs_0562) { 
    C_x_117[this_115] = xs_0_562;
}


function dispatch_C_test_C_setX_1889(integer this147, any xs_0133) { 
    if (C_typeId_139[this_147] == 0) {
        if (this_147 == 0) {
            error887("Nullpointer exception when calling C.setX");
        } else {
            error887("Called C.setX on invalid object.");
        };
    } else {
    };
    C_setX_1136(this_147, xs_0_133);
}