package android.support.constraint.i;

import android.support.constraint.i.e;
import android.support.constraint.i.i;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    boolean f416c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final a f417d;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    i f414a = null;

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

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

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

    @Override // android.support.constraint.i.e.a
    public void a(e.a aVar) {
        if (!(aVar instanceof b)) {
            return;
        }
        b bVar = (b) aVar;
        this.f414a = null;
        this.f417d.c();
        int i = 0;
        while (true) {
            a aVar2 = bVar.f417d;
            if (i >= aVar2.f408a) {
                return;
            }
            this.f417d.a(aVar2.h(i), bVar.f417d.i(i), true);
            i++;
        }
    }

    @Override // android.support.constraint.i.e.a
    public i b(e eVar, boolean[] zArr) {
        return this.f417d.g(zArr, null);
    }

    @Override // android.support.constraint.i.e.a
    public void c(i iVar) {
        int i = iVar.f439d;
        float f2 = 1.0f;
        if (i != 1) {
            if (i == 2) {
                f2 = 1000.0f;
            } else if (i == 3) {
                f2 = 1000000.0f;
            } else if (i == 4) {
                f2 = 1.0E9f;
            } else if (i == 5) {
                f2 = 1.0E12f;
            }
        }
        this.f417d.l(iVar, f2);
    }

    @Override // android.support.constraint.i.e.a
    public void clear() {
        this.f417d.c();
        this.f414a = null;
        this.f415b = 0.0f;
    }

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

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

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

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

    @Override // android.support.constraint.i.e.a
    public i getKey() {
        return this.f414a;
    }

    b h(i iVar, int i) {
        this.f414a = iVar;
        float f2 = i;
        iVar.f440e = f2;
        this.f415b = f2;
        this.f418e = true;
        return this;
    }

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

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

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

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

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

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

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

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

    void q() {
        float f2 = this.f415b;
        if (f2 < 0.0f) {
            this.f415b = f2 * (-1.0f);
            this.f417d.j();
        }
    }

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

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

    public boolean t() {
        return this.f414a == null && this.f415b == 0.0f && this.f417d.f408a == 0;
    }

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

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

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

    public void w() {
        this.f414a = null;
        this.f417d.c();
        this.f415b = 0.0f;
        this.f418e = 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: android.support.constraint.i.b.x():java.lang.String");
    }
}
