/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.cluster.ClusterProperty
 *  com.l7tech.gateway.common.security.keystore.SsgKeyEntry
 *  com.l7tech.gateway.common.service.PublishedService
 *  com.l7tech.gateway.common.transport.InterfaceTag
 *  com.l7tech.identity.GroupBean
 *  com.l7tech.identity.Identity
 *  com.l7tech.identity.IdentityProviderConfig
 *  com.l7tech.identity.IdentityProviderType
 *  com.l7tech.identity.UserBean
 *  com.l7tech.identity.internal.InternalUser
 *  com.l7tech.objectmodel.DuplicateObjectException
 *  com.l7tech.objectmodel.Entity
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.objectmodel.ObjectModelException
 *  com.l7tech.objectmodel.PersistentEntity
 *  com.l7tech.policy.Policy
 *  com.l7tech.util.Functions
 *  com.l7tech.util.Functions$Unary
 *  com.l7tech.util.Option
 *  org.springframework.transaction.TransactionStatus
 *  org.springframework.transaction.support.TransactionCallback
 */
package com.l7tech.server.bundling;

import com.l7tech.gateway.common.cluster.ClusterProperty;
import com.l7tech.gateway.common.security.keystore.SsgKeyEntry;
import com.l7tech.gateway.common.service.PublishedService;
import com.l7tech.gateway.common.transport.InterfaceTag;
import com.l7tech.identity.GroupBean;
import com.l7tech.identity.Identity;
import com.l7tech.identity.IdentityProviderConfig;
import com.l7tech.identity.IdentityProviderType;
import com.l7tech.identity.UserBean;
import com.l7tech.identity.internal.InternalUser;
import com.l7tech.objectmodel.DuplicateObjectException;
import com.l7tech.objectmodel.Entity;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.ObjectModelException;
import com.l7tech.objectmodel.PersistentEntity;
import com.l7tech.policy.Policy;
import com.l7tech.server.bundling.EntityBundleImporterImpl;
import com.l7tech.server.bundling.EntityContainer;
import com.l7tech.server.bundling.EntityMappingInstructions;
import com.l7tech.server.bundling.v;
import com.l7tech.server.bundling.w;
import com.l7tech.server.bundling.x;
import com.l7tech.util.Functions;
import com.l7tech.util.Option;
import java.util.HashSet;
import java.util.Map;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;

