/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.audit.AdminAuditRecord
 *  com.l7tech.gateway.common.audit.AuditDetail
 *  com.l7tech.gateway.common.audit.MessageSummaryAuditRecord
 *  com.l7tech.gateway.common.audit.SystemAuditRecord
 *  com.l7tech.gateway.common.cluster.ClusterNodeInfo
 *  com.l7tech.gateway.common.cluster.ServiceUsage
 *  com.l7tech.gateway.common.mapping.MessageContextMappingKeys
 *  com.l7tech.gateway.common.mapping.MessageContextMappingValues
 *  com.l7tech.gateway.common.module.ServerModuleFile
 *  com.l7tech.gateway.common.module.ServerModuleFileData
 *  com.l7tech.gateway.common.module.ServerModuleFileState
 *  com.l7tech.gateway.common.security.rbac.AttributePredicate
 *  com.l7tech.gateway.common.security.rbac.EntityFolderAncestryPredicate
 *  com.l7tech.gateway.common.security.rbac.FolderPredicate
 *  com.l7tech.gateway.common.security.rbac.ObjectIdentityPredicate
 *  com.l7tech.gateway.common.security.rbac.Permission
 *  com.l7tech.gateway.common.security.rbac.RoleAssignment
 *  com.l7tech.gateway.common.security.rbac.ScopePredicate
 *  com.l7tech.gateway.common.security.rbac.SecurityZonePredicate
 *  com.l7tech.gateway.common.service.MetricsBin
 *  com.l7tech.gateway.common.service.MetricsBinDetail
 *  com.l7tech.gateway.common.transport.email.EmailListenerState
 *  com.l7tech.gateway.common.uddi.UDDIProxiedService
 *  com.l7tech.identity.GroupMembership
 *  com.l7tech.identity.LogonInfo
 *  com.l7tech.identity.cert.CertEntryRow
 *  com.l7tech.objectmodel.Entity
 *  com.l7tech.objectmodel.PersistentEntity
 *  com.l7tech.policy.PolicyVersion
 *  org.hibernate.CallbackException
 *  org.hibernate.EntityMode
 *  org.hibernate.Interceptor
 *  org.hibernate.Transaction
 *  org.hibernate.collection.spi.PersistentCollection
 *  org.hibernate.type.Type
 *  org.springframework.context.ApplicationEvent
 *  org.springframework.context.support.ApplicationObjectSupport
 */
package com.l7tech.server;

