/*
 * Decompiled with CFR 0.152.
 */
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;

/*
 * Duplicate member names - consider using --renamedupmembers true
 */
public final class dz
extends ep
implements mt,
jz {
    private final Vector A;
    private final Hashtable i = new Hashtable();
    private final Hashtable j = new Hashtable();
    private final bq n;
    private final bq u;
    private final w[] y;
    private final Vector z = new Vector();
    private boolean B;
    private jt a;
    private iy b;
    private hx c;
    private int d = -1;
    private lk e;
    private long f;
    private lk g;
    private long h;
    private int k;
    private jp m;
    private hi v;
    private jp w;
    private jp x;

    public final void j_() {
    }

    public final void i_() {
    }

    public final void h_() {
    }

    public final void k_() {
    }

    private void m() {
        this.i.clear();
        this.j.clear();
        this.z.removeAllElements();
        this.A.removeAllElements();
    }

    private void s() {
        int n;
        this.r.b(jy.v);
        this.t();
        Object object = jj.a();
        w w2 = jj.a(false);
        dz.a(this.c, lh.d(128), (w)object);
        dz.a(this.c, lh.d(169), w2);
        dz.a(this.c, 4);
        if (this.g != null) {
            object = this.i.keys();
            while (object.hasMoreElements()) {
                nh nh2 = (nh)object.nextElement();
                if (!nh2.a) continue;
                lk lk2 = (lk)this.i.get(nh2);
                String string = lk2.g(5);
                if (ed.b(string)) {
                    string = lk2.g(6);
                }
                dz.a(this.c, string, w2);
            }
        }
        int n2 = this.z.size();
        for (n = 0; n < n2; ++n) {
            dz.a(this.c, (String)this.z.elementAt(n), w2);
        }
        n2 = this.A.size();
        for (n = 0; n < n2; ++n) {
            dz.a(this.c, (String)this.A.elementAt(n), w2);
        }
        dz.a(this.c, 4);
        this.w = dz.a(this.c, lh.d(345), false, 4, this.s.k);
        this.x = dz.a(this.c, lh.d(23), false, 4, this.s.k);
    }

    private void r() {
        int n;
        int n2;
        this.t();
        w w2 = jj.a();
        w w3 = jj.a(false);
        lk lk2 = this.e.e(3, this.k);
        lk lk3 = lk2.f(4);
        dz.a(this.c, lk2.g(5), w2);
        dz.a(this.c, lh.d(172), w3);
        ek ek2 = new ek();
        int n3 = this.g.i(3);
        for (n2 = 0; n2 < n3; ++n2) {
            lk lk4 = this.g.e(3, n2);
            int n4 = lk4.i(9);
            for (n = 0; n < n4; ++n) {
                if (!dz.a(lk4.e(9, n), lk3)) continue;
                ek2.a((long)n2);
            }
        }
        n = 0;
        for (n2 = 0; n2 < ek2.a; ++n2) {
            n3 = (int)ek2.a(n2);
            if (!this.g.e(3, n3).b(8)) {
                continue;
            }
            n = 1;
            break;
        }
        if (n != 0) {
            dz.a(this.c, 2);
            dz.a(this.c, "\u0001u " + lh.d(170), new oz(w3, ps.a().k));
        }
        dz.a(this.c, 2);
        this.i.clear();
        for (n = 0; n < ek2.a; ++n) {
            n2 = (int)ek2.a(n);
            lk3 = this.g.e(3, n2);
            fr fr2 = new fr(this.y[0]);
            fr2.c(-14006936);
            fr2.u = true;
            StringBuffer stringBuffer = new StringBuffer();
            String string = lk3.g(5);
            if (!ed.b(string)) {
                stringBuffer.append(string);
                stringBuffer.append("\n");
            }
            stringBuffer.append(lk3.g(6));
            gm gm2 = new gw(0, 0, this.c.a(), this.y[0], stringBuffer.toString(), this.s.k, this.y, fr2, 0);
            gm2.u = true;
            if (lk3.b(8)) {
                gm2 = new lm(ps.a().k, 'u', gm2);
                gm2.u = true;
            }
            fr2.l(this.c.a());
            gm2.l(this.c.a());
            this.c.d(gm2);
            this.i.put(fr2, lk3);
        }
        dz.a(this.c, 4);
        this.v = dz.a(this.c, lh.d(130));
        this.v.e = false;
    }

    private void v() {
        Vector<lk> vector = new Vector<lk>();
        ek ek2 = new ek();
        Enumeration enumeration = this.i.keys();
        while (enumeration.hasMoreElements()) {
            nh nh2 = (nh)enumeration.nextElement();
            if (!nh2.a) continue;
            lk lk2 = (lk)this.i.get(nh2);
            if (lk2.h(4)) {
                vector.addElement(lk2);
                ek2.a(lk2.e(4));
                continue;
            }
            this.z.addElement(lk2.g(6));
        }
        boolean bl2 = this.B;
        int n = ek2.a() && this.z.isEmpty() && this.A.isEmpty() ? 0 : 1;
        this.B = bl2 | n;
        Vector vector2 = new Vector();
        for (n = 0; n < this.z.size(); ++n) {
            vector2.addElement(this.z.elementAt(n));
        }
        Vector vector3 = new Vector();
        for (n = 0; n < this.A.size(); ++n) {
            vector3.addElement(this.A.elementAt(n));
        }
        ck.e().a(new bq(ek2, vector2, vector3, null, null, null, null, null, this.r, null));
        if (this.a != null) {
            this.a.a(vector, this.z);
        }
    }

    /*
     * Unable to fully structure code
     */
    public final int a(pb var1_1) {
        block15: {
            block16: {
                block17: {
                    block18: {
                        block19: {
                            block21: {
                                block23: {
                                    block24: {
                                        block22: {
                                            block20: {
                                                block14: {
                                                    if (this.c == null) break block14;
                                                    if (bu.a(var1_1, this.c)) ** GOTO lbl70
                                                    if (var1_1.c != 7 || (var2_2 = this.c.r()) == null) break block14;
                                                    var6_3 = (Integer)this.j.get(var2_2);
                                                    if (var6_3 != null) {
                                                        this.k = var6_3;
                                                        if (this.g != null) {
                                                            this.d = 3;
                                                            this.r();
                                                            return 3;
                                                        }
                                                        this.d = 2;
                                                        this.q();
                                                        var3_4 = new Vector<lk>();
                                                        var4_5 = new ek();
                                                        this.a(0, 250, var3_4, var4_5);
                                                        this.a(1, 250, var3_4, var4_5);
                                                        this.a(2, 20, var3_4, var4_5);
                                                        this.a(3, 100, var3_4, var4_5);
                                                        this.a(4, 100, var3_4, var4_5);
                                                        this.a(5, 100, var3_4, var4_5);
                                                        var8_7 = this.e.i(3);
                                                        for (var5_6 = 0; var5_6 < var8_7; ++var5_6) {
                                                            var7_8 = this.e.e(3, var5_6).f(4);
                                                            if (var7_8.h(1)) continue;
                                                            var3_4.addElement(var7_8);
                                                            var4_5.a((long)100);
                                                        }
                                                        ck.e().a(new hk(this.r, this, var3_4, var4_5));
                                                        return 3;
                                                    }
                                                    if (var2_2 == null) break block15;
                                                    if (var2_2 == this.m) break block16;
                                                    if (var2_2 == null) break block17;
                                                    if (var2_2 == null) ** GOTO lbl70
                                                    if (var2_2 == this.v) break block18;
                                                    if (var2_2 != this.w) {
                                                        if (var2_2 == this.x) {
                                                            this.d = 1;
                                                            this.p();
                                                            return 3;
                                                        } else {
                                                            ** GOTO lbl41
                                                        }
                                                    }
                                                    break block19;
                                                }
                                                if (this.d != 4) break block20;
                                                if (var1_1.d != 6 && var1_1.d != 7) {
                                                    if (var1_1.d == 5) {
                                                        this.d = 1;
                                                        this.p();
                                                        return 3;
                                                    } else {
                                                        ** GOTO lbl49
                                                    }
                                                }
                                                break block21;
                                            }
                                            if (this.d != 3) break block22;
                                            if (var1_1.d != 6) {
                                                if (var1_1.d == 5) {
                                                    this.d = 1;
                                                    this.p();
                                                    return 3;
                                                } else {
                                                    ** GOTO lbl57
                                                }
                                            }
                                            break block23;
                                        }
                                        if (var1_1.c == 8) break block24;
                                        this.b.a(var1_1);
                                        if (this.v != null) {
                                            this.v.e = this.u();
                                            return 3;
                                        }
                                        ** GOTO lbl70
                                    }
                                    switch (this.d) {
                                        case 2: 
                                        case 3: 
                                        case 4: {
                                            this.d = 1;
                                            this.p();
lbl70:
                                            // 6 sources

                                            return 3;
                                        }
                                        default: {
                                            return 1;
                                        }
                                    }
                                }
                                if (!this.u()) ** GOTO lbl70
                                this.d = 4;
                                this.s();
                                return 3;
                            }
                            this.v();
                            return 1;
                        }
                        this.v();
                        return 1;
                    }
                    ** while (!this.u())
lbl87:
                    // 1 sources

                    this.d = 4;
                    this.s();
                    return 3;
                }
                this.u.a();
                return 3;
            }
            this.n.a("");
            this.n.a();
            return 3;
        }
        this.d = 1;
        this.p();
        return 3;
    }

    private void c(lk lk2) {
        this.e = lk2;
        this.f = System.currentTimeMillis();
        int n = lk2.i(3);
        block12: for (int i = 0; i < n; ++i) {
            lk2 = this.e.e(3, i);
            lk lk3 = lk2.f(4);
            if (!lk3.h(1)) continue;
            switch (lk3.d(1)) {
                case 3: {
                    lk2.b(5, lh.d(163));
                    continue block12;
                }
                case 5: {
                    lk2.b(5, lh.d(161));
                    continue block12;
                }
                case 4: {
                    lk2.b(5, lh.d(162));
                    continue block12;
                }
                case 2: {
                    lk2.b(5, lh.d(164));
                    continue block12;
                }
                case 1: {
                    lk2.b(5, lh.d(165));
                    continue block12;
                }
                case 0: {
                    lk2.b(5, lh.d(160));
                    continue block12;
                }
                default: {
                    this.e.g(3, i);
                    --i;
                }
            }
        }
        switch (this.d) {
            case 0: {
                this.d = 1;
            }
            case 1: {
                this.p();
            }
        }
    }

    public final void a(lk lk2) {
        if (this.e != null) {
            int n = this.e.i(3);
            if (n != lk2.i(3)) {
                this.c(lk2);
                return;
            }
            for (int i = 0; i < n; ++i) {
                if (dz.a(this.e.e(3, i).f(4), lk2.e(3, i).f(4))) {
                    continue;
                }
                this.c(lk2);
                return;
            }
        } else {
            this.c(lk2);
        }
    }

    private void a(int n, int n2, Vector vector, ek ek2) {
        int n3 = this.e.i(3);
        for (int i = 0; i < n3; ++i) {
            lk lk2 = this.e.e(3, i).f(4);
            if (!lk2.h(1) || lk2.d(1) != n) {
                continue;
            }
            vector.addElement(lk2);
            ek2.a((long)n2);
            break;
        }
    }

    private void p() {
        this.r.b(jy.v);
        this.m();
        this.t();
        w w2 = jj.a();
        w w3 = jj.a(false);
        int n = this.e.i(3);
        dz.a(this.c, lh.d(131), w2);
        dz.a(this.c, lh.d(155), w3);
        for (int i = 0; i < n; ++i) {
            this.j.put(this.a(w3, -12885085, -12885085, this.e.e(3, i).g(5)), new Integer(i));
        }
        dz.a(this.c, lh.d(203), w3);
        this.m = this.a(w3, -12885085, -12885085, lh.d(147));
    }

    public final void a(cq cq2, Object object) {
        object = (jp)this.c.r();
        if (cq2.equals(jy.u)) {
            if (object == this.m) {
                this.z.addElement(this.n.b());
            }
            if (object == null) {
                this.A.addElement(this.u.b());
            }
            this.d = 4;
            this.s();
        }
    }

    public final void g_() {
        if (this.t) {
            int n = -1;
            if (this.c != null) {
                n = this.c.g(this.c.q());
            }
            switch (this.d) {
                case 4: {
                    this.s();
                    break;
                }
                case 3: {
                    this.r();
                    break;
                }
                case 2: {
                    this.q();
                    break;
                }
                case 1: {
                    this.p();
                    break;
                }
                case 0: {
                    this.q();
                }
            }
            if (n != -1) {
                this.c.l(this.c.h(n));
            }
        }
    }

    public final cq e() {
        switch (this.d) {
            case 1: {
                return jy.c;
            }
            case 4: {
                return jy.s;
            }
            case 3: {
                if (this.u()) {
                    return jy.u;
                }
            }
            case -1: 
            case 0: 
            case 2: {
                return null;
            }
        }
        return jy.c;
    }

    public final void b(lk lk2) {
        this.g = lk2;
        this.h = System.currentTimeMillis();
        switch (this.d) {
            case 2: {
                this.d = 3;
            }
            case 3: {
                this.r();
            }
        }
    }

    public final void b() {
        this.d = -1;
        this.b = null;
        this.c = null;
        if (this.B) {
            this.B = false;
            this.e = null;
            this.g = null;
            ck.e().a(new mk(this.r, this));
        }
        this.m();
    }

    public final void l() {
        if (this.e == null) {
            ck.e().a(new mk(this.r, this));
        }
    }

    public static String d(hx hx2) {
        gm gm2 = dz.c(hx2);
        if (gm2 != null && gm2 instanceof jp) {
            return ((jp)gm2).c();
        }
        return null;
    }

    public static gm c(hx hx2) {
        gm gm2;
        if (hx2 != null && (gm2 = hx2.r()) != null) {
            return gm2;
        }
        return null;
    }

    public static int a(hx hx2) {
        if (hx2 != null) {
            return hx2.a();
        }
        return 0;
    }

    public static gm a(fs fs2, int n) {
        gm gm2;
        block2: {
            int n2 = 0;
            int n3 = fs2.m();
            for (int i = 0; i < n3; ++i) {
                gm2 = fs2.h(i);
                if (!gm2.b()) continue;
                if (n2 != n) {
                    ++n2;
                    continue;
                }
                break block2;
            }
            return null;
        }
        return gm2;
    }

    /*
     * Enabled aggressive block sorting
     */
    private static boolean a(lk lk2, lk lk3) {
        return lk2.h(1) ? lk3.h(1) && lk2.d(1) == lk3.d(1) : !lk3.h(1) && lk2.e(2) == lk3.e(2);
    }

    private boolean u() {
        if (this.i != null) {
            Enumeration enumeration = this.i.keys();
            while (enumeration.hasMoreElements()) {
                if (!((nh)enumeration.nextElement()).a) continue;
                return true;
            }
        }
        return false;
    }

    public final int a(nj nj2) {
        if (this.b.b(nj2) == -3) {
            return this.a(pb.a(7));
        }
        return 3;
    }

    public final void a() {
        this.B = false;
        long l = System.currentTimeMillis();
        if (l - this.f > 60000L) {
            this.e = null;
        }
        if (l - this.h > 60000L) {
            this.g = null;
        }
        if (this.e != null) {
            this.d = 1;
            this.p();
            return;
        }
        this.l();
        this.d = 0;
        this.q();
    }

    private void t() {
        this.b = this.s.b(false, true);
        this.c = (hx)this.b.a();
    }

    public dz(eb eb2, hj hj2) {
        super(eb2, hj2);
        this.A = new Vector();
        this.n = lh.k().i().a(this, lh.d(147), jy.u, jy.a);
        this.n.b(2);
        this.u = lh.k().i().a(this, lh.d(148), jy.u, jy.a);
        this.u.b(8);
        this.y = new w[]{jj.a(false), jj.c(false)};
    }

    public static ic a(hx hx2, String string, bq bq2, w w2) {
        ic ic2 = new ic(w2, string, bq2);
        ic2.a = -14006936;
        dz.a(hx2, ic2);
        ic2.l(hx2.a());
        return ic2;
    }

    public static nh c(hx hx2, String string) {
        nh nh2 = new nh(jj.a(true), string);
        nh2.c(-14006936);
        nh2.u = true;
        dz.a(hx2, nh2);
        nh2.l(hx2.a());
        return nh2;
    }

    public static hv b(hx hx2, gm gm2) {
        hv hv2 = new hv(0, 0, dz.a(hx2), gm2);
        hv2.u = true;
        hx2.d(hv2);
        return hv2;
    }

    public static hc a(hx hx2, String string, w w2) {
        hc hc2 = new hc(0, 0, dz.a(hx2) - 0, Integer.MAX_VALUE, w2, string);
        hc2.d = w2.t();
        hc2.u = true;
        dz.a(hx2, hc2, true);
        return hc2;
    }

    public static hc a(int n, String string, w w2, int n2) {
        new hc(n2, 0, n - n2, Integer.MAX_VALUE, w2, string).d = w2.t();
        new hc(n2, 0, n - n2, Integer.MAX_VALUE, w2, string).u = true;
        return new hc(n2, 0, n - n2, Integer.MAX_VALUE, w2, string);
    }

    public static hc a(hx hx2, String string, int n, w w2) {
        hc hc2 = dz.a(hx2, string, w2);
        hc2.d = n;
        dz.a(hx2, hc2);
        return hc2;
    }

    public static hc a(hx hx2, String string, int n, w w2, boolean bl2) {
        hc hc2 = new hc(4, 0, dz.a(hx2), w2, string, bl2);
        hc2.d = n;
        dz.a(hx2, hc2);
        return hc2;
    }

    public static jp a(hx hx2, String string, boolean bl2, int n, lc lc2) {
        jp jp2 = new jp(4, 0, dz.a(hx2), n, 0, dz.a(), string, bl2, lc2);
        dz.a(hx2, jp2);
        return jp2;
    }

    public static jp a(hx hx2, String string, boolean bl2, w w2, lc lc2) {
        jp jp2 = new jp(4, 0, dz.a(hx2), pt.a(w2), 0, w2, string, bl2, lc2);
        dz.a(hx2, jp2);
        return jp2;
    }

    public static hi a(hx hx2, String string) {
        hi hi2 = new hi(0, 0, string, dz.a(), 1, dz.a(hx2));
        dz.a(hx2, hi2, true);
        return hi2;
    }

    public static hc a(int n, String string) {
        return dz.a(n, string, jj.a(true), 0);
    }

    public final void a(ht ht2) {
        this.b.a(ht2, 0, 0);
    }

    public final void s_() {
        this.e = null;
        this.g = null;
    }

    private void q() {
        this.t();
        w w2 = jj.a();
        dz.a(this.c, lh.d(578), w2);
    }

    public static void a(hx hx2, int n) {
        bl bl2 = new bl(true, 0xFFFFFF, n);
        bl2.a(Integer.MAX_VALUE, Integer.MAX_VALUE);
        dz.a(hx2, bl2);
    }

    public static bl b(hx hx2) {
        bl bl2 = new bl(true, -1184275, 2);
        dz.a(hx2, bl2);
        return bl2;
    }

    public static hc b(hx hx2, String string) {
        return dz.a(hx2, string, jj.a(true));
    }

    public final void a(jt jt2) {
        this.a = jt2;
        this.n();
    }

    public final boolean a(boolean bl2) {
        return this.a(this.b);
    }

    private jp a(w w2, int n, int n2, String string) {
        jp jp2 = new jp(0, 0, this.c.a(), 4, 0, w2, string, false, this.s.k);
        jp2.c(n, n2);
        jp2.u = true;
        this.c.d(jp2);
        return jp2;
    }

    private static void a(hx hx2, gm gm2, boolean bl2) {
        gm2.u = true;
        hx2.a(gm2, bl2);
    }

    public static void a(hx hx2, gm gm2) {
        dz.a(hx2, gm2, false);
    }

    public static jp a(hx hx2, String string, boolean bl2, lc lc2) {
        return dz.a(hx2, string, bl2, pt.a(jj.a(true)), lc2);
    }

    private static w a() {
        return jj.a(true);
    }

    public final cq d() {
        return jy.a;
    }
}

