/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.cluster.ClusterNodeInfo
 *  com.l7tech.util.CausedIOException
 *  com.l7tech.util.ConfigFactory
 *  com.l7tech.util.ExceptionUtils
 *  com.l7tech.util.HexUtils
 *  com.l7tech.util.IOUtils
 *  com.l7tech.util.InetAddressUtil
 *  com.l7tech.util.ResourceUtils
 *  org.apache.commons.configuration2.PropertiesConfiguration
 *  org.apache.commons.configuration2.builder.BuilderParameters
 *  org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder
 *  org.apache.commons.configuration2.builder.fluent.Parameters
 *  org.apache.commons.configuration2.convert.DefaultListDelimiterHandler
 *  org.apache.commons.configuration2.convert.ListDelimiterHandler
 *  org.apache.commons.configuration2.ex.ConfigurationException
 *  org.apache.commons.configuration2.io.FileBased
 *  org.apache.commons.configuration2.io.FileHandler
 *  org.springframework.orm.hibernate5.HibernateCallback
 *  org.springframework.orm.hibernate5.support.HibernateDaoSupport
 */
package com.l7tech.server.cluster;

import com.l7tech.gateway.common.cluster.ClusterNodeInfo;
import com.l7tech.server.NodePropertiesLoader;
import com.l7tech.server.cluster.t;
import com.l7tech.util.CausedIOException;
import com.l7tech.util.ConfigFactory;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.HexUtils;
import com.l7tech.util.IOUtils;
import com.l7tech.util.InetAddressUtil;
import com.l7tech.util.ResourceUtils;
import java.io.BufferedInputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.Properties;
import java.util.Set;
import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.configuration2.PropertiesConfiguration;
import org.apache.commons.configuration2.builder.BuilderParameters;
import org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder;
import org.apache.commons.configuration2.builder.fluent.Parameters;
import org.apache.commons.configuration2.convert.DefaultListDelimiterHandler;
import org.apache.commons.configuration2.convert.ListDelimiterHandler;
import org.apache.commons.configuration2.ex.ConfigurationException;
import org.apache.commons.configuration2.io.FileBased;
import org.apache.commons.configuration2.io.FileHandler;
import org.springframework.orm.hibernate5.HibernateCallback;
import org.springframework.orm.hibernate5.support.HibernateDaoSupport;

