/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.custom.CustomAssertionDescriptor
 *  com.l7tech.policy.assertion.ext.ServiceFinder
 *  org.jetbrains.annotations.NotNull
 *  org.springframework.context.ApplicationEvent
 */
package com.l7tech.server.policy.custom;

import com.l7tech.gateway.common.custom.CustomAssertionDescriptor;
import com.l7tech.policy.assertion.ext.ServiceFinder;
import com.l7tech.server.policy.custom.CustomAssertionsRegistrarImpl;
import com.l7tech.server.policy.custom.a;
import com.l7tech.server.policy.module.ModuleException;
import com.l7tech.server.policy.module.ScannerCallbacks;
import org.jetbrains.annotations.NotNull;
import org.springframework.context.ApplicationEvent;

class b
implements ScannerCallbacks.CustomAssertion {
    final CustomAssertionsRegistrarImpl this$0;
    private static final String[] a;

    b(CustomAssertionsRegistrarImpl customAssertionsRegistrarImpl) {
        this.this$0 = customAssertionsRegistrarImpl;
    }

    @Override
    public void registerAssertion(@NotNull CustomAssertionDescriptor customAssertionDescriptor) throws ModuleException {
        try {
            if (customAssertionDescriptor == null) {
                b.a(0);
            }
        }
        catch (IllegalAccessException illegalAccessException) {
            throw b.a(illegalAccessException);
        }
        try {
            com.l7tech.server.policy.custom.a.a(customAssertionDescriptor);
            this.this$0.registerCustomExtensionInterface(customAssertionDescriptor.getExtensionInterfaceClass());
        }
        catch (IllegalAccessException | InstantiationException reflectiveOperationException) {
            String[] stringArray = a;
            throw new ModuleException(stringArray[5] + customAssertionDescriptor.getName() + stringArray[0] + customAssertionDescriptor.getModuleFileName() + "]", reflectiveOperationException);
        }
        catch (Throwable throwable) {
            String[] stringArray = a;
            throw new ModuleException(stringArray[2] + customAssertionDescriptor.getName() + stringArray[3] + customAssertionDescriptor.getModuleFileName() + "]", throwable);
        }
    }

    @Override
    public void unregisterAssertion(@NotNull CustomAssertionDescriptor customAssertionDescriptor) {
        try {
            if (customAssertionDescriptor == null) {
                b.a(1);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw b.a(illegalArgumentException);
        }
        com.l7tech.server.policy.custom.a.b(customAssertionDescriptor);
    }

    @Override
    public ServiceFinder getServiceFinder() {
        return this.this$0.a();
    }

    @Override
    public void publishEvent(@NotNull ApplicationEvent applicationEvent) {
        try {
            if (applicationEvent == null) {
                b.a(2);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw b.a(illegalArgumentException);
        }
        this.this$0.a(applicationEvent);
    }

    /*
     * 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 2[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 Exception a(Exception exception) {
        return exception;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[11];
                var3_1 = 0;
                var2_2 = "\u007f\u000b\f\u0004hk>QB\u0006\u0012<g>VN\u001b\u001a}m5\u000e\u000b\u000f\u0013n.=MO\u001c\u0010y.\u000b\u0013WE\u001b\u0019{g#VN\u001b=o}5P_\u0000\u0013r*gY\u001b\u0013n.'JB\u0005\u0019<|5EB\u001a\by|9LLI\u001fi}$MFI\u001do}5P_\u0000\u0013r.\u000b\u000e\u007f\u000b\u000f\u0013n.=MO\u001c\u0010y.\u000b\nFN\u001a\u001fng VD\u001b*gY\u001b\u0013n.'JB\u0005\u0019<|5EB\u001a\by|9LLI\u001fi}$MFI\u001do}5P_\u0000\u0013r.\u000b\u0005G]\f\u0012h>cY\u000e\tqk>V\u000b\u000f\u0013n.\u0010lD\u001d2ib<\u0002[\b\u000e}c5VN\u001b\\;+#\u0005\u000b\u0006\u001a<+#\f\u000e\u001a\\q{#V\u000b\u0007\u0013h.2G\u000b\u0007\tpb\fR^\u000b\u0010u}8g]\f\u0012h";
                var4_3 = "\u007f\u000b\f\u0004hk>QB\u0006\u0012<g>VN\u001b\u001a}m5\u000e\u000b\u000f\u0013n.=MO\u001c\u0010y.\u000b\u0013WE\u001b\u0019{g#VN\u001b=o}5P_\u0000\u0013r*gY\u001b\u0013n.'JB\u0005\u0019<|5EB\u001a\by|9LLI\u001fi}$MFI\u001do}5P_\u0000\u0013r.\u000b\u000e\u007f\u000b\u000f\u0013n.=MO\u001c\u0010y.\u000b\nFN\u001a\u001fng VD\u001b*gY\u001b\u0013n.'JB\u0005\u0019<|5EB\u001a\by|9LLI\u001fi}$MFI\u001do}5P_\u0000\u0013r.\u000b\u0005G]\f\u0012h>cY\u000e\tqk>V\u000b\u000f\u0013n.\u0010lD\u001d2ib<\u0002[\b\u000e}c5VN\u001b\\;+#\u0005\u000b\u0006\u001a<+#\f\u000e\u001a\\q{#V\u000b\u0007\u0013h.2G\u000b\u0007\tpb\fR^\u000b\u0010u}8g]\f\u0012h".length();
                var1_4 = 35;
                var0_5 = -1;
lbl7:
                // 2 sources

                while (true) {
                    v0 = 64;
                    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 = "C]\u001d\u0006|i&Cy\t\u001cjo7XW\u0014!RW\u0017@c*7T[\u0012@|x1G]\b@\u007fr/X[\u0003@lh0EW\u0017@m";
                    var4_3 = "C]\u001d\u0006|i&Cy\t\u001cjo7XW\u0014!RW\u0017@c*7T[\u0012@|x1G]\b@\u007fr/X[\u0003@lh0EW\u0017@m".length();
                    var1_4 = 17;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 83;
                        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] ^ 0x10);
        }
        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 -> 98;
                    case 1 -> 107;
                    case 2 -> 41;
                    case 3 -> 60;
                    case 4 -> 92;
                    case 5 -> 78;
                    default -> 16;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