import com.l7tech.gateway.common.audit.AdminAuditRecord;
import com.l7tech.gateway.common.audit.AuditDetail;
import com.l7tech.gateway.common.audit.MessageSummaryAuditRecord;
import com.l7tech.gateway.common.audit.SystemAuditRecord;
import com.l7tech.gateway.common.cluster.ClusterNodeInfo;
import com.l7tech.gateway.common.cluster.ServiceUsage;
import com.l7tech.gateway.common.mapping.MessageContextMappingKeys;
import com.l7tech.gateway.common.mapping.MessageContextMappingValues;
import com.l7tech.gateway.common.module.ServerModuleFile;
import com.l7tech.gateway.common.module.ServerModuleFileData;
import com.l7tech.gateway.common.module.ServerModuleFileState;
import com.l7tech.gateway.common.security.rbac.AttributePredicate;
import com.l7tech.gateway.common.security.rbac.EntityFolderAncestryPredicate;
import com.l7tech.gateway.common.security.rbac.FolderPredicate;
import com.l7tech.gateway.common.security.rbac.ObjectIdentityPredicate;
import com.l7tech.gateway.common.security.rbac.Permission;
import com.l7tech.gateway.common.security.rbac.RoleAssignment;
import com.l7tech.gateway.common.security.rbac.ScopePredicate;
import com.l7tech.gateway.common.security.rbac.SecurityZonePredicate;
import com.l7tech.gateway.common.service.MetricsBin;
import com.l7tech.gateway.common.service.MetricsBinDetail;
import com.l7tech.gateway.common.transport.email.EmailListenerState;
import com.l7tech.gateway.common.uddi.UDDIProxiedService;
import com.l7tech.identity.GroupMembership;
import com.l7tech.identity.LogonInfo;
import com.l7tech.identity.cert.CertEntryRow;
import com.l7tech.objectmodel.Entity;
import com.l7tech.objectmodel.PersistentEntity;
import com.l7tech.policy.PolicyVersion;
import com.l7tech.server.audit.AuditContextUtils;
import com.l7tech.server.event.EntityChangeSet;
import com.l7tech.server.event.GroupMembershipEvent;
import com.l7tech.server.event.GroupMembershipEventInfo;
import com.l7tech.server.event.UserCertEvent;
import com.l7tech.server.event.UserCertEventInfo;
import com.l7tech.server.event.admin.AdminEvent;
import com.l7tech.server.event.admin.Created;
import com.l7tech.server.event.admin.Deleted;
import com.l7tech.server.event.admin.PolicyVersionCreated;
import com.l7tech.server.event.admin.PolicyVersionUpdated;
import com.l7tech.server.event.admin.Updated;
import com.l7tech.server.uddi.UDDIBusinessServiceStatus;
import com.l7tech.server.uddi.UDDIRegistrySubscription;
import com.l7tech.server.wsdm.subscription.Subscription;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.hibernate.CallbackException;
import org.hibernate.EntityMode;
import org.hibernate.Interceptor;
import org.hibernate.Transaction;
import org.hibernate.collection.spi.PersistentCollection;
import org.hibernate.type.Type;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.support.ApplicationObjectSupport;

