array<integer> A_nextFree633
integer A_firstFree657
integer A_maxIndex135
array<integer> A_typeId211


integer A_firstFree657 = 0
integer A_maxIndex135 = 0


function initGlobals158() { 
    A_firstFree_657 = 0;
    A_maxIndex_135 = 0;
}


function main981() { 
    initGlobals158();
    init_test110();
}


function config205() { 
}


function init_test110() { 
    dispatch_A_test_A_foo157(new_A156(), handleToIndex117(null<handle>));
}


function handleToIndex117(handle h553) returns integer { 
    return 1;
}


function A_foo127(integer this174, any t178) { 
}


function A_init139(integer this667) { 
}


function new_A156() returns integer { 
    local integer this190
    this_190 = alloc_A190();
    construct_A163(this_190);
    return this_190;
}


function construct_A163(integer this289) { 
    A_init139(this_289);
}


function alloc_A190() returns integer { 
    local integer this933
    if (A_firstFree_657 == 0) {
        if (A_maxIndex_135 < 32768) {
            A_maxIndex_135 = (A_maxIndex_135 + 1);
            this_933 = A_maxIndex_135;
            A_typeId_211[this_933] = 1;
        } else {
            error100("Out of memory: Could not create A.");
            this_933 = 0;
        };
    } else {
        A_firstFree_657 = (A_firstFree_657 - 1);
        this_933 = A_nextFree_633[A_firstFree_657];
        A_typeId_211[this_933] = 1;
    };
    return this_933;
}


function error100(string msg726) { 
    $debugPrint110((msg_726 + ("
" + #getStackTrace())));
}


function dispatch_A_test_A_foo157(integer this205, any t406) { 
    if (A_typeId_211[this_205] == 0) {
        if (this_205 == 0) {
            error100("Nullpointer exception when calling A.foo");
        } else {
            error100("Called A.foo on invalid object.");
        };
    } else {
    };
    A_foo127(this_205, t_406);
}