package g.d.a;

import g.d.a.e;
import g.d.a.i;

/* JADX INFO: compiled from: ArrayRow.java */
/* JADX INFO: loaded from: classes.dex */
public class b implements e.a {
    boolean c;
    public final a d;
    i a = null;
    float b = 0.0f;
    boolean e = false;

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

    @Override // g.d.a.e.a
    public void a(e.a aVar) {
        if (!(aVar instanceof b)) {
            return;
        }
        b bVar = (b) aVar;
        this.a = null;
        this.d.c();
        int i2 = 0;
        while (true) {
            a aVar2 = bVar.d;
            if (i2 >= aVar2.a) {
                return;
            }
            this.d.a(aVar2.h(i2), bVar.d.i(i2), true);
            i2++;
        }
    }

    @Override // g.d.a.e.a
    public void b(i iVar) {
        int i2 = iVar.d;
        float f = 1.0f;
        if (i2 != 1) {
            if (i2 == 2) {
                f = 1000.0f;
            } else if (i2 == 3) {
                f = 1000000.0f;
            } else if (i2 == 4) {
                f = 1.0E9f;
            } else if (i2 == 5) {
                f = 1.0E12f;
            }
        }
        this.d.l(iVar, f);
    }

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

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

    public b d(e eVar, int i2) {
        this.d.l(eVar.p(i2, "ep"), 1.0f);
        this.d.l(eVar.p(i2, "em"), -1.0f);
        return this;
    }

    b e(i iVar, int i2) {
        this.d.l(iVar, i2);
        return this;
    }

    boolean f(e eVar) {
        boolean z;
        i iVarB = this.d.b(eVar);
        if (iVarB == null) {
            z = true;
        } else {
            v(iVarB);
            z = false;
        }
        if (this.d.a == 0) {
            this.e = true;
        }
        return z;
    }

    b g(i iVar, i iVar2, int i2, float f, i iVar3, i iVar4, int i3) {
        if (iVar2 == iVar3) {
            this.d.l(iVar, 1.0f);
            this.d.l(iVar4, 1.0f);
            this.d.l(iVar2, -2.0f);
            return this;
        }
        if (f == 0.5f) {
            this.d.l(iVar, 1.0f);
            this.d.l(iVar2, -1.0f);
            this.d.l(iVar3, -1.0f);
            this.d.l(iVar4, 1.0f);
            if (i2 > 0 || i3 > 0) {
                this.b = (-i2) + i3;
            }
        } else if (f <= 0.0f) {
            this.d.l(iVar, -1.0f);
            this.d.l(iVar2, 1.0f);
            this.b = i2;
        } else if (f >= 1.0f) {
            this.d.l(iVar3, -1.0f);
            this.d.l(iVar4, 1.0f);
            this.b = i3;
        } else {
            float f2 = 1.0f - f;
            this.d.l(iVar, f2 * 1.0f);
            this.d.l(iVar2, f2 * (-1.0f));
            this.d.l(iVar3, (-1.0f) * f);
            this.d.l(iVar4, 1.0f * f);
            if (i2 > 0 || i3 > 0) {
                this.b = ((-i2) * f2) + (i3 * f);
            }
        }
        return this;
    }

    @Override // g.d.a.e.a
    public i getKey() {
        return this.a;
    }

    b h(i iVar, int i2) {
        this.a = iVar;
        float f = i2;
        iVar.e = f;
        this.b = f;
        this.e = true;
        return this;
    }

    b i(i iVar, i iVar2, i iVar3, float f) {
        this.d.l(iVar, -1.0f);
        this.d.l(iVar2, 1.0f - f);
        this.d.l(iVar3, f);
        return this;
    }

    public b j(i iVar, i iVar2, i iVar3, i iVar4, float f) {
        this.d.l(iVar, -1.0f);
        this.d.l(iVar2, 1.0f);
        this.d.l(iVar3, f);
        this.d.l(iVar4, -f);
        return this;
    }

