/*
 * Decompiled with CFR 0.152.
 */
public final class jc
extends t
implements jb {
    public static final String h = lh.d(64);
    public static final String i = lh.d(63);
    public static final String j = lh.d(420);
    public static final String k = lh.d(431);
    public static final String l = lh.d(554);
    public static final String m = lh.d(294);
    public static final String n = lh.d(503);
    public static final String o = lh.d(31);
    public static final String p = lh.d(507);
    public static final String u = lh.d(179);
    private final Object G = new Object();
    private final ck w;
    private boolean A;
    private iv B;
    private String C;
    private boolean D;
    private oz E;
    private eh F;
    private int x;
    private boolean y;
    private boolean z;
    public int v;

    private void u() {
        Object object = this.G;
        synchronized (object) {
            if (!this.A && !this.z) {
                this.f();
                this.y = true;
                return;
            }
            return;
        }
    }

    public final void a(ht ht2) {
        Object object = this.G;
        synchronized (object) {
            this.y = false;
            this.s.b(ht2, this.s.a >> 1, this.s.b >> 1);
            super.a(ht2);
            return;
        }
    }

    public final void a() {
        me.a((short)16, "c", me.a(new String[]{"a=o", "i="}));
        this.v = 0;
        this.B = this.w.d();
        this.y = false;
        this.C = null;
        this.D = false;
        this.E = null;
        this.F = null;
        ck ck2 = ck.e();
        this.F = null;
        this.E = null;
        this.z = false;
        this.A = false;
        this.A = true;
        iv iv2 = this.w.d();
        this.F = new eh((jb)this, iv2);
        this.z = true;
        iv2 = this.w.d();
        int n = this.w.k();
        int n2 = this.w.l();
        int n3 = this.w.c().b;
        this.E = new oz(iv2, n, n2, n3);
        this.E.b = this;
        if (this.F != null) {
            this.F.a = false;
        }
        if (this.F != null) {
            this.F.j();
        }
        if (this.E != null) {
            ck2.a(this.E);
        }
        super.a();
    }

    public final int a(pb pb2) {
        block16: {
            block15: {
                if (pb2.c == 8) break block15;
                if (this.e.a(pb2) != -3) break block16;
                this.f = ((jp)this.e.r()).c();
                int n = -1;
                if (!h.equals(this.f)) {
                    if (!i.equals(this.f)) {
                        if (!j.equals(this.f)) {
                            if (!jc.n.equals(this.f)) {
                                if (!u.equals(this.f)) {
                                    if (k.equals(this.f)) {
                                        this.v = 4;
                                        n = 41;
                                    }
                                } else {
                                    this.v = 6;
                                }
                            } else {
                                n = 32;
                                this.v = 5;
                                gu.o();
                            }
                        } else {
                            this.v = 3;
                            n = 33;
                        }
                    } else {
                        this.v = 1;
                        n = 31;
                    }
                } else {
                    this.v = 2;
                    n = 30;
                }
                if (n != -1) {
                    me.a((short)16, "c", me.a(new String[]{"a=s", "i=" + n}));
                }
            }
            return 1;
        }
        return 4;
    }

    public final void f() {
        int n = this.e != null ? this.e.g(this.e.q()) : -1;
        this.x = 0;
        int n2 = this.s.a * 80 / 100;
        int n3 = (this.s.b - ps.u() >> 1) - ps.d - 4;
        this.d = new ft(0, ps.d, n2, n3, false);
        this.e = ps.a(this.d);
        this.d.b(this.e);
        String string = !this.z ? (this.C != null ? this.C : l) : m;
        fa fa2 = new fa(this.b, string);
        fa2.l(dz.a(this.e));
        dz.a(this.e, fa2);
        if (gu.j()) {
            this.a(h, true);
            this.a(i, true);
        }
        if (!this.A) {
            if (!this.D) {
                this.a(p, false);
            } else {
                this.a(jc.n, true);
            }
        } else {
            this.a(o, false);
        }
        if (iu.g()) {
            this.a(u, true);
        }
        this.a(j, true);
        this.a(k, true);
        this.e.B();
        if (this.e.r - 8 - this.e.h - this.x > 0) {
            this.e.l(this.d.x_());
        }
        n2 = this.s.a + ps.t() >> 1;
        n3 = this.s.b - ps.u() >> 1;
        this.d.j(this.s.a - this.d.r >> 1);
        this.d.d(n2, n3);
        if (n >= 0) {
            gm gm2 = this.e.h(n);
            gm2.z();
            this.e.b(gm2);
            return;
        }
        this.e.s();
    }

    public final void l() {
        if (this.t && this.E != null && this.E.a) {
            this.z = false;
            if (this.E.e() > 0) {
                this.C = this.E.a(0).a();
            }
            this.u();
        }
    }

    public final void b(eh eh2) {
        if (this.t && eh2 == this.F) {
            this.A = false;
            this.D = eh2.f();
            this.u();
        }
    }

    /*
     * Enabled aggressive block sorting
     */
    public final boolean a(boolean bl2) {
        if (!this.w.d().equals(this.B)) {
            this.o();
            return false;
        } else {
            if (!super.a(bl2) && !this.y) return false;
            return true;
        }
    }

    private jp a(String string, boolean bl2) {
        this.a(string, 4).e = bl2;
        jp jp2 = this.a(string, 4);
        this.x = Math.max(this.x, this.b.a(string) + 8);
        return jp2;
    }

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

    public final void b() {
        super.b();
        me.a((short)16, "c", me.a(new String[]{"a=c", "i="}));
    }

    public jc(eb eb2, ck ck2) {
        super(eb2);
        this.w = ck2;
    }
}

