array<integer> I_nextFree453
integer I_firstFree749
integer I_maxIndex700
array<integer> I_typeId180


integer I_firstFree749 = 0
integer I_maxIndex700 = 0


function initGlobals922() { 
}


function main205() { 
    initGlobals922();
    init_test113();
}


function config957() { 
}


function init_test113() { 
    test156(new_B179(), new_C184());
}


function test156(integer i1196, integer i2122) { 
    if ((dispatch_I_test_I_foo101(i1_196) == 2) and (dispatch_I_test_I_foo101(i2_122) == 3)) {
        testSuccess283();
    } else {
    };
}


IS_NATIVE function testSuccess283() { 
}


function B_foo170(integer this105) returns integer { 
    return 2;
}


function B_init127(integer this835) { 
}


function new_B179() returns integer { 
    local integer this799
    this_799 = alloc_B188();
    construct_B134(this_799);
    return this_799;
}


function construct_B134(integer this182) { 
    B_init127(this_182);
}


function C_foo131(integer this841) returns integer { 
    return 3;
}


function C_init406(integer this321) { 
}


function new_C184() returns integer { 
    local integer this193
    this_193 = alloc_C611();
    construct_C145(this_193);
    return this_193;
}


function construct_C145(integer this192) { 
    C_init406(this_192);
}


function alloc_B188() returns integer { 
    local integer this142
    if (I_firstFree_749 == 0) {
        if (I_maxIndex_700 < 32768) {
            I_maxIndex_700 = (I_maxIndex_700 + 1);
            this_142 = I_maxIndex_700;
            I_typeId_180[this_142] = 2;
        } else {
            error958("Out of memory: Could not create B.");
            this_142 = 0;
        };
    } else {
        I_firstFree_749 = (I_firstFree_749 - 1);
        this_142 = I_nextFree_453[I_firstFree_749];
        I_typeId_180[this_142] = 2;
    };
    return this_142;
}


function error958(string msg105) { 
    $debugPrint500((msg_105 + ("
" + #getStackTrace())));
}


function alloc_C611() returns integer { 
    local integer this173
    if (I_firstFree_749 == 0) {
        if (I_maxIndex_700 < 32768) {
            I_maxIndex_700 = (I_maxIndex_700 + 1);
            this_173 = I_maxIndex_700;
            I_typeId_180[this_173] = 3;
        } else {
            error958("Out of memory: Could not create C.");
            this_173 = 0;
        };
    } else {
        I_firstFree_749 = (I_firstFree_749 - 1);
        this_173 = I_nextFree_453[I_firstFree_749];
        I_typeId_180[this_173] = 3;
    };
    return this_173;
}


function dispatch_I_test_I_foo101(integer this333) returns integer { 
    if (I_typeId_180[this_333] == 0) {
        if (this_333 == 0) {
            error958("Nullpointer exception when calling I.foo");
        } else {
            error958("Called I.foo on invalid object.");
        };
    } else {
    };
    if (I_typeId_180[this_333] <= 2) {
        this_333 = B_foo170(this_333);
    } else {
        this_333 = C_foo131(this_333);
    };
    return this_333;
}