/*
 * Decompiled with CFR 0.152.
 */
package com.l7tech.server.policy.assertion;

import com.l7tech.server.policy.assertion.ServerOversizedTextAssertion;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

class al
extends DefaultHandler {
    final long val$attrLimit;
    final long val$attrNameLimit;
    private static final String[] a;

    al(ServerOversizedTextAssertion serverOversizedTextAssertion, long l2, long l3) {
        this.val$attrLimit = l2;
        this.val$attrNameLimit = l3;
    }

    @Override
    public void startElement(String string, String string2, String string3, Attributes attributes) throws SAXException {
        int n2 = attributes.getLength();
        int n3 = 0;
        while (true) {
            block12: {
                block11: {
                    try {
                        try {
                            try {
                                if (n3 >= n2) break;
                                if (this.val$attrLimit < 0L) break block11;
                            }
                            catch (SAXException sAXException) {
                                throw al.a(sAXException);
                            }
                            if ((long)attributes.getValue(n3).length() <= this.val$attrLimit) break block11;
                        }
                        catch (SAXException sAXException) {
                            throw al.a(sAXException);
                        }
                        throw new SAXException(a[0]);
                    }
                    catch (SAXException sAXException) {
                        throw al.a(sAXException);
                    }
                }
                try {
                    try {
                        if (this.val$attrNameLimit < 0L || (long)attributes.getQName(n3).length() <= this.val$attrNameLimit) break block12;
                    }
                    catch (SAXException sAXException) {
                        throw al.a(sAXException);
                    }
                    throw new SAXException(a[1]);
                }
                catch (SAXException sAXException) {
                    throw al.a(sAXException);
                }
            }
            ++n3;
        }
    }

    private static SAXException a(SAXException sAXException) {
        return sAXException;
    }

    /*
     * Enabled aggressive block sorting
     */
    static {
        String[] stringArray = new String[2];
        int n2 = 0;
        String string = "\u001dM/\\5\u0013\u00049\u0019+T;\u0013\u0015|U8[0\u0012\u0018|U4X>\u0012P9A>P2\u0002\u00158<\u001dM/\\5\u0013\u00049\u00193T:\u0003P0\\3R#\u000eP0P0\\#F\u0015$Z8P3\u0003\u0014|\u0011<A#\u0014\u0019>L)Pw7>=T8\u0015;\u0003\u001e;M5\u001c";
        int n3 = "\u001dM/\\5\u0013\u00049\u0019+T;\u0013\u0015|U8[0\u0012\u0018|U4X>\u0012P9A>P2\u0002\u00158<\u001dM/\\5\u0013\u00049\u00193T:\u0003P0\\3R#\u000eP0P0\\#F\u0015$Z8P3\u0003\u0014|\u0011<A#\u0014\u0019>L)Pw7>=T8\u0015;\u0003\u001e;M5\u001c".length();
        int n4 = 36;
        int n5 = -1;
        while (true) {
            int n6 = ++n5;
            stringArray[n2++] = al.a(4, al.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] ^ 0x74);
        }
        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 -> 88;
                    case 1 -> 61;
                    case 2 -> 89;
                    case 3 -> 49;
                    case 4 -> 83;
                    case 5 -> 98;
                    default -> 116;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

