array<integer> A_nextFree213
integer A_firstFree152
integer A_maxIndex108
array<integer> A_typeId201


integer A_firstFree152 = 0
integer A_maxIndex108 = 0


function initGlobals169() { 
}


function main304() { 
    local integer b567
    initGlobals169();
    b_567 = new_B208();
    if (dispatch_A_test_A_foo148(b_567) == 8) {
        testSuccess107();
    } else {
    };
}


function config958() { 
}


IS_NATIVE function testSuccess107() { 
}


function new_B208() returns integer { 
    local integer this306
    local integer this389
    if (A_firstFree_152 == 0) {
        if (A_maxIndex_108 < 32768) {
            A_maxIndex_108 = (A_maxIndex_108 + 1);
            this_389 = A_maxIndex_108;
            A_typeId_201[this_389] = 2;
        } else {
            error543("Out of memory: Could not create B.");
            this_389 = 0;
        };
    } else {
        A_firstFree_152 = (A_firstFree_152 - 1);
        this_389 = A_nextFree_213[A_firstFree_152];
        A_typeId_201[this_389] = 2;
    };
    this_306 = this_389;
    return this_306;
}


function error543(string msg204) { 
    $debugPrint168((msg_204 + ("
" + #getStackTrace())));
}


function dispatch_A_test_A_foo148(integer this978) returns integer { 
    local integer test_A_foo_result114
    if (A_typeId_201[this_978] == 0) {
        if (this_978 == 0) {
            error543("Nullpointer exception when calling A.foo");
        } else {
            error543("Called A.foo on invalid object.");
        };
    } else {
    };
    if (A_typeId_201[this_978] <= 1) {
        test_A_foo_result_114 = 7;
    } else {
        test_A_foo_result_114 = 8;
    };
    return test_A_foo_result_114;
}