    public b k(float f, float f2, float f3, i iVar, i iVar2, i iVar3, i iVar4) {
        this.b = 0.0f;
        if (f2 == 0.0f || f == f3) {
            this.d.l(iVar, 1.0f);
            this.d.l(iVar2, -1.0f);
            this.d.l(iVar4, 1.0f);
            this.d.l(iVar3, -1.0f);
        } else if (f == 0.0f) {
            this.d.l(iVar, 1.0f);
            this.d.l(iVar2, -1.0f);
        } else if (f3 == 0.0f) {
            this.d.l(iVar3, 1.0f);
            this.d.l(iVar4, -1.0f);
        } else {
            float f4 = (f / f2) / (f3 / f2);
            this.d.l(iVar, 1.0f);
            this.d.l(iVar2, -1.0f);
            this.d.l(iVar4, f4);
            this.d.l(iVar3, -f4);
        }
        return this;
    }

    public b l(i iVar, int i2) {
        if (i2 < 0) {
            this.b = i2 * (-1);
            this.d.l(iVar, 1.0f);
        } else {
            this.b = i2;
            this.d.l(iVar, -1.0f);
        }
        return this;
    }

    public b m(i iVar, i iVar2, int i2) {
        boolean z = false;
        if (i2 != 0) {
            if (i2 < 0) {
                i2 *= -1;
                z = true;
            }
            this.b = i2;
        }
        if (z) {
            this.d.l(iVar, 1.0f);
            this.d.l(iVar2, -1.0f);
        } else {
            this.d.l(iVar, -1.0f);
            this.d.l(iVar2, 1.0f);
        }
        return this;
    }

    public b n(i iVar, i iVar2, i iVar3, int i2) {
        boolean z = false;
        if (i2 != 0) {
            if (i2 < 0) {
                i2 *= -1;
                z = true;
            }
            this.b = i2;
        }
        if (z) {
            this.d.l(iVar, 1.0f);
            this.d.l(iVar2, -1.0f);
            this.d.l(iVar3, -1.0f);
        } else {
            this.d.l(iVar, -1.0f);
            this.d.l(iVar2, 1.0f);
            this.d.l(iVar3, 1.0f);
        }
        return this;
    }

    public b o(i iVar, i iVar2, i iVar3, int i2) {
        boolean z = false;
        if (i2 != 0) {
            if (i2 < 0) {
                i2 *= -1;
                z = true;
            }
            this.b = i2;
        }
        if (z) {
            this.d.l(iVar, 1.0f);
            this.d.l(iVar2, -1.0f);
            this.d.l(iVar3, 1.0f);
        } else {
            this.d.l(iVar, -1.0f);
            this.d.l(iVar2, 1.0f);
            this.d.l(iVar3, -1.0f);
        }
        return this;
    }

    public b p(i iVar, i iVar2, i iVar3, i iVar4, float f) {
        this.d.l(iVar3, 0.5f);
        this.d.l(iVar4, 0.5f);
        this.d.l(iVar, -0.5f);
        this.d.l(iVar2, -0.5f);
        this.b = -f;
        return this;
    }

    void q() {
        float f = this.b;
        if (f < 0.0f) {
            this.b = f * (-1.0f);
            this.d.j();
        }
    }

    boolean r() {
        i iVar = this.a;
        return iVar != null && (iVar.f469g == i.a.UNRESTRICTED || this.b >= 0.0f);
    }

    boolean s(i iVar) {
        return this.d.d(iVar);
    }

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

    public String toString() {
        return x();
    }

    i u(i iVar) {
        return this.d.g(null, iVar);
    }

    void v(i iVar) {
        i iVar2 = this.a;
        if (iVar2 != null) {
            this.d.l(iVar2, -1.0f);
            this.a = null;
        }
        float fM = this.d.m(iVar, true) * (-1.0f);
        this.a = iVar;
        if (fM == 1.0f) {
            return;
        }
        this.b /= fM;
        this.d.e(fM);
    }

    public void w() {
        this.a = null;
        this.d.c();
        this.b = 0.0f;
        this.e = false;
    }

    /* JADX WARN: Removed duplicated region for block: B:29:0x00bd  */
    /* JADX WARN: Removed duplicated region for block: B:30:0x00cd  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    java.lang.String x() {
        /*
            Method dump skipped, instruction units count: 253
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: g.d.a.b.x():java.lang.String");
    }
}
