array<integer> A_nextFree747
integer A_firstFree775
integer A_maxIndex152
array<integer> A_someInt202


integer A_firstFree775 = 0
integer A_maxIndex152 = 0


function initGlobals138() { 
    A_firstFree_775 = 0;
    A_maxIndex_152 = 0;
}


function main160() { 
    initGlobals138();
    init_test125();
}


function config557() { 
}


function init_test125() { 
    if (A_someInt_202[new_B638()] == 1) {
        testSuccess118();
    } else {
    };
}


IS_NATIVE function testSuccess118() { 
}


function A_init659(integer this144) { 
}


function construct_A233(integer this571) { 
    A_init659(this_571);
}


function B_init118(integer this909) { 
}


function new_B638() returns integer { 
    local integer this716
    this_716 = alloc_B856();
    construct_B108(this_716);
    return this_716;
}


function construct_B108(integer this124) { 
    construct_A233(this_124);
    B_init118(this_124);
    A_someInt_202[this_124] = 1;
}


function error938(string msg190) { 
    $debugPrint368((msg_190 + ("
" + #getStackTrace())));
}


function alloc_B856() returns integer { 
    local integer this116
    if (A_firstFree_775 == 0) {
        if (A_maxIndex_152 < 32768) {
            A_maxIndex_152 = (A_maxIndex_152 + 1);
            this_116 = A_maxIndex_152;
        } else {
            error938("Out of memory: Could not create B.");
            this_116 = 0;
        };
    } else {
        A_firstFree_775 = (A_firstFree_775 - 1);
        this_116 = A_nextFree_747[A_firstFree_775];
    };
    return this_116;
}