/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.security.RevocationCheckPolicy
 *  com.l7tech.gateway.common.security.RevocationCheckPolicyItem
 *  com.l7tech.objectmodel.EntityHeader
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.security.cert.TrustedCertManager
 *  com.l7tech.util.Functions
 *  com.l7tech.util.Functions$Unary
 *  com.l7tech.util.Functions$UnaryThrows
 *  jakarta.inject.Inject
 *  org.jetbrains.annotations.NotNull
 */
package com.l7tech.server.search.processors;

import com.l7tech.gateway.common.security.RevocationCheckPolicy;
import com.l7tech.gateway.common.security.RevocationCheckPolicyItem;
import com.l7tech.objectmodel.EntityHeader;
import com.l7tech.objectmodel.FindException;
import com.l7tech.security.cert.TrustedCertManager;
import com.l7tech.server.search.exceptions.CannotReplaceDependenciesException;
import com.l7tech.server.search.exceptions.CannotRetrieveDependenciesException;
import com.l7tech.server.search.objects.Dependency;
import com.l7tech.server.search.processors.DefaultDependencyProcessor;
import com.l7tech.server.search.processors.DependencyFinder;
import com.l7tech.server.search.processors.ai;
import com.l7tech.server.search.processors.aj;
import com.l7tech.util.Functions;
import jakarta.inject.Inject;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.jetbrains.annotations.NotNull;

/*
 * Exception performing whole class analysis ignored.
 */