class u
implements TransactionCallback<Option<ObjectModelException>> {
    final EntityContainer val$entityContainer;
    final String val$id;
    final boolean val$activate;
    final Entity val$existingEntity;
    final String val$versionComment;
    final boolean val$replaceAllMatchingCertChain;
    final Map val$cachedPrivateKeyOperations;
    final EntityMappingInstructions val$mapping;
    final EntityBundleImporterImpl this$0;
    private static final String[] a;

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    u(EntityBundleImporterImpl entityBundleImporterImpl, EntityContainer entityContainer, String string, boolean bl2, Entity entity, String string2, boolean bl3, Map map, EntityMappingInstructions entityMappingInstructions) {
        this.this$0 = entityBundleImporterImpl;
        this.val$entityContainer = entityContainer;
        this.val$id = string;
        this.val$activate = bl2;
        this.val$existingEntity = entity;
        this.val$versionComment = string2;
        this.val$replaceAllMatchingCertChain = bl3;
        this.val$cachedPrivateKeyOperations = map;
        this.val$mapping = entityMappingInstructions;
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     * Unable to fully structure code
     * Could not resolve type clashes
     */
    public Option<ObjectModelException> doInTransaction(TransactionStatus var1_1) {
        block80: {
            try {
                block114: {
                    block117: {
                        block115: {
                            block95: {
                                block96: {
                                    block92: {
                                        block94: {
                                            block93: {
                                                block112: {
                                                    block106: {
                                                        block109: {
                                                            block91: {
                                                                block90: {
                                                                    block107: {
                                                                        block89: {
                                                                            block74: {
                                                                                block104: {
                                                                                    block85: {
                                                                                        block87: {
                                                                                            block86: {
                                                                                                block81: {
                                                                                                    block82: {
                                                                                                        block84: {
                                                                                                            block83: {
                                                                                                                block102: {
                                                                                                                    block77: {
                                                                                                                        block79: {
                                                                                                                            block78: {
                                                                                                                                block100: {
                                                                                                                                    block76: {
                                                                                                                                        block75: {
                                                                                                                                            block98: {
                                                                                                                                                if (this.val$entityContainer.getEntity() instanceof Policy) ** GOTO lbl10
                                                                                                                                                if (!(this.val$entityContainer.getEntity() instanceof PublishedService)) break block74;
                                                                                                                                                break block98;
                                                                                                                                                catch (FindException v0) {
                                                                                                                                                    throw u.a(v0);
                                                                                                                                                }
                                                                                                                                            }
                                                                                                                                            try {
                                                                                                                                                block99: {
                                                                                                                                                    if (this.val$id != null) break block75;
                                                                                                                                                    break block99;
                                                                                                                                                    catch (FindException v1) {
                                                                                                                                                        throw u.a(v1);
                                                                                                                                                    }
                                                                                                                                                }
                                                                                                                                                v2 = null;
                                                                                                                                                break block76;
                                                                                                                                            }
                                                                                                                                            catch (FindException v3) {
                                                                                                                                                throw u.a(v3);
                                                                                                                                            }
                                                                                                                                        }
                                                                                                                                        v2 = Goid.parseGoid((String)this.val$id);
                                                                                                                                    }
                                                                                                                                    var2_2 = v2;
                                                                                                                                    var3_8 = this.val$entityContainer.getEntity() instanceof Policy != false ? (Policy)this.val$entityContainer.getEntity() : ((PublishedService)this.val$entityContainer.getEntity()).getPolicy();
                                                                                                                                    var4_14 = (PersistentEntity)this.val$entityContainer.getEntity();
                                                                                                                                    if (this.val$activate) break block77;
                                                                                                                                    if (this.val$existingEntity == null) break block77;
                                                                                                                                    break block100;
                                                                                                                                    catch (FindException v4) {
                                                                                                                                        throw u.a(v4);
                                                                                                                                    }
                                                                                                                                }
                                                                                                                                try {
                                                                                                                                    block101: {
                                                                                                                                        if (!(this.val$entityContainer.getEntity() instanceof Policy)) break block78;
                                                                                                                                        break block101;
                                                                                                                                        catch (FindException v5) {
                                                                                                                                            throw u.a(v5);
                                                                                                                                        }
                                                                                                                                    }
                                                                                                                                    v6 = ((Policy)this.val$existingEntity).getXml();
                                                                                                                                    break block79;
                                                                                                                                }
                                                                                                                                catch (FindException v7) {
                                                                                                                                    throw u.a(v7);
                                                                                                                                }
                                                                                                                            }
                                                                                                                            v6 = ((PublishedService)this.val$existingEntity).getPolicy().getXml();
                                                                                                                        }
                                                                                                                        var5_20 = v6;
                                                                                                                        var4_14.setGoid(var2_2);
                                                                                                                        var4_14.setVersion(((PersistentEntity)this.val$existingEntity).getVersion());
                                                                                                                        var6_26 = var3_8.getXml();
                                                                                                                        var3_8.setXml(var5_20);
                                                                                                                        this.this$0.entityCrud.update((Entity)var4_14);
                                                                                                                        var3_8.setXml(var6_26);
                                                                                                                        this.this$0.policyVersionManager.checkpointPolicy(var3_8, false, this.val$versionComment, false);
                                                                                                                        break block80;
                                                                                                                    }
                                                                                                                    if (!(var4_14 instanceof PublishedService)) break block81;
                                                                                                                    if (this.val$existingEntity != null) break block82;
                                                                                                                    break block102;
                                                                                                                    catch (FindException v8) {
                                                                                                                        throw u.a(v8);
                                                                                                                    }
                                                                                                                }
                                                                                                                try {
                                                                                                                    block103: {
                                                                                                                        if (this.val$id != null) break block83;
                                                                                                                        break block103;
                                                                                                                        catch (FindException v9) {
                                                                                                                            throw u.a(v9);
                                                                                                                        }
                                                                                                                    }
                                                                                                                    this.this$0.serviceManager.save((PersistentEntity)((PublishedService)var4_14));
                                                                                                                    break block84;
                                                                                                                }
                                                                                                                catch (FindException v10) {
                                                                                                                    throw u.a(v10);
                                                                                                                }
                                                                                                            }
                                                                                                            this.this$0.serviceManager.save(var2_2, (PersistentEntity)((PublishedService)var4_14));
                                                                                                        }
                                                                                                        this.this$0.serviceManager.createRoles((PersistentEntity)((PublishedService)var4_14));
                                                                                                        break block104;
                                                                                                    }
                                                                                                    var4_14.setGoid(var2_2);
                                                                                                    var4_14.setVersion(((PublishedService)this.val$existingEntity).getVersion());
                                                                                                    this.this$0.serviceManager.update((PersistentEntity)((PublishedService)var4_14));
                                                                                                    break block104;
                                                                                                }
                                                                                                if (this.val$existingEntity != null) break block85;
                                                                                                try {
                                                                                                    block105: {
                                                                                                        if (this.val$id != null) break block86;
                                                                                                        break block105;
                                                                                                        catch (FindException v11) {
                                                                                                            throw u.a(v11);
                                                                                                        }
                                                                                                    }
                                                                                                    this.this$0.policyManager.save((PersistentEntity)((Policy)var4_14));
                                                                                                    break block87;
                                                                                                }
                                                                                                catch (FindException v12) {
                                                                                                    throw u.a(v12);
                                                                                                }
                                                                                            }
                                                                                            this.this$0.policyManager.save(var2_2, (PersistentEntity)((Policy)var4_14));
                                                                                        }
                                                                                        this.this$0.policyManager.createRoles((PersistentEntity)((Policy)var4_14));
                                                                                        break block104;
                                                                                    }
                                                                                    var4_14.setGoid(var2_2);
                                                                                    var4_14.setVersion(((Policy)this.val$existingEntity).getVersion());
                                                                                    this.this$0.policyManager.update((PersistentEntity)((Policy)var4_14));
                                                                                }
                                                                                try {
                                                                                    v13 = this.this$0.policyVersionManager;
                                                                                    v14 = var3_8;
                                                                                    v15 = true;
                                                                                    v16 = this.val$versionComment;
                                                                                    v17 = this.val$existingEntity == null;
                                                                                }
                                                                                catch (FindException v18) {
                                                                                    throw u.a(v18);
                                                                                }
                                                                                v13.checkpointPolicy(v14, v15, v16, v17);
                                                                                break block80;
                                                                            }
                                                                            if (this.val$entityContainer.getEntity() instanceof SsgKeyEntry) {
                                                                                block88: {
                                                                                    var2_3 = (SsgKeyEntry)this.val$entityContainer.getEntity();
                                                                                    var3_9 = this.val$replaceAllMatchingCertChain;
                                                                                    try {
                                                                                        if (this.val$existingEntity != null) break block88;
                                                                                        this.val$cachedPrivateKeyOperations.put(this.val$mapping.getSourceEntityHeader(), new v(this, var2_3, var3_9));
                                                                                        break block80;
                                                                                    }
                                                                                    catch (FindException v19) {
                                                                                        throw u.a(v19);
                                                                                    }
                                                                                }
                                                                                var4_15 = (SsgKeyEntry)this.val$existingEntity;
                                                                                try {
                                                                                    var2_3.setAlias(var4_15.getAlias());
                                                                                    if (var2_3.getKeyMetadata() != null) {
                                                                                        var2_3.getKeyMetadata().setAlias(var4_15.getAlias());
                                                                                    }
                                                                                }
                                                                                catch (FindException v20) {
                                                                                    throw u.a(v20);
                                                                                }
                                                                                this.val$cachedPrivateKeyOperations.put(this.val$mapping.getSourceEntityHeader(), new w(this, var4_15, var2_3, var3_9));
                                                                                break block80;
                                                                            }
                                                                            if (!(this.val$entityContainer.getEntity() instanceof Identity)) break block106;
                                                                            var2_4 = ((Identity)this.val$entityContainer.getEntity()).getProviderId();
                                                                            try {
                                                                                var3_10 = this.this$0.identityProviderFactory.getProvider(var2_4);
                                                                            }
                                                                            catch (FindException var4_16) {
                                                                                var3_10 = null;
                                                                            }
                                                                            if (var3_10 == null) {
                                                                                var8_31 = String.valueOf(var2_4);
                                                                                var9_32 = this.val$entityContainer.getEntity().getId();
                                                                                var10_33 = String.valueOf(this.val$entityContainer.getEntity().getClass());
                                                                                var14_34 = u.a;
                                                                                throw new ObjectModelException(var14_34[2] + var10_33 + var14_34[6] + var9_32 + var14_34[8] + var8_31);
                                                                            }
                                                                            if (!(this.val$entityContainer.getEntity() instanceof GroupBean)) break block107;
                                                                            var4_17 = var3_10.getGroupManager();
                                                                            if (this.val$existingEntity == null) {
                                                                                var5_21 = var4_17.reify((GroupBean)this.val$entityContainer.getEntity());
                                                                                try {
                                                                                    v21 = var4_17;
                                                                                    v22 = this.val$id == null ? null : Goid.parseGoid((String)this.val$id);
                                                                                }
                                                                                catch (FindException v23) {
                                                                                    throw u.a(v23);
                                                                                }
                                                                                var6_27 = v21.save(v22, var5_21, null);
                                                                                ((GroupBean)this.val$entityContainer.getEntity()).setUniqueIdentifier(var6_27);
                                                                                break block80;
                                                                            }
                                                                            var5_22 = (GroupBean)this.val$entityContainer.getEntity();
                                                                            var5_22.setUniqueIdentifier(this.val$existingEntity.getId());
                                                                            var6_28 = var4_17.reify(var5_22);
                                                                            if (!(var6_28 instanceof PersistentEntity)) break block89;
                                                                            try {
                                                                                block108: {
                                                                                    if (!(this.val$existingEntity instanceof PersistentEntity)) break block89;
                                                                                    break block108;
                                                                                    catch (FindException v24) {
                                                                                        throw u.a(v24);
                                                                                    }
                                                                                }
                                                                                ((PersistentEntity)var6_28).setVersion(((PersistentEntity)this.val$existingEntity).getVersion());
                                                                            }
                                                                            catch (FindException v25) {
                                                                                throw u.a(v25);
                                                                            }
                                                                        }
                                                                        var4_17.update(var6_28);
                                                                        break block80;
                                                                    }
                                                                    if (!(this.val$entityContainer.getEntity() instanceof UserBean)) break block109;
                                                                    var4_18 = var3_10.getUserManager();
                                                                    if (this.val$existingEntity == null) {
                                                                        var5_23 = var4_18.reify((UserBean)this.val$entityContainer.getEntity());
                                                                        if (var5_23 instanceof InternalUser) {
                                                                            var6_29 /* !! */  = (InternalUser)var5_23;
                                                                            try {
                                                                                if (this.val$existingEntity instanceof InternalUser) {
                                                                                    var6_29 /* !! */ .setPasswordChangesHistory(((InternalUser)this.val$existingEntity).getPasswordChangesHistory());
                                                                                }
                                                                            }
                                                                            catch (FindException v26) {
                                                                                throw u.a(v26);
                                                                            }
                                                                            this.this$0.passwordEnforcerManager.setUserPasswordPolicyAttributes((InternalUser)var5_23, true);
                                                                        }
                                                                        try {
                                                                            v27 = var4_18;
                                                                            v28 = this.val$id == null ? null : Goid.parseGoid((String)this.val$id);
                                                                        }
                                                                        catch (FindException v29) {
                                                                            throw u.a(v29);
                                                                        }
                                                                        var6_29 /* !! */  = v27.save(v28, var5_23, null);
                                                                        ((UserBean)this.val$entityContainer.getEntity()).setUniqueIdentifier((String)var6_29 /* !! */ );
                                                                        break block80;
                                                                    }
                                                                    var5_24 = (UserBean)this.val$entityContainer.getEntity();
                                                                    var5_24.setUniqueIdentifier(this.val$existingEntity.getId());
                                                                    var6_30 = var4_18.reify(var5_24);
                                                                    if (!(var6_30 instanceof InternalUser)) break block90;
                                                                    try {
                                                                        block110: {
                                                                            if (!(this.val$existingEntity instanceof InternalUser)) break block90;
                                                                            break block110;
                                                                            catch (FindException v30) {
                                                                                throw u.a(v30);
                                                                            }
                                                                        }
                                                                        ((InternalUser)var6_30).setPasswordChangesHistory(((InternalUser)this.val$existingEntity).getPasswordChangesHistory());
                                                                        this.this$0.passwordEnforcerManager.setUserPasswordPolicyAttributes((InternalUser)var6_30, false);
                                                                    }
                                                                    catch (FindException v31) {
                                                                        throw u.a(v31);
                                                                    }
                                                                }
                                                                if (!(var6_30 instanceof PersistentEntity)) break block91;
                                                                try {
                                                                    block111: {
                                                                        if (!(this.val$existingEntity instanceof PersistentEntity)) break block91;
                                                                        break block111;
                                                                        catch (FindException v32) {
                                                                            throw u.a(v32);
                                                                        }
                                                                    }
                                                                    ((PersistentEntity)var6_30).setVersion(((PersistentEntity)this.val$existingEntity).getVersion());
                                                                }
                                                                catch (FindException v33) {
                                                                    throw u.a(v33);
                                                                }
                                                            }
                                                            var4_18.update(var6_30);
                                                            break block80;
                                                        }
                                                        var14_35 = u.a;
                                                        throw new ObjectModelException(var14_35[3] + String.valueOf(this.val$entityContainer.getEntity().getClass()) + var14_35[0] + this.val$entityContainer.getEntity().getId() + var14_35[5]);
                                                    }
                                                    if (!(this.val$entityContainer.getEntity() instanceof IdentityProviderConfig)) break block92;
                                                    if (((IdentityProviderConfig)this.val$entityContainer.getEntity()).getTypeVal() != IdentityProviderType.INTERNAL.toVal()) break block92;
                                                    break block112;
                                                    catch (FindException v34) {
                                                        throw u.a(v34);
                                                    }
                                                }
                                                try {
                                                    block113: {
                                                        ((IdentityProviderConfig)this.val$entityContainer.getEntity()).setAdminEnabled(true);
                                                        v35 = this.this$0;
                                                        v36 = this.val$entityContainer.getEntity();
                                                        if (this.val$id != null) break block93;
                                                        break block113;
                                                        catch (FindException v37) {
                                                            throw u.a(v37);
                                                        }
                                                    }
                                                    v38 = null;
                                                    break block94;
                                                }
                                                catch (FindException v39) {
                                                    throw u.a(v39);
                                                }
                                            }
                                            v38 = Goid.parseGoid((String)this.val$id);
                                        }
                                        v35.a((Entity)v36, v38, this.val$existingEntity);
                                        break block80;
                                    }
                                    if (!(this.val$entityContainer.getEntity() instanceof InterfaceTag)) break block114;
                                    var2_5 = (InterfaceTag)this.val$entityContainer.getEntity();
                                    var3_11 = (ClusterProperty)this.this$0.clusterPropertyManager.findByUniqueName(InterfaceTag.PROPERTY_NAME);
                                    var4_19 = new HashSet<InterfaceTag>();
                                    if (var3_11 == null) break block115;
                                    var4_19.addAll(InterfaceTag.parseMultiple((String)var3_11.getValue()));
                                    var5_25 = (InterfaceTag)Functions.grepFirst(var4_19, (Functions.Unary)new x(this, var2_5));
                                    if (var5_25 == null) break block95;
                                    try {
                                        block116: {
                                            if (this.val$existingEntity != null) break block96;
                                            break block116;
                                            catch (FindException v40) {
                                                throw u.a(v40);
                                            }
                                        }
                                        throw new DuplicateObjectException(u.a[1] + var2_5.getName());
                                    }
                                    catch (FindException v41) {
                                        throw u.a(v41);
                                    }
                                }
                                var5_25.setIpPatterns(var2_5.getIpPatterns());
                                break block117;
                            }
                            var4_19.add(var2_5);
                            break block117;
                        }
                        var4_19.add(var2_5);
                    }
                    this.this$0.clusterPropertyManager.putProperty(InterfaceTag.PROPERTY_NAME, InterfaceTag.toString(var4_19));
                    break block80;
                }
                try {
                    v42 = this.this$0;
                    v43 = this.val$entityContainer.getEntity();
                    v44 = this.val$id == null ? null : Goid.parseGoid((String)this.val$id);
                }
                catch (FindException v45) {
                    throw u.a(v45);
                }
                v42.a((Entity)v43, v44, this.val$existingEntity);
            }
            catch (ObjectModelException var2_6) {
                try {
                    var3_12 = Option.some((Object)var2_6);
                }
                catch (Throwable var7_37) {
                    try {
                        var1_1.flush();
                        throw var7_37;
                    }
                    catch (Exception var2_7) {
                        var3_13 = this.val$entityContainer.getEntity();
                        var11_38 = this.this$0.a(var2_7);
                        var12_39 = var3_13.getId();
                        var13_40 = var3_13.getClass().getSimpleName();
                        var14_36 = u.a;
                        return Option.some((Object)new ObjectModelException(var14_36[7] + var13_40 + var14_36[4] + var12_39 + var14_36[9] + var11_38, (Throwable)var2_7));
                    }
                }
                var1_1.flush();
                return var3_12;
            }
        }
        var1_1.flush();
        return Option.none();
    }

    private static FindException a(FindException findException) {
        return findException;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[10];
                var3_1 = 0;
                var2_2 = "\f\u0012<~h[uH_ufm\u0011!om\u000bhE\u000b2*t\u0014<_\u0004#o \u001a<B\u0000\"*i\u0015hI\u00173kc\u001e<X\u00042*b\u000eh\f\n;o \fuX\ru~h\u001e<_\u00048o \u0015}A\u0000ukl\tyM\u0001,*e\u0003u_\u0011&$ 2rX\u0000'la\u0018y\f\u00114m \u0015}A\u0000o*#i\u0017'er[}X\u00110gp\u000fuB\u0002u~o[oM\u00130*o\t<Y\u00151kt\u001e<#i\u0017'er[}X\u00110gp\u000fuB\u0002u~o[oM\u00130*o\t<Y\u00151kt\u001e<\f\f\u0012<~h[uHEh*'M\u0002E\u0018os\b}K\u0000o*U\u0015yT\u00150it\u001ex\f,1on\u000fuX\u001cu~y\u000by\u0000E&bo\u000epHE7o \u001euX\r0x \u001a<y\u00160xB\u001e}BE:x <nC\u0010%He\u001ar\n\f\u0012<~h[uH_u'i\u0017'er[}X\u00110gp\u000fuB\u0002u~o[oM\u00130*o\t<Y\u00151kt\u001e<X\r0*";
                var4_3 = "\f\u0012<~h[uH_ufm\u0011!om\u000bhE\u000b2*t\u0014<_\u0004#o \u001a<B\u0000\"*i\u0015hI\u00173kc\u001e<X\u00042*b\u000eh\f\n;o \fuX\ru~h\u001e<_\u00048o \u0015}A\u0000ukl\tyM\u0001,*e\u0003u_\u0011&$ 2rX\u0000'la\u0018y\f\u00114m \u0015}A\u0000o*#i\u0017'er[}X\u00110gp\u000fuB\u0002u~o[oM\u00130*o\t<Y\u00151kt\u001e<#i\u0017'er[}X\u00110gp\u000fuB\u0002u~o[oM\u00130*o\t<Y\u00151kt\u001e<\f\f\u0012<~h[uHEh*'M\u0002E\u0018os\b}K\u0000o*U\u0015yT\u00150it\u001ex\f,1on\u000fuX\u001cu~y\u000by\u0000E&bo\u000epHE7o \u001euX\r0x \u001a<y\u00160xB\u001e}BE:x <nC\u0010%He\u001ar\n\f\u0012<~h[uH_u'i\u0017'er[}X\u00110gp\u000fuB\u0002u~o[oM\u00130*o\t<Y\u00151kt\u001e<X\r0*".length();
                var1_4 = 10;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = u.a(v0, u.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "0w*]A:Oy2]\u0018q&[r3GV]=\u000ex>\t\\\u0012 J{9\u0013QF0\u000en%\bN[-Klw\u0010QF!\u000ew3]\u0018\u00049yG\u0018";
                    var4_3 = "0w*]A:Oy2]\u0018q&[r3GV]=\u000ex>\t\\\u0012 J{9\u0013QF0\u000en%\bN[-Klw\u0010QF!\u000ew3]\u0018\u00049yG\u0018".length();
                    var1_4 = 53;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 88;
                        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++] = u.a(v0, u.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;
            }
        }
        u.a = var5;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x76);
        }
        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 -> 70;
                    case 1 -> 15;
                    case 2 -> 63;
                    case 3 -> 96;
                    case 4 -> 106;
                    case 5 -> 17;
                    default -> 118;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

