/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.util.Pair
 *  org.hibernate.HibernateException
 *  org.hibernate.Session
 */
package com.l7tech.server.security.rbac;

import com.l7tech.objectmodel.Goid;
import com.l7tech.server.security.rbac.RoleManagerImpl;
import com.l7tech.server.util.ReadOnlyHibernateCallback;
import com.l7tech.util.Pair;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.HibernateException;
import org.hibernate.Session;

class j
extends ReadOnlyHibernateCallback {
    private static final String[] a;

    j(RoleManagerImpl roleManagerImpl) {
    }

    public Object doInHibernateReadOnly(Session session) throws HibernateException, SQLException {
        String[] stringArray = a;
        List list = session.createQuery(stringArray[0]).list();
        ArrayList<Pair> arrayList = new ArrayList<Pair>();
        for (Object e10 : list) {
            if (!(e10 instanceof Object[])) continue;
            Object[] objectArray = (Object[])e10;
            try {
                if (objectArray.length != 2) {
                    throw new IllegalStateException(a[1]);
                }
            }
            catch (HibernateException hibernateException) {
                throw j.a(hibernateException);
            }
            Pair pair = new Pair((Object)Goid.parseGoid((String)objectArray[1].toString()), (Object)objectArray[0].toString());
            arrayList.add(pair);
        }
        return arrayList;
    }

    private static HibernateException a(HibernateException hibernateException) {
        return hibernateException;
    }

    /*
     * Enabled aggressive block sorting
     */
    static {
        String[] stringArray = new String[2];
        int n2 = 0;
        String string = "\u0013`\f)\u0007YE\u0004l\u00138\rC\u0006\u0014%\u0012b\rI\u0000\u000eq\t8\u001dd\u0001L%\u0012b\u0014_\n\u0016l\u0004)\u0016d\u0001@c\u0012#\t\r\u0006\u000fhN SY\u0000\u0003mN+\u0005Y\u0000\u0017d\u0019b\u0007B\b\rj\u000eb\u0017H\u0006\u0015w\t8\u001d\u0003\u0017\u0002d\u0003b6B\t\u0005D\u0013?\rJ\u000b\r`\u000e8D_E\u0017m\u0005>\u0001\r\u0017N`\u000e8\rY\u001c4|\u0010)D\u0010EGP\u0013)\u0016\n\")k\u0003#\u0016_\u0000\u0003q@\"\u0011@\u0007\u0005w@#\u0002\r\u0006\u000fi\u0015!\n^E\u0006j\u0015\"\u0000\u0003";
        int n3 = "\u0013`\f)\u0007YE\u0004l\u00138\rC\u0006\u0014%\u0012b\rI\u0000\u000eq\t8\u001dd\u0001L%\u0012b\u0014_\n\u0016l\u0004)\u0016d\u0001@c\u0012#\t\r\u0006\u000fhN SY\u0000\u0003mN+\u0005Y\u0000\u0017d\u0019b\u0007B\b\rj\u000eb\u0017H\u0006\u0015w\t8\u001d\u0003\u0017\u0002d\u0003b6B\t\u0005D\u0013?\rJ\u000b\r`\u000e8D_E\u0017m\u0005>\u0001\r\u0017N`\u000e8\rY\u001c4|\u0010)D\u0010EGP\u0013)\u0016\n\")k\u0003#\u0016_\u0000\u0003q@\"\u0011@\u0007\u0005w@#\u0002\r\u0006\u000fi\u0015!\n^E\u0006j\u0015\"\u0000\u0003".length();
        int n4 = 132;
        int n5 = -1;
        while (true) {
            int n6 = ++n5;
            stringArray[n2++] = j.a(69, j.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] ^ 0x20);
        }
        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 -> 37;
                    case 1 -> 64;
                    case 2 -> 37;
                    case 3 -> 9;
                    case 4 -> 33;
                    case 5 -> 104;
                    default -> 32;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