public class ClusterIDManager
extends HibernateDaoSupport {
    public static final String DEFAULT_NETWORK_INTERFACE;
    private static final Set<String> a;
    private static final Logger b;
    private static final String c;
    private static final String d;
    private static final String e;
    private static final String f;
    private static final String g;
    private static Pattern h;
    private static final String i;
    private static final String j;
    private static final String k;
    private final NodePropertiesLoader l;
    private String m;
    private static final String[] n;

    public ClusterIDManager(NodePropertiesLoader nodePropertiesLoader) {
        this.l = nodePropertiesLoader;
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    public String thisNodeId() {
        Object object;
        if (this.m != null) {
            return this.m;
        }
        String[] stringArray = n;
        String string = this.loadNodeProperty(stringArray[24]);
        if (string != null) {
            b.config(stringArray[9] + string + stringArray[23]);
        }
        try {
            object = this.getMacs();
            ArrayList<String> arrayList = new ArrayList<String>();
            if (string != null) {
                arrayList.add(string);
            }
            String string2 = null;
            Iterator<String> iterator = object.iterator();
            while (iterator.hasNext()) {
                String string3 = iterator.next();
                if (string2 == null) {
                    string2 = string3;
                }
                arrayList.add(ClusterIDManager.c(string3));
            }
            for (String string3 : arrayList) {
                ClusterNodeInfo clusterNodeInfo = this.d(string3);
                if (clusterNodeInfo == null) continue;
                String string4 = clusterNodeInfo.getAddress();
                String string5 = clusterNodeInfo.getNodeIdentifier();
                String string6 = clusterNodeInfo.getName();
                stringArray = n;
                b.config(stringArray[27] + string6 + stringArray[34] + string5 + stringArray[17] + string4 + ")");
                this.m = clusterNodeInfo.getNodeIdentifier();
                break;
            }
            this.m = string;
            if (this.m == null) {
                this.m = ClusterIDManager.a();
            }
        }
        finally {
            if (string == null && (object = this.m) != null) {
                this.f((String)object);
            }
        }
        return this.m;
    }

    public Collection<String> getMacs() {
        ArrayList<String> arrayList = new ArrayList<String>();
        String[] stringArray = n;
        String string = ConfigFactory.getProperty((String)stringArray[37]);
        if (string != null && string.length() > 0) {
            arrayList.add(string);
        } else {
            stringArray = n;
            b.fine(stringArray[28]);
        }
        if (arrayList.isEmpty()) {
            stringArray = n;
            String string2 = this.loadNodeProperty(stringArray[1]);
            if (string2 != null && string2.length() > 0) {
                arrayList.add(string2);
            } else {
                stringArray = n;
                b.fine(stringArray[25]);
            }
        }
        if (arrayList.isEmpty()) {
            stringArray = n;
            arrayList.addAll(ClusterIDManager.e(stringArray[43]));
            if (arrayList.isEmpty()) {
                b.fine(stringArray[42]);
            }
        }
        if (arrayList.isEmpty()) {
            arrayList.addAll(ClusterIDManager.b());
            if (arrayList.isEmpty()) {
                stringArray = n;
                b.fine(stringArray[21]);
            }
        }
        if (arrayList.isEmpty()) {
            arrayList.addAll(ClusterIDManager.c());
            if (arrayList.isEmpty()) {
                stringArray = n;
                b.fine(stringArray[26]);
            }
        }
        b.config(n[16] + String.valueOf(arrayList));
        return arrayList;
    }

    /*
     * Loose catch block
     * Enabled force condition propagation
     * Lifted jumps to return sites
     */
    static String a(String string) {
        String string2 = null;
        try {
            for (NetworkInterface networkInterface : Collections.list(NetworkInterface.getNetworkInterfaces())) {
                block10: {
                    byte[] byArray = networkInterface.getHardwareAddress();
                    if (byArray == null) continue;
                    try {
                        block11: {
                            if (string == null) break block10;
                            break block11;
                            catch (SocketException socketException) {
                                throw ClusterIDManager.a(socketException);
                            }
                        }
                        if (!string.equalsIgnoreCase(InetAddressUtil.formatMac((byte[])byArray))) continue;
                    }
                    catch (SocketException socketException) {
                        throw ClusterIDManager.a(socketException);
                    }
                }
                ArrayList<InetAddress> arrayList = Collections.list(networkInterface.getInetAddresses());
                if (!arrayList.isEmpty()) {
                    string2 = ((InetAddress)arrayList.iterator().next()).getHostAddress();
                }
                try {
                    if (string == null) continue;
                    return string2;
                }
                catch (SocketException socketException) {
                    throw ClusterIDManager.a(socketException);
                    return string2;
                }
            }
        }
        catch (SocketException socketException) {
            String[] stringArray = n;
            b.log(Level.FINE, stringArray[46] + socketException.getMessage() + stringArray[23], ExceptionUtils.getDebugException((Throwable)socketException));
        }
        return string2;
    }

    static String[] b(String string) {
        return Pattern.compile(n[11], 8).split(string);
    }

    private static String a() {
        return UUID.randomUUID().toString().replace("-", "");
    }

    private static String c(String string) {
        String string2 = string + n[12];
        byte[] byArray = HexUtils.encodeUtf8((String)string2);
        byte[] byArray2 = HexUtils.getMd5Digest((byte[])byArray);
        return HexUtils.encodeMd5Digest((byte[])byArray2).toLowerCase();
    }

    private ClusterNodeInfo d(String string) {
        try {
            return (ClusterNodeInfo)this.getHibernateTemplate().execute((HibernateCallback)new t(this, string));
        }
        catch (Exception exception) {
            String string2 = n[18];
            b.log(Level.WARNING, string2, exception);
            return null;
        }
    }

    private static Collection<String> e(String string) {
        ArrayList<String> arrayList = new ArrayList<String>();
        try {
            NetworkInterface networkInterface = NetworkInterface.getByName(string);
            try {
                if (networkInterface != null) {
                    arrayList.add(InetAddressUtil.formatMac((byte[])networkInterface.getHardwareAddress()));
                }
            }
            catch (SocketException socketException) {
                throw ClusterIDManager.a(socketException);
            }
        }
        catch (SocketException socketException) {
            try {
                if (b.isLoggable(Level.WARNING)) {
                    b.log(Level.WARNING, n[3] + string + n[33] + socketException.getMessage() + n[23], ExceptionUtils.getDebugException((Throwable)socketException));
                }
            }
            catch (SocketException socketException2) {
                throw ClusterIDManager.a(socketException2);
            }
        }
        return arrayList;
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    private static Collection<String> b() {
        Object[] objectArray;
        String[] stringArray;
        Process process = null;
        InputStream inputStream = null;
        String string = null;
        ArrayList<String> arrayList = new ArrayList<String>();
        try {
            block18: {
                try {
                    stringArray = n;
                    process = Runtime.getRuntime().exec(stringArray[13]);
                    inputStream = new BufferedInputStream(process.getInputStream());
                    objectArray = IOUtils.slurpStream((InputStream)inputStream);
                    string = new String((byte[])objectArray);
                    process.waitFor();
                    if (inputStream == null) break block18;
                }
                catch (Throwable throwable) {
                    try {
                        if (inputStream != null) {
                            inputStream.close();
                        }
                    }
                    catch (IOException iOException) {
                        throw ClusterIDManager.a(iOException);
                    }
                    try {
                        if (process != null) {
                            process.destroy();
                        }
                    }
                    catch (IOException iOException) {
                        throw ClusterIDManager.a(iOException);
                    }
                    throw throwable;
                }
                inputStream.close();
            }
            try {
                if (process != null) {
                    process.destroy();
                }
            }
            catch (IOException iOException) {
                throw ClusterIDManager.a(iOException);
            }
        }
        catch (IOException iOException) {
            stringArray = n;
            b.log(Level.FINE, stringArray[0] + iOException.getMessage() + stringArray[23], ExceptionUtils.getDebugException((Throwable)iOException));
        }
        catch (InterruptedException interruptedException) {
            stringArray = n;
            b.log(Level.FINE, stringArray[29] + interruptedException.getMessage() + stringArray[23], ExceptionUtils.getDebugException((Throwable)interruptedException));
        }
        try {
            if (string == null) {
                return Collections.emptyList();
            }
        }
        catch (IOException iOException) {
            throw ClusterIDManager.a(iOException);
        }
        for (byte by2 : objectArray = (Object[])ClusterIDManager.b(string)) {
            Matcher matcher = h.matcher((CharSequence)by2);
            if (!matcher.matches()) continue;
            String string2 = matcher.group(1);
            string2 = string2.replace('-', ':');
            arrayList.add(string2);
        }
        return arrayList;
    }

    /*
     * Exception decompiling
     */
    private static Collection<String> c() {
        /*
         * 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 [9[UNCONDITIONALDOLOOP]], but top level block is 2[TRYBLOCK]
         *     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");
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     * Loose catch block
     */
    public String loadNodeProperty(String string) {
        String string2;
        block13: {
            block15: {
                block11: {
                    block12: {
                        string2 = this.l.getProperty(string, null);
                        try {
                            if (null != string2) {
                                return string2;
                            }
                        }
                        catch (IOException iOException) {
                            throw ClusterIDManager.a(iOException);
                        }
                        if (!this.l.isDiskless()) break block11;
                        try {
                            block14: {
                                if (!a.contains(string)) break block12;
                                break block14;
                                catch (IOException iOException) {
                                    throw ClusterIDManager.a(iOException);
                                }
                            }
                            b.log(Level.FINE, n[40] + string + n[7]);
                            break block13;
                        }
                        catch (IOException iOException) {
                            throw ClusterIDManager.a(iOException);
                        }
                    }
                    String[] stringArray = n;
                    b.log(Level.WARNING, stringArray[14] + string + stringArray[38]);
                    break block13;
                }
                String[] stringArray = n;
                String string3 = ConfigFactory.getProperty((String)stringArray[22]);
                if (string3 == null) break block15;
                File file = new File(string3);
                File file2 = new File(file, stringArray[47]);
                if (!file2.isFile()) break block13;
                Properties properties = new Properties();
                FileInputStream fileInputStream = null;
                try {
                    fileInputStream = new FileInputStream(file2);
                    properties.load(fileInputStream);
                    string2 = properties.getProperty(string);
                }
                catch (IOException iOException) {
                    try {
                        stringArray = n;
                        b.log(Level.WARNING, stringArray[15], iOException);
                    }
                    catch (Throwable throwable) {
                        ResourceUtils.closeQuietly(fileInputStream);
                        throw throwable;
                    }
                    ResourceUtils.closeQuietly((Closeable)fileInputStream);
                    break block13;
                }
                ResourceUtils.closeQuietly((Closeable)fileInputStream);
                break block13;
            }
            b.warning(n[31]);
        }
        return string2;
    }

    private void f(String string) {
        try {
            if (this.l.isDiskless()) {
                b.warning(n[39]);
                return;
            }
        }
        catch (ConfigurationException configurationException) {
            throw ClusterIDManager.a((Exception)((Object)configurationException));
        }
        String[] stringArray = n;
        b.config(stringArray[48] + string + stringArray[8]);
        String string2 = ConfigFactory.getProperty((String)stringArray[41]);
        if (string2 != null) {
            File file = new File(string2);
            File file2 = new File(file, stringArray[44]);
            if (file.isDirectory()) {
                try {
                    PropertiesConfiguration propertiesConfiguration;
                    FileBasedConfigurationBuilder fileBasedConfigurationBuilder = new FileBasedConfigurationBuilder(PropertiesConfiguration.class);
                    fileBasedConfigurationBuilder.configure(new BuilderParameters[]{(BuilderParameters)new Parameters().properties().setListDelimiterHandler((ListDelimiterHandler)new DefaultListDelimiterHandler('\u0000'))});
                    fileBasedConfigurationBuilder.setAutoSave(false);
                    try {
                        propertiesConfiguration = (PropertiesConfiguration)fileBasedConfigurationBuilder.getConfiguration();
                    }
                    catch (ConfigurationException configurationException) {
                        stringArray = n;
                        throw new CausedIOException(stringArray[35], (Throwable)configurationException);
                    }
                    FileHandler fileHandler = new FileHandler((FileBased)propertiesConfiguration);
                    try {
                        if (file2.isFile()) {
                            fileHandler.load(file2);
                        }
                    }
                    catch (ConfigurationException configurationException) {
                        throw ClusterIDManager.a((Exception)((Object)configurationException));
                    }
                    stringArray = n;
                    propertiesConfiguration.setProperty(stringArray[5], (Object)string);
                    fileHandler.save(file2);
                }
                catch (IOException iOException) {
                    stringArray = n;
                    b.log(Level.WARNING, stringArray[45], iOException);
                }
                catch (ConfigurationException configurationException) {
                    stringArray = n;
                    b.log(Level.WARNING, stringArray[20], configurationException);
                }
            } else {
                stringArray = n;
                b.warning(stringArray[30]);
            }
        } else {
            b.warning(n[10]);
        }
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[52];
                var3_1 = 0;
                var2_2 = "`\u0016%F8 D@\u0010#@$g\u0003L\u00144F$fJBDp\u0010K\u000b3LdcOP\u0017#L8.ND\u0007'\u000bOmu9*\u000by\u0013\u000b^g\\Ty\u0013zu=\\T\b8 u=-\u007fR8 \u0004\u0016w\u007fRMy\u0003 `\u0016%F8 D@\u0010#@$g\u0003K\u0001#^%rH\u0005\r9]/rED\u00072\t\u0010K\u000b3LdcOP\u0017#L8.ND\u0007\u0007K\u000b3LdiG\fF\b\"Z>eQz\r9O%\u0011\u0002D>ZjnLQD3L,iM@\u0000y\u0002\u0002J\u001bi\u000b6M/d\u0003K\u000b3LjiG@\n#@,iFWD>Zj';f\u000b\"E. MJ\u0010wM/tFW\t>G/ @J\n1@-uQD\u0010>F$ GL\u00162J>oQ\\D#FjsBS\u0001wG%dFL\u0000y\u0002\u0001O\t\b\u00002O+uOQ;\rL\u00144F$fJBDxH&l\u001ck\u000b9\u0004%pWL\u000b9H& mJ\u00002\t:rLU\u0001%]3 \u0004\u001e`\u0016%F8 OJ\u00053@$g\u0003K\u000b3LjpQJ\u00142[>iFVJ\u0015p\u0017>G- ND\u0007wH.dQ@\u0017$L9:\u0003\u0005\tD\u001eYp\u001f@\u0016%F8 Q@\u0010%@/vJK\u0003wJ&uPQ\u0001%\t9tBQ\u0011$%\u0005\u0013?L8e\u0003F\b\"Z>eQz\r9O%.MJ\u00002`.eMQ\r1@/r\u0003\u0018D\u001e`\u0016%F8 PQ\u000b%@$g\u0003K\u000b3LjpQJ\u00142[>iFVJ%f\u00059G%t\u0003B\u0001#\t'a@\u0005\u00053M8ePVD1[%m\u0003L\u00144F$fJBJ!F\u000b:\u0007&7W@\u0007?\u00079eQS\u0001%\u0007)oMC\r0m#rFF\u00108[3\u0002\u0002J\u0007K\u000b3LdiGGk\u000b3LjmBFD6M.rFV\u0017wG%dF\u0005\u00002O#nFAD>GjnLA\u0001yY8oS@\u0016#@/s\u000f\u0005\u0017<@:pJK\u0003w]\"iP\u0005\u00178\\8cF\u000b!f\u00059G%t\u0003B\u0001#\t'a@\u0005\u00053M8ePVD1[%m\u0003o\u0005!Hd\rp\u0017>G- P@\u0016!L8 Nf\u00059G%t\u0003B\u0001#\t'a@\u0005\u00053M8ePVD1[%m\u0003V\u001d$]/m\u0003U\u00168Y/rW\\D\u007f\u000e)oN\u000b\b`]/cK\u000b\u0007;\\9tFWJ:H)AGA\u00162Z9'\n\u000b\u0018`\u0016%F8 D@\u0010#@$g\u0003L\u00144F$fJBDp;f\u000b\"E. MJ\u0010wM/tFW\t>G/ @J\n1@-uQD\u0010>F$ GL\u00162J>oQ\\D#FjsBS\u0001wG%dFL\u0000y,f\u000b\"E. MJ\u0010wM/tFW\t>G/ @J\n1@-uQD\u0010>F$ GL\u00162J>oQ\\J\bV\u00170v/tK\u0015\u0002\u0005C\u0005\u0005L\u001eMp\u0019f\u00059G%t\u0003B\u0001#\t)oMC\r0\\8aWL\u000b9\u0007\"`\u0016%F8 D@\u0010#@$g\u0003K\u0001#^%rH\u0005\r9]/rED\u00072Zj'\u001dF\u000b:\u0007&7W@\u0007?\u0007)lVV\u00102[dmBF%3M8ePV\u0011\u0002D>ZjnLQD3L,iM@\u0000yMf\u000b\"E. MJ\u0010wZ>oQ@D9F.e\u0003L\u00002G>iEL\u0001%\t>o\u0003K\u000b3LdpQJ\u00142[>iFVDz\t.iPN\b2Z9 @J\n1@- FK\u00055E/d\r\u0018j\u0014#@%nBID\u0019F.e\u0003U\u00168Y/rW\\Dp!F\u000b:\u0007&7W@\u0007?\u00079eQS\u0001%\u0007)oMC\r0m#rFF\u00108[3-f\u00059G%t\u0003B\u0001#\t'a@\u0005\u00053M8ePVD8OjsPB;2]\"0\u0003C\u00168DjJBS\u0005y\bV\u00170v/tK\u0015\u000fK\u000b3LdpQJ\u00142[>iFV\u001e`\u0016%F8 OJ\u00053@$g\u0003K\u000b3LjpQJ\u00142[>iFVJ\"`\u0016%F8 D@\u0010#@$g\u0003K\u0001#^%rH\u0005\r9]/rED\u00072Zj'\u000fK\u000b3LdpQJ\u00142[>iFV\u0019v\u00108[#nD\u0005\n8M/ JA\u00019]#fJ@\u0016w\u000e\u000eK\u000b3L\u0003dFK\u0010>O#eQ";
                var4_3 = "`\u0016%F8 D@\u0010#@$g\u0003L\u00144F$fJBDp\u0010K\u000b3LdcOP\u0017#L8.ND\u0007'\u000bOmu9*\u000by\u0013\u000b^g\\Ty\u0013zu=\\T\b8 u=-\u007fR8 \u0004\u0016w\u007fRMy\u0003 `\u0016%F8 D@\u0010#@$g\u0003K\u0001#^%rH\u0005\r9]/rED\u00072\t\u0010K\u000b3LdcOP\u0017#L8.ND\u0007\u0007K\u000b3LdiG\fF\b\"Z>eQz\r9O%\u0011\u0002D>ZjnLQD3L,iM@\u0000y\u0002\u0002J\u001bi\u000b6M/d\u0003K\u000b3LjiG@\n#@,iFWD>Zj';f\u000b\"E. MJ\u0010wM/tFW\t>G/ @J\n1@-uQD\u0010>F$ GL\u00162J>oQ\\D#FjsBS\u0001wG%dFL\u0000y\u0002\u0001O\t\b\u00002O+uOQ;\rL\u00144F$fJBDxH&l\u001ck\u000b9\u0004%pWL\u000b9H& mJ\u00002\t:rLU\u0001%]3 \u0004\u001e`\u0016%F8 OJ\u00053@$g\u0003K\u000b3LjpQJ\u00142[>iFVJ\u0015p\u0017>G- ND\u0007wH.dQ@\u0017$L9:\u0003\u0005\tD\u001eYp\u001f@\u0016%F8 Q@\u0010%@/vJK\u0003wJ&uPQ\u0001%\t9tBQ\u0011$%\u0005\u0013?L8e\u0003F\b\"Z>eQz\r9O%.MJ\u00002`.eMQ\r1@/r\u0003\u0018D\u001e`\u0016%F8 PQ\u000b%@$g\u0003K\u000b3LjpQJ\u00142[>iFVJ%f\u00059G%t\u0003B\u0001#\t'a@\u0005\u00053M8ePVD1[%m\u0003L\u00144F$fJBJ!F\u000b:\u0007&7W@\u0007?\u00079eQS\u0001%\u0007)oMC\r0m#rFF\u00108[3\u0002\u0002J\u0007K\u000b3LdiGGk\u000b3LjmBFD6M.rFV\u0017wG%dF\u0005\u00002O#nFAD>GjnLA\u0001yY8oS@\u0016#@/s\u000f\u0005\u0017<@:pJK\u0003w]\"iP\u0005\u00178\\8cF\u000b!f\u00059G%t\u0003B\u0001#\t'a@\u0005\u00053M8ePVD1[%m\u0003o\u0005!Hd\rp\u0017>G- P@\u0016!L8 Nf\u00059G%t\u0003B\u0001#\t'a@\u0005\u00053M8ePVD1[%m\u0003V\u001d$]/m\u0003U\u00168Y/rW\\D\u007f\u000e)oN\u000b\b`]/cK\u000b\u0007;\\9tFWJ:H)AGA\u00162Z9'\n\u000b\u0018`\u0016%F8 D@\u0010#@$g\u0003L\u00144F$fJBDp;f\u000b\"E. MJ\u0010wM/tFW\t>G/ @J\n1@-uQD\u0010>F$ GL\u00162J>oQ\\D#FjsBS\u0001wG%dFL\u0000y,f\u000b\"E. MJ\u0010wM/tFW\t>G/ @J\n1@-uQD\u0010>F$ GL\u00162J>oQ\\J\bV\u00170v/tK\u0015\u0002\u0005C\u0005\u0005L\u001eMp\u0019f\u00059G%t\u0003B\u0001#\t)oMC\r0\\8aWL\u000b9\u0007\"`\u0016%F8 D@\u0010#@$g\u0003K\u0001#^%rH\u0005\r9]/rED\u00072Zj'\u001dF\u000b:\u0007&7W@\u0007?\u0007)lVV\u00102[dmBF%3M8ePV\u0011\u0002D>ZjnLQD3L,iM@\u0000yMf\u000b\"E. MJ\u0010wZ>oQ@D9F.e\u0003L\u00002G>iEL\u0001%\t>o\u0003K\u000b3LdpQJ\u00142[>iFVDz\t.iPN\b2Z9 @J\n1@- FK\u00055E/d\r\u0018j\u0014#@%nBID\u0019F.e\u0003U\u00168Y/rW\\Dp!F\u000b:\u0007&7W@\u0007?\u00079eQS\u0001%\u0007)oMC\r0m#rFF\u00108[3-f\u00059G%t\u0003B\u0001#\t'a@\u0005\u00053M8ePVD8OjsPB;2]\"0\u0003C\u00168DjJBS\u0005y\bV\u00170v/tK\u0015\u000fK\u000b3LdpQJ\u00142[>iFV\u001e`\u0016%F8 OJ\u00053@$g\u0003K\u000b3LjpQJ\u00142[>iFVJ\"`\u0016%F8 D@\u0010#@$g\u0003K\u0001#^%rH\u0005\r9]/rED\u00072Zj'\u000fK\u000b3LdpQJ\u00142[>iFV\u0019v\u00108[#nD\u0005\n8M/ JA\u00019]#fJ@\u0016w\u000e\u000eK\u000b3L\u0003dFK\u0010>O#eQ".length();
                var1_4 = 24;
                var0_5 = -1;
lbl7:
                // 2 sources

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

                while (true) {
                    var5[var3_1++] = ClusterIDManager.a(v0, ClusterIDManager.g(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "\t\\r\u000e )\u0005\u001a]i\u0006r\u0015\u0000\u0001HrCi$I\fB|\u0010sj\u001d\fApMl}\u001d\nMuMc&\u001c\u001cZx\u0011.'\b\foy\u0007r/\u001a\u001c";
                    var4_3 = "\t\\r\u000e )\u0005\u001a]i\u0006r\u0015\u0000\u0001HrCi$I\fB|\u0010sj\u001d\fApMl}\u001d\nMuMc&\u001c\u001cZx\u0011.'\b\foy\u0007r/\u001a\u001c".length();
                    var1_4 = 27;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 98;
                        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++] = ClusterIDManager.a(v0, ClusterIDManager.g(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;
            }
        }
        ClusterIDManager.n = var5;
        ClusterIDManager.e = ClusterIDManager.n[24];
        ClusterIDManager.c = ClusterIDManager.n[22];
        ClusterIDManager.g = ClusterIDManager.n[51];
        ClusterIDManager.f = ClusterIDManager.n[4];
        ClusterIDManager.d = ClusterIDManager.n[47];
        ClusterIDManager.j = ClusterIDManager.n[49];
        ClusterIDManager.i = ClusterIDManager.n[6];
        ClusterIDManager.DEFAULT_NETWORK_INTERFACE = ClusterIDManager.n[32];
        var0_6 = ClusterIDManager.n;
        ClusterIDManager.a = Set.of(var0_6[4]);
        ClusterIDManager.b = Logger.getLogger(ClusterIDManager.class.getName());
        ClusterIDManager.h = Pattern.compile(var0_6[2], 32);
        ClusterIDManager.k = var0_6[50] + ClusterNodeInfo.class.getName() + var0_6[19];
    }

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

    private static char[] g(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0xB);
        }
        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 -> 13;
                    case 1 -> 76;
                    case 2 -> 127;
                    case 3 -> 1;
                    case 4 -> 98;
                    case 5 -> 40;
                    default -> 11;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

