/*
 * Decompiled with CFR 0.152.
 */
package com.l7tech.server;

import com.l7tech.server.EntityVersionChecker;
import com.l7tech.server.b7;
import com.l7tech.server.w;
import com.l7tech.server.x;
import java.util.ArrayList;
import java.util.List;
import java.util.TimerTask;
import java.util.logging.Level;

class b1
extends TimerTask {
    private final List<b7> a;
    final EntityVersionChecker this$0;
    private static final String[] b;

    private b1(EntityVersionChecker entityVersionChecker) {
        this.this$0 = entityVersionChecker;
        this.a = new ArrayList<b7>();
    }

    private void a(List<b7> list) {
        this.a.addAll(list);
    }

    @Override
    public void run() {
        Level level;
        EntityVersionChecker.a.fine(new w(this));
        long l2 = System.currentTimeMillis();
        this.this$0.h.reset();
        for (int i2 = 0; i2 < this.a.size(); ++i2) {
            TimerTask timerTask = this.a.get(i2);
            try {
                if (this.this$0.e == null) {
                    EntityVersionChecker.a.info(b[1]);
                    break;
                }
            }
            catch (Exception exception) {
                throw b1.a(exception);
            }
            try {
                timerTask.run();
                continue;
            }
            catch (Exception exception) {
                EntityVersionChecker.a.log(Level.WARNING, b[0], exception);
            }
        }
        this.this$0.h.reset();
        long l3 = System.currentTimeMillis() - l2;
        try {
            level = l3 > 1000L ? Level.INFO : Level.FINE;
        }
        catch (Exception exception) {
            throw b1.a(exception);
        }
        Level level2 = level;
        EntityVersionChecker.a.log(level2, new x(this, l3));
    }

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

    /*
     * Enabled aggressive block sorting
     */
    static {
        String[] stringArray = new String[2];
        int n2 = 0;
        String string = "\u0007K\u0007C8{W7W\u001bE$<\u00054\\\u0007_#4KbZ\u001dI)0\u00056X\u0006G+\u0014\\\u0007_#4KbZ\u001dI)0\u00056X\u0006Gj>]+M\u001cB-{A7\\UX%{V*L\u0001H%,Kl";
        int n3 = "\u0007K\u0007C8{W7W\u001bE$<\u00054\\\u0007_#4KbZ\u001dI)0\u00056X\u0006G+\u0014\\\u0007_#4KbZ\u001dI)0\u00056X\u0006Gj>]+M\u001cB-{A7\\UX%{V*L\u0001H%,Kl".length();
        int n4 = 32;
        int n5 = -1;
        while (true) {
            int n6 = ++n5;
            stringArray[n2++] = b1.a(16, b1.a(string.substring(n6, n6 + n4)));
            if ((n5 += n4) >= n3) {
                b = stringArray;
                return;
            }
            n4 = string.charAt(n5);
        }
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x35);
        }
        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 -> 82;
                    case 1 -> 41;
                    case 2 -> 101;
                    case 3 -> 60;
                    case 4 -> 90;
                    case 5 -> 75;
                    default -> 53;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

