/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.common.http.GenericHttpRequestParams
 *  com.l7tech.common.http.NtlmAuthentication
 *  com.l7tech.common.io.SingleCertX509KeyManager
 *  com.l7tech.common.io.SslSocketUtil
 *  com.l7tech.gateway.common.resources.HttpConfiguration
 *  com.l7tech.gateway.common.resources.HttpProxyConfiguration
 *  com.l7tech.gateway.common.security.keystore.SsgKeyEntry
 *  com.l7tech.gateway.common.security.password.SecurePassword
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.policy.assertion.HttpRoutingAssertion
 *  com.l7tech.util.Config
 *  com.l7tech.util.ConfigFactory
 *  com.l7tech.util.Functions
 *  com.l7tech.util.Functions$Binary
 *  org.springframework.beans.factory.InitializingBean
 *  org.springframework.context.ApplicationEvent
 *  org.springframework.jmx.export.annotation.ManagedAttribute
 *  org.springframework.jmx.export.annotation.ManagedOperation
 *  org.springframework.jmx.export.annotation.ManagedResource
 */
package com.l7tech.server.globalresources;

import com.l7tech.common.http.GenericHttpRequestParams;
import com.l7tech.common.http.NtlmAuthentication;
import com.l7tech.common.io.SingleCertX509KeyManager;
import com.l7tech.common.io.SslSocketUtil;
import com.l7tech.gateway.common.resources.HttpConfiguration;
import com.l7tech.gateway.common.resources.HttpProxyConfiguration;
import com.l7tech.gateway.common.security.keystore.SsgKeyEntry;
import com.l7tech.gateway.common.security.password.SecurePassword;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.policy.assertion.HttpRoutingAssertion;
import com.l7tech.server.DefaultKey;
import com.l7tech.server.event.EntityClassEvent;
import com.l7tech.server.globalresources.DefaultHttpProxyManager;
import com.l7tech.server.globalresources.HttpConfigurationManager;
import com.l7tech.server.globalresources.f;
import com.l7tech.server.globalresources.g;
import com.l7tech.server.globalresources.h;
import com.l7tech.server.globalresources.i;
import com.l7tech.server.globalresources.m;
import com.l7tech.server.globalresources.s;
import com.l7tech.server.globalresources.t;
import com.l7tech.server.security.keystore.KeystoreFile;
import com.l7tech.server.security.keystore.SsgKeyStoreManager;
import com.l7tech.server.security.password.SecurePasswordManager;
import com.l7tech.server.transport.http.DefaultHttpCiphers;
import com.l7tech.server.util.PostStartupApplicationListener;
import com.l7tech.util.Config;
import com.l7tech.util.ConfigFactory;
import com.l7tech.util.Functions;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.IOException;
import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.net.ProxySelector;
import java.net.URL;
import java.security.GeneralSecurityException;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.UnrecoverableKeyException;
import java.security.cert.X509Certificate;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicReference;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.KeyManager;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationEvent;
import org.springframework.jmx.export.annotation.ManagedAttribute;
import org.springframework.jmx.export.annotation.ManagedOperation;
import org.springframework.jmx.export.annotation.ManagedResource;

