package o;

import java.util.ArrayList;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.nF, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1941nF extends AbstractC0745al0 {
    public static final int[] k = new int[2];

    public static void m(int[] iArr, int i, int i2, int i3, int i4, float f, int i5) {
        int i6 = i2 - i;
        int i7 = i4 - i3;
        if (i5 != -1) {
            if (i5 == 0) {
                iArr[0] = (int) ((i7 * f) + 0.5f);
                iArr[1] = i7;
                return;
            } else {
                if (i5 != 1) {
                    return;
                }
                iArr[0] = i6;
                iArr[1] = (int) ((i6 * f) + 0.5f);
                return;
            }
        }
        int i8 = (int) ((i7 * f) + 0.5f);
        int i9 = (int) ((i6 / f) + 0.5f);
        if (i8 <= i6) {
            iArr[0] = i8;
            iArr[1] = i7;
        } else if (i9 <= i7) {
            iArr[0] = i6;
            iArr[1] = i9;
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:116:0x0268  */
    /* JADX WARN: Removed duplicated region for block: B:11:0x0026  */
    @Override // o.InterfaceC2755vr
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void a(o.InterfaceC2755vr r24) {
        /*
            Method dump skipped, instructions count: 901
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C1941nF.a(o.vr):void");
    }

    @Override // o.AbstractC0745al0
    public final void d() {
        C0530Ul c0530Ul;
        C0530Ul c0530Ul2;
        int i;
        C0530Ul c0530Ul3;
        C0530Ul c0530Ul4;
        int i2;
        C0530Ul c0530Ul5 = this.b;
        boolean z = c0530Ul5.a;
        C0588Wr c0588Wr = this.e;
        if (z) {
            c0588Wr.d(c0530Ul5.q());
        }
        boolean z2 = c0588Wr.j;
        ArrayList arrayList = c0588Wr.k;
        ArrayList arrayList2 = c0588Wr.l;
        C0017Ar c0017Ar = this.i;
        C0017Ar c0017Ar2 = this.h;
        if (!z2) {
            C0530Ul c0530Ul6 = this.b;
            int i3 = c0530Ul6.p0[0];
            this.d = i3;
            if (i3 != 3) {
                if (i3 == 4 && (c0530Ul4 = c0530Ul6.T) != null && ((i2 = c0530Ul4.p0[0]) == 1 || i2 == 4)) {
                    int iQ = (c0530Ul4.q() - this.b.I.e()) - this.b.K.e();
                    AbstractC0745al0.b(c0017Ar2, c0530Ul4.d.h, this.b.I.e());
                    AbstractC0745al0.b(c0017Ar, c0530Ul4.d.i, -this.b.K.e());
                    c0588Wr.d(iQ);
                    return;
                }
                if (i3 == 1) {
                    c0588Wr.d(c0530Ul6.q());
                }
            }
        } else if (this.d == 4 && (c0530Ul2 = (c0530Ul = this.b).T) != null && ((i = c0530Ul2.p0[0]) == 1 || i == 4)) {
            AbstractC0745al0.b(c0017Ar2, c0530Ul2.d.h, c0530Ul.I.e());
            AbstractC0745al0.b(c0017Ar, c0530Ul2.d.i, -this.b.K.e());
            return;
        }
        if (c0588Wr.j) {
            C0530Ul c0530Ul7 = this.b;
            if (c0530Ul7.a) {
                C3123zl[] c3123zlArr = c0530Ul7.Q;
                C3123zl c3123zl = c3123zlArr[0];
                C3123zl c3123zl2 = c3123zl.f;
                if (c3123zl2 != null && c3123zlArr[1].f != null) {
                    if (c0530Ul7.x()) {
                        c0017Ar2.f = this.b.Q[0].e();
                        c0017Ar.f = -this.b.Q[1].e();
                        return;
                    }
                    C0017Ar c0017ArH = AbstractC0745al0.h(this.b.Q[0]);
                    if (c0017ArH != null) {
                        AbstractC0745al0.b(c0017Ar2, c0017ArH, this.b.Q[0].e());
                    }
                    C0017Ar c0017ArH2 = AbstractC0745al0.h(this.b.Q[1]);
                    if (c0017ArH2 != null) {
                        AbstractC0745al0.b(c0017Ar, c0017ArH2, -this.b.Q[1].e());
                    }
                    c0017Ar2.b = true;
                    c0017Ar.b = true;
                    return;
                }
                if (c3123zl2 != null) {
                    C0017Ar c0017ArH3 = AbstractC0745al0.h(c3123zl);
                    if (c0017ArH3 != null) {
                        AbstractC0745al0.b(c0017Ar2, c0017ArH3, this.b.Q[0].e());
                        AbstractC0745al0.b(c0017Ar, c0017Ar2, c0588Wr.g);
                        return;
                    }
                    return;
                }
                C3123zl c3123zl3 = c3123zlArr[1];
                if (c3123zl3.f != null) {
                    C0017Ar c0017ArH4 = AbstractC0745al0.h(c3123zl3);
                    if (c0017ArH4 != null) {
                        AbstractC0745al0.b(c0017Ar, c0017ArH4, -this.b.Q[1].e());
                        AbstractC0745al0.b(c0017Ar2, c0017Ar, -c0588Wr.g);
                        return;
                    }
                    return;
                }
                if ((c0530Ul7 instanceof AbstractC0701aF) || c0530Ul7.T == null || c0530Ul7.i(7).f != null) {
                    return;
                }
                C0530Ul c0530Ul8 = this.b;
                AbstractC0745al0.b(c0017Ar2, c0530Ul8.T.d.h, c0530Ul8.r());
                AbstractC0745al0.b(c0017Ar, c0017Ar2, c0588Wr.g);
                return;
            }
        }
        if (this.d == 3) {
            C0530Ul c0530Ul9 = this.b;
            int i4 = c0530Ul9.r;
            if (i4 == 2) {
                C0530Ul c0530Ul10 = c0530Ul9.T;
                if (c0530Ul10 != null) {
                    C0588Wr c0588Wr2 = c0530Ul10.e.e;
                    arrayList2.add(c0588Wr2);
                    c0588Wr2.k.add(c0588Wr);
                    c0588Wr.b = true;
                    arrayList.add(c0017Ar2);
                    arrayList.add(c0017Ar);
                }
            } else if (i4 == 3) {
                if (c0530Ul9.s == 3) {
                    c0017Ar2.a = this;
                    c0017Ar.a = this;
                    C3120zj0 c3120zj0 = c0530Ul9.e;
                    c3120zj0.h.a = this;
                    c3120zj0.i.a = this;
                    c0588Wr.a = this;
                    if (c0530Ul9.y()) {
                        arrayList2.add(this.b.e.e);
                        this.b.e.e.k.add(c0588Wr);
                        C3120zj0 c3120zj02 = this.b.e;
                        c3120zj02.e.a = this;
                        arrayList2.add(c3120zj02.h);
                        arrayList2.add(this.b.e.i);
                        this.b.e.h.k.add(c0588Wr);
                        this.b.e.i.k.add(c0588Wr);
                    } else if (this.b.x()) {
                        this.b.e.e.l.add(c0588Wr);
                        arrayList.add(this.b.e.e);
                    } else {
                        this.b.e.e.l.add(c0588Wr);
                    }
                } else {
                    C0588Wr c0588Wr3 = c0530Ul9.e.e;
                    arrayList2.add(c0588Wr3);
                    c0588Wr3.k.add(c0588Wr);
                    this.b.e.h.k.add(c0588Wr);
                    this.b.e.i.k.add(c0588Wr);
                    c0588Wr.b = true;
                    arrayList.add(c0017Ar2);
                    arrayList.add(c0017Ar);
                    c0017Ar2.l.add(c0588Wr);
                    c0017Ar.l.add(c0588Wr);
                }
            }
        }
        C0530Ul c0530Ul11 = this.b;
        C3123zl[] c3123zlArr2 = c0530Ul11.Q;
        C3123zl c3123zl4 = c3123zlArr2[0];
        C3123zl c3123zl5 = c3123zl4.f;
        if (c3123zl5 != null && c3123zlArr2[1].f != null) {
            if (c0530Ul11.x()) {
                c0017Ar2.f = this.b.Q[0].e();
                c0017Ar.f = -this.b.Q[1].e();
                return;
            }
            C0017Ar c0017ArH5 = AbstractC0745al0.h(this.b.Q[0]);
            C0017Ar c0017ArH6 = AbstractC0745al0.h(this.b.Q[1]);
            if (c0017ArH5 != null) {
                c0017ArH5.b(this);
            }
            if (c0017ArH6 != null) {
                c0017ArH6.b(this);
            }
            this.j = 4;
            return;
        }
        if (c3123zl5 != null) {
            C0017Ar c0017ArH7 = AbstractC0745al0.h(c3123zl4);
            if (c0017ArH7 != null) {
                AbstractC0745al0.b(c0017Ar2, c0017ArH7, this.b.Q[0].e());
                c(c0017Ar, c0017Ar2, 1, c0588Wr);
                return;
            }
            return;
        }
        C3123zl c3123zl6 = c3123zlArr2[1];
        if (c3123zl6.f != null) {
            C0017Ar c0017ArH8 = AbstractC0745al0.h(c3123zl6);
            if (c0017ArH8 != null) {
                AbstractC0745al0.b(c0017Ar, c0017ArH8, -this.b.Q[1].e());
                c(c0017Ar2, c0017Ar, -1, c0588Wr);
                return;
            }
            return;
        }
        if ((c0530Ul11 instanceof AbstractC0701aF) || (c0530Ul3 = c0530Ul11.T) == null) {
            return;
        }
        AbstractC0745al0.b(c0017Ar2, c0530Ul3.d.h, c0530Ul11.r());
        c(c0017Ar, c0017Ar2, 1, c0588Wr);
    }

    @Override // o.AbstractC0745al0
    public final void e() {
        C0017Ar c0017Ar = this.h;
        if (c0017Ar.j) {
            this.b.Y = c0017Ar.g;
        }
    }

    @Override // o.AbstractC0745al0
    public final void f() {
        this.c = null;
        this.h.c();
        this.i.c();
        this.e.c();
        this.g = false;
    }

    @Override // o.AbstractC0745al0
    public final boolean k() {
        return this.d != 3 || this.b.r == 0;
    }

    public final void n() {
        this.g = false;
        C0017Ar c0017Ar = this.h;
        c0017Ar.c();
        c0017Ar.j = false;
        C0017Ar c0017Ar2 = this.i;
        c0017Ar2.c();
        c0017Ar2.j = false;
        this.e.j = false;
    }

    public final String toString() {
        return "HorizontalRun " + this.b.h0;
    }
}
