/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.util.Charsets
 */
package com.l7tech.server.tomcat;

import com.l7tech.server.tomcat.SsgContextConfig;
import com.l7tech.util.Charsets;
import java.util.function.UnaryOperator;

class a
implements UnaryOperator<byte[]> {
    final String val$wacRepl;
    final String val$extraAdmin;
    private static final String[] a;

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    a(SsgContextConfig ssgContextConfig, String string, String string2) {
        this.val$wacRepl = string;
        this.val$extraAdmin = string2;
    }

    @Override
    public byte[] apply(byte[] byArray) {
        String[] stringArray = a;
        return new String(byArray, Charsets.UTF8).replaceAll(stringArray[1], this.val$wacRepl).replaceAll(stringArray[0], this.val$extraAdmin).getBytes(Charsets.UTF8);
    }

    /*
     * Enabled aggressive block sorting
     */
    static {
        String[] stringArray = new String[2];
        int n2 = 0;
        String string = "o\u0005bWGU+W\\J]IP0|Wg@gV0G\\eM\u000be`\u0015D\\ixTI2ZZjMMV0pVeMAA*";
        int n3 = "o\u0005bWGU+W\\J]IP0|Wg@gV0G\\eM\u000be`\u0015D\\ixTI2ZZjMMV0pVeMAA*".length();
        int n4 = 28;
        int n5 = -1;
        while (true) {
            int n6 = ++n5;
            stringArray[n2++] = com.l7tech.server.tomcat.a.a(93, com.l7tech.server.tomcat.a.a(string.substring(n6, n6 + n4)));
            if ((n5 += n4) >= n3) {
                a = stringArray;
                return;
            }
            n4 = string.charAt(n5);
        }
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 3);
        }
        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 -> 110;
                    case 1 -> 100;
                    case 2 -> 86;
                    case 3 -> 100;
                    case 4 -> 121;
                    case 5 -> 100;
                    default -> 3;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

