package c.e.b;

import c.e.b.d;
import c.e.b.g;
import java.util.ArrayList;

/* JADX INFO: compiled from: ArrayRow.java */
/* JADX INFO: loaded from: classes.dex */
public class b implements d.a {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public a f1073d;
    public g a = null;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public float f1071b = 0.0f;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public ArrayList<g> f1072c = new ArrayList<>();

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public boolean f1074e = false;

    /* JADX INFO: compiled from: ArrayRow.java */
    public interface a {
        int a();

        g b(int i2);

        void c();

        void clear();

        float d(int i2);

        void e(g gVar, float f2, boolean z);

        float f(g gVar);

        boolean g(g gVar);

        float h(b bVar, boolean z);

        void i(g gVar, float f2);

        float j(g gVar, boolean z);

        void k(float f2);
    }

    public b() {
    }

    /* JADX WARN: Removed duplicated region for block: B:17:0x0021  */
    @Override // c.e.b.d.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void a(c.e.b.g r3) {
        /*
            r2 = this;
            int r0 = r3.f1100e
            r1 = 1
            if (r0 != r1) goto L6
            goto L21
        L6:
            r1 = 2
            if (r0 != r1) goto Lc
            r0 = 1148846080(0x447a0000, float:1000.0)
            goto L23
        Lc:
            r1 = 3
            if (r0 != r1) goto L13
            r0 = 1232348160(0x49742400, float:1000000.0)
            goto L23
        L13:
            r1 = 4
            if (r0 != r1) goto L1a
            r0 = 1315859240(0x4e6e6b28, float:1.0E9)
            goto L23
        L1a:
            r1 = 5
            if (r0 != r1) goto L21
            r0 = 1399379109(0x5368d4a5, float:1.0E12)
            goto L23
        L21:
            r0 = 1065353216(0x3f800000, float:1.0)
        L23:
            c.e.b.b$a r1 = r2.f1073d
            r1.i(r3, r0)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: c.e.b.b.a(c.e.b.g):void");
    }

    @Override // c.e.b.d.a
    public g b(d dVar, boolean[] zArr) {
        return i(zArr, null);
    }

    public b c(d dVar, int i2) {
        this.f1073d.i(dVar.k(i2, "ep"), 1.0f);
        this.f1073d.i(dVar.k(i2, "em"), -1.0f);
        return this;
    }

    @Override // c.e.b.d.a
    public void clear() {
        this.f1073d.clear();
        this.a = null;
        this.f1071b = 0.0f;
    }

    public b d(g gVar, g gVar2, g gVar3, g gVar4, float f2) {
        this.f1073d.i(gVar, -1.0f);
        this.f1073d.i(gVar2, 1.0f);
        this.f1073d.i(gVar3, f2);
        this.f1073d.i(gVar4, -f2);
        return this;
    }

    public b e(g gVar, g gVar2, g gVar3, int i2) {
        boolean z = false;
        if (i2 != 0) {
            if (i2 < 0) {
                i2 *= -1;
                z = true;
            }
            this.f1071b = i2;
        }
        if (z) {
            this.f1073d.i(gVar, 1.0f);
            this.f1073d.i(gVar2, -1.0f);
            this.f1073d.i(gVar3, -1.0f);
        } else {
            this.f1073d.i(gVar, -1.0f);
            this.f1073d.i(gVar2, 1.0f);
            this.f1073d.i(gVar3, 1.0f);
        }
        return this;
    }

    public b f(g gVar, g gVar2, g gVar3, int i2) {
        boolean z = false;
        if (i2 != 0) {
            if (i2 < 0) {
                i2 *= -1;
                z = true;
            }
            this.f1071b = i2;
        }
        if (z) {
            this.f1073d.i(gVar, 1.0f);
            this.f1073d.i(gVar2, -1.0f);
            this.f1073d.i(gVar3, 1.0f);
        } else {
            this.f1073d.i(gVar, -1.0f);
            this.f1073d.i(gVar2, 1.0f);
            this.f1073d.i(gVar3, -1.0f);
        }
        return this;
    }

    public b g(g gVar, g gVar2, g gVar3, g gVar4, float f2) {
        this.f1073d.i(gVar3, 0.5f);
        this.f1073d.i(gVar4, 0.5f);
        this.f1073d.i(gVar, -0.5f);
        this.f1073d.i(gVar2, -0.5f);
        this.f1071b = -f2;
        return this;
    }

    public final boolean h(g gVar) {
        return gVar.m <= 1;
    }

    public final g i(boolean[] zArr, g gVar) {
        g.a aVar;
        int iA = this.f1073d.a();
        g gVar2 = null;
        float f2 = 0.0f;
        for (int i2 = 0; i2 < iA; i2++) {
            float fD = this.f1073d.d(i2);
            if (fD < 0.0f) {
                g gVarB = this.f1073d.b(i2);
                if ((zArr == null || !zArr[gVarB.f1098c]) && gVarB != gVar && (((aVar = gVarB.f1105j) == g.a.SLACK || aVar == g.a.ERROR) && fD < f2)) {
                    f2 = fD;
                    gVar2 = gVarB;
                }
            }
        }
        return gVar2;
    }

    @Override // c.e.b.d.a
    public boolean isEmpty() {
        return this.a == null && this.f1071b == 0.0f && this.f1073d.a() == 0;
    }

    public void j(g gVar) {
        g gVar2 = this.a;
        if (gVar2 != null) {
            this.f1073d.i(gVar2, -1.0f);
            this.a.f1099d = -1;
            this.a = null;
        }
        float fJ = this.f1073d.j(gVar, true) * (-1.0f);
        this.a = gVar;
        if (fJ == 1.0f) {
            return;
        }
        this.f1071b /= fJ;
        this.f1073d.k(fJ);
    }

    public void k(d dVar, g gVar, boolean z) {
        if (gVar.f1102g) {
            float f2 = this.f1073d.f(gVar);
            this.f1071b = (gVar.f1101f * f2) + this.f1071b;
            this.f1073d.j(gVar, z);
            if (z) {
                gVar.b(this);
            }
            if (this.f1073d.a() == 0) {
                this.f1074e = true;
                dVar.f1080d = true;
            }
        }
    }

    public void l(d dVar, b bVar, boolean z) {
        float fH = this.f1073d.h(bVar, z);
        this.f1071b = (bVar.f1071b * fH) + this.f1071b;
        if (z) {
            bVar.a.b(this);
        }
        if (this.a == null || this.f1073d.a() != 0) {
            return;
        }
        this.f1074e = true;
        dVar.f1080d = true;
    }

    /* JADX WARN: Removed duplicated region for block: B:29:0x007a  */
    /* JADX WARN: Removed duplicated region for block: B:30:0x007f  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public java.lang.String toString() {
        /*
            r10 = this;
            c.e.b.g r0 = r10.a
            if (r0 != 0) goto L7
            java.lang.String r0 = "0"
            goto L16
        L7:
            java.lang.String r0 = ""
            java.lang.StringBuilder r0 = d.b.a.a.a.B(r0)
            c.e.b.g r1 = r10.a
            r0.append(r1)
            java.lang.String r0 = r0.toString()
        L16:
            java.lang.String r1 = " = "
            java.lang.String r0 = d.b.a.a.a.p(r0, r1)
            float r1 = r10.f1071b
            r2 = 0
            int r1 = (r1 > r2 ? 1 : (r1 == r2 ? 0 : -1))
            r3 = 0
            r4 = 1
            if (r1 == 0) goto L34
            java.lang.StringBuilder r0 = d.b.a.a.a.B(r0)
            float r1 = r10.f1071b
            r0.append(r1)
            java.lang.String r0 = r0.toString()
            r1 = r4
            goto L35
        L34:
            r1 = r3
        L35:
            c.e.b.b$a r5 = r10.f1073d
            int r5 = r5.a()
        L3b:
            if (r3 >= r5) goto L9a
            c.e.b.b$a r6 = r10.f1073d
            c.e.b.g r6 = r6.b(r3)
            if (r6 != 0) goto L46
            goto L97
        L46:
            c.e.b.b$a r7 = r10.f1073d
            float r7 = r7.d(r3)
            int r8 = (r7 > r2 ? 1 : (r7 == r2 ? 0 : -1))
            if (r8 != 0) goto L51
            goto L97
        L51:
            java.lang.String r6 = r6.toString()
            r9 = -1082130432(0xffffffffbf800000, float:-1.0)
            if (r1 != 0) goto L64
            int r1 = (r7 > r2 ? 1 : (r7 == r2 ? 0 : -1))
            if (r1 >= 0) goto L74
            java.lang.String r1 = "- "
            java.lang.String r0 = d.b.a.a.a.p(r0, r1)
            goto L73
        L64:
            if (r8 <= 0) goto L6d
            java.lang.String r1 = " + "
            java.lang.String r0 = d.b.a.a.a.p(r0, r1)
            goto L74
        L6d:
            java.lang.String r1 = " - "
            java.lang.String r0 = d.b.a.a.a.p(r0, r1)
        L73:
            float r7 = r7 * r9
        L74:
            r1 = 1065353216(0x3f800000, float:1.0)
            int r1 = (r7 > r1 ? 1 : (r7 == r1 ? 0 : -1))
            if (r1 != 0) goto L7f
            java.lang.String r0 = d.b.a.a.a.p(r0, r6)
            goto L96
        L7f:
            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()
        L96:
            r1 = r4
        L97:
            int r3 = r3 + 1
            goto L3b
        L9a:
            if (r1 != 0) goto La2
            java.lang.String r1 = "0.0"
            java.lang.String r0 = d.b.a.a.a.p(r0, r1)
        La2:
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: c.e.b.b.toString():java.lang.String");
    }

    public b(c cVar) {
        this.f1073d = new c.e.b.a(this, cVar);
    }
}
