/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.util.Functions$BinaryVoid
 *  com.l7tech.util.Functions$Unary
 *  org.apache.mina.core.future.ConnectFuture
 *  org.apache.mina.core.future.IoFuture
 *  org.apache.mina.core.service.IoConnector
 *  org.apache.mina.core.service.IoHandler
 *  org.apache.mina.core.session.IoSession
 *  org.apache.mina.transport.socket.nio.NioSocketConnector
 */
package com.l7tech.server.log.syslog.impl;

import com.l7tech.server.log.syslog.SyslogConfig;
import com.l7tech.server.log.syslog.SyslogConnectionListener;
import com.l7tech.server.log.syslog.SyslogProtocol;
import com.l7tech.server.log.syslog.impl.MinaManagedSyslog;
import com.l7tech.server.log.syslog.impl.MinaSecureSyslogHandler;
import com.l7tech.server.log.syslog.impl.SyslogSslClientSupport;
import com.l7tech.server.log.syslog.impl.d;
import com.l7tech.server.log.syslog.impl.f;
import com.l7tech.server.log.syslog.impl.g;
import com.l7tech.util.Functions;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.channels.UnresolvedAddressException;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.logging.Level;
import org.apache.mina.core.future.ConnectFuture;
import org.apache.mina.core.future.IoFuture;
import org.apache.mina.core.service.IoConnector;
import org.apache.mina.core.service.IoHandler;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.transport.socket.nio.NioSocketConnector;

