/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.common.http.HttpMethod
 *  com.l7tech.common.log.HybridDiagnosticContext
 *  com.l7tech.common.mime.NoSuchPartException
 *  com.l7tech.common.protocol.SecureSpanConstants$HttpHeaders
 *  com.l7tech.gateway.common.audit.Audit
 *  com.l7tech.gateway.common.audit.AuditDetailMessage
 *  com.l7tech.gateway.common.audit.MessageProcessingMessages
 *  com.l7tech.gateway.common.service.PublishedService
 *  com.l7tech.gateway.common.service.PublishedService$ServiceException
 *  com.l7tech.message.HttpRequestKnob
 *  com.l7tech.message.HttpServletRequestKnob
 *  com.l7tech.message.Message
 *  com.l7tech.message.SecurityKnob
 *  com.l7tech.objectmodel.EntityUtil
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.policy.PolicyType
 *  com.l7tech.policy.assertion.AssertionStatus
 *  com.l7tech.policy.assertion.PolicyAssertionException
 *  com.l7tech.security.cert.KeyUsageException
 *  com.l7tech.security.xml.SecurityActor
 *  com.l7tech.security.xml.UnexpectedKeyInfoException
 *  com.l7tech.security.xml.decorator.DecorationRequirements
 *  com.l7tech.security.xml.processor.BadSecurityContextException
 *  com.l7tech.security.xml.processor.ProcessorException
 *  com.l7tech.security.xml.processor.ProcessorResult
 *  com.l7tech.security.xml.processor.ProcessorValidationException
 *  com.l7tech.security.xml.processor.WssProcessorErrorHandler
 *  com.l7tech.security.xml.processor.WssProcessorImpl
 *  com.l7tech.util.ExceptionUtils
 *  com.l7tech.util.Functions
 *  com.l7tech.util.Functions$Unary
 *  com.l7tech.util.InvalidDocumentFormatException
 *  com.l7tech.util.ResourceUtils
 *  com.l7tech.util.SoapConstants
 *  com.l7tech.xml.InvalidDocumentSignatureException
 *  com.l7tech.xml.MessageNotSoapException
 *  com.l7tech.xml.SoapFaultLevel
 *  com.l7tech.xml.soap.SoapFaultUtils
 *  com.l7tech.xml.soap.SoapUtil
 *  com.l7tech.xml.soap.SoapVersion
 */
package com.l7tech.server;

import com.l7tech.common.http.HttpMethod;
import com.l7tech.common.log.HybridDiagnosticContext;
import com.l7tech.common.mime.NoSuchPartException;
import com.l7tech.common.protocol.SecureSpanConstants;
import com.l7tech.gateway.common.audit.Audit;
import com.l7tech.gateway.common.audit.AuditDetailMessage;
import com.l7tech.gateway.common.audit.MessageProcessingMessages;
import com.l7tech.gateway.common.service.PublishedService;
import com.l7tech.message.HttpRequestKnob;
import com.l7tech.message.HttpServletRequestKnob;
import com.l7tech.message.Message;
import com.l7tech.message.SecurityKnob;
import com.l7tech.objectmodel.EntityUtil;
import com.l7tech.objectmodel.Goid;
import com.l7tech.policy.PolicyType;
import com.l7tech.policy.assertion.AssertionStatus;
import com.l7tech.policy.assertion.PolicyAssertionException;
import com.l7tech.security.cert.KeyUsageException;
import com.l7tech.security.xml.SecurityActor;
import com.l7tech.security.xml.UnexpectedKeyInfoException;
import com.l7tech.security.xml.decorator.DecorationRequirements;
import com.l7tech.security.xml.processor.BadSecurityContextException;
import com.l7tech.security.xml.processor.ProcessorException;
import com.l7tech.security.xml.processor.ProcessorResult;
import com.l7tech.security.xml.processor.ProcessorValidationException;
import com.l7tech.security.xml.processor.WssProcessorErrorHandler;
import com.l7tech.security.xml.processor.WssProcessorImpl;
import com.l7tech.server.MessageProcessor;
import com.l7tech.server.MethodNotAllowedException;
import com.l7tech.server.a;
import com.l7tech.server.audit.Auditor;
import com.l7tech.server.av;
import com.l7tech.server.message.HttpSessionPolicyContextCache;
import com.l7tech.server.message.PolicyEnforcementContext;
import com.l7tech.server.message.PolicyEnforcementContextFactory;
import com.l7tech.server.policy.PolicyCache;
import com.l7tech.server.policy.PolicyMetadata;
import com.l7tech.server.policy.PolicyVersionException;
import com.l7tech.server.policy.ServerPolicyHandle;
import com.l7tech.server.policy.assertion.ServerAssertion;
import com.l7tech.server.service.ServiceCache;
import com.l7tech.server.service.resolution.ServiceResolutionException;
import com.l7tech.server.trace.TracePolicyEvaluator;
import com.l7tech.server.util.WSSecurityProcessorUtils;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.Functions;
import com.l7tech.util.InvalidDocumentFormatException;
import com.l7tech.util.ResourceUtils;
import com.l7tech.util.SoapConstants;
import com.l7tech.xml.InvalidDocumentSignatureException;
import com.l7tech.xml.MessageNotSoapException;
import com.l7tech.xml.SoapFaultLevel;
import com.l7tech.xml.soap.SoapFaultUtils;
import com.l7tech.xml.soap.SoapUtil;
import com.l7tech.xml.soap.SoapVersion;
import java.io.Closeable;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.text.MessageFormat;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;

