/*
 * Decompiled with CFR 0.152.
 */
public final class iz
extends iu {
    public static final String b;
    public static final String e;
    public static final String c;
    public static final String d;
    public static final String f;
    public static final String g;
    public static final String h;
    public static final String i;
    public static final String j;
    public static final w k;
    public final String a = lh.d(428);
    private int p;
    private br S;
    private int o;
    private boolean q;
    private gp r = gp.a("locationMemory");
    public int l;
    public mo m;

    public iz(gd gd2, ck ck2, lh lh2, jt jt2) {
        super(gd2, ck2, lh2, jt2);
    }

    public final ft e() {
        String[] stringArray = new String[]{this.u(), h};
        w[] wArray = new w[]{this.E, this.D};
        return this.u.a(stringArray, wArray, 0);
    }

    public final ck r() {
        return this.x;
    }

    public final ps s() {
        return (ps)this.z;
    }

    public final int a(pz pz2) {
        return this.c(pz2) / 3;
    }

    public final int b(pz pz2) {
        return -this.d(pz2) / 2;
    }

    public final int c(pz pz2) {
        return this.u.b(pz2.l());
    }

    public final int d(pz pz2) {
        return this.u.a(pz2.l());
    }

    public final void a(ht ht2, pz pz2, int n, int n2, int n3) {
        this.u.a(ht2, pz2.l(), n, n2, n3);
    }

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

    public final void a(ps ps2, br br2, int n) {
        this.a(ps2, true, n);
        this.S = br2;
    }

    public final void C() {
    }

    public final void j() {
        this.a(true);
        this.v.D();
        this.z = null;
    }

    public final boolean E() {
        this.d(pb.a(7));
        return true;
    }

    private boolean J() {
        return this.l == 1 || this.l == 2 || this.l == 3;
    }

    private String F() {
        boolean bl2 = this.l == 0;
        if (bl2) {
            return "s";
        }
        return "w";
    }

    public final boolean q() {
        ps ps2 = this.s();
        boolean bl2 = this.l == 4;
        return !bl2 && !ps2.g() && ps2.m();
    }

    private int ab() {
        if (!this.q() && iz.Z()) {
            return 1;
        }
        return 0;
    }

    public final void f(ht ht2) {
        if (!this.q()) {
            super.f(ht2);
        }
    }

    private void L() {
        int n = this.V() - this.ab();
        if (n >= 0) {
            this.b(n);
        }
        this.b(false);
    }

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

    private void ac() {
        switch (this.z.i()) {
            case 3: {
                iz.a("m");
                this.L();
                this.y();
                this.d();
            }
            default: {
                return;
            }
            case 0: 
            case 1: 
        }
        iz.a("l");
        this.z();
        int n = this.z.w() + this.ab();
        this.C.l(dz.a((fs)this.C, n));
    }

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

    private void b(boolean bl2) {
        ar ar2 = (ar)this.M();
        if (ar2 != null) {
            if (bl2) {
                this.v.a(ar2.a(), false);
                return;
            }
            this.v.a(ar2.a());
        }
    }

    public final void a(hh hh2) {
        block3: {
            this.G.a((fb[])null);
            this.z = hh2;
            if (hh2 != null && hh2 instanceof ps) {
                for (int i = 0; i < hh2.a(); ++i) {
                    if (hh2.c(i).l() == 2) {
                        continue;
                    }
                    break block3;
                }
                this.v.a(this);
                this.d();
            }
        }
    }

    public final String t() {
        String string = lh.o();
        StringBuffer stringBuffer = new StringBuffer().append(this.s().c);
        string = !string.startsWith("ja") ? " loc: " : " ";
        return stringBuffer.append(string).append(this.u()).toString();
    }

    public final cq n() {
        if (this.S()) {
            if (this.q()) {
                return jy.e;
            }
            if (lh.t() && !lh.u()) {
                return jy.q;
            }
            return jy.c;
        }
        if (lh.t() && !this.q()) {
            return jy.r;
        }
        return null;
    }

    public final cq m() {
        if (this.z.i() != 3) {
            return super.m();
        }
        if (this.q()) {
            return jy.h;
        }
        return jy.g;
    }

    public final String u() {
        if (!this.q()) {
            return ((ar)this.z.c(this.z.w())).d();
        }
        return this.s().d;
    }

    public final String i() {
        if (!lh.t() && this.z.a() != 1 && !this.S()) {
            StringBuffer stringBuffer = new StringBuffer();
            int n = this.z.w();
            if (n != 0) {
                if (n != this.z.a() - 1) {
                    stringBuffer.append(e);
                    stringBuffer.append("   ");
                    stringBuffer.append(f);
                } else {
                    stringBuffer.append(d);
                }
            } else {
                stringBuffer.append(c);
            }
            if (stringBuffer.length() > 0) {
                stringBuffer.append("\n");
            }
            stringBuffer.append(g);
            if (stringBuffer.length() > 0) {
                return stringBuffer.toString();
            }
        }
        return null;
    }

    static {
        lh.k();
        b = lh.d(61);
        c = lh.d(401);
        d = lh.d(404);
        e = lh.d(414);
        f = lh.d(412);
        g = lh.d(15);
        String string = !lh.t() ? lh.d(527) : lh.d(548);
        h = string;
        i = lh.d(481);
        j = lh.d(92);
        k = jj.a();
    }

    public final void b() {
        this.B = this.u.a(true, true, lh.u());
        this.C = (hx)this.B.a();
        this.a(k, b, this.C);
        if (this.J()) {
            String string = this.q ? i : j;
            this.c(string, this.C);
        }
        ps ps2 = this.s();
        if (!this.q()) {
            if (iz.Z()) {
                this.a(this.a, this.C, 4).c(-5636096, -5636096);
            }
            for (int i = 0; i < ps2.a(); ++i) {
                this.b(((ar)ps2.c(i)).d(), this.C);
            }
        } else {
            this.b(ps2.d, this.C);
        }
        this.C.s();
        this.C.B();
    }

    public final void g() {
        block10: {
            block8: {
                block9: {
                    if (this.z.i() == 0) break block8;
                    if (this.q() || this.z.i() != 3) break block9;
                    if (this.V() == 0) break block10;
                    this.L();
                }
                if (this.J()) {
                    fk fk2;
                    int n = this.z.w();
                    if (!this.q) {
                        this.m.m = fk2 = this.m.n[n];
                    } else {
                        this.m.k = fk2 = this.m.l[n];
                    }
                    if (bz.b(fk2)) {
                        this.r.a(fk2);
                    }
                    this.m.p();
                }
                this.a(false);
                this.v.C();
                if (this.S != null && this.l == 4) {
                    this.S.a((ar)this.z.j());
                }
                this.z = null;
            }
            return;
        }
        this.ac();
    }

    /*
     * Enabled force condition propagation
     * Lifted jumps to return sites
     */
    public final boolean c(pb pb2) {
        int n;
        if (pb2.b() == '#' && !this.q()) {
            this.ac();
            return true;
        }
        if (pb2.c == 7) {
            this.g();
            return true;
        }
        if (pb2.c == 8) {
            this.j();
            return true;
        }
        char c = pb2.b();
        byte by2 = this.z.i();
        if (!this.S()) {
            n = this.z.w();
            if (c == this.t && n > 0) {
                iz.a("p");
                --n;
            } else if (c == this.s && n < this.z.a() - 1) {
                iz.a("n");
                ++n;
            }
            if (n != this.z.w() || by2 == 0 && (c == this.t || c == this.s)) {
                this.y();
                this.b(n);
                this.b(true);
                return true;
            }
            n = 0;
        } else {
            n = 0;
        }
        if (n != 0) return true;
        if (pb2.b() != '*') return false;
        if (this.q()) return true;
        return false;
    }

    public final void a(mo mo2, int n) {
        this.m = mo2;
        this.l = n;
        int n2 = n == 2 ? 1 : 0;
        this.q = n2;
        if (n == 1) {
            n2 = mo2.l != null ? 1 : 0;
            this.q = n2;
        }
        fk[] fkArray = this.q ? mo2.l : mo2.n;
        ar[] arArray = new ar[fkArray.length];
        for (n2 = 0; n2 < fkArray.length; ++n2) {
            arArray[n2] = new ar(fkArray[n2].c, fkArray[n2].e, fkArray[n2].b, "", "", 2);
        }
        this.a(new ps(arArray, null, null, 3), true, n);
    }

    public final void d(ht ht2) {
        int n;
        if (!this.v.f) {
            for (n = 0; n < this.z.a(); ++n) {
                ar ar2 = (ar)this.z.c(this.z.d(n));
                if (ar2 == null || ar2.a() == null) continue;
                this.x.a(ar2.a(), this.y);
                this.u.a(ht2, ar2.b, this.y.a, this.y.b);
            }
        }
        for (n = 0; n < this.z.a(); ++n) {
            int n2 = this.z.d(n);
            pz pz2 = this.z.c(n2);
            if (pz2 == null || pz2.a() == null) continue;
            this.x.a(pz2.a(), this.y);
            this.a(ht2, pz2, this.y.a, this.y.b, n2);
        }
    }

    public final void a(ps ps2, boolean bl2, int n) {
        int n2 = Integer.MAX_VALUE;
        this.l = n;
        int n3 = Integer.MIN_VALUE;
        int n4 = Integer.MIN_VALUE;
        n = Integer.MAX_VALUE;
        ps2.p = (byte)3;
        this.c(ps2);
        me.a((short)56, "s", me.a(new String[]{"m=" + this.F(), "c=" + this.z.a()}));
        for (int i = 0; i < this.z.a(); ++i) {
            iv iv2 = this.z.c(i).a();
            if (iv2 == null) continue;
            n2 = Math.min(iv2.a, n2);
            n4 = Math.max(iv2.a, n4);
            n = Math.min(iv2.b, n);
            n3 = Math.max(iv2.b, n3);
        }
        this.o = n4 - n2;
        this.p = n3 - n;
        this.b(0);
        if (bl2 && !this.q()) {
            this.x.a(this.o, this.p);
        }
        this.S = null;
    }

    private void a(boolean bl2) {
        String string = !bl2 ? String.valueOf(this.z.w()) : "b";
        me.a((short)56, "e", me.a(new String[]{"m=" + this.F(), "r=" + string}));
    }
}

