package o;

import java.util.ArrayList;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.o9, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public class C2029o9 {
    public final C1268g9 d;
    public R90 a = null;
    public float b = 0.0f;
    public final ArrayList c = new ArrayList();
    public boolean e = false;

    public C2029o9(C3126zm0 c3126zm0) {
        this.d = new C1268g9(this, c3126zm0);
    }

    public final void a(C2991yL c2991yL, int i) {
        this.d.g(c2991yL.j(i), 1.0f);
        this.d.g(c2991yL.j(i), -1.0f);
    }

    public final void b(R90 r90, R90 r902, R90 r903, int i) {
        boolean z = false;
        if (i != 0) {
            if (i < 0) {
                i *= -1;
                z = true;
            }
            this.b = i;
        }
        if (z) {
            this.d.g(r90, 1.0f);
            this.d.g(r902, -1.0f);
            this.d.g(r903, -1.0f);
        } else {
            this.d.g(r90, -1.0f);
            this.d.g(r902, 1.0f);
            this.d.g(r903, 1.0f);
        }
    }

    public final void c(R90 r90, R90 r902, R90 r903, int i) {
        boolean z = false;
        if (i != 0) {
            if (i < 0) {
                i *= -1;
                z = true;
            }
            this.b = i;
        }
        if (z) {
            this.d.g(r90, 1.0f);
            this.d.g(r902, -1.0f);
            this.d.g(r903, 1.0f);
        } else {
            this.d.g(r90, -1.0f);
            this.d.g(r902, 1.0f);
            this.d.g(r903, -1.0f);
        }
    }

    public R90 d(boolean[] zArr) {
        return f(zArr, null);
    }

    public boolean e() {
        return this.a == null && this.b == 0.0f && this.d.d() == 0;
    }

    public final R90 f(boolean[] zArr, R90 r90) {
        int i;
        int iD = this.d.d();
        R90 r902 = null;
        float f = 0.0f;
        for (int i2 = 0; i2 < iD; i2++) {
            float f2 = this.d.f(i2);
            if (f2 < 0.0f) {
                R90 r90E = this.d.e(i2);
                if ((zArr == null || !zArr[r90E.m]) && r90E != r90 && (((i = r90E.w) == 3 || i == 4) && f2 < f)) {
                    f = f2;
                    r902 = r90E;
                }
            }
        }
        return r902;
    }

    public final void g(R90 r90) {
        R90 r902 = this.a;
        if (r902 != null) {
            this.d.g(r902, -1.0f);
            this.a.n = -1;
            this.a = null;
        }
        float fH = this.d.h(r90, true) * (-1.0f);
        this.a = r90;
        if (fH == 1.0f) {
            return;
        }
        this.b /= fH;
        C1268g9 c1268g9 = this.d;
        int i = c1268g9.h;
        for (int i2 = 0; i != -1 && i2 < c1268g9.a; i2++) {
            float[] fArr = c1268g9.g;
            fArr[i] = fArr[i] / fH;
            i = c1268g9.f[i];
        }
    }

    public final void h(C2991yL c2991yL, R90 r90, boolean z) {
        if (r90.q) {
            float fC = this.d.c(r90);
            this.b = (r90.p * fC) + this.b;
            this.d.h(r90, z);
            if (z) {
                r90.b(this);
            }
            if (this.d.d() == 0) {
                this.e = true;
                c2991yL.b = true;
            }
        }
    }

    public void i(C2991yL c2991yL, C2029o9 c2029o9, boolean z) {
        C1268g9 c1268g9 = this.d;
        c1268g9.getClass();
        float fC = c1268g9.c(c2029o9.a);
        c1268g9.h(c2029o9.a, z);
        C1268g9 c1268g92 = c2029o9.d;
        int iD = c1268g92.d();
        for (int i = 0; i < iD; i++) {
            R90 r90E = c1268g92.e(i);
            c1268g9.a(r90E, c1268g92.c(r90E) * fC, z);
        }
        this.b = (c2029o9.b * fC) + this.b;
        if (z) {
            c2029o9.a.b(this);
        }
        if (this.a == null || this.d.d() != 0) {
            return;
        }
        this.e = true;
        c2991yL.b = true;
    }

    /* JADX WARN: Removed duplicated region for block: B:29:0x0080  */
    /* JADX WARN: Removed duplicated region for block: B:30:0x0085  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public java.lang.String toString() {
        /*
            r10 = this;
            o.R90 r0 = r10.a
            if (r0 != 0) goto L7
            java.lang.String r0 = "0"
            goto L17
        L7:
            java.lang.StringBuilder r0 = new java.lang.StringBuilder
            java.lang.String r1 = ""
            r0.<init>(r1)
            o.R90 r1 = r10.a
            r0.append(r1)
            java.lang.String r0 = r0.toString()
        L17:
            java.lang.String r1 = " = "
            java.lang.String r0 = o.AbstractC2462sn.i(r0, r1)
            float r1 = r10.b
            r2 = 0
            int r1 = (r1 > r2 ? 1 : (r1 == r2 ? 0 : -1))
            r3 = 0
            r4 = 1
            if (r1 == 0) goto L39
            java.lang.StringBuilder r1 = new java.lang.StringBuilder
            r1.<init>()
            r1.append(r0)
            float r0 = r10.b
            r1.append(r0)
            java.lang.String r0 = r1.toString()
            r1 = r4
            goto L3a
        L39:
            r1 = r3
        L3a:
            o.g9 r5 = r10.d
            int r5 = r5.d()
        L40:
            if (r3 >= r5) goto La0
            o.g9 r6 = r10.d
            o.R90 r6 = r6.e(r3)
            if (r6 != 0) goto L4b
            goto L9d
        L4b:
            o.g9 r7 = r10.d
            float r7 = r7.f(r3)
            int r8 = (r7 > r2 ? 1 : (r7 == r2 ? 0 : -1))
            if (r8 != 0) goto L56
            goto L9d
        L56:
            java.lang.String r6 = r6.toString()
            r9 = -1082130432(0xffffffffbf800000, float:-1.0)
            if (r1 != 0) goto L6a
            int r1 = (r7 > r2 ? 1 : (r7 == r2 ? 0 : -1))
            if (r1 >= 0) goto L7a
            java.lang.String r1 = "- "
            java.lang.String r0 = o.AbstractC2462sn.i(r0, r1)
        L68:
            float r7 = r7 * r9
            goto L7a
        L6a:
            if (r8 <= 0) goto L73
            java.lang.String r1 = " + "
            java.lang.String r0 = o.AbstractC2462sn.i(r0, r1)
            goto L7a
        L73:
            java.lang.String r1 = " - "
            java.lang.String r0 = o.AbstractC2462sn.i(r0, r1)
            goto L68
        L7a:
            r1 = 1065353216(0x3f800000, float:1.0)
            int r1 = (r7 > r1 ? 1 : (r7 == r1 ? 0 : -1))
            if (r1 != 0) goto L85
            java.lang.String r0 = o.AbstractC2462sn.i(r0, r6)
            goto L9c
        L85:
            java.lang.StringBuilder r1 = new java.lang.StringBuilder
            r1.<init>()
            r1.append(r0)
            r1.append(r7)
            java.lang.String r0 = " "
            r1.append(r0)
            r1.append(r6)
            java.lang.String r0 = r1.toString()
        L9c:
            r1 = r4
        L9d:
            int r3 = r3 + 1
            goto L40
        La0:
            if (r1 != 0) goto La8
            java.lang.String r1 = "0.0"
            java.lang.String r0 = o.AbstractC2462sn.i(r0, r1)
        La8:
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C2029o9.toString():java.lang.String");
    }
}