public class PersistenceEventInterceptor
extends ApplicationObjectSupport
implements Interceptor {
    private static Logger a;
    private final Set<String> b = new HashSet<String>();
    private final Set<String> c;
    private static final String[] d;

    public PersistenceEventInterceptor() {
        this.b.add(AdminAuditRecord.class.getName());
        this.b.add(SystemAuditRecord.class.getName());
        this.b.add(MessageSummaryAuditRecord.class.getName());
        this.b.add(AuditDetail.class.getName());
        this.b.add(MetricsBin.class.getName());
        this.b.add(MetricsBinDetail.class.getName());
        this.b.add(ServiceUsage.class.getName());
        this.b.add(Subscription.class.getName());
        this.b.add(MessageContextMappingKeys.class.getName());
        this.b.add(MessageContextMappingValues.class.getName());
        this.b.add(LogonInfo.class.getName());
        this.b.add(EmailListenerState.class.getName());
        this.b.add(RoleAssignment.class.getName());
        String[] stringArray = d;
        this.b.add(stringArray[11]);
        this.b.add(stringArray[2]);
        this.b.add(UDDIRegistrySubscription.class.getName());
        this.b.add(UDDIBusinessServiceStatus.class.getName());
        this.b.add(ServerModuleFileState.class.getName());
        this.b.add(ServerModuleFileData.class.getName());
        this.c = new HashSet<String>();
        this.c.add(ClusterNodeInfo.class.getName());
        this.c.add(Permission.class.getName());
        this.c.add(ScopePredicate.class.getName());
        this.c.add(ObjectIdentityPredicate.class.getName());
        this.c.add(AttributePredicate.class.getName());
        this.c.add(FolderPredicate.class.getName());
        this.c.add(EntityFolderAncestryPredicate.class.getName());
        this.c.add(SecurityZonePredicate.class.getName());
        this.c.add(UDDIProxiedService.class.getName());
        this.c.add(stringArray[17]);
        this.c.add(stringArray[10]);
        this.c.add(stringArray[5]);
    }

    private boolean a(Object object) {
        boolean bl2;
        block5: {
            block4: {
                try {
                    try {
                        if (object instanceof PersistentEntity && !this.b.contains(object.getClass().getName())) break block4;
                    }
                    catch (IllegalStateException illegalStateException) {
                        throw PersistenceEventInterceptor.a(illegalStateException);
                    }
                    bl2 = true;
                    break block5;
                }
                catch (IllegalStateException illegalStateException) {
                    throw PersistenceEventInterceptor.a(illegalStateException);
                }
            }
            bl2 = false;
        }
        return bl2;
    }

    public Set<String> getIgnoredClassNames() {
        return this.b;
    }

    public Set<String> getNoAuditClassNames() {
        return this.c;
    }

    private AdminEvent a(Object object, AdminEvent adminEvent) {
        block7: {
            try {
                block6: {
                    try {
                        try {
                            if (AuditContextUtils.isSystem() || this.c.contains(object.getClass().getName())) break block6;
                        }
                        catch (IllegalStateException illegalStateException) {
                            throw PersistenceEventInterceptor.a(illegalStateException);
                        }
                        if (!this.b(object, adminEvent)) break block7;
                    }
                    catch (IllegalStateException illegalStateException) {
                        throw PersistenceEventInterceptor.a(illegalStateException);
                    }
                }
                adminEvent.setAuditIgnore(true);
            }
            catch (IllegalStateException illegalStateException) {
                throw PersistenceEventInterceptor.a(illegalStateException);
            }
        }
        return adminEvent;
    }

    private boolean b(Object object, AdminEvent adminEvent) {
        boolean bl2;
        block8: {
            block6: {
                try {
                    block7: {
                        try {
                            try {
                                if (!(object instanceof ServerModuleFile)) break block6;
                                if (adminEvent instanceof Created) break block7;
                            }
                            catch (IllegalStateException illegalStateException) {
                                throw PersistenceEventInterceptor.a(illegalStateException);
                            }
                            if (!(adminEvent instanceof Deleted)) break block6;
                        }
                        catch (IllegalStateException illegalStateException) {
                            throw PersistenceEventInterceptor.a(illegalStateException);
                        }
                    }
                    bl2 = true;
                    break block8;
                }
                catch (IllegalStateException illegalStateException) {
                    throw PersistenceEventInterceptor.a(illegalStateException);
                }
            }
            bl2 = false;
        }
        return bl2;
    }

    public boolean onSave(Object object, Serializable serializable, Object[] objectArray, String[] stringArray, Type[] typeArray) throws CallbackException {
        try {
            if (!this.a(object)) {
                a.log(Level.FINE, d[8] + object.getClass().getName() + " " + String.valueOf(serializable));
                this.getApplicationContext().publishEvent((ApplicationEvent)this.a(object, this.d(object)));
            }
        }
        catch (CallbackException callbackException) {
            throw PersistenceEventInterceptor.a((RuntimeException)((Object)callbackException));
        }
        return false;
    }

    public void onDelete(Object object, Serializable serializable, Object[] objectArray, String[] stringArray, Type[] typeArray) throws CallbackException {
        try {
            if (!this.a(object)) {
                a.log(Level.FINE, d[7] + object.getClass().getName() + " " + String.valueOf(serializable));
                this.getApplicationContext().publishEvent((ApplicationEvent)this.a(object, this.c(object)));
            }
        }
        catch (CallbackException callbackException) {
            throw PersistenceEventInterceptor.a((RuntimeException)((Object)callbackException));
        }
    }

    public boolean onFlushDirty(Object object, Serializable serializable, Object[] objectArray, Object[] objectArray2, String[] stringArray, Type[] typeArray) throws CallbackException {
        if (!this.a(object)) {
            a.log(Level.FINE, d[9] + object.getClass().getName() + " " + String.valueOf(serializable));
            EntityChangeSet entityChangeSet = new EntityChangeSet(stringArray, objectArray2, objectArray);
            this.getApplicationContext().publishEvent((ApplicationEvent)this.a(object, this.a(object, entityChangeSet)));
        }
        return false;
    }

    public void onCollectionRecreate(Object object, Serializable serializable) throws CallbackException {
        this.b(object);
    }

    public void onCollectionRemove(Object object, Serializable serializable) throws CallbackException {
        this.b(object);
    }

    public void onCollectionUpdate(Object object, Serializable serializable) throws CallbackException {
        this.b(object);
    }

    private void b(Object object) {
        Entity entity;
        PersistentCollection persistentCollection;
        Object object2;
        if (object instanceof PersistentCollection && (object2 = (persistentCollection = (PersistentCollection)object).getOwner()) instanceof Entity && !this.a(entity = (Entity)object2)) {
            String[] stringArray = d;
            a.log(Level.FINE, stringArray[16] + entity.getClass().getName() + " " + entity.getId());
            String[] stringArray2 = new String[]{persistentCollection.getRole()};
            Object[] objectArray = new String[]{stringArray[13]};
            Object[] objectArray2 = new String[]{stringArray[6]};
            EntityChangeSet entityChangeSet = new EntityChangeSet(stringArray2, objectArray, objectArray2);
            AdminEvent adminEvent = this.a((Object)entity, entityChangeSet);
            adminEvent.setAuditIgnore(true);
            this.getApplicationContext().publishEvent((ApplicationEvent)this.a((Object)entity, adminEvent));
        }
    }

    private AdminEvent c(Object object) {
        try {
            if (object instanceof GroupMembership) {
                return new GroupMembershipEvent(new GroupMembershipEventInfo((GroupMembership)object, d[19], this.getApplicationContext()));
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw PersistenceEventInterceptor.a(illegalStateException);
        }
        try {
            if (object instanceof CertEntryRow) {
                return new UserCertEvent(new UserCertEventInfo((CertEntryRow)object, d[0], null, this.getApplicationContext()));
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw PersistenceEventInterceptor.a(illegalStateException);
        }
        try {
            if (object instanceof Entity) {
                return new Deleted<Entity>((Entity)object);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw PersistenceEventInterceptor.a(illegalStateException);
        }
        throw new IllegalStateException(d[1] + object.getClass().getName());
    }

    private AdminEvent d(Object object) {
        try {
            if (object instanceof CertEntryRow) {
                return new UserCertEvent(new UserCertEventInfo((CertEntryRow)object, d[12], null, this.getApplicationContext()));
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw PersistenceEventInterceptor.a(illegalStateException);
        }
        try {
            if (object instanceof GroupMembership) {
                return new GroupMembershipEvent(new GroupMembershipEventInfo((GroupMembership)object, d[3], this.getApplicationContext()));
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw PersistenceEventInterceptor.a(illegalStateException);
        }
        try {
            if (object instanceof PolicyVersion) {
                return new PolicyVersionCreated((PolicyVersion)object);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw PersistenceEventInterceptor.a(illegalStateException);
        }
        try {
            if (object instanceof Entity) {
                return new Created<Entity>((Entity)object);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw PersistenceEventInterceptor.a(illegalStateException);
        }
        throw new IllegalStateException(d[18] + object.getClass().getName());
    }

    private AdminEvent a(Object object, EntityChangeSet entityChangeSet) {
        block13: {
            try {
                try {
                    if (!(object instanceof CertEntryRow) || AuditContextUtils.isSystem()) break block13;
                }
                catch (IllegalStateException illegalStateException) {
                    throw PersistenceEventInterceptor.a(illegalStateException);
                }
                return new UserCertEvent(new UserCertEventInfo((CertEntryRow)object, d[4], entityChangeSet, this.getApplicationContext()));
            }
            catch (IllegalStateException illegalStateException) {
                throw PersistenceEventInterceptor.a(illegalStateException);
            }
        }
        try {
            if (object instanceof GroupMembership) {
                return new GroupMembershipEvent(new GroupMembershipEventInfo((GroupMembership)object, d[14], this.getApplicationContext()));
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw PersistenceEventInterceptor.a(illegalStateException);
        }
        try {
            if (object instanceof PolicyVersion) {
                return new PolicyVersionUpdated((PolicyVersion)object, entityChangeSet);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw PersistenceEventInterceptor.a(illegalStateException);
        }
        try {
            if (object instanceof Entity) {
                return new Updated<Entity>((Entity)object, entityChangeSet);
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw PersistenceEventInterceptor.a(illegalStateException);
        }
        throw new IllegalStateException(d[15] + object.getClass().getName());
    }

    public boolean onLoad(Object object, Serializable serializable, Object[] objectArray, String[] stringArray, Type[] typeArray) throws CallbackException {
        return false;
    }

    public void preFlush(Iterator iterator) throws CallbackException {
    }

    public void postFlush(Iterator iterator) throws CallbackException {
    }

    public Boolean isTransient(Object object) {
        return null;
    }

    public int[] findDirty(Object object, Serializable serializable, Object[] objectArray, Object[] objectArray2, String[] stringArray, Type[] typeArray) {
        return null;
    }

    public Object instantiate(String string, EntityMode entityMode, Serializable serializable) throws CallbackException {
        return null;
    }

    public String getEntityName(Object object) throws CallbackException {
        return null;
    }

    public Object getEntity(String string, Serializable serializable) throws CallbackException {
        return null;
    }

    public void afterTransactionBegin(Transaction transaction) {
    }

    public void beforeTransactionCompletion(Transaction transaction) {
    }

    public void afterTransactionCompletion(Transaction transaction) {
    }

    public String onPrepareStatement(String string) {
        return string;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[20];
                var3_1 = 0;
                var2_2 = "OK\u0019\u001e+\u0007X!~O\u001aV)BQ\\E\u0011Q<BxXB\u0011\u00058\u0006\u001cXX\u0011\u001f)BZR\\T\u0010}6^A\u0019_1UHXM\u001c_.\u0007NKK\u0006_8\u000fO\u0013C\u001d\u0016/\u0003HTA\u001a_\u0010\u000b[OO\u0000\u00182\fq\\^\u0004\u00183\u0005nXM\u001b\u00039\u0005\\J\u0010\u00149\u0007H^\u0010\u0010)\u0007X>^A\u0019_1UHXM\u001c_.\u0007NKK\u0006_8\u000fO\u0013C\u001b\u001f4\u0016SOG\u001a\u0016s'RIG\u0000\b\u0010\rRTZ\u001b\u00034\f[m\\\u001b\u00018\u0010HD}\u0011\u0005(\u0012\ffM\u001b\u001d1\u0007_IG\u001b\u001f\u0000\byK\u0018\u0014)\u0007X\u001d\b~\\\u0011\u0010)\u0007X\u001d\bh^\u0010\u0010)\u0007X\u001d<^A\u0019_1UHXM\u001c_.\u0007NKK\u0006_8\u000fO\u0013C\u001b\u001f4\u0016SOG\u001a\u0016s1OZm\u0018\u0004.\u0016YO`\u001b\u00054\u0004U^O\u0000\u00182\foXZ\u0001\u0001<^A\u0019_1UHXM\u001c_.\u0007NKK\u0006_8\u000fO\u0013]\u0000\u00103\u0006]OJ\u0006\u0014-\rNI]Z\")\u0003RYO\u0006\u0015\u000f\u0007LR\\\u00000/\u0016U[O\u0017\u0005\u0005\\J\u0010\u00149\ffM\u001b\u001d1\u0007_IG\u001b\u001f\u0000\u0007H^\u0010\u0010)\u0007X\"~O\u001aV)BQ\\E\u0011Q<\f\u001ch^\u0010\u0010)\u0007X\u001dK\u0002\u00143\u0016\u001c[A\u0006Q<B\u0016h^\u0010\u0010)\u0007X\u001dM\u001b\u001d1\u0007_IG\u001b\u001f}\u000bR\u001dA^A\u0019_1UHXM\u001c_.\u0007NKK\u0006_8\u000fO\u0013C\u001b\u001f4\u0016SOG\u001a\u0016s1ENZ\u0011\u001c\u0010\rRTZ\u001b\u00034\f[sA\u0000\u0018;\u000b_\\Z\u001d\u001e30IQK";
                var4_3 = "OK\u0019\u001e+\u0007X!~O\u001aV)BQ\\E\u0011Q<BxXB\u0011\u00058\u0006\u001cXX\u0011\u001f)BZR\\T\u0010}6^A\u0019_1UHXM\u001c_.\u0007NKK\u0006_8\u000fO\u0013C\u001d\u0016/\u0003HTA\u001a_\u0010\u000b[OO\u0000\u00182\fq\\^\u0004\u00183\u0005nXM\u001b\u00039\u0005\\J\u0010\u00149\u0007H^\u0010\u0010)\u0007X>^A\u0019_1UHXM\u001c_.\u0007NKK\u0006_8\u000fO\u0013C\u001b\u001f4\u0016SOG\u001a\u0016s'RIG\u0000\b\u0010\rRTZ\u001b\u00034\f[m\\\u001b\u00018\u0010HD}\u0011\u0005(\u0012\ffM\u001b\u001d1\u0007_IG\u001b\u001f\u0000\byK\u0018\u0014)\u0007X\u001d\b~\\\u0011\u0010)\u0007X\u001d\bh^\u0010\u0010)\u0007X\u001d<^A\u0019_1UHXM\u001c_.\u0007NKK\u0006_8\u000fO\u0013C\u001b\u001f4\u0016SOG\u001a\u0016s1OZm\u0018\u0004.\u0016YO`\u001b\u00054\u0004U^O\u0000\u00182\foXZ\u0001\u0001<^A\u0019_1UHXM\u001c_.\u0007NKK\u0006_8\u000fO\u0013]\u0000\u00103\u0006]OJ\u0006\u0014-\rNI]Z\")\u0003RYO\u0006\u0015\u000f\u0007LR\\\u00000/\u0016U[O\u0017\u0005\u0005\\J\u0010\u00149\ffM\u001b\u001d1\u0007_IG\u001b\u001f\u0000\u0007H^\u0010\u0010)\u0007X\"~O\u001aV)BQ\\E\u0011Q<\f\u001ch^\u0010\u0010)\u0007X\u001dK\u0002\u00143\u0016\u001c[A\u0006Q<B\u0016h^\u0010\u0010)\u0007X\u001dM\u001b\u001d1\u0007_IG\u001b\u001f}\u000bR\u001dA^A\u0019_1UHXM\u001c_.\u0007NKK\u0006_8\u000fO\u0013C\u001b\u001f4\u0016SOG\u001a\u0016s1ENZ\u0011\u001c\u0010\rRTZ\u001b\u00034\f[sA\u0000\u0018;\u000b_\\Z\u001d\u001e30IQK".length();
                var1_4 = 7;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = PersistenceEventInterceptor.a(v0, PersistenceEventInterceptor.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "Xi<p\u000fdwzc7w\u001adYim3#\u001e :~~79\u000fd|tzr6[\u0007im?8\r!~";
                    var4_3 = "Xi<p\u000fdwzc7w\u001adYim3#\u001e :~~79\u000fd|tzr6[\u0007im?8\r!~".length();
                    var1_4 = 33;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 85;
                        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++] = PersistenceEventInterceptor.a(v0, PersistenceEventInterceptor.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;
            }
        }
        PersistenceEventInterceptor.d = var5;
        PersistenceEventInterceptor.a = Logger.getLogger(PersistenceEventInterceptor.class.getName());
    }

    private static RuntimeException a(RuntimeException runtimeException) {
        return runtimeException;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x4F);
        }
        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 -> 78;
                    case 1 -> 93;
                    case 2 -> 7;
                    case 3 -> 2;
                    case 4 -> 46;
                    case 5 -> 17;
                    default -> 79;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

