/*
 * Decompiled with CFR 0.152.
 */
public final class db
extends fo {
    private ij[] l;
    private int m;
    private int n;
    private String o;
    private String p;
    private int q;
    private boolean r;

    public db(ds ds2, int n) {
        super(ds2, n);
    }

    public final String a(boolean bl2) {
        ij ij2 = this.f(bl2);
        if (ij2 != null && ij2.a()) {
            return ij2.a;
        }
        return null;
    }

    public final boolean b(boolean bl2) {
        Object object = this.k;
        synchronized (object) {
            ij ij2 = this.f(bl2);
            if (ij2 != null && !ij2.a()) {
                this.a.b(lh.d(506));
                return false;
            }
            int n = this.m;
            int n2 = !bl2 ? -1 : 1;
            n2 = n + n2;
            if (!this.h.b.equals(this.a(bl2))) {
                if (bl2 = super.b(bl2)) {
                    this.n = n2;
                }
                return bl2;
            }
            this.n = n2;
            this.l();
            return true;
        }
    }

    public final void a(int n, ij[] ijArray) {
        ij ij2 = ijArray[n];
        Object object = this.k;
        synchronized (object) {
            this.m = n;
            this.n = n;
            this.l = ijArray;
            this.a(new eh((jb)this, ij2.a));
            return;
        }
    }

    public final void a(ht ht2, int n, int n2, int n3, int n4, boolean bl2, int n5, boolean bl3) {
        if (this.h != null && this.r) {
            n += n3 / 2;
            n3 = this.q - n5 & 0xFFFF;
            ps.a().a(ht2, n, n2 += n4 - n4 / 6, gu.f(n3), bl2);
        }
    }

    private static int a(iv iv2, iv iv3) {
        return gu.b(iv3.b - iv2.b, iv3.a - iv2.a);
    }

    public final boolean a() {
        return true;
    }

    private ij f(boolean n) {
        if ((n = n != 0 ? this.m + 1 : this.m - 1) >= 0 && n < this.l.length) {
            return this.l[n];
        }
        return null;
    }

    public final String b() {
        return this.o;
    }

    public final String c() {
        if (this.f) {
            return null;
        }
        return this.p;
    }

    private void l() {
        block7: {
            iv iv2;
            iv iv3;
            iv iv4;
            iv iv5;
            block6: {
                ij ij2;
                block5: {
                    this.m = this.n;
                    this.n = -1;
                    ij ij3 = this.l[this.m];
                    this.o = ed.a(ed.a(ij3.b), true, true, false);
                    this.p = ij3.f;
                    ij2 = this.l[this.m];
                    if (ij2.d == null) break block5;
                    if (ij2.c != null) {
                        iv5 = ij2.d;
                        iv4 = ij2.a;
                        iv3 = ij2.a;
                        iv2 = ij2.c;
                        this.r = true;
                    } else {
                        iv5 = ij2.d;
                        iv4 = ij2.a;
                        iv3 = ij2.d;
                        iv2 = ij2.a;
                        this.r = false;
                    }
                    break block6;
                }
                if (ij2.c == null) break block7;
                iv5 = ij2.a;
                iv4 = ij2.c;
                iv3 = ij2.a;
                iv2 = ij2.c;
                this.r = true;
            }
            this.g = db.a(iv5, iv4);
            this.q = db.a(iv3, iv2);
            return;
        }
        this.r = false;
        this.g = 0;
    }

    public final void a(ck ck2, boolean bl2) {
        this.l();
    }
}

