/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.objectmodel.EntityType
 *  com.l7tech.policy.assertion.UsesEntities
 *  com.l7tech.util.Functions$Binary
 *  org.jetbrains.annotations.NotNull
 */
package com.l7tech.server.policy.validator;

import com.l7tech.objectmodel.EntityType;
import com.l7tech.policy.assertion.UsesEntities;
import com.l7tech.server.policy.validator.ServerPolicyValidator;
import com.l7tech.server.util.EntityUseUtils;
import com.l7tech.util.Functions;
import org.jetbrains.annotations.NotNull;

class b
implements Functions.Binary<String, UsesEntities, EntityType> {
    private static final String[] a;

    b(ServerPolicyValidator serverPolicyValidator) {
    }

    public String call(@NotNull UsesEntities usesEntities, @NotNull EntityType entityType) {
        try {
            if (usesEntities == null) {
                b.a(0);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw b.a(illegalArgumentException);
        }
        try {
            if (entityType == null) {
                b.a(1);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw b.a(illegalArgumentException);
        }
        return EntityUseUtils.getTypeName(usesEntities, entityType);
    }

    /*
     * Exception decompiling
     */
    private static void a(int var0) {
        /*
         * This method has failed to decompile.  When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
         * 
         * org.benf.cfr.reader.util.ConfusedCFRException: Tried to end blocks [0[TRYBLOCK]], but top level block is 1[SWITCH]
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.processEndingBlocks(Op04StructuredStatement.java:435)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:484)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201)
         *     at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94)
         *     at org.benf.cfr.reader.entities.Method.analyse(Method.java:531)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942)
         *     at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257)
         *     at org.benf.cfr.reader.Driver.doJar(Driver.java:139)
         *     at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76)
         *     at org.benf.cfr.reader.Main.main(Main.java:54)
         */
        throw new IllegalStateException("Decompilation failed");
    }

    private static IllegalArgumentException a(IllegalArgumentException illegalArgumentException) {
        return illegalArgumentException;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[5];
                var3_1 = 0;
                var2_2 = "tL\u0000l$tB\u0001/@\u0014-rN\u0004/_F+aH\u001e/\\L5~N\u0015/ZB5~I\rtCQvu\nrC\u0018iXZ\rn]\t";
                var4_3 = "tL\u0000l$tB\u0001/@\u0014-rN\u0004/_F+aH\u001e/\\L5~N\u0015/ZB5~I\rtCQvu\nrC\u0018iXZ\rn]\t".length();
                var1_4 = 4;
                var0_5 = -1;
lbl7:
                // 2 sources

                while (true) {
                    v0 = 88;
                    v1 = ++var0_5;
                    v2 = var2_2.substring(v1, v1 + var1_4);
                    v3 = -1;
                    break block9;
                    break;
                }
lbl13:
                // 1 sources

                while (true) {
                    var5[var3_1++] = b.a(v0, b.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "\u001a&q\u000b\u00115U\u0006!}\u001d'>.'s\r9>O\u001bur\u0017&{a!:`6!7MO%u\n56D\u001b0fXs~RHu{\u001et~RApgX9.R\u001buz\u0017 {C\nuz\r87";
                    var4_3 = "\u001a&q\u000b\u00115U\u0006!}\u001d'>.'s\r9>O\u001bur\u0017&{a!:`6!7MO%u\n56D\u001b0fXs~RHu{\u001et~RApgX9.R\u001buz\u0017 {C\nuz\r87".length();
                    var1_4 = 12;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 32;
                        v4 = ++var0_5;
                        v2 = var2_2.substring(v4, v4 + var1_4);
                        v3 = 0;
                        break block9;
                        break;
                    }
                    break;
                }
lbl28:
                // 1 sources

                while (true) {
                    var5[var3_1++] = b.a(v0, b.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    break block10;
                    break;
                }
            }
            switch (v3) {
                default: {
                    ** continue;
                }
                ** case 0:
lbl39:
                // 1 sources

                ** continue;
            }
        }
        b.a = var5;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ '\u0001');
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 79;
                    case 1 -> 117;
                    case 2 -> 52;
                    case 3 -> 88;
                    case 4 -> 116;
                    case 5 -> 123;
                    default -> 1;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

