/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.policy.assertion.AssertionStatus
 *  com.l7tech.policy.assertion.PolicyAssertionException
 *  com.l7tech.policy.assertion.RaiseErrorAssertion
 *  com.l7tech.policy.assertion.RaisedByPolicyException
 *  org.jetbrains.annotations.NotNull
 */
package com.l7tech.server.policy.assertion;

import com.l7tech.policy.assertion.AssertionStatus;
import com.l7tech.policy.assertion.PolicyAssertionException;
import com.l7tech.policy.assertion.RaiseErrorAssertion;
import com.l7tech.policy.assertion.RaisedByPolicyException;
import com.l7tech.server.message.PolicyEnforcementContext;
import com.l7tech.server.policy.assertion.AbstractServerAssertion;
import java.io.IOException;
import org.jetbrains.annotations.NotNull;

public class ServerRaiseErrorAssertion
extends AbstractServerAssertion<RaiseErrorAssertion> {
    private static final String[] d;

    public ServerRaiseErrorAssertion(@NotNull RaiseErrorAssertion raiseErrorAssertion) {
        if (raiseErrorAssertion == null) {
            ServerRaiseErrorAssertion.b(0);
        }
        super(raiseErrorAssertion);
    }

    @Override
    public AssertionStatus checkRequest(PolicyEnforcementContext policyEnforcementContext) throws IOException, PolicyAssertionException {
        throw new RaisedByPolicyException(this.assertion, d[0]);
    }

    private static /* synthetic */ void b(int n2) {
        String[] stringArray = d;
        throw new IllegalArgumentException(String.format(stringArray[3], stringArray[2], stringArray[4], stringArray[1]));
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[5];
                var3_1 = 0;
                var2_2 = "fG\u0017\u0010H\u001bMFI\f\"^-ZFR\u0017\fC~VG\u0006\r\u0017B.O]H\u0019CH&ZWS\n\nB0\u0011\u0006\bO\u0010\nY`\tUU\r\u0006_*V[H";
                var4_3 = "fG\u0017\u0010H\u001bMFI\f\"^-ZFR\u0017\fC~VG\u0006\r\u0017B.O]H\u0019CH&ZWS\n\nB0\u0011\u0006\bO\u0010\nY`\tUU\r\u0006_*V[H".length();
                var1_4 = 42;
                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++] = ServerRaiseErrorAssertion.b(v0, ServerRaiseErrorAssertion.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "\u0007&kd2I#2tj~-\f\r\b;x_*@!f$mc>A(21~1x\t>atcw\u007f\t>hq\u007f12Y>2tb~+\f/#tbd3@<%;a>3\u001b9#7d>,I?01~>/C!/7u>>_>#&xx0Bb\u00151~g:^\u001f'=\u007ft\u001a^?)&Mb,I?2=c\u007f";
                    var4_3 = "\u0007&kd2I#2tj~-\f\r\b;x_*@!f$mc>A(21~1x\t>atcw\u007f\t>hq\u007f12Y>2tb~+\f/#tbd3@<%;a>3\u001b9#7d>,I?01~>/C!/7u>>_>#&xx0Bb\u00151~g:^\u001f'=\u007ft\u001a^?)&Mb,I?2=c\u007f".length();
                    var1_4 = 62;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 56;
                        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++] = ServerRaiseErrorAssertion.b(v0, ServerRaiseErrorAssertion.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;
            }
        }
        ServerRaiseErrorAssertion.d = var5;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x75);
        }
        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 -> 126;
                    case 1 -> 108;
                    case 2 -> 52;
                    case 3 -> 41;
                    case 4 -> 103;
                    case 5 -> 20;
                    default -> 117;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

