array<integer> Func_nextFree239
integer Func_firstFree214
integer Func_maxIndex544
array<integer> Func_typeId501


integer Func_firstFree214 = 0
integer Func_maxIndex544 = 0
integer Func2_firstFree203 = 0
integer Func2_maxIndex472 = 0


function initGlobals198() { 
    Func_firstFree_214 = 0;
    Func_maxIndex_544 = 0;
}


function main537() { 
    initGlobals198();
    init_A564();
}


function config172() { 
}


function init_A564() { 
    local integer clVar157
    clVar_157 = alloc_Func_bar_A146();
    if (bar159(clVar_157) == 2) {
        testSuccess162();
    } else {
    };
}


function bar159(integer f720) returns integer { 
    return dispatch_Func_A_Func_apply324(f_720, 1);
}


IS_NATIVE function testSuccess162() { 
}


function apply_bar_A150(integer this839, integer x129) returns integer { 
    return (x_129 + 1);
}


function alloc_Func_bar_A146() returns integer { 
    local integer this116
    if (Func_firstFree_214 == 0) {
        if (Func_maxIndex_544 < 32768) {
            Func_maxIndex_544 = (Func_maxIndex_544 + 1);
            this_116 = Func_maxIndex_544;
            Func_typeId_501[this_116] = 2;
        } else {
            error828("Out of memory: Could not create Func_bar_A.");
            this_116 = 0;
        };
    } else {
        Func_firstFree_214 = (Func_firstFree_214 - 1);
        this_116 = Func_nextFree_239[Func_firstFree_214];
        Func_typeId_501[this_116] = 2;
    };
    return this_116;
}


function error828(string msg103) { 
    $debugPrint162((msg_103 + ("
" + #getStackTrace())));
}


function dispatch_Func_A_Func_apply324(integer this787, integer x148) returns integer { 
    local integer A_Func_apply_result211
    if (Func_typeId_501[this_787] == 0) {
        if (this_787 == 0) {
            error828("Nullpointer exception when calling Func.apply");
        } else {
            error828("Called Func.apply on invalid object.");
        };
    } else {
    };
    A_Func_apply_result_211 = apply_bar_A150(this_787, x_148);
    return A_Func_apply_result_211;
}