package ῲ.ⁱ.ῲ.㿎;

import androidx.constraintlayout.solver.SolverVariable;
import androidx.constraintlayout.solver.widgets.ConstraintAnchor;
import androidx.constraintlayout.solver.widgets.ConstraintWidget;
import java.util.HashMap;
import ඓ.K.K.K.C1293;
import ῲ.ⁱ.ῲ.C2073;
import ῲ.ⁱ.ῲ.C2080;

/* renamed from: ῲ.ⁱ.ῲ.㿎.K  reason: contains not printable characters */
/* compiled from: Barrier */
public class C2103 extends C2102 {

    /* renamed from: ჹ  reason: contains not printable characters */
    public int f7280 = 0;

    /* renamed from: ᑁ  reason: contains not printable characters */
    public boolean f7281 = false;

    /* renamed from: ẫ  reason: contains not printable characters */
    public int f7282 = 0;

    /* renamed from: 㒎  reason: contains not printable characters */
    public boolean f7283 = true;

    @Override // androidx.constraintlayout.solver.widgets.ConstraintWidget
    public String toString() {
        String r0 = C1293.m3414(C1293.m3416("[Barrier] "), this.f893, " {");
        for (int i = 0; i < this.f7278; i++) {
            ConstraintWidget constraintWidget = this.f7279[i];
            if (i > 0) {
                r0 = C1293.m3412(r0, ", ");
            }
            StringBuilder r02 = C1293.m3416(r0);
            r02.append(constraintWidget.f893);
            r0 = r02.toString();
        }
        return C1293.m3412(r0, "}");
    }

    /* renamed from: Ԛ  reason: contains not printable characters */
    public boolean m5560() {
        int i;
        int i2;
        int i3;
        int i4 = 0;
        boolean z = true;
        while (true) {
            i = this.f7278;
            if (i4 >= i) {
                break;
            }
            ConstraintWidget constraintWidget = this.f7279[i4];
            if ((this.f7283 || constraintWidget.m484()) && ((((i2 = this.f7282) == 0 || i2 == 1) && !constraintWidget.m504()) || (((i3 = this.f7282) == 2 || i3 == 3) && !constraintWidget.m471()))) {
                z = false;
            }
            i4++;
        }
        if (!z || i <= 0) {
            return false;
        }
        int i5 = 0;
        boolean z2 = false;
        for (int i6 = 0; i6 < this.f7278; i6++) {
            ConstraintWidget constraintWidget2 = this.f7279[i6];
            if (this.f7283 || constraintWidget2.m484()) {
                if (!z2) {
                    int i7 = this.f7282;
                    if (i7 == 0) {
                        i5 = constraintWidget2.m488(ConstraintAnchor.Type.LEFT).m459();
                    } else if (i7 == 1) {
                        i5 = constraintWidget2.m488(ConstraintAnchor.Type.RIGHT).m459();
                    } else if (i7 == 2) {
                        i5 = constraintWidget2.m488(ConstraintAnchor.Type.TOP).m459();
                    } else if (i7 == 3) {
                        i5 = constraintWidget2.m488(ConstraintAnchor.Type.BOTTOM).m459();
                    }
                    z2 = true;
                }
                int i8 = this.f7282;
                if (i8 == 0) {
                    i5 = Math.min(i5, constraintWidget2.m488(ConstraintAnchor.Type.LEFT).m459());
                } else if (i8 == 1) {
                    i5 = Math.max(i5, constraintWidget2.m488(ConstraintAnchor.Type.RIGHT).m459());
                } else if (i8 == 2) {
                    i5 = Math.min(i5, constraintWidget2.m488(ConstraintAnchor.Type.TOP).m459());
                } else if (i8 == 3) {
                    i5 = Math.max(i5, constraintWidget2.m488(ConstraintAnchor.Type.BOTTOM).m459());
                }
            }
        }
        int i9 = i5 + this.f7280;
        int i10 = this.f7282;
        if (i10 == 0 || i10 == 1) {
            m489(i9, i9);
        } else {
            m481(i9, i9);
        }
        this.f7281 = true;
        return true;
    }

    @Override // androidx.constraintlayout.solver.widgets.ConstraintWidget
    /* renamed from: ؿ  reason: contains not printable characters */
    public boolean m5561() {
        return this.f7281;
    }

    @Override // androidx.constraintlayout.solver.widgets.ConstraintWidget
    /* renamed from: ῲ  reason: contains not printable characters */
    public boolean m5562() {
        return true;
    }

    @Override // ῲ.ⁱ.ῲ.㿎.C2102, androidx.constraintlayout.solver.widgets.ConstraintWidget
    /* renamed from: K  reason: contains not printable characters */
    public void m5563(ConstraintWidget constraintWidget, HashMap<ConstraintWidget, ConstraintWidget> hashMap) {
        super.m5556(constraintWidget, hashMap);
        C2103 k = (C2103) constraintWidget;
        this.f7282 = k.f7282;
        this.f7283 = k.f7283;
        this.f7280 = k.f7280;
    }

    @Override // androidx.constraintlayout.solver.widgets.ConstraintWidget
    /* renamed from: 㗗  reason: contains not printable characters */
    public boolean m5565() {
        return this.f7281;
    }

