final ObjectDefinition method345() {
        int j = -1;
        if (anInt540 == -1) {
            if (anInt599 != -1) {
                j = Class21.settings[anInt599];
            }
        } else {
            j = Class142_Sub27_Sub14.method1892(anInt540);
        }
        if (~j > -1 || -1 + childIDs.length <= j || ~childIDs[j] == 0) {
            int k = childIDs[-1 + childIDs.length];
            if (k != -1) {
                return Class40_Sub3.objectDefinitionForID(k);
            } else {
                return null;
            }
        } else {
            return Class40_Sub3.objectDefinitionForID(childIDs[j]);
        }
    }