final class au
implements ServiceCache.ResolutionListener,
Closeable {
    private final PolicyEnforcementContext a;
    ProcessorResult b;
    boolean c;
    AssertionStatus d;
    Exception e;
    ServerPolicyHandle f;
    static final boolean g;
    final MessageProcessor this$0;
    private static final String[] h;

    private au(MessageProcessor messageProcessor, PolicyEnforcementContext policyEnforcementContext) {
        this.this$0 = messageProcessor;
        this.f = null;
        this.a = policyEnforcementContext;
    }

    private AssertionStatus a() throws ServiceResolutionException, IOException, MethodNotAllowedException, PolicyVersionException, PublishedService.ServiceException, PolicyAssertionException, SAXException {
        AssertionStatus assertionStatus;
        block10: {
            block7: {
                boolean bl2 = false;
                assertionStatus = AssertionStatus.NONE;
                try {
                    assertionStatus = this.h();
                    if (assertionStatus == AssertionStatus.NONE) {
                        assertionStatus = this.b();
                    }
                    bl2 = true;
                }
                catch (Throwable throwable) {
                    block9: {
                        block8: {
                            try {
                                this.this$0.debugManager.onMessageFinished(this.a, this.a.getPolicyResult());
                                if (assertionStatus != AssertionStatus.NONE || !bl2) break block8;
                            }
                            catch (ServiceResolutionException serviceResolutionException) {
                                throw au.a(serviceResolutionException);
                            }
                            assertionStatus = this.a(false);
                            break block9;
                        }
                        this.a(true);
                    }
                    throw throwable;
                }
                try {
                    this.this$0.debugManager.onMessageFinished(this.a, this.a.getPolicyResult());
                    if (assertionStatus != AssertionStatus.NONE || !bl2) break block7;
                }
                catch (ServiceResolutionException serviceResolutionException) {
                    throw au.a(serviceResolutionException);
                }
                assertionStatus = this.a(false);
                break block10;
            }
            this.a(true);
        }
        return assertionStatus;
    }

    private AssertionStatus b() throws ServiceResolutionException, IOException, MethodNotAllowedException, PolicyVersionException, PublishedService.ServiceException, PolicyAssertionException, SAXException {
        boolean bl2;
        AssertionStatus assertionStatus = this.d();
        try {
            if (assertionStatus != AssertionStatus.NONE) {
                return assertionStatus;
            }
        }
        catch (ServiceResolutionException serviceResolutionException) {
            throw au.a(serviceResolutionException);
        }
        try {
            if (this.a.getRequest().isHttpRequest()) {
                this.a(this.a);
            }
        }
        catch (ServiceResolutionException serviceResolutionException) {
            throw au.a(serviceResolutionException);
        }
        try {
            this.this$0.b(this.a);
            this.lookupServerPolicy();
            if (this.e()) {
                return AssertionStatus.BAD_REQUEST;
            }
        }
        catch (ServiceResolutionException serviceResolutionException) {
            throw au.a(serviceResolutionException);
        }
        try {
            if (this.g()) {
                return this.d;
            }
        }
        catch (ServiceResolutionException serviceResolutionException) {
            throw au.a(serviceResolutionException);
        }
        boolean bl3 = this.this$0.j.executePreServiceInjections(this.a);
        try {
            if (!bl3) {
                this.this$0.y.log(Level.FINE, h[15]);
                return AssertionStatus.NONE;
            }
        }
        catch (ServiceResolutionException serviceResolutionException) {
            throw au.a(serviceResolutionException);
        }
        AssertionStatus assertionStatus2 = this.i();
        try {
            if (assertionStatus2 != AssertionStatus.NONE) {
                return assertionStatus2;
            }
        }
        catch (ServiceResolutionException serviceResolutionException) {
            throw au.a(serviceResolutionException);
        }
        try {
            this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.RUNNING_POLICY);
            this.a.setPolicyExecutionAttempted(true);
            if (this.a.getService().isTracingEnabled()) {
                this.c();
            }
        }
        catch (ServiceResolutionException serviceResolutionException) {
            throw au.a(serviceResolutionException);
        }
        this.this$0.debugManager.onMessageArrived(this.a, this.a.getService().getPolicy().getGoid());
        assertionStatus2 = this.f.checkRequest(this.a);
        if (assertionStatus2 == AssertionStatus.NONE) {
            assertionStatus2 = this.c(this.a);
        }
        this.a.setPolicyResult(assertionStatus2);
        if (assertionStatus2 == AssertionStatus.NONE) {
            assertionStatus2 = this.a(PolicyType.TAG_GLOBAL_POST_SERVICE, (AuditDetailMessage)MessageProcessingMessages.RUNNING_POST_SERVICE_POLICY, (AuditDetailMessage)MessageProcessingMessages.ERROR_POST_SERVICE, false);
        }
        if (assertionStatus2 == AssertionStatus.NONE && !(bl2 = this.this$0.j.executePostServiceInjections(this.a))) {
            this.this$0.y.log(Level.FINE, h[12]);
            assertionStatus2 = AssertionStatus.FALSIFIED;
        }
        this.a(assertionStatus2);
        if (assertionStatus2 == AssertionStatus.NONE) {
            assertionStatus2 = this.a(PolicyType.TAG_GLOBAL_POST_SECURITY, (AuditDetailMessage)MessageProcessingMessages.RUNNING_POST_SECURITY_POLICY, (AuditDetailMessage)MessageProcessingMessages.ERROR_POST_SECURITY, false);
        }
        return assertionStatus2;
    }

    private void c() {
        String string;
        block4: {
            String[] stringArray = h;
            string = this.this$0.m.getProperty(stringArray[13]);
            try {
                try {
                    if (string != null && string.trim().length() >= 1) break block4;
                }
                catch (IllegalStateException illegalStateException) {
                    throw au.a(illegalStateException);
                }
                this.this$0.y.info(h[6]);
                return;
            }
            catch (IllegalStateException illegalStateException) {
                throw au.a(illegalStateException);
            }
        }
        TracePolicyEvaluator.createAndAttachToContext(this.a, this.this$0.d.getServerPolicy(string));
    }

    /*
     * Loose catch block
     */
    AssertionStatus d() throws ServiceResolutionException, IOException, PolicyAssertionException {
        PublishedService publishedService;
        block9: {
            block10: {
                publishedService = this.this$0.c.resolve(this.a.getRequest(), this);
                if (publishedService != null) break block9;
                try {
                    block11: {
                        this.f();
                        if (this.d == null) break block10;
                        break block11;
                        catch (IllegalStateException illegalStateException) {
                            throw au.a(illegalStateException);
                        }
                    }
                    return this.d;
                }
                catch (IllegalStateException illegalStateException) {
                    throw au.a(illegalStateException);
                }
            }
            this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.SERVICE_NOT_FOUND);
            try {
                String string = this.a.getRequest().getHttpRequestKnob().getRequestUrl();
                String[] stringArray = h;
                this.this$0.y.info(stringArray[0] + string);
            }
            catch (IllegalStateException illegalStateException) {
                // empty catch block
            }
            return AssertionStatus.SERVICE_NOT_FOUND;
        }
        try {
            if (publishedService.isDisabled()) {
                this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.SERVICE_DISABLED);
                return AssertionStatus.SERVICE_NOT_FOUND;
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw au.a(illegalStateException);
        }
        this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.RESOLVED_SERVICE, publishedService.getName(), String.valueOf(publishedService.getGoid()));
        this.a.setService(publishedService);
        String[] stringArray = h;
        HybridDiagnosticContext.put((String)stringArray[5], (String)publishedService.getId());
        HybridDiagnosticContext.put((String)stringArray[14], (String)publishedService.displayName());
        HybridDiagnosticContext.put((String)stringArray[3], (String)publishedService.getFolder().getPath());
        HybridDiagnosticContext.put((String)stringArray[9], (List)Functions.map(this.this$0.d.getFolderPath(publishedService.getPolicy().getGoid()), (Functions.Unary)EntityUtil.id()));
        return AssertionStatus.NONE;
    }

    /*
     * Loose catch block
     */
    private void a(PolicyEnforcementContext policyEnforcementContext) throws MethodNotAllowedException, PolicyVersionException {
        block22: {
            block20: {
                boolean bl2;
                block21: {
                    Object object;
                    PublishedService publishedService;
                    HttpRequestKnob httpRequestKnob;
                    block19: {
                        block18: {
                            httpRequestKnob = policyEnforcementContext.getRequest().getHttpRequestKnob();
                            publishedService = policyEnforcementContext.getService();
                            if (g) break block18;
                            try {
                                block23: {
                                    if (publishedService != null) break block18;
                                    break block23;
                                    catch (IllegalArgumentException illegalArgumentException) {
                                        throw au.a(illegalArgumentException);
                                    }
                                }
                                throw new AssertionError();
                            }
                            catch (IllegalArgumentException illegalArgumentException) {
                                throw au.a(illegalArgumentException);
                            }
                        }
                        HttpMethod httpMethod = httpRequestKnob.getMethod();
                        try {
                            if (httpMethod == null || publishedService.isMethodAllowed(httpMethod)) break block19;
                        }
                        catch (IllegalArgumentException illegalArgumentException) {
                            throw au.a(illegalArgumentException);
                        }
                        String[] stringArray = new String[]{httpMethod.name(), publishedService.getName()};
                        Object[] objectArray = new Object[]{httpMethod.name()};
                        this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.METHOD_NOT_ALLOWED, stringArray);
                        String string = MessageFormat.format(MessageProcessingMessages.METHOD_NOT_ALLOWED_FAULT.getMessage(), objectArray) + h[4] + httpRequestKnob.getRequestUrl();
                        throw new MethodNotAllowedException(string);
                    }
                    if (httpRequestKnob instanceof HttpServletRequestKnob) {
                        object = String.valueOf(publishedService.getGoid()) + "." + publishedService.getVersion();
                        HttpSessionPolicyContextCache httpSessionPolicyContextCache = new HttpSessionPolicyContextCache(((HttpServletRequestKnob)httpRequestKnob).getHttpServletRequest(), (String)object);
                        policyEnforcementContext.setCache(httpSessionPolicyContextCache);
                    }
                    object = httpRequestKnob.getHeaderFirstValue(SecureSpanConstants.HttpHeaders.POLICY_VERSION);
                    try {
                        if (object == null || ((String)object).length() <= 0) break block20;
                    }
                    catch (IllegalArgumentException illegalArgumentException) {
                        throw au.a(illegalArgumentException);
                    }
                    bl2 = false;
                    int n2 = ((String)object).indexOf(124);
                    if (n2 < 0) {
                        this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.POLICY_VERSION_WRONG_FORMAT);
                        bl2 = true;
                    } else {
                        try {
                            String string = this.this$0.d.getUniquePolicyVersionIdentifer(publishedService.getPolicy().getGoid());
                            Goid goid = Goid.parseGoid((String)((String)object).substring(0, n2));
                            String string2 = ((String)object).substring(n2 + 1);
                            try {
                                if (Goid.equals((Goid)goid, (Goid)publishedService.getGoid()) && string2.equals(string)) break block21;
                            }
                            catch (IllegalArgumentException illegalArgumentException) {
                                throw au.a(illegalArgumentException);
                            }
                            this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.POLICY_VERSION_INVALID, new String[]{object, String.valueOf(publishedService.getGoid()), string});
                            bl2 = true;
                        }
                        catch (IllegalArgumentException illegalArgumentException) {
                            bl2 = true;
                            this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.POLICY_VERSION_WRONG_FORMAT, null, illegalArgumentException);
                        }
                    }
                }
                try {
                    if (bl2) {
                        policyEnforcementContext.setRequestPolicyViolated();
                        policyEnforcementContext.setRequestClaimingWrongPolicyVersion();
                        throw new PolicyVersionException();
                    }
                    break block22;
                }
                catch (IllegalArgumentException illegalArgumentException) {
                    throw au.a(illegalArgumentException);
                }
            }
            this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.POLICY_ID_NOT_PROVIDED);
        }
    }

    /*
     * Could not resolve type clashes
     * Loose catch block
     */
    @Override
    public boolean notifyPreParseServices(Message message, Set<ServiceCache.ServiceMetadata> set) {
        block36: {
            Object object2;
            this.c = true;
            boolean bl2 = false;
            boolean bl3 = false;
            boolean bl4 = true;
            boolean bl5 = false;
            try {
                if (!this.processPreServicePoliciesNoThrow(PolicyType.TAG_GLOBAL_PRE_SECURITY, (AuditDetailMessage)MessageProcessingMessages.RUNNING_PRE_SECURITY_POLICY, (AuditDetailMessage)MessageProcessingMessages.ERROR_PRE_SECURITY)) {
                    return false;
                }
            }
            catch (SAXException sAXException) {
                throw au.a(sAXException);
            }
            for (Object object2 : set) {
                if (!((ServiceCache.ServiceMetadata)object2).isWssInPolicy()) {
                    bl4 = false;
                }
                if (!((ServiceCache.ServiceMetadata)object2).isWssProcessingRequired()) continue;
                bl5 = true;
            }
            try {
                boolean bl6;
                block35: {
                    block34: {
                        bl2 = this.a.getRequest().isSoap(bl4);
                        if (!bl2) break block34;
                        try {
                            block37: {
                                if (!this.a.getRequest().getSoapKnob().isSecurityHeaderPresent()) break block34;
                                break block37;
                                catch (SAXException sAXException) {
                                    throw au.a(sAXException);
                                }
                            }
                            bl6 = true;
                            break block35;
                        }
                        catch (SAXException sAXException) {
                            throw au.a(sAXException);
                        }
                    }
                    bl6 = false;
                }
                bl3 = bl6;
            }
            catch (SAXException sAXException) {
                this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.INVALID_REQUEST_WITH_DETAIL, new String[]{ExceptionUtils.getMessage((Throwable)sAXException)}, ExceptionUtils.getDebugException((Throwable)sAXException));
                this.a.setMalformedRequest();
                this.d = AssertionStatus.BAD_REQUEST;
                return false;
            }
            catch (MessageNotSoapException messageNotSoapException) {
                this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.MESSAGE_NOT_SOAP, null, ExceptionUtils.getDebugException((Throwable)messageNotSoapException));
            }
            catch (NoSuchPartException noSuchPartException) {
                this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.INVALID_REQUEST_WITH_DETAIL, new String[]{ExceptionUtils.getMessage((Throwable)noSuchPartException)}, ExceptionUtils.getDebugException((Throwable)noSuchPartException));
                this.d = AssertionStatus.BAD_REQUEST;
                return false;
            }
            catch (IOException iOException) {
                this.e = iOException;
                return false;
            }
            if (!bl5) break block36;
            try {
                block38: {
                    if (!bl2) break block36;
                    break block38;
                    catch (SAXException sAXException) {
                        throw au.a(sAXException);
                    }
                }
                if (!bl3) break block36;
            }
            catch (SAXException sAXException) {
                throw au.a(sAXException);
            }
            WssProcessorImpl wssProcessorImpl = new WssProcessorImpl();
            object2 = this.this$0.p.get();
            wssProcessorImpl.setSignedAttachmentSizeLimit(((av)object2).a);
            wssProcessorImpl.setRejectOnMustUnderstand(((av)object2).b);
            wssProcessorImpl.setPermitMultipleTimestampSignatures(((av)object2).c);
            wssProcessorImpl.setPermitUnknownBinarySecurityTokens(((av)object2).d);
            wssProcessorImpl.setStrictSignatureConfirmationValidation(((av)object2).e);
            wssProcessorImpl.setErrorHandler((WssProcessorErrorHandler)new a(this));
            try {
                Message message2 = this.a.getRequest();
                SecurityKnob securityKnob = message2.getSecurityKnob();
                this.b = wssProcessorImpl.undecorateMessage(message2, this.this$0.g, this.this$0.f);
                securityKnob.setProcessorResult(this.b);
            }
            catch (MessageNotSoapException messageNotSoapException) {
                this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.MESSAGE_NOT_SOAP_NO_WSS, null, messageNotSoapException);
            }
            catch (UnexpectedKeyInfoException unexpectedKeyInfoException) {
                SoapVersion soapVersion;
                SoapFaultLevel soapFaultLevel;
                this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.ERROR_WSS_PROCESSING_INFO, new String[]{ExceptionUtils.getMessage((Throwable)unexpectedKeyInfoException)}, ExceptionUtils.getDebugException((Throwable)unexpectedKeyInfoException));
                this.a.setAuditLevel(Level.WARNING);
                SoapFaultLevel soapFaultLevel2 = new SoapFaultLevel();
                try {
                    soapFaultLevel2.setLevel(1);
                    soapFaultLevel = soapFaultLevel2;
                    soapVersion = this.a.getService() != null ? this.a.getService().getSoapVersion() : SoapVersion.UNKNOWN;
                }
                catch (SAXException sAXException) {
                    throw au.a(sAXException);
                }
                soapFaultLevel.setFaultTemplate(SoapFaultUtils.badKeyInfoFault((SoapVersion)soapVersion, (String)this.b(this.a)));
                this.a.setFaultlevel(soapFaultLevel2);
                this.d = AssertionStatus.FAILED;
                return false;
            }
            catch (ProcessorValidationException processorValidationException) {
                this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.ERROR_WSS_PROCESSING_INFO, new String[]{ExceptionUtils.getMessage((Throwable)processorValidationException)}, ExceptionUtils.getDebugException((Throwable)processorValidationException));
                this.d = AssertionStatus.BAD_REQUEST;
                return false;
            }
            catch (ProcessorException processorException) {
                this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.ERROR_WSS_PROCESSING_INFO, new String[]{ExceptionUtils.getMessage((Throwable)processorException)}, ExceptionUtils.getDebugException((Throwable)processorException));
                this.d = AssertionStatus.SERVER_ERROR;
                return false;
            }
            catch (InvalidDocumentSignatureException invalidDocumentSignatureException) {
                this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.ERROR_WSS_SIGNATURE, new String[]{ExceptionUtils.getMessage((Throwable)invalidDocumentSignatureException)}, ExceptionUtils.getDebugException((Throwable)invalidDocumentSignatureException));
                this.a.setAuditLevel(Level.WARNING);
                this.d = AssertionStatus.BAD_REQUEST;
                return false;
            }
            catch (InvalidDocumentFormatException invalidDocumentFormatException) {
                this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.ERROR_WSS_PROCESSING_INFO, new String[]{ExceptionUtils.getMessage((Throwable)invalidDocumentFormatException)}, ExceptionUtils.getDebugException((Throwable)invalidDocumentFormatException));
                this.a.setAuditLevel(Level.WARNING);
                this.d = AssertionStatus.BAD_REQUEST;
                return false;
            }
            catch (KeyUsageException keyUsageException) {
                this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.CERT_KEY_USAGE, keyUsageException.getActivityName());
                this.a.setAuditLevel(Level.WARNING);
                this.d = AssertionStatus.BAD_REQUEST;
                return false;
            }
            catch (GeneralSecurityException generalSecurityException) {
                this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.ERROR_WSS_PROCESSING_INFO, new String[]{ExceptionUtils.getMessage((Throwable)generalSecurityException)}, ExceptionUtils.getDebugException((Throwable)generalSecurityException));
                this.a.setAuditLevel(Level.WARNING);
                this.d = AssertionStatus.SERVER_ERROR;
                return false;
            }
            catch (SAXException sAXException) {
                this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.ERROR_RETRIEVE_XML, null, sAXException);
                this.a.setAuditLevel(Level.WARNING);
                this.d = AssertionStatus.SERVER_ERROR;
                return false;
            }
            catch (BadSecurityContextException badSecurityContextException) {
                SoapVersion soapVersion;
                this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.ERROR_WSS_PROCESSING_INFO, ExceptionUtils.getMessage((Throwable)badSecurityContextException));
                this.a.setAuditLevel(Level.WARNING);
                SoapFaultLevel soapFaultLevel2 = new SoapFaultLevel();
                try {
                    soapFaultLevel2.setLevel(1);
                    soapVersion = this.a.getService() != null ? this.a.getService().getSoapVersion() : SoapVersion.UNKNOWN;
                }
                catch (SAXException sAXException) {
                    throw au.a(sAXException);
                }
                SoapVersion soapVersion2 = soapVersion;
                soapFaultLevel2.setFaultTemplate(SoapFaultUtils.badContextTokenFault((SoapVersion)soapVersion2, (String)badSecurityContextException.getWsscNamespace(), (String)this.b(this.a)));
                this.a.setFaultlevel(soapFaultLevel2);
                this.d = AssertionStatus.FAILED;
                return false;
            }
            catch (IOException iOException) {
                this.e = iOException;
                return false;
            }
            this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.WSS_PROCESSING_COMPLETE);
        }
        return true;
    }

    @Override
    public boolean notifyResolveCatchAll() {
        boolean bl2;
        block5: {
            block4: {
                try {
                    try {
                        if (this.e != null || this.d != null) break block4;
                    }
                    catch (IllegalStateException illegalStateException) {
                        throw au.a(illegalStateException);
                    }
                    bl2 = true;
                    break block5;
                }
                catch (IllegalStateException illegalStateException) {
                    throw au.a(illegalStateException);
                }
            }
            bl2 = false;
        }
        return bl2;
    }

    private String b(PolicyEnforcementContext policyEnforcementContext) {
        Object object;
        HttpRequestKnob httpRequestKnob = (HttpRequestKnob)policyEnforcementContext.getRequest().getKnob(HttpRequestKnob.class);
        try {
            if (httpRequestKnob == null) {
                this.this$0.y.warning(h[1]);
                return "";
            }
        }
        catch (IllegalStateException illegalStateException) {
            throw au.a(illegalStateException);
        }
        try {
            object = httpRequestKnob.getQueryString() == null ? httpRequestKnob.getRequestUrl() : httpRequestKnob.getRequestUrl() + "?" + httpRequestKnob.getQueryString();
        }
        catch (IllegalStateException illegalStateException) {
            throw au.a(illegalStateException);
        }
        return object;
    }

    private boolean e() throws PublishedService.ServiceException {
        block6: {
            try {
                try {
                    try {
                        if (!this.a.getRequest().getMimeKnob().isMultipart() || this.a.getService().isMultipart()) break block6;
                    }
                    catch (PublishedService.ServiceException serviceException) {
                        throw au.a((Exception)((Object)serviceException));
                    }
                    if (this.f.getPolicyMetadata().isMultipart()) break block6;
                }
                catch (PublishedService.ServiceException serviceException) {
                    throw au.a((Exception)((Object)serviceException));
                }
                this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.MULTIPART_NOT_ALLOWED);
                return true;
            }
            catch (PublishedService.ServiceException serviceException) {
                throw au.a((Exception)((Object)serviceException));
            }
        }
        return false;
    }

    private void f() throws PolicyAssertionException, IOException {
        block7: {
            block8: {
                try {
                    try {
                        if (this.e == null) break block7;
                        if (!(this.e instanceof IOException)) break block8;
                    }
                    catch (PolicyAssertionException policyAssertionException) {
                        throw au.a((Exception)((Object)policyAssertionException));
                    }
                    throw (IOException)this.e;
                }
                catch (PolicyAssertionException policyAssertionException) {
                    throw au.a((Exception)((Object)policyAssertionException));
                }
            }
            try {
                if (this.e instanceof PolicyAssertionException) {
                    throw (PolicyAssertionException)((Object)this.e);
                }
            }
            catch (PolicyAssertionException policyAssertionException) {
                throw au.a((Exception)((Object)policyAssertionException));
            }
            throw ExceptionUtils.wrap((Throwable)this.e);
        }
    }

    private boolean g() throws IOException, PolicyAssertionException {
        block5: {
            try {
                if (this.c || !this.a.getService().isWssProcessingEnabled()) break block5;
            }
            catch (IOException iOException) {
                throw au.a(iOException);
            }
            PolicyMetadata policyMetadata = this.f.getPolicyMetadata();
            Set<ServiceCache.ServiceMetadata> set = Collections.singleton(new ServiceCache.ServiceMetadata(policyMetadata, true));
            try {
                if (!this.notifyPreParseServices(this.a.getRequest(), set)) {
                    this.f();
                    return true;
                }
            }
            catch (IOException iOException) {
                throw au.a(iOException);
            }
        }
        return false;
    }

    private AssertionStatus h() throws IOException, PolicyAssertionException {
        return this.processPreServicePolicies(PolicyType.TAG_GLOBAL_MESSAGE_RECEIVED, (AuditDetailMessage)MessageProcessingMessages.RUNNING_MESSAGE_RECEIVED_POLICY, (AuditDetailMessage)MessageProcessingMessages.ERROR_MESSAGE_RECEIVED);
    }

    private AssertionStatus a(boolean bl2) throws IOException, PolicyAssertionException {
        return this.a(PolicyType.TAG_GLOBAL_MESSAGE_COMPLETED, (AuditDetailMessage)MessageProcessingMessages.RUNNING_MESSAGE_COMPLETED_POLICY, (AuditDetailMessage)MessageProcessingMessages.ERROR_MESSAGE_COMPLETED, bl2);
    }

    private AssertionStatus i() throws IOException, PolicyAssertionException {
        AssertionStatus assertionStatus = AssertionStatus.NONE;
        if (!this.c) {
            assertionStatus = this.processPreServicePolicies(PolicyType.TAG_GLOBAL_PRE_SECURITY, (AuditDetailMessage)MessageProcessingMessages.RUNNING_PRE_SECURITY_POLICY, (AuditDetailMessage)MessageProcessingMessages.ERROR_PRE_SECURITY);
        }
        if (assertionStatus == AssertionStatus.NONE) {
            assertionStatus = this.processPreServicePolicies(PolicyType.TAG_GLOBAL_PRE_SERVICE, (AuditDetailMessage)MessageProcessingMessages.RUNNING_PRE_SERVICE_POLICY, (AuditDetailMessage)MessageProcessingMessages.ERROR_PRE_SERVICE);
        }
        return assertionStatus;
    }

    public boolean processPreServicePoliciesNoThrow(String string, AuditDetailMessage auditDetailMessage, AuditDetailMessage auditDetailMessage2) {
        boolean bl2 = true;
        try {
            AssertionStatus assertionStatus = this.processPreServicePolicies(string, auditDetailMessage, auditDetailMessage2);
            if (assertionStatus != AssertionStatus.NONE) {
                this.d = assertionStatus;
                bl2 = false;
            }
        }
        catch (IOException iOException) {
            this.e = iOException;
            bl2 = false;
        }
        catch (PolicyAssertionException policyAssertionException) {
            this.e = policyAssertionException;
            bl2 = false;
        }
        return bl2;
    }

    /*
     * Enabled force condition propagation
     * Lifted jumps to return sites
     */
    public AssertionStatus processPreServicePolicies(String string, AuditDetailMessage auditDetailMessage, AuditDetailMessage auditDetailMessage2) throws IOException, PolicyAssertionException {
        AssertionStatus assertionStatus = AssertionStatus.NONE;
        Set<String> set = this.this$0.d.getPoliciesByTypeAndTag(PolicyType.GLOBAL_FRAGMENT, string);
        if (set.isEmpty()) return assertionStatus;
        this.this$0.x.logAndAudit(auditDetailMessage);
        try {
            for (String string2 : set) {
                assertionStatus = this.a(this.this$0.d, this.a, string2);
                try {
                    if (assertionStatus == AssertionStatus.NONE) continue;
                    return assertionStatus;
                }
                catch (PolicyAssertionException policyAssertionException) {
                    throw au.a((Exception)((Object)policyAssertionException));
                    return assertionStatus;
                }
            }
        }
        catch (PolicyAssertionException policyAssertionException) {
            this.this$0.x.logAndAudit(auditDetailMessage2, ExceptionUtils.getMessage((Throwable)policyAssertionException));
            throw policyAssertionException;
        }
        catch (RuntimeException runtimeException) {
            this.this$0.x.logAndAudit(auditDetailMessage2, ExceptionUtils.getMessage((Throwable)runtimeException));
            throw runtimeException;
        }
    }

    /*
     * Enabled force condition propagation
     * Lifted jumps to return sites
     */
    private AssertionStatus a(String string, AuditDetailMessage auditDetailMessage, AuditDetailMessage auditDetailMessage2, boolean bl2) throws IOException, PolicyAssertionException {
        AssertionStatus assertionStatus = AssertionStatus.NONE;
        Set<String> set = this.this$0.d.getPoliciesByTypeAndTag(PolicyType.GLOBAL_FRAGMENT, string);
        if (set.isEmpty()) return assertionStatus;
        this.this$0.x.logAndAudit(auditDetailMessage);
        try {
            for (String string2 : set) {
                assertionStatus = this.a(this.this$0.d, this.a, string2);
                try {
                    if (assertionStatus == AssertionStatus.NONE) continue;
                    return assertionStatus;
                }
                catch (PolicyAssertionException policyAssertionException) {
                    throw au.a((Exception)((Object)policyAssertionException));
                    return assertionStatus;
                }
            }
        }
        catch (PolicyAssertionException policyAssertionException) {
            PolicyAssertionException policyAssertionException2;
            String[] stringArray;
            AuditDetailMessage auditDetailMessage3;
            Auditor auditor;
            try {
                auditor = this.this$0.x;
                auditDetailMessage3 = auditDetailMessage2;
                String[] stringArray2 = new String[1];
                stringArray = stringArray2;
                stringArray2[0] = ExceptionUtils.getMessage((Throwable)policyAssertionException);
                policyAssertionException2 = bl2 ? null : policyAssertionException;
            }
            catch (PolicyAssertionException policyAssertionException3) {
                throw au.a((Exception)((Object)policyAssertionException3));
            }
            try {
                auditor.logAndAudit(auditDetailMessage3, stringArray, policyAssertionException2);
                if (bl2) return assertionStatus;
                throw policyAssertionException;
            }
            catch (PolicyAssertionException policyAssertionException4) {
                throw au.a((Exception)((Object)policyAssertionException4));
            }
        }
        catch (RuntimeException runtimeException) {
            RuntimeException runtimeException2;
            String[] stringArray;
            AuditDetailMessage auditDetailMessage4;
            Auditor auditor;
            try {
                auditor = this.this$0.x;
                auditDetailMessage4 = auditDetailMessage2;
                String[] stringArray3 = new String[1];
                stringArray = stringArray3;
                stringArray3[0] = ExceptionUtils.getMessage((Throwable)runtimeException);
                runtimeException2 = bl2 ? null : runtimeException;
            }
            catch (PolicyAssertionException policyAssertionException) {
                throw au.a((Exception)((Object)policyAssertionException));
            }
            try {
                auditor.logAndAudit(auditDetailMessage4, stringArray, runtimeException2);
                if (bl2) return assertionStatus;
                throw runtimeException;
            }
            catch (PolicyAssertionException policyAssertionException) {
                throw au.a((Exception)((Object)policyAssertionException));
            }
        }
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     * Loose catch block
     */
    private AssertionStatus a(PolicyCache policyCache, PolicyEnforcementContext policyEnforcementContext, String string) throws PolicyAssertionException, IOException {
        PolicyEnforcementContext policyEnforcementContext2;
        ServerPolicyHandle serverPolicyHandle;
        AssertionStatus assertionStatus;
        block12: {
            block11: {
                assertionStatus = null;
                serverPolicyHandle = null;
                policyEnforcementContext2 = null;
                try {
                    serverPolicyHandle = policyCache.getServerPolicy(string);
                    if (serverPolicyHandle != null) {
                        policyEnforcementContext2 = PolicyEnforcementContextFactory.createPolicyEnforcementContext(policyEnforcementContext, true);
                        this.this$0.debugManager.onMessageArrived(policyEnforcementContext2, serverPolicyHandle.getPolicyMetadata().getPolicyHeader().getGoid());
                        assertionStatus = serverPolicyHandle.checkRequest(policyEnforcementContext2);
                        break block11;
                    }
                    assertionStatus = AssertionStatus.NONE;
                }
                catch (Throwable throwable) {
                    block13: {
                        try {
                            try {
                                if (serverPolicyHandle == null || policyEnforcementContext2 == null) break block13;
                            }
                            catch (PolicyAssertionException policyAssertionException) {
                                throw au.a((Exception)((Object)policyAssertionException));
                            }
                            this.this$0.debugManager.onMessageFinished(policyEnforcementContext2, assertionStatus);
                        }
                        catch (PolicyAssertionException policyAssertionException) {
                            throw au.a((Exception)((Object)policyAssertionException));
                        }
                    }
                    ResourceUtils.closeQuietly(policyEnforcementContext2);
                    ResourceUtils.closeQuietly((Closeable)serverPolicyHandle);
                    throw throwable;
                }
            }
            if (serverPolicyHandle == null) break block12;
            try {
                block14: {
                    if (policyEnforcementContext2 == null) break block12;
                    break block14;
                    catch (PolicyAssertionException policyAssertionException) {
                        throw au.a((Exception)((Object)policyAssertionException));
                    }
                }
                this.this$0.debugManager.onMessageFinished(policyEnforcementContext2, assertionStatus);
            }
            catch (PolicyAssertionException policyAssertionException) {
                throw au.a((Exception)((Object)policyAssertionException));
            }
        }
        ResourceUtils.closeQuietly((Closeable)policyEnforcementContext2);
        ResourceUtils.closeQuietly((Closeable)serverPolicyHandle);
        return assertionStatus;
    }

    public void lookupServerPolicy() throws ServiceResolutionException {
        Goid goid = this.a.getService().getGoid();
        try {
            this.f = this.this$0.c.getServerPolicy(goid);
            if (this.f == null) {
                throw new ServiceResolutionException(h[11] + String.valueOf(goid) + h[10] + this.a.getService().getName() + ")");
            }
        }
        catch (ServiceResolutionException serviceResolutionException) {
            throw au.a(serviceResolutionException);
        }
        this.a.setServicePolicyMetadata(this.f.getPolicyMetadata());
    }

    @Override
    public void close() throws IOException {
        ResourceUtils.closeQuietly((Closeable)this.f);
        this.f = null;
    }

    private AssertionStatus c(PolicyEnforcementContext policyEnforcementContext) throws PolicyAssertionException, IOException {
        AssertionStatus assertionStatus = AssertionStatus.NONE;
        for (ServerAssertion serverAssertion : policyEnforcementContext.getDeferredAssertions()) {
            assertionStatus = serverAssertion.checkRequest(policyEnforcementContext);
            try {
                if (assertionStatus == AssertionStatus.NONE) continue;
                return assertionStatus;
            }
            catch (PolicyAssertionException policyAssertionException) {
                throw au.a((Exception)((Object)policyAssertionException));
            }
        }
        return assertionStatus;
    }

    /*
     * Loose catch block
     */
    private void a(AssertionStatus assertionStatus) throws IOException, SAXException, PolicyAssertionException {
        block24: {
            block27: {
                WSSecurityProcessorUtils.addSignatureConfirmations(this.a.getResponse(), (Audit)this.this$0.x);
                if (assertionStatus != AssertionStatus.NONE) break block24;
                if (!this.a.getResponse().isXml()) break block24;
                break block27;
                catch (Exception exception) {
                    throw au.a(exception);
                }
            }
            try {
                block28: {
                    if (this.a.getResponse().getSecurityKnob().getDecorationRequirements().length <= 0) break block24;
                    break block28;
                    catch (Exception exception) {
                        throw au.a(exception);
                    }
                }
                if (!this.a.getResponse().isSoap()) break block24;
            }
            catch (Exception exception) {
                throw au.a(exception);
            }
            try {
                DecorationRequirements[] decorationRequirementsArray = this.a.getResponse().getSecurityKnob().getDecorationRequirements();
                SecurityKnob securityKnob = this.a.getRequest().getSecurityKnob();
                this.j();
                this.a(decorationRequirementsArray, securityKnob);
                for (DecorationRequirements decorationRequirements : decorationRequirementsArray) {
                    block25: {
                        block26: {
                            block29: {
                                if (decorationRequirements == null) break block25;
                                if (this.b == null) break block25;
                                break block29;
                                catch (Exception exception) {
                                    throw au.a(exception);
                                }
                            }
                            try {
                                block30: {
                                    if (this.b.getSecurityNS() == null) break block26;
                                    break block30;
                                    catch (Exception exception) {
                                        throw au.a(exception);
                                    }
                                }
                                decorationRequirements.getNamespaceFactory().setWsseNs(this.b.getSecurityNS());
                            }
                            catch (Exception exception) {
                                throw au.a(exception);
                            }
                        }
                        try {
                            if (this.b.getWSUNS() != null) {
                                decorationRequirements.getNamespaceFactory().setWsuNs(this.b.getWSUNS());
                            }
                        }
                        catch (Exception exception) {
                            throw au.a(exception);
                        }
                        try {
                            if (this.b.getWsscNS() != null) {
                                decorationRequirements.getNamespaceFactory().setWsscNs(this.b.getWsscNS());
                            }
                        }
                        catch (Exception exception) {
                            throw au.a(exception);
                        }
                        try {
                            if (this.b.isDerivedKeySeen()) {
                                decorationRequirements.setUseDerivedKeys(true);
                            }
                        }
                        catch (Exception exception) {
                            throw au.a(exception);
                        }
                    }
                    this.this$0.e.decorateMessage(this.a.getResponse(), decorationRequirements);
                }
            }
            catch (Exception exception) {
                this.this$0.x.logAndAudit((AuditDetailMessage)MessageProcessingMessages.ERROR_WSS_RESPONSE, ExceptionUtils.getMessage((Throwable)exception));
                throw new PolicyAssertionException(null, h[8], (Throwable)exception);
            }
        }
    }

    private void a(DecorationRequirements[] decorationRequirementsArray, SecurityKnob securityKnob) {
        block9: {
            String string;
            block11: {
                block10: {
                    try {
                        try {
                            try {
                                if (securityKnob.getProcessorResult() == null || securityKnob.getProcessorResult().getProcessedActor() == null) break block9;
                            }
                            catch (IllegalStateException illegalStateException) {
                                throw au.a(illegalStateException);
                            }
                            if (securityKnob.getProcessorResult().getProcessedActor() != SecurityActor.NOACTOR) break block10;
                        }
                        catch (IllegalStateException illegalStateException) {
                            throw au.a(illegalStateException);
                        }
                        string = null;
                        break block11;
                    }
                    catch (IllegalStateException illegalStateException) {
                        throw au.a(illegalStateException);
                    }
                }
                string = securityKnob.getProcessorResult().getProcessedActorUri();
            }
            String string2 = string;
            for (DecorationRequirements decorationRequirements : decorationRequirementsArray) {
                try {
                    if (!SoapConstants.L7_SOAP_ACTOR.equals(decorationRequirements.getSecurityHeaderActor())) continue;
                    decorationRequirements.setSecurityHeaderActor(string2);
                }
                catch (IllegalStateException illegalStateException) {
                    throw au.a(illegalStateException);
                }
            }
        }
    }

    /*
     * Loose catch block
     */
    private void j() throws InvalidDocumentFormatException {
        block13: {
            try {
                String string;
                block12: {
                    string = this.a.getSavedRequestL7aMessageId();
                    try {
                        if (string != null || !this.a.getRequest().isSoap()) break block12;
                    }
                    catch (InvalidDocumentFormatException invalidDocumentFormatException) {
                        throw au.a((Exception)((Object)invalidDocumentFormatException));
                    }
                    try {
                        string = SoapUtil.getL7aMessageId((Document)this.a.getRequest().getXmlKnob().getDocumentReadOnly());
                    }
                    catch (InvalidDocumentFormatException invalidDocumentFormatException) {
                    }
                    catch (SAXException sAXException) {
                        // empty catch block
                    }
                }
                if (string == null) break block13;
                try {
                    block14: {
                        if (string.length() <= 0) break block13;
                        break block14;
                        catch (InvalidDocumentFormatException invalidDocumentFormatException) {
                            throw au.a((Exception)((Object)invalidDocumentFormatException));
                        }
                    }
                    SoapUtil.setL7aRelatesTo((Document)this.a.getResponse().getXmlKnob().getDocumentWritable(), (String)string);
                }
                catch (InvalidDocumentFormatException invalidDocumentFormatException) {
                    throw au.a((Exception)((Object)invalidDocumentFormatException));
                }
            }
            catch (IOException iOException) {
                String[] stringArray = h;
                this.this$0.y.log(Level.WARNING, stringArray[7] + ExceptionUtils.getMessage((Throwable)iOException), ExceptionUtils.getDebugException((Throwable)iOException));
            }
            catch (SAXException sAXException) {
                this.this$0.y.log(Level.WARNING, h[2] + ExceptionUtils.getMessage((Throwable)sAXException), ExceptionUtils.getDebugException((Throwable)sAXException));
            }
        }
    }

    /*
     * Unable to fully structure code
     */
    static {
        block12: {
            block11: {
                var5 = new String[16];
                var3_1 = 0;
                var2_2 = "\u0001dc,X'\u0012sT@\u0015\u001d:\t'!`<N;\n%dvc\u001d\u001c0`|7R F4d|<O5\u00126!{7^;\u000b:ouyh\u0006*+\u0006os;Q1F'n2<E \u00142bfyP1\u0015 `u<\u001d\u001d\"sg`6Pt\u00146pg<N \\s\u0013 d`/T7\u0003~g}5Y1\u0014~qs-U\u0002i!\n d`/T7\u0003~hv9\u0007ss:T:\u0001sd|8_8\u00037!}7\u001d'\u0003!w{:Xt\u0004&u27Rt\u0012!`q<\u001d$\t?hq \u001d7\t=g{>H&\u00037+\u0006os;Q1F'n2<E \u00142bfyP1\u0015 `u<\u001d\u001d\"sg`6Pt\u00146pg<N \\s*\u0015`{5X0F'n28M$\n*!E\nnt\u00026b}+\\ \u000f<o2-Rt\u00146rb6S'\u0003\t5n~=X&K:e\u0002s)M d`/T7\u0003shayO1\u0015<md<Yt\u0004&u2-U1F0n`+X'\u0016<ov0S3F#n~0^-F:r20S\"\u0007?hvy[;\u0014srw+K=\u00056!U\u0016t\u0010FC\u001eda*\\3\u0003sq`6^1\u0015 h|>\u001d2\u0007?r{?T1\u0002seg<\u001d \tsq}*Iy\u00156sd0^1F:ox<^ \u000f<o2+X'\u0016<oa<\u0011'ss:Xz\u0016<m{:Dz\u0001&hv";
                var4_3 = "\u0001dc,X'\u0012sT@\u0015\u001d:\t'!`<N;\n%dvc\u001d\u001c0`|7R F4d|<O5\u00126!{7^;\u000b:ouyh\u0006*+\u0006os;Q1F'n2<E \u00142bfyP1\u0015 `u<\u001d\u001d\"sg`6Pt\u00146pg<N \\s\u0013 d`/T7\u0003~g}5Y1\u0014~qs-U\u0002i!\n d`/T7\u0003~hv9\u0007ss:T:\u0001sd|8_8\u00037!}7\u001d'\u0003!w{:Xt\u0004&u27Rt\u0012!`q<\u001d$\t?hq \u001d7\t=g{>H&\u00037+\u0006os;Q1F'n2<E \u00142bfyP1\u0015 `u<\u001d\u001d\"sg`6Pt\u00146pg<N \\s*\u0015`{5X0F'n28M$\n*!E\nnt\u00026b}+\\ \u000f<o2-Rt\u00146rb6S'\u0003\t5n~=X&K:e\u0002s)M d`/T7\u0003shayO1\u0015<md<Yt\u0004&u2-U1F0n`+X'\u0016<ov0S3F#n~0^-F:r20S\"\u0007?hvy[;\u0014srw+K=\u00056!U\u0016t\u0010FC\u001eda*\\3\u0003sq`6^1\u0015 h|>\u001d2\u0007?r{?T1\u0002seg<\u001d \tsq}*Iy\u00156sd0^1F:ox<^ \u000f<o2+X'\u0016<oa<\u0011'ss:Xz\u0016<m{:Dz\u0001&hv".length();
                var1_4 = 26;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = au.a(v0, au.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "g#'h\u0013pDAG2:n\nzOsf8{\t`@s#un\b|Bq5&w\u0014t\u0001p30>\u000e|\u0001d403\tvSb/6{ZzO~#6j\u0013|O440m\n|Og#";
                    var4_3 = "g#'h\u0013pDAG2:n\nzOsf8{\t`@s#un\b|Bq5&w\u0014t\u0001p30>\u000e|\u0001d403\tvSb/6{ZzO~#6j\u0013|O440m\n|Og#".length();
                    var1_4 = 7;
                    var0_5 = -1;
lbl22:
                    // 2 sources

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

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

                ** continue;
            }
        }
        au.h = var5;
        try {
            v5 = MessageProcessor.class.desiredAssertionStatus() == false;
        }
        catch (IllegalStateException v6) {
            throw au.a(v6);
        }
        au.g = v5;
    }

    private static Exception a(Exception exception) {
        return exception;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x51);
        }
        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 -> 100;
                    case 1 -> 54;
                    case 2 -> 37;
                    case 3 -> 110;
                    case 4 -> 10;
                    case 5 -> 99;
                    default -> 81;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

