/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.util.CollectionUtils
 *  org.hibernate.HibernateException
 *  org.hibernate.Session
 *  org.hibernate.query.NativeQuery
 *  org.hibernate.type.StringType
 *  org.hibernate.type.Type
 *  org.springframework.orm.hibernate5.HibernateCallback
 */
package com.l7tech.server.solutionkit;

import com.l7tech.objectmodel.Goid;
import com.l7tech.server.solutionkit.SolutionKitManagerImpl;
import com.l7tech.util.CollectionUtils;
import java.util.Collection;
import java.util.logging.Level;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.query.NativeQuery;
import org.hibernate.type.StringType;
import org.hibernate.type.Type;
import org.springframework.orm.hibernate5.HibernateCallback;

class f
implements HibernateCallback<Void> {
    final Collection val$entityIds;
    final Goid val$solutionKit;
    private static final String[] a;

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    f(SolutionKitManagerImpl solutionKitManagerImpl, Collection collection, Goid goid) {
        this.val$entityIds = collection;
        this.val$solutionKit = goid;
    }

    public Void doInHibernate(Session session) throws HibernateException {
        try {
            if (SolutionKitManagerImpl.m.isLoggable(Level.FINE)) {
                SolutionKitManagerImpl.m.log(Level.FINE, a[0] + CollectionUtils.mkString((Iterable)this.val$entityIds, (String)",") + a[1] + this.val$solutionKit.toString() + a[2]);
            }
        }
        catch (HibernateException hibernateException) {
            throw f.a(hibernateException);
        }
        String[] stringArray = a;
        NativeQuery nativeQuery = session.createSQLQuery(stringArray[3]);
        nativeQuery.setParameterList(stringArray[5], this.val$entityIds, (Type)new StringType());
        nativeQuery.setBinary(stringArray[7], this.val$solutionKit.getBytes());
        int n2 = nativeQuery.executeUpdate();
        try {
            if (SolutionKitManagerImpl.m.isLoggable(Level.FINE)) {
                SolutionKitManagerImpl.m.log(Level.FINE, stringArray[4] + n2 + stringArray[6]);
            }
        }
        catch (HibernateException hibernateException) {
            throw f.a(hibernateException);
        }
        return null;
    }

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

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[8];
                var3_1 = 0;
                var2_2 = "\"\u000bnl,}3\b\u001adp.0 \u0003\u001c~w&~\t\u0015\u001als909\u0000Nhp=y\"\u000f\u000b~$i\u0010F\u0001zp ~1F\u0005djiy%\\N\u0003H@#s3>I_\u001dUv\u0015\u0001ak=y9\b1fw=O;\u0003\u001al>:u\"F\u0018hl:y9\b1~j(}&[\u0018hl:y9\b1~j(}&K_-I\u0001U\u0004#Nhp=y\"\u001f1dziy8FF7w-c\u007fF\u000fczic9\n\u001byw&~\t\r\u0007yA.\u007f?\u0002R3$:{\u0011\t\u0007i\u001e\u0010\u000b\u007fm \u007f89\u001dy\u007f$`v\u0002\u000bnl,}3\b\u001ahziv9\u0014N\u0003\u000f\n~";
                var4_3 = "\"\u000bnl,}3\b\u001adp.0 \u0003\u001c~w&~\t\u0015\u001als909\u0000Nhp=y\"\u000f\u000b~$i\u0010F\u0001zp ~1F\u0005djiy%\\N\u0003H@#s3>I_\u001dUv\u0015\u0001ak=y9\b1fw=O;\u0003\u001al>:u\"F\u0018hl:y9\b1~j(}&[\u0018hl:y9\b1~j(}&K_-I\u0001U\u0004#Nhp=y\"\u001f1dziy8FF7w-c\u007fF\u000fczic9\n\u001byw&~\t\r\u0007yA.\u007f?\u0002R3$:{\u0011\t\u0007i\u001e\u0010\u000b\u007fm \u007f89\u001dy\u007f$`v\u0002\u000bnl,}3\b\u001ahziv9\u0014N\u0003\u000f\n~".length();
                var1_4 = 40;
                var0_5 = -1;
lbl7:
                // 2 sources

                while (true) {
                    v0 = 100;
                    v1 = ++var0_5;
                    v2 = var2_2.substring(v1, v1 + var1_4);
                    v3 = -1;
                    break block9;
                    break;
                }
lbl13:
                // 1 sources

                while (true) {
                    var5[var3_1++] = f.a(v0, f.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "7z\u0012\u001bQ\u0015NrlR\u0006dt;\u0000Q\u0005";
                    var4_3 = "7z\u0012\u001bQ\u0015NrlR\u0006dt;\u0000Q\u0005".length();
                    var1_4 = 10;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 21;
                        v4 = ++var0_5;
                        v2 = var2_2.substring(v4, v4 + var1_4);
                        v3 = 0;
                        break block9;
                        break;
                    }
                    break;
                }
lbl28:
                // 1 sources

                while (true) {
                    var5[var3_1++] = f.a(v0, f.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    break block10;
                    break;
                }
            }
            switch (v3) {
                default: {
                    ** continue;
                }
                ** case 0:
lbl39:
                // 1 sources

                ** continue;
            }
        }
        f.a = var5;
    }

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

