array<integer> A_nextFree200
integer A_firstFree130
integer A_maxIndex195
array<integer> A_b_i_0614
array<integer> A_b_i_1163


integer A_firstFree130 = 0
integer A_maxIndex195 = 0


function initGlobals123() { 
    A_firstFree_130 = 0;
    A_maxIndex_195 = 0;
}


function main897() { 
    initGlobals123();
    init_test156();
}


function config149() { 
}


function init_test156() { 
    local integer a159
    local integer tuple_temp181
    local integer tuple_temp139
    a_159 = new_A645();
    tuple_temp_181 = 4;
    A_b_i_set101(a_159, 0, tuple_temp_181);
    tuple_temp_139 = 5;
    A_b_i_set101(a_159, 1, tuple_temp_139);
    if ((A_b_i_get317(a_159, 0) == 4) and (A_b_i_get317(a_159, 1) == 5)) {
        testSuccess545();
    } else {
    };
}


IS_NATIVE function testSuccess545() { 
}


function A_init947(integer this153) { 
}


function new_A645() returns integer { 
    local integer this120
    this_120 = alloc_A189();
    construct_A218(this_120);
    return this_120;
}


function construct_A218(integer this150) { 
    A_init947(this_150);
}


function alloc_A189() returns integer { 
    local integer this154
    if (A_firstFree_130 == 0) {
        if (A_maxIndex_195 < 32768) {
            A_maxIndex_195 = (A_maxIndex_195 + 1);
            this_154 = A_maxIndex_195;
        } else {
            error661("Out of memory: Could not create A.");
            this_154 = 0;
        };
    } else {
        A_firstFree_130 = (A_firstFree_130 - 1);
        this_154 = A_nextFree_200[A_firstFree_130];
    };
    return this_154;
}


function error661(string msg157) { 
    $debugPrint711((msg_157 + ("
" + #getStackTrace())));
}


function A_b_i_set101(integer instanceId206, integer arrayIndex101, integer value945) { 
    if ((arrayIndex_101 < 0) or (arrayIndex_101 >= 2)) {
        error661("Index out of Bounds");
    } else {
        if (arrayIndex_101 <= 0) {
            A_b_i_0_614[instanceId_206] = value_945;
        } else {
            A_b_i_1_163[instanceId_206] = value_945;
        };
    };
}


function A_b_i_get317(integer index1297, integer index2188) returns integer { 
    local integer returnVal163
    if ((index2_188 < 0) or (index2_188 >= 2)) {
        error661("Index out of Bounds");
    } else {
        if (index2_188 <= 0) {
            returnVal_163 = A_b_i_0_614[index1_297];
        } else {
            returnVal_163 = A_b_i_1_163[index1_297];
        };
    };
    return returnVal_163;
}