/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.audit.AuditDetailMessage
 *  com.l7tech.gateway.common.audit.MessagesUtil
 */
package com.l7tech.server.policy.variable;

import com.l7tech.gateway.common.audit.AuditDetailMessage;
import com.l7tech.gateway.common.audit.MessagesUtil;
import com.l7tech.server.message.PolicyEnforcementContext;
import com.l7tech.server.policy.variable.ServerVariables;
import com.l7tech.server.policy.variable.bg;

class dl
extends bg {
    private static final String[] a;

    dl() {
    }

    @Override
    Object get(String string, PolicyEnforcementContext policyEnforcementContext) {
        String[] stringArray = a;
        string = string.substring(stringArray[0].length());
        int n2 = string.indexOf(46);
        try {
            String string2;
            int n3 = n2 == -1 ? Integer.parseInt(string) : Integer.parseInt(string.substring(0, n2));
            AuditDetailMessage auditDetailMessage = MessagesUtil.getAuditDetailMessageById((int)n3);
            try {
                string2 = auditDetailMessage == null ? null : auditDetailMessage.getMessage();
            }
            catch (NumberFormatException numberFormatException) {
                throw dl.a(numberFormatException);
            }
            return string2;
        }
        catch (NumberFormatException numberFormatException) {
            ServerVariables.a.info(a[1]);
            return null;
        }
    }

    private static NumberFormatException a(NumberFormatException numberFormatException) {
        return numberFormatException;
    }

    /*
     * Enabled aggressive block sorting
     */
    static {
        String[] stringArray = new String[2];
        int n2 = 0;
        String string = "\u0018\u0012D\n>)%\u0016\u0003EM50\tV\u0002&n\"Y\tU\u000e/u/\u001aGI\r.b>Y\u0001O\u0011jf3\u001d\u000eTC.b2\u0018\u000eLC'b5\n\u0006G\u0006jk)\u0016\fU\u0013";
        int n3 = "\u0018\u0012D\n>)%\u0016\u0003EM50\tV\u0002&n\"Y\tU\u000e/u/\u001aGI\r.b>Y\u0001O\u0011jf3\u001d\u000eTC.b2\u0018\u000eLC'b5\n\u0006G\u0006jk)\u0016\fU\u0013".length();
        int n4 = 11;
        int n5 = -1;
        while (true) {
            int n6 = ++n5;
            stringArray[n2++] = dl.a(29, dl.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] ^ 0x5B);
        }
        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 -> 100;
                    case 1 -> 122;
                    case 2 -> 61;
                    case 3 -> 126;
                    case 4 -> 87;
                    case 5 -> 26;
                    default -> 91;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

