/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.resources.HttpConfiguration
 *  com.l7tech.gateway.common.resources.HttpConfiguration$Option
 *  com.l7tech.gateway.common.security.keystore.SsgKeyEntry
 *  com.l7tech.objectmodel.Entity
 *  com.l7tech.objectmodel.FindException
 *  jakarta.inject.Inject
 *  org.jetbrains.annotations.NotNull
 */
package com.l7tech.server.search.processors;

import com.l7tech.gateway.common.resources.HttpConfiguration;
import com.l7tech.gateway.common.security.keystore.SsgKeyEntry;
import com.l7tech.objectmodel.Entity;
import com.l7tech.objectmodel.FindException;
import com.l7tech.server.DefaultKey;
import com.l7tech.server.DefaultKeyImpl;
import com.l7tech.server.EntityHeaderUtils;
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 jakarta.inject.Inject;
import java.io.IOException;
import java.util.List;
import org.jetbrains.annotations.NotNull;

/*
 * Exception performing whole class analysis ignored.
 */
public class HttpConfigurationDependencyProcessor
extends DefaultDependencyProcessor<HttpConfiguration> {
    @Inject
    private DefaultKey defaultKey;
    private static final String[] a;

    @Override
    @NotNull
    public List<Dependency> findDependencies(@NotNull HttpConfiguration httpConfiguration, @NotNull DependencyFinder dependencyFinder) throws FindException, CannotRetrieveDependenciesException {
        List<Dependency> list;
        try {
            if (httpConfiguration == null) {
                HttpConfigurationDependencyProcessor.b(0);
            }
        }
        catch (FindException findException) {
            throw HttpConfigurationDependencyProcessor.a((Exception)((Object)findException));
        }
        try {
            if (dependencyFinder == null) {
                HttpConfigurationDependencyProcessor.b(1);
            }
        }
        catch (FindException findException) {
            throw HttpConfigurationDependencyProcessor.a((Exception)((Object)findException));
        }
        List<Dependency> list2 = super.findDependencies(httpConfiguration, dependencyFinder);
        try {
            if (HttpConfiguration.Option.DEFAULT.equals((Object)httpConfiguration.getTlsKeyUse())) {
                this.a(list2, dependencyFinder, a[2]);
                this.a(list2, dependencyFinder);
                this.b(list2, dependencyFinder);
            }
        }
        catch (FindException findException) {
            throw HttpConfigurationDependencyProcessor.a((Exception)((Object)findException));
        }
        try {
            list = list2;
            if (list == null) {
                HttpConfigurationDependencyProcessor.b(2);
            }
        }
        catch (FindException findException) {
            throw HttpConfigurationDependencyProcessor.a((Exception)((Object)findException));
        }
        return list;
    }

    /*
     * Loose catch block
     */
    private void a(List<Dependency> list, DependencyFinder dependencyFinder, String string) throws FindException, CannotRetrieveDependenciesException {
        block8: {
            try {
                SsgKeyEntry ssgKeyEntry = this.defaultKey.getSslInfo();
                try {
                    if (ssgKeyEntry == null || DefaultKeyImpl.isNullEntry(ssgKeyEntry)) break block8;
                }
                catch (IOException iOException) {
                    throw HttpConfigurationDependencyProcessor.a(iOException);
                }
                Dependency dependency = dependencyFinder.a(DependencyFinder.FindResults.create(ssgKeyEntry, EntityHeaderUtils.fromEntity((Entity)ssgKeyEntry)));
                if (dependency == null) break block8;
                try {
                    block9: {
                        if (list.contains(dependency)) break block8;
                        break block9;
                        catch (IOException iOException) {
                            throw HttpConfigurationDependencyProcessor.a(iOException);
                        }
                    }
                    list.add(dependency);
                }
                catch (IOException iOException) {
                    throw HttpConfigurationDependencyProcessor.a(iOException);
                }
            }
            catch (IOException iOException) {
                String[] stringArray = a;
                throw new FindException(stringArray[6] + string + stringArray[7], (Throwable)iOException);
            }
        }
    }

    /*
     * Loose catch block
     */
    private void a(List<Dependency> list, DependencyFinder dependencyFinder) throws FindException, CannotRetrieveDependenciesException {
        block8: {
            try {
                SsgKeyEntry ssgKeyEntry = this.defaultKey.getServerSslInfo();
                try {
                    if (ssgKeyEntry == null || DefaultKeyImpl.isNullEntry(ssgKeyEntry)) break block8;
                }
                catch (IOException iOException) {
                    throw HttpConfigurationDependencyProcessor.a(iOException);
                }
                Dependency dependency = dependencyFinder.a(DependencyFinder.FindResults.create(ssgKeyEntry, EntityHeaderUtils.fromEntity((Entity)ssgKeyEntry)));
                if (dependency == null) break block8;
                try {
                    block9: {
                        if (list.contains(dependency)) break block8;
                        break block9;
                        catch (IOException iOException) {
                            throw HttpConfigurationDependencyProcessor.a(iOException);
                        }
                    }
                    list.add(dependency);
                }
                catch (IOException iOException) {
                    throw HttpConfigurationDependencyProcessor.a(iOException);
                }
            }
            catch (IOException iOException) {
                // empty catch block
            }
        }
    }

    /*
     * Loose catch block
     */
    private void b(List<Dependency> list, DependencyFinder dependencyFinder) throws FindException, CannotRetrieveDependenciesException {
        block8: {
            try {
                SsgKeyEntry ssgKeyEntry = this.defaultKey.getClientSslInfo();
                try {
                    if (ssgKeyEntry == null || DefaultKeyImpl.isNullEntry(ssgKeyEntry)) break block8;
                }
                catch (IOException iOException) {
                    throw HttpConfigurationDependencyProcessor.a(iOException);
                }
                Dependency dependency = dependencyFinder.a(DependencyFinder.FindResults.create(ssgKeyEntry, EntityHeaderUtils.fromEntity((Entity)ssgKeyEntry)));
                if (dependency == null) break block8;
                try {
                    block9: {
                        if (list.contains(dependency)) break block8;
                        break block9;
                        catch (IOException iOException) {
                            throw HttpConfigurationDependencyProcessor.a(iOException);
                        }
                    }
                    list.add(dependency);
                }
                catch (IOException iOException) {
                    throw HttpConfigurationDependencyProcessor.a(iOException);
                }
            }
            catch (IOException iOException) {
                // empty catch block
            }
        }
    }

    /*
     * 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[11];
                var3_1 = 0;
                var2_2 = "\u0010\u0018\u0018^*Be<v\u001aO\u0010_f4vRYJ\u0012zp;\u0002Y\u0010\u0017g?\"WX\u0001C|\"8WD\u0011[e\u00106?\u0019N Ry58\u0013O\nT`5%\u000b\u00143\u0011K\u0011[}p\u0005$f\u00118\"\u0003Z'Xg6?\u0010_\u0016V}99\u0019>\u0011$\u0010_\tRg$v\u0011E\u0016\u0017I\u001e9\u0003d\u0011[ep&\u0016X\u0005Zl$3\u0005\nC\u0012zwv\u0018LD\u0012z~s\u0004\n\tBz$v\u0019E\u0010\u0017k5v\u0019_\b[\u00106?\u0019N Ry58\u0013O\nT`5%\u000e\u00139\u0002F\u0000\u0017g?\"WM\u0001C)\u0004p=\u0012S\u00066?\u0019N\u0001E";
                var4_3 = "\u0010\u0018\u0018^*Be<v\u001aO\u0010_f4vRYJ\u0012zp;\u0002Y\u0010\u0017g?\"WX\u0001C|\"8WD\u0011[e\u00106?\u0019N Ry58\u0013O\nT`5%\u000b\u00143\u0011K\u0011[}p\u0005$f\u00118\"\u0003Z'Xg6?\u0010_\u0016V}99\u0019>\u0011$\u0010_\tRg$v\u0011E\u0016\u0017I\u001e9\u0003d\u0011[ep&\u0016X\u0005Zl$3\u0005\nC\u0012zwv\u0018LD\u0012z~s\u0004\n\tBz$v\u0019E\u0010\u0017k5v\u0019_\b[\u00106?\u0019N Ry58\u0013O\nT`5%\u000e\u00139\u0002F\u0000\u0017g?\"WM\u0001C)\u0004p=\u0012S\u00066?\u0019N\u0001E".length();
                var1_4 = 42;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = HttpConfigurationDependencyProcessor.b(v0, HttpConfigurationDependencyProcessor.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "\n\u0000#<19D\f\f&<.kB\u001f\n<<.kQ\u001b\f&<-|_\n\n=`2|CF':g-M_\u0007\t't(|Q\u001d\u0006!}\u0019k@\f\u0001*v3mI9\u001d!p8}C\u0006\u001dH\n\u0000#<19D\f\f&<.kB\u001f\n<<.kQ\u001b\f&<-|_\n\n=`2|CF':g-M_\u0007\t't(|Q\u001d\u0006!}\u0019k@\f\u0001*v3mI9\u001d!p8}C\u0006\u001d";
                    var4_3 = "\n\u0000#<19D\f\f&<.kB\u001f\n<<.kQ\u001b\f&<-|_\n\n=`2|CF':g-M_\u0007\t't(|Q\u001d\u0006!}\u0019k@\f\u0001*v3mI9\u001d!p8}C\u0006\u001dH\n\u0000#<19D\f\f&<.kB\u001f\n<<.kQ\u001b\f&<-|_\n\n=`2|CF':g-M_\u0007\t't(|Q\u001d\u0006!}\u0019k@\f\u0001*v3mI9\u001d!p8}C\u0006\u001d".length();
                    var1_4 = 72;
                    var0_5 = -1;
lbl22:
                    // 2 sources

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

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x54);
        }
        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 -> 13;
                    case 1 -> 11;
                    case 2 -> 42;
                    case 3 -> 119;
                    case 4 -> 57;
                    case 5 -> 106;
                    default -> 84;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