    /* renamed from: 㶋  reason: contains not printable characters */
    public int m5566() {
        int i = this.f7282;
        if (i == 0 || i == 1) {
            return 0;
        }
        return (i == 2 || i == 3) ? 1 : -1;
    }

    @Override // androidx.constraintlayout.solver.widgets.ConstraintWidget
    /* renamed from: K  reason: contains not printable characters */
    public void m5564(C2080 r14, boolean z) {
        Object[] objArr;
        boolean z2;
        int i;
        int i2;
        ConstraintAnchor[] constraintAnchorArr = this.f856;
        constraintAnchorArr[0] = this.f820;
        constraintAnchorArr[2] = this.f885;
        constraintAnchorArr[1] = this.f833;
        constraintAnchorArr[3] = this.f841;
        int i3 = 0;
        while (true) {
            objArr = this.f856;
            if (i3 >= objArr.length) {
                break;
            }
            objArr[i3].f808 = r14.m5454(objArr[i3]);
            i3++;
        }
        int i4 = this.f7282;
        if (i4 >= 0 && i4 < 4) {
            ConstraintAnchor constraintAnchor = objArr[i4];
            if (!this.f7281) {
                m5560();
            }
            if (this.f7281) {
                this.f7281 = false;
                int i5 = this.f7282;
                if (i5 == 0 || i5 == 1) {
                    r14.m5457(this.f820.f808, this.f822);
                    r14.m5457(this.f833.f808, this.f822);
                } else if (i5 == 2 || i5 == 3) {
                    r14.m5457(this.f885.f808, this.f892);
                    r14.m5457(this.f841.f808, this.f892);
                }
            } else {
                int i6 = 0;
                while (true) {
                    if (i6 >= this.f7278) {
                        z2 = false;
                        break;
                    }
                    ConstraintWidget constraintWidget = this.f7279[i6];
                    if ((this.f7283 || constraintWidget.m484()) && ((((i = this.f7282) == 0 || i == 1) && constraintWidget.m508() == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT && constraintWidget.f820.f812 != null && constraintWidget.f833.f812 != null) || (((i2 = this.f7282) == 2 || i2 == 3) && constraintWidget.m512() == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT && constraintWidget.f885.f812 != null && constraintWidget.f841.f812 != null))) {
                        z2 = true;
                    } else {
                        i6++;
                    }
                }
                z2 = true;
                boolean z3 = this.f820.m466() || this.f833.m466();
                boolean z4 = this.f885.m466() || this.f841.m466();
                boolean z5 = !z2 && ((this.f7282 == 0 && z3) || ((this.f7282 == 2 && z4) || ((this.f7282 == 1 && z3) || (this.f7282 == 3 && z4))));
                int i7 = 5;
                if (!z5) {
                    i7 = 4;
                }
                for (int i8 = 0; i8 < this.f7278; i8++) {
                    ConstraintWidget constraintWidget2 = this.f7279[i8];
                    if (this.f7283 || constraintWidget2.m484()) {
                        SolverVariable r8 = r14.m5454(constraintWidget2.f856[this.f7282]);
                        ConstraintAnchor[] constraintAnchorArr2 = constraintWidget2.f856;
                        int i9 = this.f7282;
                        constraintAnchorArr2[i9].f808 = r8;
                        int i10 = (constraintAnchorArr2[i9].f812 == null || constraintAnchorArr2[i9].f812.f813 != this) ? 0 : constraintAnchorArr2[i9].f810 + 0;
                        int i11 = this.f7282;
                        if (i11 == 0 || i11 == 2) {
                            C2073 r11 = r14.m5448();
                            SolverVariable r12 = r14.m5443();
                            r12.f792 = 0;
                            r11.m5399(constraintAnchor.f808, r8, r12, this.f7280 - i10);
                            r14.m5461(r11);
                        } else {
                            C2073 r112 = r14.m5448();
                            SolverVariable r122 = r14.m5443();
                            r122.f792 = 0;
                            r112.m5404(constraintAnchor.f808, r8, r122, this.f7280 + i10);
                            r14.m5461(r112);
                        }
                        r14.m5455(constraintAnchor.f808, r8, this.f7280 + i10, i7);
                    }
                }
                int i12 = this.f7282;
                if (i12 == 0) {
                    r14.m5455(this.f833.f808, this.f820.f808, 0, 8);
                    r14.m5455(this.f820.f808, this.f867.f833.f808, 0, 4);
                    r14.m5455(this.f820.f808, this.f867.f820.f808, 0, 0);
                } else if (i12 == 1) {
                    r14.m5455(this.f820.f808, this.f833.f808, 0, 8);
                    r14.m5455(this.f820.f808, this.f867.f820.f808, 0, 4);
                    r14.m5455(this.f820.f808, this.f867.f833.f808, 0, 0);
                } else if (i12 == 2) {
                    r14.m5455(this.f841.f808, this.f885.f808, 0, 8);
                    r14.m5455(this.f885.f808, this.f867.f841.f808, 0, 4);
                    r14.m5455(this.f885.f808, this.f867.f885.f808, 0, 0);
                } else if (i12 == 3) {
                    r14.m5455(this.f885.f808, this.f841.f808, 0, 8);
                    r14.m5455(this.f885.f808, this.f867.f885.f808, 0, 4);
                    r14.m5455(this.f885.f808, this.f867.f841.f808, 0, 0);
                }
            }
        }
    }
}
