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

public final class bu
extends cf
implements mt,
es {
    private static final String S = lh.d(420);
    private static final String T = lh.d(158);
    private static final cq aB;
    private static final cq aD;
    private static final Hashtable aI;
    private static final String aS;
    private static final String aT;
    private final jt W;
    private final cx X;
    private final bq aA;
    private final bq aC;
    private final hj aE;
    private final Hashtable aL;
    private final Vector aM;
    private final w[] ae;
    private final w[] ai;
    private final w[] aj;
    private final w ak;
    private final w al;
    private final w[] as;
    public final w b;
    private static boolean aR;
    private static char an;
    private static char ao;
    private static char ap;
    private static char aq;
    private static char ar;
    private lh U;
    private jt V;
    private boolean Y;
    private boolean Z;
    private ps aF;
    private jt aG;
    private Vector aH;
    private boolean aJ;
    private long aK = -1;
    private int aN = -1;
    private Vector aO;
    private Vector aP;
    private int aQ;
    private Vector aa;
    private kx ab;
    private kx ac;
    private kx ad;
    private jp af;
    private int ag;
    private int[] ah;
    private byte am = 0;
    private mm at = new mm(null);
    private jp au;
    private jp av;
    private jp aw;
    private Vector ax;
    private ko[] az;
    public eb a;

    private static void d(String string) {
        me.a((short)61, "a", string);
    }

    public final void a(dk dk2) {
        this.aL.put(dk2.d, dk2);
        this.aM.addElement(dk2);
    }

    private jp d(String string, hx hx2) {
        jp jp2 = new jp(0, 0, dz.a(hx2), 4, 0, this.D, string, false, this.u.k);
        jp2.c(-5636096, -65536);
        jp2.u = true;
        jp jp3 = jp2;
        dr dr2 = this.ah();
        dr2.u = true;
        dr2.d(jp3);
        hx2.d(dr2);
        return jp3;
    }

    private jp e(String string, hx hx2) {
        jp jp2 = new jp(4, 0, dz.a(hx2), pt.a(this.D), 0, this.D, string, false, this.u.k);
        jp2.u = true;
        jp2.c(4);
        hx2.d(jp2);
        return jp2;
    }

    private kx a(hx hx2, String string, bq bq2, w[] wArray) {
        mq mq2 = new mq(wArray[0], bq2);
        kx kx2 = new kx(0, 0, dz.a(hx2), wArray[0], string, this.u.k, wArray, mq2, 0);
        kx2.u = true;
        kx2.d(true);
        hx2.d(kx2);
        return kx2;
    }

    private int a(hx hx2, String string, int n) {
        hc hc2 = new hc(0, 0, hx2.a(), this.D, string);
        hc2.b(true);
        hc2.a(1);
        hc2.d = this.D.t();
        hx2.d(hc2);
        hc2.j(2);
        return Math.max(n, hc2.d());
    }

    private static hc a(int n, String string, w w2) {
        hc hc2 = new hc(0, 0, n, w2, string);
        hc2.d = w2.t();
        hc2.e();
        hc2.u = true;
        return hc2;
    }

    private dr ah() {
        return new md(this, false, 1);
    }

    public final String l() {
        return S;
    }

    public final jt x() {
        return this.a(0);
    }

    public static void a(bu bu2, boolean bl2) {
        bu2.c(bl2);
    }

    public static void b(bu bu2, boolean bl2) {
        bu2.d(bl2);
    }

    public final boolean w() {
        boolean bl2 = this.Z;
        this.Z = false;
        return bl2;
    }

    public final boolean E() {
        this.aq();
        return super.E();
    }

    public static void b(bu bu2) {
        bu2.ad();
    }

    public static void f(bu bu2) {
        bu2.ab();
    }

    public static int h(bu bu2) {
        return bu2.ak();
    }

    public static int i(bu bu2) {
        return bu2.al();
    }

    public static boolean j(bu bu2) {
        return bu2.aJ;
    }

    public final boolean p() {
        return this.aJ;
    }

    public static lh g(bu bu2) {
        return bu2.U;
    }

    public static hj c(bu bu2) {
        return bu2.aE;
    }

    public static Vector e(bu bu2) {
        return bu2.aa;
    }

    public static mm d(bu bu2) {
        return bu2.at;
    }

    public static Hashtable a(bu bu2) {
        return bu2.aL;
    }

    private void ai() {
        this.a.a(new jt(this, false, false, false));
    }

    private static void ar() {
        bu.d("pv");
    }

    private static void an() {
        bu.d("fmv");
    }

    private static void ao() {
        bu.d("mv");
    }

    private static void ap() {
        bu.d("lv");
    }

    private void ab() {
        this.N = null;
        this.O = null;
    }

    public final void B() {
        this.c(0);
        super.B();
    }

    public final void D() {
        super.D();
        this.aJ = false;
    }

    public final void v() {
        this.o();
        this.aF = null;
        this.G.a(this.X);
        this.aJ = false;
    }

    public final void o() {
        super.o();
        this.Y = false;
        this.G.a(this.X);
    }

    public final void b(ht ht2) {
        jt jt2;
        int n;
        if (!gu.p() && this.am() && (n = (int)((jt2 = this.aa()).l() * (long)2)) > 0) {
            cn cn2 = this.x.c();
            oa oa2 = this.x.b(jt2.b.a());
            int n2 = cn2.a(n);
            n = cn2.a(n);
            oa2.a -= n2 / 2;
            oa2.b -= n / 2;
            ps.a(ht2, oa2, n2, n, this.ak(), this.al());
        }
    }

    private void d(hx hx2) {
        if (bu.Z()) {
            this.aw = this.a(T, hx2, 4);
            this.aw.c(-5636096, -5636096);
        }
    }

    private static gm b(gm gm2) {
        gm gm3;
        if (gm2 == null || !gm2.t_()) {
            return null;
        }
        while ((gm2 = (gm3 = gm2).r()) != gm3) {
        }
        return gm3;
    }

    private void e(jt jt2) {
        if (bu.f(jt2)) {
            jt2.b.b = (byte)14;
            return;
        }
        jt2.b.b = 0;
    }

    private void g(jt jt2) {
        if (jt2 != null) {
            boolean bl2 = bu.f(jt2);
            aI.put(jt2.h(), jt2.h());
            if (bl2 != bu.f(jt2)) {
                this.c(true);
            }
        }
    }

    public final boolean a(int n, boolean bl2) {
        if (bl2) {
            this.aq();
        }
        return super.a(n, bl2);
    }

    private boolean a(gm gm2) {
        Long l = (Long)this.aG.a(gm2);
        if (l != null) {
            long l2 = l;
            int n = this.aH.size();
            for (int i = 0; i < n; ++i) {
                if (this.a(i).h() != l2) {
                    continue;
                }
                this.b(i);
                return true;
            }
        }
        return false;
    }

    private String a(long l, boolean bl2) {
        if (l < 0L || bl2 && this.U.h()) {
            return null;
        }
        long l2 = l / 86400000L;
        if (l2 <= 0L) {
            l2 = l / 3600000L;
            if (l2 <= 0L) {
                return ed.a(lh.d(181), Long.toString(l /= 60000L));
            }
            return ed.a(lh.d(167), Long.toString(l2));
        }
        return ed.a(lh.d(139), Long.toString(l2));
    }

    public final jt a(long l) {
        int n = this.z.a();
        for (int i = 0; i < n; ++i) {
            jt jt2 = this.a(i);
            if (l != jt2.h()) {
                continue;
            }
            return jt2;
        }
        return null;
    }

    public final jt a(String string) {
        jt jt2;
        block2: {
            int n = this.z.a();
            for (int i = 0; i < n; ++i) {
                jt2 = this.a(i);
                if (!string.equals(jt2.m())) {
                    continue;
                }
                break block2;
            }
            return null;
        }
        return jt2;
    }

    private int al() {
        if (this.z.w() != 0) {
            if (this.x.m()) {
                return 0x20800080;
            }
            return 0x10800080;
        }
        if (this.x.m()) {
            return 402653439;
        }
        return 0x100000FF;
    }

    private int ak() {
        if (this.z.w() == 0) {
            if (this.x.m()) {
                return 0x400000FF;
            }
            return 0x200000FF;
        }
        if (!this.x.m()) {
            return 0x20800080;
        }
        return 0x40800080;
    }

    private void d(boolean bl2) {
        iv iv2;
        block3: {
            block2: {
                ar ar2;
                this.aJ = false;
                jt jt2 = this.aa();
                if (!bu.f(jt2) || (ar2 = jt2.b) == null || (iv2 = ar2.a()) == null) break block2;
                this.aJ = true;
                if (bl2) break block3;
                this.v.n();
                this.x.a(iv2);
            }
            return;
        }
        this.v.a(iv2, false);
    }

    public final void f() {
        this.Y = true;
        this.ag = 0;
        this.ah = new int[2];
        if (this.aF != null) {
            this.a(this.aF, true);
        }
        this.a.e().l();
    }

    private void c(int n) {
        if (this.B != null && this.B instanceof d) {
            n = ((d)this.B).b;
            Vector vector = ((d)this.B).e();
            for (int i = 0; i < vector.size(); ++i) {
                fs fs2 = (fs)((ht)vector.elementAt((int)i)).a;
                this.ah[i] = fs2.g(fs2.q());
            }
        }
        this.ag = n;
    }

    private void a(d d2) {
        for (int i = 0; i < this.ah.length; ++i) {
            hx hx2 = (hx)((ht)d2.e().elementAt((int)i)).a;
            int n = this.ah[i];
            if (n < 0 || n >= hx2.m()) continue;
            hx2.l(hx2.h(n));
            hx2.d();
        }
        d2.a_(this.ag);
    }

    public static boolean a(pb pb2, hx hx2) {
        char c = an;
        char c2 = ao;
        char c3 = ap;
        if (!lh.z) {
            c = aq;
            c2 = ar;
        }
        if (pb2.b() == c) {
            hx2.c(2);
            return true;
        }
        if (pb2.b() != c2 && pb2.b() != c3) {
            return false;
        }
        hx2.d(2);
        hx2.d();
        return true;
    }

    public final gm a(ar ar2, hx hx2, int n) {
        if (!ed.b(ar2.f()) && ar2.g()) {
            return this.a(this.h, hx2, n);
        }
        return null;
    }

    public final jt a(int n) {
        if (this.aH != null) {
            return (jt)this.aH.elementAt(n);
        }
        return null;
    }

    public final int a(pz pz2) {
        if (pz2.l() != 0) {
            return this.c(pz2) / 4;
        }
        return 0;
    }

    public final int b(pz pz2) {
        if (pz2.l() != 0) {
            return 1 - this.d(pz2);
        }
        return 0;
    }

    public final boolean G() {
        return !this.am();
    }

    public final boolean h() {
        return super.h() && this.Y;
    }

    private boolean am() {
        jt jt2 = this.aa();
        return jt2 != null && bu.f(jt2) && (!jt2.e || this.U.g());
    }

    private static boolean f(jt jt2) {
        return jt2 != null && jt2.b.a() != null && jt2.h() && (jt2.e || jt2.p() || aI.containsKey(jt2.h()));
    }

    private static String h(jt jt2) {
        if (jt2.h()) {
            if (jt2.e()) {
                if (jt2.f()) {
                    return " \u0001f";
                }
            } else {
                return " \u0001h";
            }
        }
        return null;
    }

    public final String i() {
        if (!lh.t() && this.z != null && !this.S()) {
            this.c(false);
            if (this.aO.size() != 0 && (this.aO.size() > 1 || ((ek)this.aO.elementAt((int)0)).a > 1)) {
                return aS;
            }
        }
        return null;
    }

    private jt aa() {
        if (this.z != null && this.z.i() != 0 && this.z.w() != -1) {
            return this.a(this.z.w());
        }
        return null;
    }

    public final void c(ht ht2) {
        ar ar2 = (ar)this.z.j();
        if (ar2 != null) {
            iv iv2 = ar2.a();
            if (this.z.i() == 1 && iv2 != null) {
                this.a(ht2, ar2);
            }
        }
    }

    public final void a(hh hh2) {
        this.G.a((fb[])null);
        this.z = hh2;
        this.c(true);
        if (hh2 != null) {
            this.v.a(this);
            this.a(hh2.i());
            this.d();
            this.O();
            this.G.a(((ps)hh2).r());
        }
    }

    public final boolean a(iy iy2, hx hx2) {
        if (iy2 != null && hx2 != null && this.z.i() == 3) {
            this.a((d)iy2);
        }
        return super.a(iy2, hx2);
    }

    public final void a() {
        int n = this.z.w();
        if (this.z.i() == 3 && n != -1 && this.aK != (long)-1) {
            gm gm2 = (gm)this.aG.b(new Long(this.aK));
            if (gm2 != null) {
                this.C.l(gm2);
                this.C.d();
            }
            this.aK = -1;
        }
    }

    public final void d() {
        super.d();
        if (this.z != null && gu.p()) {
            this.c(false);
            if (this.am()) {
                jt jt2 = this.aa();
                this.G.a((cx)null);
                int n = (int)(jt2.l() * (long)2);
                if (n > 0) {
                    this.G.a(new fb[]{new ms(this, n, jt2)});
                    return;
                }
                this.G.a((fb[])null);
                return;
            }
            this.G.a(this.X);
            this.G.a((fb[])null);
        }
    }

    public final void y() {
        jt jt2 = this.aa();
        if (jt2 != null && !bu.f(jt2)) {
            this.z.b(-1);
            this.k();
        } else {
            this.d(false);
        }
        super.y();
    }

    public final void k() {
        int n = this.a(this.x.d());
        if (n != -1) {
            if (!bu.f(this.a(n))) {
                this.z.a((byte)0);
            } else {
                this.z.b(n);
            }
        } else {
            this.z.a((byte)0);
        }
        this.d();
    }

    public final void z() {
        if (this.z != null) {
            this.ax = new Vector();
            for (int i = 0; i < this.z.a(); ++i) {
                this.ax.addElement(new Integer(i));
            }
            a.a(this.ax, this.az[0]);
            super.z();
        }
    }

    public final void F() {
        block3: {
            block2: {
                if (this.z == null || this.z.a() <= 0) break block2;
                if (!this.U.g()) break block3;
                this.b(-1);
            }
            return;
        }
        this.b(0);
    }

    public final void j() {
        if (this.z.i() == 2) {
            this.a(this.am);
            return;
        }
        this.y();
        this.d();
    }

    public final void A() {
        if (this.z.i() != 2) {
            this.am = this.z.i();
        }
        super.A();
    }

    private void ad() {
        this.ab();
        this.Q = null;
        this.R = null;
        if (this.z.i() == 3) {
            this.z();
            return;
        }
        if (this.z.i() != 2) {
            if (this.z.i() == 1) {
                this.T();
            }
            return;
        }
        this.A();
    }

    public final void b(boolean bl2) {
        if (this.z != null) {
            jt jt2 = this.a(0);
            this.W.l();
            jt2.n();
            if (this.h()) {
                this.ab();
                if (this.z.i() == 3) {
                    this.z();
                }
            }
        }
    }

    public final void e(boolean bl2) {
        if (this.z != null) {
            jt jt2 = this.a(0);
            this.W.l();
            jt2.n();
            if (this.h()) {
                this.ab();
                if (this.z.i() == 3) {
                    this.z();
                }
            }
        }
    }

    public final void a(iv iv2, Long l, boolean bl2) {
        if (this.z != null) {
            jt jt2 = this.a(0);
            if (iv2 != null) {
                jt2.c = iv2;
                jt2.b.a(iv2);
                jt2.a(System.currentTimeMillis());
                if (l == null) {
                    jt2.b(-1);
                }
            }
            if (l != null) {
                jt2.b(l);
            }
            jt2.n();
            this.c(true);
            this.k();
            if (iv2 != null) {
                this.aJ = true;
            }
            if (this.h()) {
                this.ab();
                if (this.z.i() == 3) {
                    this.z();
                }
            }
        }
    }

    private void aq() {
        block4: {
            StringBuffer stringBuffer;
            block5: {
                block2: {
                    block3: {
                        stringBuffer = new StringBuffer();
                        stringBuffer.append("|");
                        stringBuffer.append("s");
                        stringBuffer.append("=");
                        byte by2 = this.z.i();
                        if (by2 == 3) break block2;
                        if (by2 == 1) break block3;
                        if (by2 != 2) break block4;
                        stringBuffer.append("p");
                        break block5;
                    }
                    stringBuffer.append("m");
                    break block5;
                }
                stringBuffer.append("l");
            }
            stringBuffer.append("|");
            stringBuffer.append("t");
            stringBuffer.append("=");
            if (this.z.w() != 0) {
                stringBuffer.append("f");
            } else {
                stringBuffer.append("o");
            }
            stringBuffer.append("|");
            me.a((short)61, "p", stringBuffer.toString());
        }
    }

    static {
        an = (char)32;
        ao = (char)116;
        ap = (char)84;
        aq = (char)48;
        ar = (char)50;
        aB = cq.a(lh.d(346), cq.c, 5);
        aD = cq.a(lh.d(346), cq.c, 5);
        aI = new Hashtable();
        aR = ct.b();
        aS = lh.d(414) + "   " + lh.d(412);
        aT = lh.d(133);
        String cfr_ignored_0 = aS + "\n" + aT;
    }

    public bu(gd gd2, bi object, ck ck2, lh lh2, hj hj2, jt jt2, lh lh3, jt jt3, cx cx2) {
        super(gd2, ck2, lh2, jt2);
        this.aL = new Hashtable();
        this.aM = new Vector();
        this.aO = new Vector();
        this.aP = new Vector();
        new ek();
        this.aQ = -1;
        this.U = lh3;
        this.V = jt3;
        this.aE = hj2;
        this.X = cx2;
        this.Y = false;
        object = jj.a(false, true, -16777216);
        w w2 = jj.a(false, false, -16777216);
        w w3 = jj.a(false, true, -7566196);
        w w4 = jj.a(false, false, -7566196);
        this.al = jj.b();
        this.ak = new oz(jj.a(), ps.a().k);
        this.b = jj.a(false, false, -9211021);
        this.ai = new w[]{new oz((w)object, ps.a().k), w2, w2};
        this.aj = new w[]{w3, w4, w4};
        object = jj.a(false, true, -12885085);
        w2 = jj.c(false);
        this.as = new w[]{object, w2};
        this.ae = new w[]{jj.a(true)};
        this.aA = lh.k().i().a(this, lh.d(144), aB, jy.a);
        this.aC = lh.k().i().a(this, lh.d(145), aD, jy.a);
        this.aC.b(4);
        this.az = new ko[]{new ba(lh.d(226), this), new hn(lh.d(223), this), new ko(lh.d(224), this)};
        this.W = new jt(this, null);
        lh3.a(this.W);
    }

    private gm a(jt jt2, int n) {
        dh dh2 = new dh(jt2, this.aL, 2, this.u);
        mc mc2 = null;
        int n2 = 0;
        n -= 12;
        int n3 = this.u.b(2) + 6 + 8;
        String string = this.a(jt2.k(), jt2.e);
        if (!ed.b(string)) {
            n2 = this.ak.c() - this.b.c();
            mc2 = new mc(this, 0, 0, Integer.MAX_VALUE, this.b, string, n2);
            mc2.d = this.b.t();
            mc2.e();
            n2 = mc2.r;
        }
        string = jt2.b.v().trim();
        String string2 = bu.h(jt2);
        if (string2 != null) {
            string = string + string2;
        }
        hc hc2 = new hc(0, 0, n - n3 - n2, this.ak, string);
        hc2.d = this.ak.t();
        hc2.e();
        string = jt2.m();
        hc hc3 = null;
        if (!ed.b(string)) {
            hc3 = new hc(0, 0, n - n3, this.D, string);
            hc3.d = this.ak.t();
            hc3.e();
        }
        hc hc4 = null;
        if (jt2.h()) {
            StringBuffer stringBuffer = new StringBuffer();
            if (jt2.h()) {
                string = jt2.c(true);
                if (!ed.b(string)) {
                    stringBuffer.append(string);
                }
                if (!ed.b(string = jt2.i())) {
                    if (stringBuffer.length() > 0) {
                        stringBuffer.append("\n");
                    }
                    stringBuffer.append(string);
                }
            } else if (jt2.c()) {
                stringBuffer.append(lh.d(166));
            }
            string = stringBuffer.toString();
            hc4 = new hc(0, 0, n - n3, this.D, string);
            hc4.u = true;
            hc4.d = this.D.t();
            hc4.e();
        }
        dr dr2 = new dr(false, 0);
        if (mc2 != null) {
            dr dr3 = new dr(true, 4);
            dr3.d(hc2);
            dr3.d(mc2);
            dr2.d(dr3);
        } else {
            dr2.d(hc2);
        }
        if (hc3 != null) {
            dr2.d(hc3);
        }
        if (hc4 != null) {
            dr2.d(hc4);
        }
        dr dr4 = new dr(true, 4);
        dr4.d(dh2);
        dr4.d(dr2);
        dr4.j(4);
        return dr4;
    }

    private void c(boolean n) {
        if (n != 0 || this.aO == null || this.aN != this.x.c().b) {
            ek ek2;
            iv iv2;
            jt jt2;
            int n2;
            this.aN = this.x.c().b;
            this.aO.setSize(0);
            this.aP.setSize(0);
            this.aQ = -1;
            oa oa2 = new oa();
            long l = this.u.b((byte)14) / 2;
            long l2 = l * l;
            int n3 = this.z != null ? this.z.a() : 0;
            boolean bl2 = false;
            if (n3 > 0) {
                bl2 = this.a(this.x.d()) == this.z.w();
            }
            for (n2 = 0; n2 < n3; ++n2) {
                jt2 = this.a(n2);
                this.e(jt2);
                if (jt2.b.b == 0) continue;
                jt2.b.a(jt2.c);
                iv2 = jt2.b.a();
                if (iv2 == null) continue;
                boolean bl3 = false;
                this.x.a(iv2, this.y);
                int n4 = this.aO.size();
                for (n = 0; n < n4; ++n) {
                    ek2 = (ek)this.aO.elementAt(n);
                    jt jt3 = this.a((int)ek2.a(0));
                    this.x.a(jt3.b.a(), oa2);
                    long l3 = oa2.a - this.y.a;
                    long l4 = oa2.b - this.y.b;
                    if (l3 * l3 + l4 * l4 > l2) {
                        continue;
                    }
                    bl3 = true;
                    jt2.b.a(jt3.c);
                    ek2.a((long)n2);
                    break;
                }
                if (bl3) continue;
                ek ek3 = new ek();
                ek3.a((long)n2);
                this.aO.addElement(ek3);
            }
            n2 = this.aO.size();
            for (n = 0; n < n2; ++n) {
                this.aP.addElement(this.aO.elementAt(n));
            }
            ek2 = new ek();
            for (n = 0; n < n3; ++n) {
                jt2 = this.a(n);
                if (jt2.b.a() == null) {
                    continue;
                }
                iv2 = jt2.b.a();
                ek2.b(0);
                n2 = this.aP.size();
                for (n = 0; n < n2; ++n) {
                    ek2.a(this.a((int)((int)((ek)this.aP.elementAt((int)n)).a((int)0))).b.a().b(iv2));
                }
                a.a(this.aP, ek2);
                break;
            }
            if (this.aJ || bl2) {
                this.d(true);
            }
        }
    }

    public final void d(ht ht2) {
        if (this.z != null) {
            int n;
            int n2;
            ek ek2;
            this.c(false);
            if (this.aQ != this.z.w()) {
                this.aQ = this.z.w();
                ek2 = new ek();
                n2 = this.aO.size();
                for (n = 0; n < n2; ++n) {
                    this.x.a(this.a((int)((int)((ek)this.aO.elementAt((int)n)).a((int)0))).b.a(), this.y);
                    ek2.a((long)this.y.b);
                }
                a.a(this.aO, ek2);
                n2 = this.aO.size();
                for (n = 0; n < n2; ++n) {
                    ek2 = (ek)this.aO.elementAt(n);
                    if (!ek2.b((long)this.z.w())) {
                        continue;
                    }
                    this.aO.removeElementAt(n);
                    this.aO.addElement(ek2);
                    break;
                }
            }
            int n3 = this.u.b((byte)14);
            int n4 = this.u.a((byte)14);
            int n5 = this.aO.size();
            for (n2 = 0; n2 < n5; ++n2) {
                jt jt2;
                int n6;
                ek2 = (ek)this.aO.elementAt(n2);
                this.x.a(this.a((int)((int)ek2.a((int)0))).b.a(), this.y);
                this.y.a -= n3 / 2;
                this.y.b -= n4;
                if (!bk.a(ht2, this.y.a, this.y.b, n3, n4)) continue;
                if (ek2.a != 1) {
                    n = (int)ek2.a(0);
                    n6 = this.z.w();
                    if (ek2.b((long)n6)) {
                        n = n6;
                    }
                    jt2 = this.a(n);
                } else {
                    jt2 = this.a((int)ek2.a(0));
                }
                n = ek2.a <= 1 ? 0 : 1;
                n = n == 0 ? (jt2.o() ? (!jt2.g() ? (jt2.q() ? 60738 : 60736) : 60741) : (jt2.g() ? 60742 : 60737)) : (!jt2.o() ? (jt2.g() ? 60744 : 60740) : (jt2.g() ? 60743 : 60739));
                this.u.a((char)n, ht2, this.y.a, this.y.b);
                n = this.y.a + dk.a;
                n6 = this.y.b + dk.b;
                dk dk2 = (dk)this.aL.get(jt2.h());
                if (jt2.h() && dk2 != null) {
                    ht2.a(dk2.e, n, n6);
                    continue;
                }
                this.u.a(jt2.h(), 0, ht2, n, n6);
            }
        }
    }

    /*
     * Enabled aggressive block sorting
     */
    public final boolean c(pb pb2) {
        block27: {
            int n;
            block22: {
                block24: {
                    jt jt2;
                    int n2;
                    int n3;
                    ek ek2;
                    int n4;
                    int n5;
                    int n6;
                    block19: {
                        block26: {
                            block20: {
                                block25: {
                                    block23: {
                                        block21: {
                                            if (pb2.c == 21) {
                                                this.ai();
                                                return true;
                                            }
                                            if (pb2.c == 22) {
                                                this.V.a((jt)null);
                                                return true;
                                            }
                                            if (this.z.i() == 3) {
                                                if (bu.a(pb2, this.C)) return true;
                                            }
                                            this.w.b("");
                                            if (pb2.b() == '#') break block20;
                                            ar ar2 = (ar)this.M();
                                            if (this.z != null && ar2 != null) {
                                                if (pb2.c == 8 && this.z.i() == 2) {
                                                    this.y();
                                                    this.d();
                                                    return true;
                                                }
                                                if (pb2.c == 7 && this.z.i() == 1) {
                                                    n = 1;
                                                    this.aq();
                                                    this.A();
                                                    this.d();
                                                } else {
                                                    n = 0;
                                                }
                                            } else {
                                                n = 0;
                                            }
                                            if (n != 0) return true;
                                            n6 = this.z.w();
                                            n = this.z.i();
                                            n5 = pb2.b();
                                            if (n == 3) return true;
                                            if (n5 == this.t || n5 == this.s) break block21;
                                            n = 0;
                                            break block22;
                                        }
                                        String string = n5 != this.t ? "nf" : "pf";
                                        me.a((short)61, "a", string);
                                        if (n != 0 || n6 == -1) break block23;
                                        this.b(n6);
                                        n = 1;
                                        this.d(true);
                                        break block22;
                                    }
                                    if (this.z.a() <= 1) break block24;
                                    this.c(false);
                                    n4 = this.aP.size();
                                    if (n4 == 0) break block25;
                                    break block26;
                                }
                                n = 0;
                                break block22;
                            }
                            if (this.z.i() == 3) {
                                this.a(bu.b(this.B));
                                this.g(this.aa());
                                this.d(false);
                                bu.ao();
                                this.y();
                                this.d();
                                return true;
                            }
                            if (this.z.i() == 2) {
                                this.g(this.aa());
                                this.d(false);
                                bu.an();
                                this.y();
                                this.d();
                                return true;
                            }
                            break block27;
                        }
                        for (n = 0; n < n4; ++n) {
                            ek2 = (ek)this.aP.elementAt(n);
                            n3 = ek2.a;
                            for (n2 = 0; n2 < n3; ++n2) {
                                if (ek2.a(n2) != (long)n6) {
                                    continue;
                                }
                                break block19;
                            }
                        }
                        n = 0;
                        n2 = 0;
                    }
                    n5 = n5 != this.t ? 1 : -1;
                    do {
                        ek2 = (ek)this.aP.elementAt(n);
                        if ((n2 += n5) >= 0) {
                            if (n2 >= ek2.a) {
                                n = (n4 + n + n5) % n4;
                                n2 = 0;
                                ek2 = (ek)this.aP.elementAt(n);
                            }
                        } else {
                            n = (n4 + n + n5) % n4;
                            ek2 = (ek)this.aP.elementAt(n);
                            n2 = ek2.a - 1;
                        }
                        n3 = (int)ek2.a(n2);
                        jt2 = this.a(n3);
                    } while (n3 != n6 && !bu.f(jt2));
                    if (n3 != n6) {
                        this.b(n3);
                        this.d(true);
                        if (this.z.i() != 2) return true;
                        this.aq();
                        return true;
                    }
                }
                n = 0;
            }
            if (n != 0) return true;
            if (pb2.c != 12) return false;
            if (!this.H()) return false;
            this.g();
            return true;
        }
        bu.ap();
        this.z();
        int n = this.z.w();
        if (n == -1) return true;
        jt jt3 = this.a(n);
        this.C.l((gm)this.aG.b(jt3.h()));
        this.C.d();
        return true;
    }

    /*
     * Unable to fully structure code
     */
    public final void a(ps var1_1, boolean var2_2) {
        block25: {
            if (var1_1.l()) {
                ka.c();
                return;
            }
            this.aF = var1_1;
            this.Z = true;
            if (!this.Y) break block25;
            var11_3 = -1;
            this.c(0);
            this.aK = -1;
            if (this.z != null) {
                var4_4 = this.aa();
                if (var4_4 != null) {
                    var11_3 = var4_4.h();
                }
                if (this.z.i() == 3) {
                    var6_5 = (Long)this.aG.a(bu.b(this.B));
                    if (var6_5 != null) {
                        this.aK = var6_5;
                        var11_3 = var6_5;
                    }
                    var2_2 = false;
                }
                var1_1.p = this.z.i();
            } else {
                var1_1.p = (byte)3;
            }
            var9_6 = new Hashtable<Long, jt>();
            if (this.z != null) {
                for (var3_7 = 0; var3_7 < this.z.a(); ++var3_7) {
                    var9_6.put(this.a(var3_7).h(), this.a(var3_7));
                }
            }
            var7_8 = new ek();
            this.aa = new Vector<E>();
            this.aH = new Vector<E>(var1_1.a());
            var13_9 = var1_1.a();
            for (var3_7 = 0; var3_7 < var13_9; ++var3_7) {
                block27: {
                    block26: {
                        var14_13 = (ar)var1_1.c(var3_7);
                        var8_11 = var3_7 == 0;
                        var15_14(var8_11, var14_13);
                        this.aH.addElement(var4_4);
                        if (var4_4.e && !this.U.g()) {
                            this.W.a(var4_4);
                        }
                        if (this.z == null && var4_4.e && var11_3 == (long)-1) {
                            var1_1.b(var3_7);
                            this.aK = var4_4.h();
                        } else if (var11_3 == var4_4.h()) {
                            var1_1.b(var3_7);
                        }
                        if (var4_4.i()) {
                            this.aa.addElement(var4_4);
                        }
                        if ((var10_12 = (jt)var9_6.get(var4_4.h())) == null) break block26;
                        if (!var4_4.j().equals(var10_12.j())) ** GOTO lbl-1000
                        var5_10 = (dk)this.aL.get(var4_4.h());
                        if (var5_10 != null) {
                            var5_10.c = true;
                        }
                        break block27;
                    }
                    var5_10 = (dk)this.aL.get(var4_4.h());
                    if (var5_10 != null) {
                        var5_10.c = true;
                    } else lbl-1000:
                    // 2 sources

                    {
                        var7_8.a(var4_4.h());
                    }
                }
                this.e(var4_4);
            }
            for (var3_7 = 0; var3_7 < this.aM.size(); ++var3_7) {
                var5_10 = (dk)this.aM.elementAt(var3_7);
                if (!var5_10.c) {
                    this.aL.remove(var5_10.d);
                    this.aM.removeElementAt(var3_7);
                    --var3_7;
                }
                var5_10.c = false;
            }
            if (!var7_8.a()) {
                ck.e().a(new mm(var7_8, this, this.aE));
            }
            var3_7 = var2_2 != false && (this.aJ != false || this.z == null) ? 1 : 0;
            this.c(var1_1);
            if (var3_7 != 0) {
                if (var1_1.b < 0) {
                    if (var1_1.a() > 0) {
                        this.b(0);
                    }
                } else {
                    this.b(var1_1.b);
                }
                this.d(true);
                return;
            }
            if (var1_1.p == 1 || var1_1.p == 0) {
                this.k();
            }
        }
    }

    private void a(jt jt2, ek ek2, ek ek3) {
        if (!jt2.e()) {
            ek ek4 = new ek();
            ek4.a(jt2.h());
            ek ek5 = ek4;
            ck.e().a(new ko(ek5, null, this.aE, null));
            jt2.c(true);
        }
        this.w.a(lh.d(177), 2);
        ck.e().a(new bq(null, null, null, null, null, null, ek3, ek2, this.aE, new bj(this)));
    }

    /*
     * Enabled aggressive block sorting
     * Enabled unnecessary exception pruning
     * Enabled aggressive exception aggregation
     */
    public final void a(cq cq2, Object object) {
        Long l;
        String string;
        jt jt2;
        block8: {
            block7: {
                if (cq2.equals(aB)) break block7;
                if (cq2.equals(aD)) {
                    jt2 = this.a(0);
                    string = jt2.r();
                    try {
                        l = new Long(Long.parseLong(this.aC.b()));
                    }
                    catch (NumberFormatException numberFormatException) {
                        l = null;
                    }
                    break block8;
                } else {
                    if (!cq2.equals(jy.i) || bu.b(this.B) != this.at.d) return;
                    this.ai();
                    return;
                }
            }
            this.w.a(lh.d(229), 2);
            String string2 = this.aA.b();
            this.aA.a("");
            ck.e().a(new am(string2, null, null, null, null, this.aE, new bj(this, false)));
            this.at.a.z();
            return;
        }
        this.aC.a("");
        if (l != null) {
            ck.e().a(new am(null, string, l, null, null, this.aE, new aq(this, jt2)));
        } else {
            this.w.a(lh.d(152), 0);
        }
        this.at.c.z();
    }

    /*
     * Enabled aggressive block sorting
     */
    public final void g() {
        gm gm2 = bu.b(this.B);
        if (gm2 == this.at.a) {
            this.aA.a();
            return;
        }
        if (gm2 == this.at.k) {
            this.a.c(new jt(this, false));
            return;
        }
        if (gm2 == this.at.b) {
            this.a.b(new jt(this, false, false));
            return;
        }
        if (gm2 == this.at.c) {
            this.aC.a();
            return;
        }
        if (gm2 == this.at.d) {
            this.ai();
            return;
        }
        if (gm2 == this.au) {
            bu.ar();
            this.z();
            ((d)this.B).a_(1);
            return;
        }
        if (gm2 == this.av) {
            bu.ap();
            this.z();
            ((d)this.B).a_(0);
            return;
        }
        if (gm2 != this.aw) {
            if (gm2 == this.at.i) {
                bu.ar();
                ((d)this.B).a_(1);
                return;
            }
            if (gm2 == this.at.j) {
                this.a.a(this.aa, new jt(this, false, false, false, false, false));
                return;
            }
            if (this.at.e != null && gm2 == this.at.e) {
                if (this.U.f()) return;
                this.U.e(true);
                this.w.a(lh.d(177), 2);
                return;
            }
            if (gm2 != this.at.f) {
                if (gm2 == this.at.g) {
                    this.z.a((byte)0);
                    this.a.a(new jt(this), new jt(this, false, false, false, false, false, false), "typed Location history");
                    return;
                }
                if (gm2 == this.at.h) {
                    ka.c();
                    return;
                }
                if (this.ab != null && gm2 == this.ab) {
                    jt jt2 = this.aa();
                    ek ek2 = new ek();
                    ek2.a(jt2.h());
                    this.a(jt2, ek2, null);
                    jt2.b(false);
                    this.ad();
                    this.ab.f();
                    this.ab.z();
                    return;
                }
                if (this.ac != null && gm2 == this.ac) {
                    jt jt3 = this.aa();
                    ek ek3 = new ek();
                    ek3.a(jt3.h());
                    this.a(jt3, null, ek3);
                    jt3.b(true);
                    this.ad();
                    this.ac.f();
                    this.ac.z();
                    return;
                }
                if (this.ad != null && gm2 == this.ad) {
                    jt jt4 = this.aa();
                    ek ek4 = new ek();
                    ek4.a(jt4.h());
                    ek ek5 = ek4;
                    this.w.a(lh.d(177), 2);
                    ck.e().a(new ko(null, ek5, this.aE, new aq(this)));
                    jt4.c(false);
                    this.ad();
                    this.ad.f();
                    this.ad.z();
                    return;
                }
                if (this.af != null && gm2 == this.af) {
                    jt jt5 = this.aa();
                    String string = ed.a(lh.d(211), jt5.b.v());
                    String string2 = lh.d(210);
                    this.a.a(string, string2, null, null, new jt(this, jt5));
                    return;
                } else {
                    if (this.a(gm2)) {
                        this.aq();
                        this.d(false);
                        this.A();
                        this.H = true;
                        return;
                    }
                    if (!this.c.equals(this.U())) {
                        super.g();
                        return;
                    }
                    this.g(this.aa());
                    this.y();
                    this.d();
                    return;
                }
            }
            if (this.U.h()) return;
            this.U.b(true);
            this.w.a(lh.d(177), 2);
            return;
        }
        if (this.z.i() != 2) {
            bu.ao();
        } else {
            bu.an();
        }
        this.g(this.aa());
        this.y();
        this.d();
    }

    public final void C() {
        jt jt2 = this.aa();
        this.B = this.u.a(false, true, lh.u());
        this.C = (hx)this.B.a();
        if (jt2.e) {
            hx hx2 = this.C;
            hx2.a(this.a(jt2, hx2.a()), true);
            if (jt2.b.a() != null) {
                this.d(hx2);
            }
            String string = lh.d(227);
            this.at.a = new jp(4, 0, dz.a(hx2), pt.a(this.D), 0, this.D, string, false, this.u.k);
            this.at.a.u = true;
            this.at.a.c(4);
            hx2.d(this.at.a);
            if (aR) {
                string = lh.d(234);
                this.at.k = new jp(4, 0, dz.a(hx2), pt.a(this.D), 0, this.D, string, false, this.u.k);
                this.at.k.u = true;
                this.at.k.c(4);
                hx2.d(this.at.k);
            }
            if (!ed.b(string = jt2.r())) {
                this.ah().u = true;
                dr dr2 = this.ah();
                string = ed.a(lh.d(187), string);
                this.at.b = this.e(string, hx2);
                this.at.b.c(-16621882, -16621882);
                this.at.c = this.e(lh.d(188), hx2);
                this.at.c.c(-16751053, -16751053);
                hx2.f(this.at.b);
                dr2.d(this.at.b);
                hx2.f(this.at.c);
                dr2.d(this.at.c);
                hx2.d(dr2);
            } else {
                string = jt2.b.f();
                if (!ed.b(string)) {
                    string = ed.a(lh.d(184), string);
                    this.at.b = this.e(string, hx2);
                } else {
                    string = lh.d(182);
                    this.at.b = this.e(string, hx2);
                }
            }
            this.au = this.a(lh.d(159), hx2, 4);
        } else {
            hx hx3 = this.C;
            hx3.a(this.a(jt2, hx3.a()), true);
            if (jt2.h()) {
                super.a(jt2.b, hx3);
                dz.a(this.C, 2);
                dz.a(hx3, lh.d(236), jj.b(false));
                bq bq2 = new bq(false);
                this.ab = this.a(hx3, lh.d(242), bq2, this.ae);
                this.ac = this.a(hx3, lh.d(233), bq2, this.ae);
                this.ad = this.a(hx3, lh.d(237), bq2, this.ae);
                dz.a(this.C, 2);
                if (jt2.e()) {
                    if (!jt2.f()) {
                        this.ab.f();
                    } else {
                        this.ac.f();
                    }
                } else {
                    this.ad.f();
                }
            }
            this.af = dz.a(hx3, lh.d(240), false, 4, this.u.k);
        }
        this.av = this.a(lh.d(156), this.C, 4);
        this.C.s();
    }

    public final void b() {
        this.aG = new jt(false, false);
        int n = this.u.a(false);
        if (lh.u()) {
            n -= this.u.h();
        }
        d d2 = new d(ps.c, ps.d, this.u.n(), n, this.al, false);
        hx hx2 = ps.a((iy)d2);
        dz.a(hx2, 1);
        if (ps.w()) {
            this.au = this.a(lh.d(512) + " " + '\u00bb', hx2, 4);
        }
        hx hx3 = ps.a((iy)d2);
        if (ps.w()) {
            this.av = this.a("\u00ab " + lh.d(512), hx3, 4);
        }
        dr dr2 = new dr(true, 4);
        bu.a(this.ak, lh.d(173), dr2, hx3.a());
        hx3.d(dr2);
        bq bq2 = new bq(false);
        this.at.e = this.a(hx3, lh.d(218), bq2, this.as);
        this.at.g = this.a(hx3, lh.d(180), bq2, this.as);
        this.at.f = this.a(hx3, lh.d(142), bq2, this.as);
        dz.a(hx3, 4);
        this.at.h = dz.a(hx3, lh.d(221), false, 4, this.u.k);
        switch (this.U.d) {
            case 0: {
                this.at.e.f();
                this.at.e.z();
                break;
            }
            case 1: {
                this.at.g.f();
                this.at.g.z();
                break;
            }
            default: {
                this.at.f.f();
                this.at.f.z();
            }
        }
        ht[] htArray = new ht[]{new ht(hx2, lh.d(230), this.al), new ht(hx3, lh.d(206), this.al)};
        Vector<ht> vector = new Vector<ht>();
        for (n = 0; n < 2; ++n) {
            vector.addElement(htArray[n]);
        }
        d2.a(vector);
        this.B = d2;
        this.C = hx2;
        String string = null;
        switch (this.U.d) {
            case 2: {
                string = lh.d(174);
                break;
            }
            case 1: {
                string = lh.d(175);
            }
        }
        this.at.i = null;
        if (string != null) {
            this.at.i = this.d(string, this.C);
        }
        this.at.j = null;
        if (this.aa.size() != 1) {
            if (this.aa.size() > 1) {
                string = ed.a(lh.d(190), "" + this.aa.size());
                this.at.j = this.d(string, this.C);
            }
        } else {
            this.at.j = this.d(lh.d(194), this.C);
        }
        this.d(this.C);
        for (n = 0; n < this.z.a(); ++n) {
            mb mb2;
            String string2;
            jt jt2 = this.a((Integer)this.ax.elementAt(n));
            if (!jt2.h() && !jt2.c()) continue;
            hx2 = this.C;
            w[] wArray = jt2.h() ? this.ai : this.aj;
            StringBuffer stringBuffer = new StringBuffer();
            stringBuffer.append(jt2.b.v());
            string = bu.h(jt2);
            if (string != null) {
                stringBuffer.append(string);
            }
            stringBuffer.append("\n");
            if (jt2.h()) {
                string = jt2.c(false);
                if (!ed.b(string)) {
                    stringBuffer.append(string);
                }
                if (!ed.b(string2 = jt2.i())) {
                    if (!ed.b(string)) {
                        stringBuffer.append("\n");
                    }
                    stringBuffer.append(string2);
                }
            } else if (jt2.c()) {
                stringBuffer.append(lh.d(166));
            }
            string = stringBuffer.toString();
            string2 = this.a(jt2.k(), jt2.e);
            new mb((bu)this, (int)0, (int)0, (int)dz.a((hx)hx2), (int)4, (int)0, (w)this.D, (String)string, (boolean)false, (lc)ps.a().k, (int)0, (int)0, (w[])wArray, null, (jt)jt2, (String)string2).u = true;
            hx2.d(mb2);
            this.aG.a(jt2.h(), mb2, false);
        }
        this.at.d = this.a(lh.d(232), this.C, 4);
        this.a((d)this.B);
    }

    public final ft e() {
        jt jt2 = this.a(this.z.w());
        ft ft2 = new ft(ps.c, ps.d, this.u.n(), this.u.m(), false);
        hx hx2 = ps.a(ft2);
        ft2.b(hx2);
        dr dr2 = new dr(true, 4);
        String string = jt2.b.v();
        String string2 = bu.h(jt2);
        if (string2 != null) {
            string = string + string2;
        }
        hc hc2 = bu.a(hx2.a(), string, new oz(this.E, ps.a().k));
        hc2.j(2);
        hc2.b(true);
        hc2.a(1);
        dr2.d(hc2);
        string = this.a(jt2.k(), jt2.e);
        if (string != null) {
            hc hc3 = bu.a(hx2.a(), string, this.b);
            hc3.b(true);
            hc3.a(1);
            dr2.d(hc3);
        }
        hx2.d(dr2);
        int n = Math.max(0, dr2.r);
        string = jt2.b.c();
        if (!ed.b(string)) {
            n = this.a(hx2, string, n);
        }
        if (!ed.b(string = jt2.i())) {
            n = this.a(hx2, string, n);
        }
        string = !lh.t() ? lh.d(123) : lh.d(541);
        if (lh.v()) {
            string = lh.d(124);
        }
        if ((n = this.a(hx2, string, n) + (ft2.r - ft2.x_()) + 4) < ft2.r) {
            ft2.l(n);
        }
        hx2.B();
        ft2.s();
        if (ft2.s > this.u.m() - this.u.a((byte)14) + dk.b) {
            ft2.k(1);
        }
        return ft2;
    }
}

