package ῲ.ⁱ.ῲ.㿎.ᕣ;

import androidx.constraintlayout.solver.widgets.ConstraintAnchor;
import androidx.constraintlayout.solver.widgets.ConstraintWidget;
import androidx.constraintlayout.solver.widgets.analyzer.DependencyNode;
import androidx.constraintlayout.solver.widgets.analyzer.WidgetRun;
import ඓ.K.K.K.C1293;
import ῲ.ⁱ.ῲ.㿎.AbstractC2105;

/* renamed from: ῲ.ⁱ.ῲ.㿎.ᕣ.㳳  reason: contains not printable characters */
/* compiled from: HorizontalWidgetRun */
public class C2094 extends WidgetRun {

    /* renamed from: ᕣ  reason: contains not printable characters */
    public static int[] f7239 = new int[2];

    public C2094(ConstraintWidget constraintWidget) {
        super(constraintWidget);
        this.f928.f907 = DependencyNode.Type.LEFT;
        this.f921.f907 = DependencyNode.Type.RIGHT;
        this.f926 = 0;
    }

    public String toString() {
        StringBuilder r0 = C1293.m3416("HorizontalRun ");
        r0.append(this.f922.f893);
        return r0.toString();
    }

    @Override // androidx.constraintlayout.solver.widgets.analyzer.WidgetRun
    /* renamed from: ʬ  reason: contains not printable characters */
    public void m5532() {
        this.f919 = null;
        this.f928.m515();
        this.f921.m515();
        this.f920.m515();
        this.f923 = false;
    }

    @Override // androidx.constraintlayout.solver.widgets.analyzer.WidgetRun
    /* renamed from: ඓ  reason: contains not printable characters */
    public boolean m5533() {
        if (this.f927 != ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT || this.f922.f874 == 0) {
            return true;
        }
        return false;
    }

    @Override // androidx.constraintlayout.solver.widgets.analyzer.WidgetRun
    /* renamed from: ῲ  reason: contains not printable characters */
    public void m5534() {
        DependencyNode dependencyNode = this.f928;
        if (dependencyNode.f914) {
            this.f922.f822 = dependencyNode.f911;
        }
    }