@ManagedResource(description="HTTP Configuration Cache", objectName="l7tech:type=HttpConfigurationCache")
public class HttpConfigurationCache
implements PostStartupApplicationListener,
InitializingBean,
PropertyChangeListener {
    private static final Logger a;
    private final Config b;
    private final DefaultHttpProxyManager c;
    private final HttpConfigurationManager d;
    private final SecurePasswordManager e;
    private final HostnameVerifier f;
    private final SsgKeyStoreManager g;
    private final DefaultKey h;
    private final X509TrustManager i;
    private final AtomicReference<SSLContext> j = new AtomicReference();
    private final AtomicReference<SSLContext> k = new AtomicReference();
    private final Map<m, SSLContext> l = new ConcurrentHashMap<m, SSLContext>();
    private final AtomicReference<i> m = new AtomicReference();
    private static final Pattern n;
    private static final String[] o;

    public HttpConfigurationCache(Config config, DefaultHttpProxyManager defaultHttpProxyManager, HttpConfigurationManager httpConfigurationManager, SecurePasswordManager securePasswordManager, HostnameVerifier hostnameVerifier, SsgKeyStoreManager ssgKeyStoreManager, DefaultKey defaultKey, X509TrustManager x509TrustManager) {
        this.b = config;
        this.c = defaultHttpProxyManager;
        this.d = httpConfigurationManager;
        this.e = securePasswordManager;
        this.f = hostnameVerifier;
        this.g = ssgKeyStoreManager;
        this.h = defaultKey;
        this.i = x509TrustManager;
    }

    /*
     * Loose catch block
     */
    public void configure(GenericHttpRequestParams genericHttpRequestParams, boolean bl2) {
        block35: {
            block36: {
                String[] stringArray;
                boolean bl3;
                HttpProxyConfiguration httpProxyConfiguration;
                i i2;
                block30: {
                    HttpConfiguration httpConfiguration;
                    block31: {
                        block32: {
                            String string;
                            String string2;
                            char[] cArray;
                            String string3;
                            NtlmAuthentication ntlmAuthentication;
                            NtlmAuthentication ntlmAuthentication2;
                            GenericHttpRequestParams genericHttpRequestParams2;
                            block34: {
                                block33: {
                                    block37: {
                                        URL uRL = genericHttpRequestParams.getTargetUrl();
                                        i2 = this.m.get();
                                        httpProxyConfiguration = null;
                                        bl3 = false;
                                        try {
                                            if (uRL == null || i2 == null) break block30;
                                        }
                                        catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                                            throw HttpConfigurationCache.a(noSuchAlgorithmException);
                                        }
                                        httpConfiguration = i2.getHttpConfiguration(uRL);
                                        if (httpConfiguration == null) break block30;
                                        bl3 = true;
                                        if (httpConfiguration.getUsername() == null) break block31;
                                        if (httpConfiguration.getNtlmDomain() == null) break block32;
                                        break block37;
                                        catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                                            throw HttpConfigurationCache.a(noSuchAlgorithmException);
                                        }
                                    }
                                    try {
                                        block38: {
                                            NtlmAuthentication ntlmAuthentication3;
                                            genericHttpRequestParams2 = genericHttpRequestParams;
                                            ntlmAuthentication2 = ntlmAuthentication3;
                                            ntlmAuthentication = ntlmAuthentication3;
                                            string3 = httpConfiguration.getUsername();
                                            cArray = i2.getPassword(httpConfiguration.getPasswordGoid());
                                            string2 = httpConfiguration.getNtlmDomain();
                                            if (httpConfiguration.getNtlmHost() != null) break block33;
                                            break block38;
                                            catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                                                throw HttpConfigurationCache.a(noSuchAlgorithmException);
                                            }
                                        }
                                        string = this.b.getProperty(o[7], o[8]);
                                        break block34;
                                    }
                                    catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                                        throw HttpConfigurationCache.a(noSuchAlgorithmException);
                                    }
                                }
                                string = httpConfiguration.getNtlmHost();
                            }
                            ntlmAuthentication2(string3, cArray, string2, string);
                            genericHttpRequestParams2.setNtlmAuthentication(ntlmAuthentication);
                            break block31;
                        }
                        genericHttpRequestParams.setPasswordAuthentication(new PasswordAuthentication(httpConfiguration.getUsername(), i2.getPassword(httpConfiguration.getPasswordGoid())));
                    }
                    try {
                        this.a(httpConfiguration, genericHttpRequestParams);
                    }
                    catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                        stringArray = o;
                        a.log(Level.WARNING, stringArray[0], noSuchAlgorithmException);
                    }
                    catch (KeyManagementException keyManagementException) {
                        stringArray = o;
                        a.log(Level.WARNING, stringArray[11], keyManagementException);
                    }
                    genericHttpRequestParams.setConnectionTimeout(httpConfiguration.getConnectTimeout());
                    genericHttpRequestParams.setReadTimeout(httpConfiguration.getReadTimeout());
                    genericHttpRequestParams.setFollowRedirects(httpConfiguration.isFollowRedirects());
                    switch (com.l7tech.server.globalresources.h.a[httpConfiguration.getProxyUse().ordinal()]) {
                        case 1: {
                            httpProxyConfiguration = i2.a;
                            break;
                        }
                        case 2: {
                            httpProxyConfiguration = httpConfiguration.getProxyConfiguration();
                        }
                    }
                }
                if (!bl3) {
                    HttpProxyConfiguration httpProxyConfiguration2;
                    try {
                        this.a(bl2, genericHttpRequestParams);
                    }
                    catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                        stringArray = o;
                        a.log(Level.WARNING, stringArray[11], noSuchAlgorithmException);
                    }
                    catch (KeyManagementException keyManagementException) {
                        stringArray = o;
                        a.log(Level.WARNING, stringArray[11], keyManagementException);
                    }
                    catch (IOException iOException) {
                        a.log(Level.WARNING, o[11], iOException);
                    }
                    try {
                        httpProxyConfiguration2 = i2 != null ? i2.a : null;
                    }
                    catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                        throw HttpConfigurationCache.a(noSuchAlgorithmException);
                    }
                    httpProxyConfiguration = httpProxyConfiguration2;
                }
                try {
                    try {
                        try {
                            try {
                                genericHttpRequestParams.setHostnameVerifier(this.f);
                                if (httpProxyConfiguration == null || httpProxyConfiguration.getHost() == null) break block35;
                            }
                            catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                                throw HttpConfigurationCache.a(noSuchAlgorithmException);
                            }
                            genericHttpRequestParams.setProxyHost(httpProxyConfiguration.getHost());
                            genericHttpRequestParams.setProxyPort(httpProxyConfiguration.getPort());
                            if (httpProxyConfiguration.getUsername() == null) break block36;
                        }
                        catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                            throw HttpConfigurationCache.a(noSuchAlgorithmException);
                        }
                        if (httpProxyConfiguration.getPasswordGoid() == null) break block36;
                    }
                    catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                        throw HttpConfigurationCache.a(noSuchAlgorithmException);
                    }
                    genericHttpRequestParams.setProxyAuthentication(new PasswordAuthentication(httpProxyConfiguration.getUsername(), i2.getPassword(httpProxyConfiguration.getPasswordGoid())));
                    break block35;
                }
                catch (NoSuchAlgorithmException noSuchAlgorithmException) {
                    throw HttpConfigurationCache.a(noSuchAlgorithmException);
                }
            }
            genericHttpRequestParams.setProxyAuthentication(null);
        }
    }

    @Override
    public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
        String[] stringArray = o;
        if (propertyChangeEvent.getPropertyName().startsWith(stringArray[5])) {
            a.config(stringArray[10]);
            this.k.set(null);
        } else {
            this.a();
        }
    }

    public void onApplicationEvent(ApplicationEvent applicationEvent) {
        if (applicationEvent instanceof EntityClassEvent) {
            EntityClassEvent entityClassEvent = (EntityClassEvent)applicationEvent;
            if (HttpConfiguration.class.isAssignableFrom(entityClassEvent.getEntityClass()) || SecurePassword.class.isAssignableFrom(entityClassEvent.getEntityClass())) {
                this.a();
            } else if (KeystoreFile.class.isAssignableFrom(entityClassEvent.getEntityClass())) {
                this.k.set(null);
                this.l.clear();
            }
        }
    }

    public void afterPropertiesSet() {
        this.a();
        this.installProxySelector(new t(this.m));
        this.installAuthenticator(new s(this.m));
    }

    @ManagedOperation(description="Rebuild HTTP Configuration Cache")
    public void resetCache() {
        this.a();
        this.j.set(null);
        this.k.set(null);
        this.l.clear();
    }

    @ManagedAttribute(description="HTTP Configuration Cache Size", currencyTimeLimit=5)
    public int getHttpConfigurationCacheSize() {
        i i2 = this.m.get();
        return i2 == null ? 0 : (Integer)Functions.reduce(i2.b.values(), (Object)0, (Functions.Binary)new f(this));
    }

    @ManagedAttribute(description="SSL Socket Factory Cache Size", currencyTimeLimit=5)
    public int getSSLSocketFactoryCacheSize() {
        return this.l.size();
    }

    @ManagedAttribute(description="Password Cache Size", currencyTimeLimit=5)
    public int getPasswordCacheSize() {
        i i2 = this.m.get();
        return i2 == null ? 0 : i2.c.size();
    }

    protected void installProxySelector(ProxySelector proxySelector) {
        ProxySelector.setDefault(proxySelector);
    }

    protected void installAuthenticator(Authenticator authenticator) {
        Authenticator.setDefault(authenticator);
    }

    private void a() {
        String[] stringArray = o;
        a.config(stringArray[6]);
        try {
            this.m.set(new i(this.c.getDefaultHttpProxyConfiguration(), this.d.findAll(), this.e.findAll(), new g(this)));
        }
        catch (FindException findException) {
            a.log(Level.WARNING, o[4], findException);
        }
    }

    private void a(HttpConfiguration httpConfiguration, GenericHttpRequestParams genericHttpRequestParams) throws NoSuchAlgorithmException, KeyManagementException {
        Goid goid;
        Object object;
        m m2 = new m(httpConfiguration.getTlsKeyUse(), httpConfiguration.getTlsVersion(), httpConfiguration.getTlsKeystoreGoid(), httpConfiguration.getTlsKeystoreAlias(), httpConfiguration.getTlsCipherSuites());
        SSLContext sSLContext = this.l.get(m2);
        if (sSLContext == null) {
            try {
                switch (com.l7tech.server.globalresources.h.a[httpConfiguration.getTlsKeyUse().ordinal()]) {
                    case 3: {
                        sSLContext = this.a(false, genericHttpRequestParams);
                        break;
                    }
                    case 2: {
                        String string;
                        object = new m(httpConfiguration.getTlsKeyUse(), null, httpConfiguration.getTlsKeystoreGoid(), httpConfiguration.getTlsKeystoreAlias(), null);
                        goid = httpConfiguration.getTlsKeystoreGoid();
                        try {
                            string = httpConfiguration.getTlsKeystoreAlias() == null ? "" : httpConfiguration.getTlsKeystoreAlias();
                        }
                        catch (KeyStoreException keyStoreException) {
                            throw HttpConfigurationCache.a(keyStoreException);
                        }
                        String string2 = string;
                        sSLContext = this.l.get(object);
                        if (sSLContext != null) break;
                        String[] stringArray = o;
                        sSLContext = SSLContext.getInstance(stringArray[9]);
                        int n2 = ConfigFactory.getIntProperty((String)HttpRoutingAssertion.PROP_SSL_SESSION_TIMEOUT, (int)600);
                        sSLContext.getClientSessionContext().setSessionTimeout(n2);
                        SsgKeyEntry ssgKeyEntry = this.g.lookupKeyByKeyAlias(string2, goid);
                        X509Certificate[] x509CertificateArray = ssgKeyEntry.getCertificateChain();
                        PrivateKey privateKey = ssgKeyEntry.getPrivateKey();
                        KeyManager[] keyManagerArray = new KeyManager[]{new SingleCertX509KeyManager(x509CertificateArray, privateKey)};
                        sSLContext.init(keyManagerArray, new TrustManager[]{this.i}, null);
                        this.l.put((m)object, sSLContext);
                    }
                }
            }
            catch (KeyStoreException keyStoreException) {
                String[] stringArray = o;
                a.log(Level.WARNING, stringArray[1], keyStoreException);
            }
            catch (FindException findException) {
                String[] stringArray = o;
                a.log(Level.WARNING, stringArray[3], findException);
            }
            catch (UnrecoverableKeyException unrecoverableKeyException) {
                String[] stringArray = o;
                a.log(Level.WARNING, stringArray[3], unrecoverableKeyException);
            }
            catch (IOException iOException) {
                String[] stringArray = o;
                a.log(Level.WARNING, stringArray[3], iOException);
            }
            if (sSLContext == null) {
                try {
                    sSLContext = this.a(true, genericHttpRequestParams);
                }
                catch (IOException iOException) {
                    a.log(Level.WARNING, o[3], iOException);
                }
            }
            this.l.put(m2, sSLContext);
        }
        if (((String[])(object = SslSocketUtil.filterSelectedTLSVersion((String)httpConfiguration.getTlsVersion(), (Set)SslSocketUtil.DEFAULT_SUPPORTED_TLS_VERSIONS))).length == 0) {
            object = SslSocketUtil.DEFAULT_SUPPORTED_TLS_VERSIONS_ARRAY;
        }
        genericHttpRequestParams.setSupportedProtocols(object);
        goid = this.a(httpConfiguration.getTlsCipherSuites());
        genericHttpRequestParams.setSupportedCiphers((String[])goid);
        genericHttpRequestParams.setSslContext(sSLContext);
    }

    private String[] a(String string) {
        if (string == null) {
            string = DefaultHttpCiphers.getDefaultEnabledOutboundCipherSuites();
        }
        String[] stringArray = n.split(string.trim() + "," + SslSocketUtil.TLS_EMPTY_RENEGOTIATION_INFO_SCSV);
        return stringArray;
    }

    private SSLContext a(boolean bl2, GenericHttpRequestParams genericHttpRequestParams) throws NoSuchAlgorithmException, KeyManagementException, IOException {
        AtomicReference<SSLContext> atomicReference;
        try {
            atomicReference = bl2 ? this.k : this.j;
        }
        catch (NoSuchAlgorithmException noSuchAlgorithmException) {
            throw HttpConfigurationCache.a(noSuchAlgorithmException);
        }
        AtomicReference<SSLContext> atomicReference2 = atomicReference;
        SSLContext sSLContext = atomicReference2.get();
        if (sSLContext == null) {
            sSLContext = this.a(bl2);
            atomicReference2.compareAndSet(null, sSLContext);
        }
        genericHttpRequestParams.setSslContext(sSLContext);
        return sSLContext;
    }

    private SSLContext a(boolean bl2) throws NoSuchAlgorithmException, KeyManagementException {
        KeyManager[] keyManagerArray;
        SSLContext sSLContext;
        SSLContext sSLContext2 = SSLContext.getInstance(o[12]);
        int n2 = ConfigFactory.getIntProperty((String)HttpRoutingAssertion.PROP_SSL_SESSION_TIMEOUT, (int)600);
        try {
            sSLContext2.getClientSessionContext().setSessionTimeout(n2);
            sSLContext = sSLContext2;
            keyManagerArray = bl2 ? this.h.getClientSslKeyManagers() : null;
        }
        catch (NoSuchAlgorithmException noSuchAlgorithmException) {
            throw HttpConfigurationCache.a(noSuchAlgorithmException);
        }
        sSLContext.init(keyManagerArray, new TrustManager[]{this.i}, null);
        return sSLContext2;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[13];
                var3_1 = 0;
                var2_2 = "_;,I0*|h,?R+dx:\u001a\rjbipt=;^6$\u001a_;,I0*x\u007f=*O,m?q,'\u0006$em:\u001a\rjl\u0007F:t\n\u001ey5\u001a_;,I0*x\u007f=*O,m?q,'\u0006$em:\u001a\rjl!_;,I0*su(:O,m?R\u001d\nvbipt/7A7x~n 1Hl\bq,'u6em\u007f\u001f2\u001b;\u000f\u000ee~~ 0AbBKN\u0019~E-dys.+T#~vu'p\u000by%+U6omR&-R\tv&=G.bpi=\u0003N\u0005\r0S'(G.c{{=7H%*|{*6C&*LI\u0005~E-dk\u007f1*\u0006$em:-;@#\u007fsni5C;$";
                var4_3 = "_;,I0*|h,?R+dx:\u001a\rjbipt=;^6$\u001a_;,I0*x\u007f=*O,m?q,'\u0006$em:\u001a\rjl\u0007F:t\n\u001ey5\u001a_;,I0*x\u007f=*O,m?q,'\u0006$em:\u001a\rjl!_;,I0*su(:O,m?R\u001d\nvbipt/7A7x~n 1Hl\bq,'u6em\u007f\u001f2\u001b;\u000f\u000ee~~ 0AbBKN\u0019~E-dys.+T#~vu'p\u000by%+U6omR&-R\tv&=G.bpi=\u0003N\u0005\r0S'(G.c{{=7H%*|{*6C&*LI\u0005~E-dk\u007f1*\u0006$em:-;@#\u007fsni5C;$".length();
                var1_4 = 27;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = HttpConfigurationCache.a(v0, HttpConfigurationCache.b(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = ":^I,UO\u0019\rIZ7N\u0001\u001d_\u007fh\u000f\u0007\f\u0015\u0011X^;SA\u0003+`h";
                    var4_3 = ":^I,UO\u0019\rIZ7N\u0001\u001d_\u007fh\u000f\u0007\f\u0015\u0011X^;SA\u0003+`h".length();
                    var1_4 = 27;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 46;
                        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++] = HttpConfigurationCache.a(v0, HttpConfigurationCache.b(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;
            }
        }
        HttpConfigurationCache.o = var5;
        HttpConfigurationCache.a = Logger.getLogger(HttpConfigurationCache.class.getName());
        HttpConfigurationCache.n = Pattern.compile(HttpConfigurationCache.o[2]);
    }

    private static GeneralSecurityException a(GeneralSecurityException generalSecurityException) {
        return generalSecurityException;
    }

    private static char[] b(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x54);
        }
        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 -> 81;
                    case 1 -> 2;
                    case 2 -> 21;
                    case 3 -> 109;
                    case 4 -> 9;
                    case 5 -> 65;
                    default -> 84;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

