/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.identity.PersistentGroup
 *  com.l7tech.identity.User
 *  com.l7tech.objectmodel.Goid
 *  org.hibernate.HibernateException
 *  org.hibernate.Session
 *  org.hibernate.query.Query
 *  org.hibernate.type.BinaryType
 *  org.hibernate.type.Type
 */
package com.l7tech.server.identity;

import com.l7tech.identity.PersistentGroup;
import com.l7tech.identity.User;
import com.l7tech.objectmodel.Goid;
import com.l7tech.server.identity.PersistentGroupManagerImpl;
import com.l7tech.server.util.ReadOnlyHibernateCallback;
import java.sql.SQLException;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.query.Query;
import org.hibernate.type.BinaryType;
import org.hibernate.type.Type;

class r
extends ReadOnlyHibernateCallback {
    final User val$user;
    final PersistentGroup val$group;
    final PersistentGroupManagerImpl this$0;
    private static final String[] a;

    r(PersistentGroupManagerImpl persistentGroupManagerImpl, User user, PersistentGroup persistentGroup) {
        this.this$0 = persistentGroupManagerImpl;
        this.val$user = user;
        this.val$group = persistentGroup;
    }

    public Object doInHibernateReadOnly(Session session) throws HibernateException, SQLException {
        Query query = session.createQuery(this.this$0.q);
        String[] stringArray = a;
        query.setParameter(stringArray[0], (Object)Goid.parseGoid((String)this.val$user.getId()).getBytes(), (Type)new BinaryType());
        query.setParameter(stringArray[1], (Object)Goid.parseGoid((String)this.val$group.getId()).getBytes(), (Type)new BinaryType());
        return query.iterate().hasNext();
    }

    /*
     * Enabled aggressive block sorting
     */
    static {
        String[] stringArray = new String[2];
        int n2 = 0;
        String string = "9fO\u000bY\u0015i'fP X\u000b kK\u001a{\u0015S!sk\r";
        int n3 = "9fO\u000bY\u0015i'fP X\u000b kK\u001a{\u0015S!sk\r".length();
        int n4 = 12;
        int n5 = -1;
        while (true) {
            int n6 = ++n5;
            stringArray[n2++] = r.a(76, r.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] ^ 0x70);
        }
        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 -> 24;
                    case 1 -> 79;
                    case 2 -> 110;
                    case 3 -> 37;
                    case 4 -> 112;
                    case 5 -> 43;
                    default -> 112;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