class b
implements Runnable {
    private static final long a = 15L;
    private static final long b = 1000L;
    private static final int c = 1;
    private final boolean d;
    private int e;
    private final Object f;
    private d g;
    private SyslogConfig h;
    private IoConnector i;
    private g j;
    private final AtomicBoolean k;
    private final AtomicBoolean l;
    private final AtomicInteger m;
    private final AtomicReference<IoSession> n;
    private final AtomicReference<SyslogConnectionListener> o;
    private final boolean p;
    private final BlockingQueue<f> q;
    private int r;
    private String s;
    private static final String[] t;

    /*
     * Exception decompiling
     */
    b(SyslogConfig var1_1, BlockingQueue<f> var2_2) {
        /*
         * This method has failed to decompile.  When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
         * 
         * org.benf.cfr.reader.util.ConfusedCFRException: Tried to end blocks [2[TRYBLOCK]], but top level block is 3[SWITCH]
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.processEndingBlocks(Op04StructuredStatement.java:435)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:484)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201)
         *     at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94)
         *     at org.benf.cfr.reader.entities.Method.analyse(Method.java:531)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942)
         *     at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257)
         *     at org.benf.cfr.reader.Driver.doJar(Driver.java:139)
         *     at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76)
         *     at org.benf.cfr.reader.Main.main(Main.java:54)
         */
        throw new IllegalStateException("Decompilation failed");
    }

    @Override
    public void run() {
        this.h();
    }

    public String toString() {
        try {
            if (this.s == null) {
                this.s = t[4] + this.h.getProtocol().name() + "-" + String.valueOf(this.n());
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
        }
        return this.s;
    }

    private void a(SyslogConnectionListener syslogConnectionListener) {
        this.o.set(syslogConnectionListener);
    }

    private void a() {
        this.k.set(false);
    }

    boolean b() {
        return this.k.get();
    }

    /*
     * Loose catch block
     */
    private void a(IoSession ioSession, String string) {
        block14: {
            block15: {
                block13: {
                    block12: {
                        block16: {
                            if (ioSession != null) break block12;
                            if (this.n.get() == null) break block12;
                            break block16;
                            catch (InterruptedException interruptedException) {
                                throw com.l7tech.server.log.syslog.impl.b.a(interruptedException);
                            }
                        }
                        try {
                            block17: {
                                if (string.equals(this.n.get().toString())) break block12;
                                break block17;
                                catch (InterruptedException interruptedException) {
                                    throw com.l7tech.server.log.syslog.impl.b.a(interruptedException);
                                }
                            }
                            return;
                        }
                        catch (InterruptedException interruptedException) {
                            throw com.l7tech.server.log.syslog.impl.b.a(interruptedException);
                        }
                    }
                    try {
                        if (ioSession != null) break block13;
                        this.n.set(null);
                        this.m();
                        Thread.sleep(this.h.getReconnectInterval());
                        this.l.set(true);
                    }
                    catch (IllegalArgumentException illegalArgumentException) {
                        throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
                    }
                    {
                        catch (InterruptedException interruptedException) {
                            Thread.currentThread().interrupt();
                        }
                        break block14;
                    }
                }
                try {
                    if (this.n.get() == null) break block15;
                    this.n.set(ioSession);
                    break block14;
                }
                catch (InterruptedException interruptedException) {
                    throw com.l7tech.server.log.syslog.impl.b.a(interruptedException);
                }
            }
            this.n.set(ioSession);
            this.l();
        }
    }

    private void c() {
        this.e = 0;
    }

    /*
     * Loose catch block
     */
    private void d() {
        try {
            block7: {
                block6: {
                    if (!this.d) break block6;
                    try {
                        block8: {
                            if (this.m.get() > 0) break block6;
                            break block8;
                            catch (InterruptedException interruptedException) {
                                throw com.l7tech.server.log.syslog.impl.b.a(interruptedException);
                            }
                        }
                        this.e();
                        this.m.set(this.h.getMaxReconnectAttempts() + 1);
                        break block7;
                    }
                    catch (InterruptedException interruptedException) {
                        throw com.l7tech.server.log.syslog.impl.b.a(interruptedException);
                    }
                }
                Thread.sleep(this.h.getReconnectInterval());
            }
            this.l.set(true);
            this.o();
        }
        catch (InterruptedException interruptedException) {
            Thread.currentThread().interrupt();
        }
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    private void e() {
        try {
            if (this.e > this.h.getSyslogAddresses().length) {
                MinaManagedSyslog.d.log(Level.WARNING, t[2]);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
        }
        String string = this.toString();
        Object object = this.f;
        synchronized (object) {
            this.s = null;
            ++this.e;
            this.r = (this.r + 1) % this.h.getSyslogAddresses().length;
            MinaManagedSyslog.d.log(Level.WARNING, t[8], new Object[]{string, this.toString()});
        }
    }

    void f() {
        this.l.set(false);
        this.i.setConnectTimeoutMillis((long)this.h.getConnectTimeOut());
        try {
            String string = this.toString();
            ConnectFuture connectFuture = this.i.connect(this.n());
            connectFuture.addListener(arg_0 -> this.lambda$connect$0(connectFuture, string, arg_0));
        }
        catch (UnresolvedAddressException unresolvedAddressException) {
            this.m();
            this.d();
        }
    }

    private void g() {
        block11: {
            block9: {
                block10: {
                    try {
                        if (this.n.get() != null) {
                            this.n.get().closeNow();
                        }
                    }
                    catch (UnresolvedAddressException unresolvedAddressException) {
                        throw com.l7tech.server.log.syslog.impl.b.a(unresolvedAddressException);
                    }
                    try {
                        if (this.i != null) break block9;
                        if (!SyslogSslClientSupport.isInitialized()) break block10;
                    }
                    catch (UnresolvedAddressException unresolvedAddressException) {
                        throw com.l7tech.server.log.syslog.impl.b.a(unresolvedAddressException);
                    }
                    MinaSecureSyslogHandler minaSecureSyslogHandler = new MinaSecureSyslogHandler(this.p(), this.q(), this.h.getSslKeystoreAlias(), this.h.getSslKeystoreId(), this::d, this.h.isValidateExtendedKeyUsage());
                    this.j = minaSecureSyslogHandler;
                    this.i = new NioSocketConnector();
                    minaSecureSyslogHandler.setupConnectorForSSL(this.i);
                    this.i.setHandler((IoHandler)this.j);
                    this.i.setConnectTimeoutMillis((long)this.h.getConnectTimeOut());
                    break block9;
                }
                return;
            }
            this.l.set(false);
            try {
                long l2 = System.currentTimeMillis();
                ConnectFuture connectFuture = this.i.connect(this.n()).addListener(this::lambda$connectSSL$1);
                try {
                    connectFuture.awaitUninterruptibly(1000L);
                    if (!MinaManagedSyslog.d.isLoggable(Level.FINE) || !connectFuture.isDone()) break block11;
                }
                catch (UnresolvedAddressException unresolvedAddressException) {
                    throw com.l7tech.server.log.syslog.impl.b.a(unresolvedAddressException);
                }
                String[] stringArray = t;
                StringBuilder stringBuilder = new StringBuilder(stringArray[9]);
                stringBuilder.append(System.currentTimeMillis() - l2).append("\n");
                IoSession ioSession = connectFuture.getSession();
                stringBuilder.append(stringArray[15]).append(ioSession.getCreationTime()).append("\n");
                stringBuilder.append(stringArray[5]).append(ioSession.isConnected()).append("\n");
                stringBuilder.append(stringArray[1]).append(ioSession.isClosing()).append("\n");
                stringBuilder.append(stringArray[10]).append(ioSession.getTransportMetadata().getName()).append("\n");
                stringBuilder.append(stringArray[6]).append(((MinaSecureSyslogHandler)this.j).a(ioSession)).append("\n");
                stringBuilder.append(stringArray[16]).append(this.n()).append("\n");
                stringBuilder.append(stringArray[3]).append(this.a(this.n()));
                MinaManagedSyslog.d.fine(stringBuilder.toString());
            }
            catch (UnresolvedAddressException unresolvedAddressException) {
                this.m();
                this.d();
            }
        }
    }

    private Set<IoSession> a(SocketAddress socketAddress) {
        Map map = this.i.getManagedSessions();
        HashSet<IoSession> hashSet = new HashSet<IoSession>();
        for (IoSession ioSession : map.values()) {
            try {
                if (!ioSession.getRemoteAddress().equals(socketAddress)) continue;
                hashSet.add(ioSession);
            }
            catch (IllegalArgumentException illegalArgumentException) {
                throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
            }
        }
        return hashSet;
    }

    /*
     * Exception decompiling
     */
    private void h() {
        /*
         * This method has failed to decompile.  When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
         * 
         * org.benf.cfr.reader.util.ConfusedCFRException: Started 3 blocks at once
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.getStartingBlocks(Op04StructuredStatement.java:412)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:487)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201)
         *     at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94)
         *     at org.benf.cfr.reader.entities.Method.analyse(Method.java:531)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942)
         *     at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257)
         *     at org.benf.cfr.reader.Driver.doJar(Driver.java:139)
         *     at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76)
         *     at org.benf.cfr.reader.Main.main(Main.java:54)
         */
        throw new IllegalStateException("Decompilation failed");
    }

    boolean i() {
        return this.l.get();
    }

    private boolean a(IoSession ioSession) {
        boolean bl2;
        block9: {
            block8: {
                try {
                    try {
                        try {
                            try {
                                if (ioSession == null || !ioSession.isConnected()) break block8;
                            }
                            catch (IllegalArgumentException illegalArgumentException) {
                                throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
                            }
                            if (ioSession.isClosing()) break block8;
                        }
                        catch (IllegalArgumentException illegalArgumentException) {
                            throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
                        }
                        if (!ioSession.isActive()) break block8;
                    }
                    catch (IllegalArgumentException illegalArgumentException) {
                        throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
                    }
                    bl2 = true;
                    break block9;
                }
                catch (IllegalArgumentException illegalArgumentException) {
                    throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
                }
            }
            bl2 = false;
        }
        return bl2;
    }

    private boolean j() {
        boolean bl2;
        block5: {
            block4: {
                try {
                    try {
                        if (this.q.isEmpty() && this.g == null) break block4;
                    }
                    catch (IllegalArgumentException illegalArgumentException) {
                        throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
                    }
                    bl2 = true;
                    break block5;
                }
                catch (IllegalArgumentException illegalArgumentException) {
                    throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
                }
            }
            bl2 = false;
        }
        return bl2;
    }

    private d k() throws InterruptedException {
        if (this.g != null) {
            d d10 = this.g;
            this.g = null;
            return d10;
        }
        f f2 = this.q.poll(100L, TimeUnit.MILLISECONDS);
        if (f2 != null) {
            String string = MinaManagedSyslog.access$000(f2.a(), f2.getFacility(), f2.getSeverity(), f2.getPriority(), f2.getHost(), f2.getProcess(), f2.getThreadId(), f2.getTime(), f2.getMessage());
            return new d(f2.a().getCharset(), f2.a().getDelimiter(), f2.a().getMaxLength(), string);
        }
        return null;
    }

    private void l() {
        block4: {
            SyslogConnectionListener syslogConnectionListener = this.o.get();
            try {
                try {
                    if (syslogConnectionListener == null || SyslogProtocol.UDP == this.h.getProtocol()) break block4;
                }
                catch (IllegalArgumentException illegalArgumentException) {
                    throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
                }
                syslogConnectionListener.notifyConnected(this.n());
            }
            catch (IllegalArgumentException illegalArgumentException) {
                throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
            }
        }
    }

    private void m() {
        block4: {
            SyslogConnectionListener syslogConnectionListener = this.o.get();
            try {
                try {
                    if (syslogConnectionListener == null || SyslogProtocol.UDP == this.h.getProtocol()) break block4;
                }
                catch (IllegalArgumentException illegalArgumentException) {
                    throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
                }
                syslogConnectionListener.notifyDisconnected(this.n());
            }
            catch (IllegalArgumentException illegalArgumentException) {
                throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
            }
        }
    }

    private SocketAddress n() {
        return this.h.getSyslogAddresses()[this.r];
    }

    private void o() {
        InetSocketAddress inetSocketAddress = (InetSocketAddress)this.n();
        this.h.getSyslogAddresses()[this.r] = new InetSocketAddress(inetSocketAddress.getHostName(), inetSocketAddress.getPort());
        this.s = null;
    }

    private Functions.BinaryVoid<IoSession, String> p() {
        return this::a;
    }

    private Functions.Unary<Boolean, IoSession> q() {
        return this::lambda$getCurrentSessionCallback$2;
    }

    private Boolean lambda$getCurrentSessionCallback$2(IoSession ioSession) {
        boolean bl2;
        block5: {
            block4: {
                try {
                    try {
                        if (this.n.get() == null || !this.n.get().equals((Object)ioSession)) break block4;
                    }
                    catch (IllegalArgumentException illegalArgumentException) {
                        throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
                    }
                    bl2 = true;
                    break block5;
                }
                catch (IllegalArgumentException illegalArgumentException) {
                    throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
                }
            }
            bl2 = false;
        }
        return bl2;
    }

    private void lambda$connectSSL$1(IoFuture ioFuture) {
        try {
            if (!((ConnectFuture)ioFuture).isConnected()) {
                MinaManagedSyslog.d.log(Level.WARNING, t[12] + this.toString() + ")");
                this.d();
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
        }
    }

    private void lambda$connect$0(ConnectFuture connectFuture, String string, IoFuture ioFuture) {
        block3: {
            block2: {
                try {
                    if (connectFuture.isConnected()) break block2;
                    MinaManagedSyslog.d.log(Level.WARNING, t[11] + string + ")");
                    this.d();
                    break block3;
                }
                catch (IllegalArgumentException illegalArgumentException) {
                    throw com.l7tech.server.log.syslog.impl.b.a(illegalArgumentException);
                }
            }
            this.c();
        }
    }

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

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[17];
                var3_1 = 0;
                var2_2 = "\u0005(\u001aKNor$#\u001b\u0013[xc?4_@[du9(\u0018\u0013Msb<)\u0018\u0013Sob#'\u0018VM&1##\u0011W[x15>\u0016GWdvp\u000b95<_Qyx>!E\u0013-\u0011*\u0013\u0013msb<)\u0018\u0013Xkx<)\tVL*y?5\u000b@\u001ebp&#_Q[o\u007fp'\u000bG[ga$#\u001b\u0016\u0003#\f@We\u007f#f\u0019\\L*p4\"\rVMy+p\u000e\u001d#\f@_mt\u0003#\u0011W[x<\u000b\u0013)\u0011][ie5\"E\u0013\f\u0003\u00153`[yb9)\u0011\t\u001e9\u0005(\u001aKNor$#\u001b\u0013[xc?4_@[du9(\u0018\u0013Msb<)\u0018\u0013Sob#'\u0018VM&1##\u0011W[x15>\u0016GWdvp\u001d\u0003?\f_Qm16'\u0016_Q|t\"|_H\u000ew1m{B\r\u001eq -\u0019\u0013)\u0011][ie9)\u0011\u0013]e| *\u001aG[&1$2\u001c\u000e\u000b\u00044\u001e]Mz~\"2E\u0013\"\u0003?\f_Qm13)\u0011][ie9)\u0011\u0013_~e5+\u000fG\u001elp9*\u001aW\u001e\"&\u0003?\f_Qm1\u0003\u00153\u0013]e\u007f>#\u001cGWe\u007fp'\u000bG[ga$f\u0019RWft4fW)\u0005(\u001aKNor$#\u001b\u0013[xc?4_@[du9(\u0018\u0013Msb<)\u0018\u0013Sob#'\u0018VM*\u00119(\tRRcup6\r\\Jer?*_";
                var4_3 = "\u0005(\u001aKNor$#\u001b\u0013[xc?4_@[du9(\u0018\u0013Msb<)\u0018\u0013Sob#'\u0018VM&1##\u0011W[x15>\u0016GWdvp\u000b95<_Qyx>!E\u0013-\u0011*\u0013\u0013msb<)\u0018\u0013Xkx<)\tVL*y?5\u000b@\u001ebp&#_Q[o\u007fp'\u000bG[ga$#\u001b\u0016\u0003#\f@We\u007f#f\u0019\\L*p4\"\rVMy+p\u000e\u001d#\f@_mt\u0003#\u0011W[x<\u000b\u0013)\u0011][ie5\"E\u0013\f\u0003\u00153`[yb9)\u0011\t\u001e9\u0005(\u001aKNor$#\u001b\u0013[xc?4_@[du9(\u0018\u0013Msb<)\u0018\u0013Sob#'\u0018VM&1##\u0011W[x15>\u0016GWdvp\u001d\u0003?\f_Qm16'\u0016_Q|t\"|_H\u000ew1m{B\r\u001eq -\u0019\u0013)\u0011][ie9)\u0011\u0013]e| *\u001aG[&1$2\u001c\u000e\u000b\u00044\u001e]Mz~\"2E\u0013\"\u0003?\f_Qm13)\u0011][ie9)\u0011\u0013_~e5+\u000fG\u001elp9*\u001aW\u001e\"&\u0003?\f_Qm1\u0003\u00153\u0013]e\u007f>#\u001cGWe\u007fp'\u000bG[ga$f\u0019RWft4fW)\u0005(\u001aKNor$#\u001b\u0013[xc?4_@[du9(\u0018\u0013Msb<)\u0018\u0013Sob#'\u0018VM*\u00119(\tRRcup6\r\\Jer?*_".length();
                var1_4 = 57;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = com.l7tech.server.log.syslog.impl.b.a(v0, com.l7tech.server.log.syslog.impl.b.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "GgH\u0004\u0013!;Wp^\u0016\u000e+o4\u000fGmX\u001c\u001f:\u0014pfI\u0012\t=o4";
                    var4_3 = "GgH\u0004\u0013!;Wp^\u0016\u000e+o4\u000fGmX\u001c\u001f:\u0014pfI\u0012\t=o4".length();
                    var1_4 = 15;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 72;
                        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++] = com.l7tech.server.log.syslog.impl.b.a(v0, com.l7tech.server.log.syslog.impl.b.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;
            }
        }
        com.l7tech.server.log.syslog.impl.b.t = var5;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x1D);
        }
        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 -> 92;
                    case 1 -> 74;
                    case 2 -> 115;
                    case 3 -> 63;
                    case 4 -> 50;
                    case 5 -> 6;
                    default -> 29;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