    @Override // androidx.constraintlayout.solver.widgets.analyzer.WidgetRun
    /* renamed from: K  reason: contains not printable characters */
    public void m5535() {
        ConstraintWidget constraintWidget;
        ConstraintWidget constraintWidget2;
        ConstraintWidget constraintWidget3;
        ConstraintWidget constraintWidget4 = this.f922;
        if (constraintWidget4.f861) {
            this.f920.m5539(constraintWidget4.m478());
        }
        if (!this.f920.f914) {
            this.f927 = this.f922.m508();
            ConstraintWidget.DimensionBehaviour dimensionBehaviour = this.f927;
            if (dimensionBehaviour != ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
                if (dimensionBehaviour == ConstraintWidget.DimensionBehaviour.MATCH_PARENT && (((constraintWidget3 = this.f922.f867) != null && constraintWidget3.m508() == ConstraintWidget.DimensionBehaviour.FIXED) || constraintWidget3.m508() == ConstraintWidget.DimensionBehaviour.MATCH_PARENT)) {
                    int r1 = (constraintWidget3.m478() - this.f922.f820.m456()) - this.f922.f833.m456();
                    m526(this.f928, constraintWidget3.f896.f928, this.f922.f820.m456());
                    m526(this.f921, constraintWidget3.f896.f921, -this.f922.f833.m456());
                    this.f920.m5539(r1);
                    return;
                } else if (this.f927 == ConstraintWidget.DimensionBehaviour.FIXED) {
                    this.f920.m5539(this.f922.m478());
                }
            }
        } else if (this.f927 == ConstraintWidget.DimensionBehaviour.MATCH_PARENT && (((constraintWidget2 = this.f922.f867) != null && constraintWidget2.m508() == ConstraintWidget.DimensionBehaviour.FIXED) || constraintWidget2.m508() == ConstraintWidget.DimensionBehaviour.MATCH_PARENT)) {
            m526(this.f928, constraintWidget2.f896.f928, this.f922.f820.m456());
            m526(this.f921, constraintWidget2.f896.f921, -this.f922.f833.m456());
            return;
        }
        if (this.f920.f914) {
            ConstraintWidget constraintWidget5 = this.f922;
            if (constraintWidget5.f861) {
                ConstraintAnchor[] constraintAnchorArr = constraintWidget5.f856;
                if (constraintAnchorArr[0].f812 == null || constraintAnchorArr[1].f812 == null) {
                    ConstraintWidget constraintWidget6 = this.f922;
                    ConstraintAnchor[] constraintAnchorArr2 = constraintWidget6.f856;
                    if (constraintAnchorArr2[0].f812 != null) {
                        DependencyNode r0 = m522(constraintAnchorArr2[0]);
                        if (r0 != null) {
                            DependencyNode dependencyNode = this.f928;
                            int r12 = this.f922.f856[0].m456();
                            dependencyNode.f913.add(r0);
                            dependencyNode.f915 = r12;
                            r0.f908.add(dependencyNode);
                            m526(this.f921, this.f928, this.f920.f911);
                            return;
                        }
                        return;
                    } else if (constraintAnchorArr2[1].f812 != null) {
                        DependencyNode r02 = m522(constraintAnchorArr2[1]);
                        if (r02 != null) {
                            DependencyNode dependencyNode2 = this.f921;
                            dependencyNode2.f913.add(r02);
                            dependencyNode2.f915 = -this.f922.f856[1].m456();
                            r02.f908.add(dependencyNode2);
                            m526(this.f928, this.f921, -this.f920.f911);
                            return;
                        }
                        return;
                    } else if (!(constraintWidget6 instanceof AbstractC2105) && constraintWidget6.f867 != null && constraintWidget6.m488(ConstraintAnchor.Type.CENTER).f812 == null) {
                        ConstraintWidget constraintWidget7 = this.f922;
                        m526(this.f928, constraintWidget7.f867.f896.f928, constraintWidget7.m506());
                        m526(this.f921, this.f928, this.f920.f911);
                        return;
                    } else {
                        return;
                    }
                } else if (constraintWidget5.m503()) {
                    this.f928.f915 = this.f922.f856[0].m456();
                    this.f921.f915 = -this.f922.f856[1].m456();
                    return;
                } else {
                    DependencyNode r03 = m522(this.f922.f856[0]);
                    if (r03 != null) {
                        DependencyNode dependencyNode3 = this.f928;
                        int r13 = this.f922.f856[0].m456();
                        dependencyNode3.f913.add(r03);
                        dependencyNode3.f915 = r13;
                        r03.f908.add(dependencyNode3);
                    }
                    DependencyNode r04 = m522(this.f922.f856[1]);
                    if (r04 != null) {
                        DependencyNode dependencyNode4 = this.f921;
                        dependencyNode4.f913.add(r04);
                        dependencyNode4.f915 = -this.f922.f856[1].m456();
                        r04.f908.add(dependencyNode4);
                    }
                    this.f928.f910 = true;
                    this.f921.f910 = true;
                    return;
                }
            }
        }
        if (this.f927 == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
            ConstraintWidget constraintWidget8 = this.f922;
            int i = constraintWidget8.f874;
            if (i == 2) {
                ConstraintWidget constraintWidget9 = constraintWidget8.f867;
                if (constraintWidget9 != null) {
                    C2095 r05 = constraintWidget9.f835.f920;
                    this.f920.f913.add(r05);
                    r05.f908.add(this.f920);
                    C2095 r06 = this.f920;
                    r06.f910 = true;
                    r06.f908.add(this.f928);
                    this.f920.f908.add(this.f921);
                }
            } else if (i == 3) {
                if (constraintWidget8.f827 == 3) {
                    this.f928.f912 = this;
                    this.f921.f912 = this;
                    C2093 r3 = constraintWidget8.f835;
                    r3.f928.f912 = this;
                    r3.f921.f912 = this;
                    this.f920.f912 = this;
                    if (constraintWidget8.m514()) {
                        this.f920.f913.add(this.f922.f835.f920);
                        this.f922.f835.f920.f908.add(this.f920);
                        C2093 r07 = this.f922.f835;
                        r07.f920.f912 = this;
                        this.f920.f913.add(r07.f928);
                        this.f920.f913.add(this.f922.f835.f921);
                        this.f922.f835.f928.f908.add(this.f920);
                        this.f922.f835.f921.f908.add(this.f920);
                    } else if (this.f922.m503()) {
                        this.f922.f835.f920.f913.add(this.f920);
                        this.f920.f908.add(this.f922.f835.f920);
                    } else {
                        this.f922.f835.f920.f913.add(this.f920);
                    }
                } else {
                    C2095 r08 = constraintWidget8.f835.f920;
                    this.f920.f913.add(r08);
                    r08.f908.add(this.f920);
                    this.f922.f835.f928.f908.add(this.f920);
                    this.f922.f835.f921.f908.add(this.f920);
                    C2095 r09 = this.f920;
                    r09.f910 = true;
                    r09.f908.add(this.f928);
                    this.f920.f908.add(this.f921);
                    this.f928.f913.add(this.f920);
                    this.f921.f913.add(this.f920);
                }
            }
        }
        ConstraintWidget constraintWidget10 = this.f922;
        ConstraintAnchor[] constraintAnchorArr3 = constraintWidget10.f856;
        if (constraintAnchorArr3[0].f812 == null || constraintAnchorArr3[1].f812 == null) {
            ConstraintWidget constraintWidget11 = this.f922;
            ConstraintAnchor[] constraintAnchorArr4 = constraintWidget11.f856;
            if (constraintAnchorArr4[0].f812 != null) {
                DependencyNode r010 = m522(constraintAnchorArr4[0]);
                if (r010 != null) {
                    DependencyNode dependencyNode5 = this.f928;
                    int r14 = this.f922.f856[0].m456();
                    dependencyNode5.f913.add(r010);
                    dependencyNode5.f915 = r14;
                    r010.f908.add(dependencyNode5);
                    m527(this.f921, this.f928, 1, this.f920);
                }
            } else if (constraintAnchorArr4[1].f812 != null) {
                DependencyNode r011 = m522(constraintAnchorArr4[1]);
                if (r011 != null) {
                    DependencyNode dependencyNode6 = this.f921;
                    dependencyNode6.f913.add(r011);
                    dependencyNode6.f915 = -this.f922.f856[1].m456();
                    r011.f908.add(dependencyNode6);
                    m527(this.f928, this.f921, -1, this.f920);
                }
            } else if (!(constraintWidget11 instanceof AbstractC2105) && (constraintWidget = constraintWidget11.f867) != null) {
                m526(this.f928, constraintWidget.f896.f928, constraintWidget11.m506());
                m527(this.f921, this.f928, 1, this.f920);
            }
        } else if (constraintWidget10.m503()) {
            this.f928.f915 = this.f922.f856[0].m456();
            this.f921.f915 = -this.f922.f856[1].m456();
        } else {
            DependencyNode r012 = m522(this.f922.f856[0]);
            DependencyNode r15 = m522(this.f922.f856[1]);
            r012.f908.add(this);
            if (r012.f914) {
                m5536(this);
            }
            r15.f908.add(this);
            if (r15.f914) {
                m5536(this);
            }
            this.f925 = WidgetRun.RunType.CENTER;
        }
    }