public class RevocationCheckPolicyDependencyProcessor
extends DefaultDependencyProcessor<RevocationCheckPolicy> {
    @Inject
    private TrustedCertManager trustedCertManager;
    private static final String[] a;

    @Override
    @NotNull
    public List<Dependency> findDependencies(@NotNull RevocationCheckPolicy revocationCheckPolicy, @NotNull DependencyFinder dependencyFinder) throws FindException, CannotRetrieveDependenciesException {
        List<Dependency> list;
        try {
            if (revocationCheckPolicy == null) {
                RevocationCheckPolicyDependencyProcessor.b(0);
            }
        }
        catch (FindException findException) {
            throw RevocationCheckPolicyDependencyProcessor.a((Exception)((Object)findException));
        }
        try {
            if (dependencyFinder == null) {
                RevocationCheckPolicyDependencyProcessor.b(1);
            }
        }
        catch (FindException findException) {
            throw RevocationCheckPolicyDependencyProcessor.a((Exception)((Object)findException));
        }
        List<Dependency> list2 = super.findDependencies(revocationCheckPolicy, dependencyFinder);
        ArrayList<DependencyFinder.FindResults> arrayList = new ArrayList<DependencyFinder.FindResults>();
        for (RevocationCheckPolicyItem revocationCheckPolicyItem : revocationCheckPolicy.getRevocationCheckItems()) {
            arrayList.addAll(Functions.map((Iterable)revocationCheckPolicyItem.getTrustedSigners(), (Functions.UnaryThrows)new ai(this)));
        }
        try {
            if (!arrayList.isEmpty()) {
                list2.addAll(dependencyFinder.getDependenciesFromObjects(revocationCheckPolicy, dependencyFinder, arrayList));
            }
        }
        catch (FindException findException) {
            throw RevocationCheckPolicyDependencyProcessor.a((Exception)((Object)findException));
        }
        try {
            list = list2;
            if (list == null) {
                RevocationCheckPolicyDependencyProcessor.b(2);
            }
        }
        catch (FindException findException) {
            throw RevocationCheckPolicyDependencyProcessor.a((Exception)((Object)findException));
        }
        return list;
    }

    @Override
    public void replaceDependencies(@NotNull RevocationCheckPolicy revocationCheckPolicy, @NotNull Map<EntityHeader, EntityHeader> map, @NotNull DependencyFinder dependencyFinder, boolean bl2) throws CannotReplaceDependenciesException {
        try {
            if (revocationCheckPolicy == null) {
                RevocationCheckPolicyDependencyProcessor.b(3);
            }
        }
        catch (CannotReplaceDependenciesException cannotReplaceDependenciesException) {
            throw RevocationCheckPolicyDependencyProcessor.a(cannotReplaceDependenciesException);
        }
        try {
            if (map == null) {
                RevocationCheckPolicyDependencyProcessor.b(4);
            }
        }
        catch (CannotReplaceDependenciesException cannotReplaceDependenciesException) {
            throw RevocationCheckPolicyDependencyProcessor.a(cannotReplaceDependenciesException);
        }
        try {
            if (dependencyFinder == null) {
                RevocationCheckPolicyDependencyProcessor.b(5);
            }
        }
        catch (CannotReplaceDependenciesException cannotReplaceDependenciesException) {
            throw RevocationCheckPolicyDependencyProcessor.a(cannotReplaceDependenciesException);
        }
        super.replaceDependencies(revocationCheckPolicy, map, dependencyFinder, bl2);
        for (RevocationCheckPolicyItem revocationCheckPolicyItem : revocationCheckPolicy.getRevocationCheckItems()) {
            revocationCheckPolicyItem.setTrustedSigners(Functions.map((Iterable)revocationCheckPolicyItem.getTrustedSigners(), (Functions.Unary)new aj(this, map)));
        }
    }

    /*
     * Exception decompiling
     */
    private static /* synthetic */ void b(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 6[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:1050)
         *     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 Exception a(Exception exception) {
        return exception;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[10];
                var3_1 = 0;
                var2_2 = "[*C\u0007edF]&F\u0007z6@N \\\u0007z6SJ&F\u0007y!][ ][f!A\u0017\u0017K^f0SL,AFJ;W[.~Ge:QA\u0001KXl=V]+MQY!][ ][f!\u0010^,@LM6B]+JMg0[]6\u000eJ ^Dh0WU @\\D2B*x\u000bA\\G&^TeCM};]\\e\u000b['vA\u0018([[}s\\W1\u000eZl'GJ+\u000eF|?^\u0006W'DMj'\u0010^,@LM6B]+JMg0[]6\u0013J ^Dh0W| ^Mg7WV&GMz\u0006^,@Ll!";
                var4_3 = "[*C\u0007edF]&F\u0007z6@N \\\u0007z6SJ&F\u0007y!][ ][f!A\u0017\u0017K^f0SL,AFJ;W[.~Ge:QA\u0001KXl=V]+MQY!][ ][f!\u0010^,@LM6B]+JMg0[]6\u000eJ ^Dh0WU @\\D2B*x\u000bA\\G&^TeCM};]\\e\u000b['vA\u0018([[}s\\W1\u000eZl'GJ+\u000eF|?^\u0006W'DMj'\u0010^,@LM6B]+JMg0[]6\u0013J ^Dh0W| ^Mg7WV&GMz\u0006^,@Ll!".length();
                var1_4 = 76;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = RevocationCheckPolicyDependencyProcessor.b(v0, RevocationCheckPolicyDependencyProcessor.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "\u001ak\u0002F$%\u0007\u001cg\u0007F;w\u0001\u000fa\u001dF;w\u0012\u000bg\u0007F8`\u001c\u001aa\u001c\u001a'`\u0000VV\n\u001f'q\u0012\rm\u0000\u0007\u000bz\u0016\u001ao?\u0006${\u0010\u0000@\n\u0019-|\u0017\u001cj\f\u0010\u0018`\u001c\u001aa\u001c\u001a'`>8v\b\u001c%w\u001d\r$\t\u0006:237k\u001b'=~\u001fYt\u000e\u001b)\u007f\u0016\ra\u001dIo7\u0000^$\u0000\u000fh7\u0000W!\u001cI%g\u0000\r$\u0001\u0006<2\u0011\u001c$\u0001\u001c$~";
                    var4_3 = "\u001ak\u0002F$%\u0007\u001cg\u0007F;w\u0001\u000fa\u001dF;w\u0012\u000bg\u0007F8`\u001c\u001aa\u001c\u001a'`\u0000VV\n\u001f'q\u0012\rm\u0000\u0007\u000bz\u0016\u001ao?\u0006${\u0010\u0000@\n\u0019-|\u0017\u001cj\f\u0010\u0018`\u001c\u001aa\u001c\u001a'`>8v\b\u001c%w\u001d\r$\t\u0006:237k\u001b'=~\u001fYt\u000e\u001b)\u007f\u0016\ra\u001dIo7\u0000^$\u0000\u000fh7\u0000W!\u001cI%g\u0000\r$\u0001\u0006<2\u0011\u001c$\u0001\u001c$~".length();
                    var1_4 = 76;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 11;
                        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++] = RevocationCheckPolicyDependencyProcessor.b(v0, RevocationCheckPolicyDependencyProcessor.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;
            }
        }
        RevocationCheckPolicyDependencyProcessor.a = var5;
    }

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

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String b(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 -> 114;
                    case 1 -> 15;
                    case 2 -> 100;
                    case 3 -> 98;
                    case 4 -> 67;
                    case 5 -> 25;
                    default -> 120;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