    /* renamed from: 㴹  reason: contains not printable characters */
    public void m5538() {
        this.f923 = false;
        this.f928.m515();
        this.f928.f914 = false;
        this.f921.m515();
        this.f921.f914 = false;
        this.f920.f914 = false;
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m5537(int[] iArr, int i, int i2, int i3, int i4, float f, int i5) {
        int i6 = i2 - i;
        int i7 = i4 - i3;
        if (i5 == -1) {
            int i8 = (int) ((((float) i7) * f) + 0.5f);
            int i9 = (int) ((((float) i6) / f) + 0.5f);
            if (i8 <= i6 && i7 <= i7) {
                iArr[0] = i8;
                iArr[1] = i7;
            } else if (i6 <= i6 && i9 <= i7) {
                iArr[0] = i6;
                iArr[1] = i9;
            }
        } else if (i5 == 0) {
            iArr[0] = (int) ((((float) i7) * f) + 0.5f);
            iArr[1] = i7;
        } else if (i5 == 1) {
            iArr[0] = i6;
            iArr[1] = (int) ((((float) i6) * f) + 0.5f);
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:102:0x029a, code lost:
        if (r14 != 1) goto L_0x02fc;
     */
    @Override // ῲ.ⁱ.ῲ.㿎.ᕣ.AbstractC2096, androidx.constraintlayout.solver.widgets.analyzer.WidgetRun
    /* renamed from: K  reason: contains not printable characters */
    public void m5536(AbstractC2096 r17) {
        int i;
        float f;
        float f2;
        float f3;
        int ordinal = this.f925.ordinal();
        if (ordinal == 1 || ordinal == 2 || ordinal != 3) {
            C2095 r0 = this.f920;
            if (!r0.f914 && this.f927 == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
                ConstraintWidget constraintWidget = this.f922;
                int i2 = constraintWidget.f874;
                if (i2 == 2) {
                    ConstraintWidget constraintWidget2 = constraintWidget.f867;
                    if (constraintWidget2 != null) {
                        C2095 r1 = constraintWidget2.f896.f920;
                        if (r1.f914) {
                            r0.m5539((int) ((((float) r1.f911) * constraintWidget.f901) + 0.5f));
                        }
                    }
                } else if (i2 == 3) {
                    int i3 = constraintWidget.f827;
                    if (i3 == 0 || i3 == 3) {
                        ConstraintWidget constraintWidget3 = this.f922;
                        C2093 r2 = constraintWidget3.f835;
                        DependencyNode dependencyNode = r2.f928;
                        DependencyNode dependencyNode2 = r2.f921;
                        boolean z = constraintWidget3.f820.f812 != null;
                        boolean z2 = this.f922.f885.f812 != null;
                        boolean z3 = this.f922.f833.f812 != null;
                        boolean z4 = this.f922.f841.f812 != null;
                        ConstraintWidget constraintWidget4 = this.f922;
                        int i4 = constraintWidget4.f855;
                        if (z && z2 && z3 && z4) {
                            float f4 = constraintWidget4.f842;
                            if (!dependencyNode.f914 || !dependencyNode2.f914) {
                                DependencyNode dependencyNode3 = this.f928;
                                if (dependencyNode3.f914) {
                                    DependencyNode dependencyNode4 = this.f921;
                                    if (dependencyNode4.f914) {
                                        if (dependencyNode.f906 && dependencyNode2.f906) {
                                            m5537(f7239, dependencyNode3.f911 + dependencyNode3.f915, dependencyNode4.f911 - dependencyNode4.f915, dependencyNode.f913.get(0).f911 + dependencyNode.f915, dependencyNode2.f913.get(0).f911 - dependencyNode2.f915, f4, i4);
                                            this.f920.m5539(f7239[0]);
                                            this.f922.f835.f920.m5539(f7239[1]);
                                        } else {
                                            return;
                                        }
                                    }
                                }
                                DependencyNode dependencyNode5 = this.f928;
                                if (dependencyNode5.f906 && this.f921.f906 && dependencyNode.f906 && dependencyNode2.f906) {
                                    m5537(f7239, dependencyNode5.f913.get(0).f911 + this.f928.f915, this.f921.f913.get(0).f911 - this.f921.f915, dependencyNode.f913.get(0).f911 + dependencyNode.f915, dependencyNode2.f913.get(0).f911 - dependencyNode2.f915, f4, i4);
                                    this.f920.m5539(f7239[0]);
                                    this.f922.f835.f920.m5539(f7239[1]);
                                } else {
                                    return;
                                }
                            } else {
                                DependencyNode dependencyNode6 = this.f928;
                                if (dependencyNode6.f906 && this.f921.f906) {
                                    m5537(f7239, dependencyNode6.f913.get(0).f911 + this.f928.f915, this.f921.f913.get(0).f911 - this.f921.f915, dependencyNode.f911 + dependencyNode.f915, dependencyNode2.f911 - dependencyNode2.f915, f4, i4);
                                    this.f920.m5539(f7239[0]);
                                    this.f922.f835.f920.m5539(f7239[1]);
                                    return;
                                }
                                return;
                            }
                        } else if (z && z3) {
                            DependencyNode dependencyNode7 = this.f928;
                            if (dependencyNode7.f906 && this.f921.f906) {
                                float f5 = this.f922.f842;
                                int i5 = dependencyNode7.f913.get(0).f911 + this.f928.f915;
                                int i6 = this.f921.f913.get(0).f911 - this.f921.f915;
                                if (i4 == -1 || i4 == 0) {
                                    int r02 = m521(i6 - i5, 0);
                                    int i7 = (int) ((((float) r02) * f5) + 0.5f);
                                    int r3 = m521(i7, 1);
                                    if (i7 != r3) {
                                        r02 = (int) ((((float) r3) / f5) + 0.5f);
                                    }
                                    this.f920.m5539(r02);
                                    this.f922.f835.f920.m5539(r3);
                                } else if (i4 == 1) {
                                    int r03 = m521(i6 - i5, 0);
                                    int i8 = (int) ((((float) r03) / f5) + 0.5f);
                                    int r32 = m521(i8, 1);
                                    if (i8 != r32) {
                                        r03 = (int) ((((float) r32) * f5) + 0.5f);
                                    }
                                    this.f920.m5539(r03);
                                    this.f922.f835.f920.m5539(r32);
                                }
                            } else {
                                return;
                            }
                        } else if (z2 && z4) {
                            if (dependencyNode.f906 && dependencyNode2.f906) {
                                float f6 = this.f922.f842;
                                int i9 = dependencyNode.f913.get(0).f911 + dependencyNode.f915;
                                int i10 = dependencyNode2.f913.get(0).f911 - dependencyNode2.f915;
                                if (i4 != -1) {
                                    if (i4 == 0) {
                                        int r12 = m521(i10 - i9, 1);
                                        int i11 = (int) ((((float) r12) * f6) + 0.5f);
                                        int r33 = m521(i11, 0);
                                        if (i11 != r33) {
                                            r12 = (int) ((((float) r33) / f6) + 0.5f);
                                        }
                                        this.f920.m5539(r33);
                                        this.f922.f835.f920.m5539(r12);
                                    }
                                }
                                int r13 = m521(i10 - i9, 1);
                                int i12 = (int) ((((float) r13) / f6) + 0.5f);
                                int r34 = m521(i12, 0);
                                if (i12 != r34) {
                                    r13 = (int) ((((float) r34) * f6) + 0.5f);
                                }
                                this.f920.m5539(r34);
                                this.f922.f835.f920.m5539(r13);
                            } else {
                                return;
                            }
                        }
                    } else {
                        int i13 = constraintWidget.f855;
                        if (i13 == -1) {
                            f3 = (float) constraintWidget.f835.f920.f911;
                            f2 = constraintWidget.f842;
                        } else if (i13 == 0) {
                            f = ((float) constraintWidget.f835.f920.f911) / constraintWidget.f842;
                            i = (int) (f + 0.5f);
                            this.f920.m5539(i);
                        } else if (i13 != 1) {
                            i = 0;
                            this.f920.m5539(i);
                        } else {
                            f3 = (float) constraintWidget.f835.f920.f911;
                            f2 = constraintWidget.f842;
                        }
                        f = f3 * f2;
                        i = (int) (f + 0.5f);
                        this.f920.m5539(i);
                    }
                }
            }
            DependencyNode dependencyNode8 = this.f928;
            if (dependencyNode8.f906) {
                DependencyNode dependencyNode9 = this.f921;
                if (dependencyNode9.f906) {
                    if (!dependencyNode8.f914 || !dependencyNode9.f914 || !this.f920.f914) {
                        if (!this.f920.f914 && this.f927 == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
                            ConstraintWidget constraintWidget5 = this.f922;
                            if (constraintWidget5.f874 == 0 && !constraintWidget5.m503()) {
                                int i14 = this.f928.f913.get(0).f911;
                                DependencyNode dependencyNode10 = this.f928;
                                int i15 = i14 + dependencyNode10.f915;
                                int i16 = this.f921.f913.get(0).f911 + this.f921.f915;
                                dependencyNode10.m516(i15);
                                this.f921.m516(i16);
                                this.f920.m5539(i16 - i15);
                                return;
                            }
                        }
                        if (!this.f920.f914 && this.f927 == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT && this.f924 == 1 && this.f928.f913.size() > 0 && this.f921.f913.size() > 0) {
                            int min = Math.min((this.f921.f913.get(0).f911 + this.f921.f915) - (this.f928.f913.get(0).f911 + this.f928.f915), this.f920.f7240);
                            ConstraintWidget constraintWidget6 = this.f922;
                            int i17 = constraintWidget6.f829;
                            int max = Math.max(constraintWidget6.f877, min);
                            if (i17 > 0) {
                                max = Math.min(i17, max);
                            }
                            this.f920.m5539(max);
                        }
                        if (this.f920.f914) {
                            DependencyNode dependencyNode11 = this.f928.f913.get(0);
                            DependencyNode dependencyNode12 = this.f921.f913.get(0);
                            int i18 = dependencyNode11.f911;
                            int i19 = this.f928.f915 + i18;
                            int i20 = dependencyNode12.f911;
                            int i21 = this.f921.f915 + i20;
                            float f7 = this.f922.f878;
                            if (dependencyNode11 == dependencyNode12) {
                                f7 = 0.5f;
                            } else {
                                i18 = i19;
                                i20 = i21;
                            }
                            this.f928.m516((int) ((((float) ((i20 - i18) - this.f920.f911)) * f7) + ((float) i18) + 0.5f));
                            this.f921.m516(this.f928.f911 + this.f920.f911);
                            return;
                        }
                        return;
                    }
                    return;
                }
                return;
            }
            return;
        }
        ConstraintWidget constraintWidget7 = this.f922;
        m525(constraintWidget7.f820, constraintWidget7.f833, 0);
    }
}
