package ῲ.ⁱ.ῲ.㿎;

import androidx.constraintlayout.solver.widgets.ConstraintAnchor;
import androidx.constraintlayout.solver.widgets.ConstraintWidget;
import androidx.constraintlayout.solver.widgets.analyzer.WidgetRun;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;
import java.io.PrintStream;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import ῲ.ⁱ.ῲ.C2080;
import ῲ.ⁱ.ῲ.㿎.ᕣ.C2084;
import ῲ.ⁱ.ῲ.㿎.ᕣ.C2085;
import ῲ.ⁱ.ῲ.㿎.ᕣ.C2088;
import ῲ.ⁱ.ῲ.㿎.ᕣ.C2091;
import ῲ.ⁱ.ῲ.㿎.ᕣ.C2098;
import K.K.K.ʬ.C2369;

/* renamed from: ῲ.ⁱ.ῲ.㿎.ʬ  reason: contains not printable characters */
/* compiled from: ConstraintWidgetContainer */
public class C2082 extends C2104 {

    /* renamed from: Κ  reason: contains not printable characters */
    public int f7184;

    /* renamed from: А  reason: contains not printable characters */
    public WeakReference<ConstraintAnchor> f7185 = null;

    /* renamed from: ভ  reason: contains not printable characters */
    public WeakReference<ConstraintAnchor> f7186 = null;

    /* renamed from: ಊ  reason: contains not printable characters */
    public int f7187;

    /* renamed from: ၰ  reason: contains not printable characters */
    public C2101[] f7188 = new C2101[4];

    /* renamed from: ჹ  reason: contains not printable characters */
    public boolean f7189 = false;

    /* renamed from: ᇒ  reason: contains not printable characters */
    public int f7190 = 0;

    /* renamed from: ᑁ  reason: contains not printable characters */
    public C2080 f7191 = new C2080();

    /* renamed from: ᝮ  reason: contains not printable characters */
    public int f7192 = 257;

    /* renamed from: ᡊ  reason: contains not printable characters */
    public C2088.C2090 f7193 = new C2088.C2090();

    /* renamed from: ᬈ  reason: contains not printable characters */
    public C2088 f7194 = new C2088(this);

    /* renamed from: ẫ  reason: contains not printable characters */
    public C2085 f7195 = new C2085(this);

    /* renamed from: ᾊ  reason: contains not printable characters */
    public boolean f7196 = false;

    /* renamed from: ㄭ  reason: contains not printable characters */
    public boolean f7197 = false;

    /* renamed from: 㒎  reason: contains not printable characters */
    public C2088.AbstractC2089 f7198 = null;

    /* renamed from: 㮫  reason: contains not printable characters */
    public WeakReference<ConstraintAnchor> f7199 = null;

    /* renamed from: 㵼  reason: contains not printable characters */
    public C2101[] f7200 = new C2101[4];

    /* renamed from: 㸼  reason: contains not printable characters */
    public WeakReference<ConstraintAnchor> f7201 = null;

    /* renamed from: 䄇  reason: contains not printable characters */
    public int f7202 = 0;

    /* renamed from: ʬ  reason: contains not printable characters */
    public void m5468(ConstraintAnchor constraintAnchor) {
        WeakReference<ConstraintAnchor> weakReference = this.f7201;
        if (weakReference == null || weakReference.get() == null || constraintAnchor.m459() > this.f7201.get().m459()) {
            this.f7201 = new WeakReference<>(constraintAnchor);
        }
    }

    /* renamed from: Ԕ  reason: contains not printable characters */
    public void m5469(int i) {
        this.f7192 = i;
        C2080.f7165 = m5482(512);
    }

    /* renamed from: Ԛ  reason: contains not printable characters */
    public boolean m5470() {
        return false;
    }

    /* renamed from: ᓆ  reason: contains not printable characters */
    public void m5471() {
        C2088 r0 = this.f7194;
        r0.f7225.clear();
        int size = this.f7284.size();
        for (int i = 0; i < size; i++) {
            ConstraintWidget constraintWidget = this.f7284.get(i);
            if (constraintWidget.m508() == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT || constraintWidget.m512() == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT) {
                r0.f7225.add(constraintWidget);
            }
        }
        m5480();
    }

    @Override // ῲ.ⁱ.ῲ.㿎.C2104, androidx.constraintlayout.solver.widgets.ConstraintWidget
    /* renamed from: ᓣ  reason: contains not printable characters */
    public void m5472() {
        this.f7191.m5451();
        this.f7184 = 0;
        this.f7187 = 0;
        super.m5567();
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public void m5473(ConstraintAnchor constraintAnchor) {
        WeakReference<ConstraintAnchor> weakReference = this.f7185;
        if (weakReference == null || weakReference.get() == null || constraintAnchor.m459() > this.f7185.get().m459()) {
            this.f7185 = new WeakReference<>(constraintAnchor);
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:38:0x00f5  */
    /* JADX WARNING: Removed duplicated region for block: B:48:0x011b  */
    /* JADX WARNING: Removed duplicated region for block: B:77:0x0148 A[EDGE_INSN: B:77:0x0148->B:62:0x0148 ?: BREAK  , SYNTHETIC] */
    /* renamed from: K  reason: contains not printable characters */
    public boolean m5479(boolean z, int i) {
        boolean z2;
        Iterator<WidgetRun> it2;
        Iterator<WidgetRun> it3;
        ConstraintWidget.DimensionBehaviour dimensionBehaviour;
        C2085 r0 = this.f7195;
        boolean z3 = true;
        boolean z4 = z & true;
        ConstraintWidget.DimensionBehaviour r2 = r0.f7215.m480(0);
        ConstraintWidget.DimensionBehaviour r4 = r0.f7215.m480(1);
        int r5 = r0.f7215.m506();
        int r6 = r0.f7215.m476();
        if (z4 && (r2 == (dimensionBehaviour = ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) || r4 == dimensionBehaviour)) {
            Iterator<WidgetRun> it4 = r0.f7212.iterator();
            while (true) {
                if (!it4.hasNext()) {
                    break;
                }
                WidgetRun next = it4.next();
                if (next.f926 == i && !next.m519()) {
                    z4 = false;
                    break;
                }
            }
            if (i == 0) {
                if (z4 && r2 == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) {
                    r0.f7215.m493(ConstraintWidget.DimensionBehaviour.FIXED);
                    C2082 r11 = r0.f7215;
                    r11.m502(r0.m5501(r11, 0));
                    C2082 r112 = r0.f7215;
                    r112.f896.f920.m5539(r112.m478());
                }
            } else if (z4 && r4 == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) {
                r0.f7215.m482(ConstraintWidget.DimensionBehaviour.FIXED);
                C2082 r113 = r0.f7215;
                r113.m479(r0.m5501(r113, 1));
                C2082 r114 = r0.f7215;
                r114.f835.f920.m5539(r114.m473());
            }
        }
        if (i == 0) {
            ConstraintWidget.DimensionBehaviour[] dimensionBehaviourArr = r0.f7215.f886;
            if (dimensionBehaviourArr[0] == ConstraintWidget.DimensionBehaviour.FIXED || dimensionBehaviourArr[0] == ConstraintWidget.DimensionBehaviour.MATCH_PARENT) {
                int r115 = r0.f7215.m478() + r5;
                r0.f7215.f896.f921.m516(r115);
                r0.f7215.f896.f920.m5539(r115 - r5);
                z2 = true;
                r0.m5500();
                it2 = r0.f7212.iterator();
                while (it2.hasNext()) {
                    WidgetRun next2 = it2.next();
                    if (next2.f926 == i && (next2.f922 != r0.f7215 || next2.f923)) {
                        next2.m520();
                    }
                }
                it3 = r0.f7212.iterator();
                while (true) {
                    if (!it3.hasNext()) {
                        break;
                    }
                    WidgetRun next3 = it3.next();
                    if (next3.f926 == i && ((z2 || next3.f922 != r0.f7215) && (!next3.f928.f914 || !next3.f921.f914 || (!(next3 instanceof C2084) && !next3.f920.f914)))) {
                        z3 = false;
                    }
                }
                z3 = false;
                r0.f7215.m493(r2);
                r0.f7215.m482(r4);
                return z3;
            }
        } else {
            ConstraintWidget.DimensionBehaviour[] dimensionBehaviourArr2 = r0.f7215.f886;
            if (dimensionBehaviourArr2[1] == ConstraintWidget.DimensionBehaviour.FIXED || dimensionBehaviourArr2[1] == ConstraintWidget.DimensionBehaviour.MATCH_PARENT) {
                int r116 = r0.f7215.m473() + r6;
                r0.f7215.f835.f921.m516(r116);
                r0.f7215.f835.f920.m5539(r116 - r6);
                z2 = true;
                r0.m5500();
                it2 = r0.f7212.iterator();
                while (it2.hasNext()) {
                }
                it3 = r0.f7212.iterator();
                while (true) {
                    if (!it3.hasNext()) {
                    }
                }
                z3 = false;
                r0.f7215.m493(r2);
                r0.f7215.m482(r4);
                return z3;
            }
        }
        z2 = false;
        r0.m5500();
        it2 = r0.f7212.iterator();
        while (it2.hasNext()) {
        }
        it3 = r0.f7212.iterator();
        while (true) {
            if (!it3.hasNext()) {
            }
        }
        z3 = false;
        r0.f7215.m493(r2);
        r0.f7215.m482(r4);
        return z3;
    }

    /* renamed from: 㶋  reason: contains not printable characters */
    public void m5480() {
        this.f7195.f7213 = true;
    }

    /* JADX WARN: Type inference failed for: r11v7, types: [boolean] */
    /* JADX WARN: Type inference failed for: r11v11 */
    /* JADX WARN: Type inference failed for: r11v12 */
    /* JADX WARNING: Removed duplicated region for block: B:210:0x03d8  */
    /* JADX WARNING: Removed duplicated region for block: B:237:0x0434  */
    /* JADX WARNING: Removed duplicated region for block: B:242:0x044a  */
    /* JADX WARNING: Removed duplicated region for block: B:249:0x0463  */
    /* JADX WARNING: Removed duplicated region for block: B:259:0x0489  */
    /* JADX WARNING: Removed duplicated region for block: B:265:0x049f  */
    /* JADX WARNING: Removed duplicated region for block: B:271:0x04bc  */
    /* JADX WARNING: Removed duplicated region for block: B:316:0x05c4  */
    /* JADX WARNING: Removed duplicated region for block: B:319:0x05ee  */
    /* JADX WARNING: Removed duplicated region for block: B:323:0x0608  */
    /* JADX WARNING: Removed duplicated region for block: B:345:0x068a  */
    /* JADX WARNING: Removed duplicated region for block: B:348:0x06a6  */
    /* JADX WARNING: Removed duplicated region for block: B:349:0x06b3  */
    /* JADX WARNING: Removed duplicated region for block: B:351:0x06b6  */
    /* JADX WARNING: Removed duplicated region for block: B:367:0x06fd  */
    /* JADX WARNING: Unknown variable types count: 1 */
    @Override // ῲ.ⁱ.ῲ.㿎.C2104
    /* renamed from: 䀟  reason: contains not printable characters */
    public void m5481() {
        int i;
        ConstraintWidget.DimensionBehaviour dimensionBehaviour;
        int i2;
        boolean z;
        int i3;
        boolean z2;
        boolean z3;
        boolean z4;
        boolean z5;
        int max;
        int max2;
        ?? r11;
        Exception e;
        ConstraintWidget.DimensionBehaviour dimensionBehaviour2;
        int i4;
        int i5;
        ConstraintWidget.DimensionBehaviour dimensionBehaviour3;
        C2098 r9;
        C2098 r2;
        int r6;
        int r62;
        int i6;
        int i7;
        boolean z6 = false;
        this.f822 = 0;
        this.f892 = 0;
        this.f7196 = false;
        this.f7197 = false;
        int size = this.f7284.size();
        int max3 = Math.max(0, m478());
        int max4 = Math.max(0, m473());
        ConstraintWidget.DimensionBehaviour[] dimensionBehaviourArr = this.f886;
        ConstraintWidget.DimensionBehaviour dimensionBehaviour4 = dimensionBehaviourArr[1];
        ConstraintWidget.DimensionBehaviour dimensionBehaviour5 = dimensionBehaviourArr[0];
        if (C2108.m5585(this.f7192, 1)) {
            C2091.m5523(this, this.f7198);
            for (int i8 = 0; i8 < size; i8++) {
                ConstraintWidget constraintWidget = this.f7284.get(i8);
                if (constraintWidget.m470() && !(constraintWidget instanceof C2083) && !(constraintWidget instanceof C2103) && !(constraintWidget instanceof C2100) && !constraintWidget.f863) {
                    ConstraintWidget.DimensionBehaviour r10 = constraintWidget.m480(0);
                    ConstraintWidget.DimensionBehaviour r112 = constraintWidget.m480(1);
                    ConstraintWidget.DimensionBehaviour dimensionBehaviour6 = ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT;
                    if (!(r10 == dimensionBehaviour6 && constraintWidget.f874 != 1 && r112 == dimensionBehaviour6 && constraintWidget.f827 != 1)) {
                        m5467(constraintWidget, this.f7198, new C2088.C2090(), false);
                    }
                }
            }
        }
        if (size <= 2 || (!(dimensionBehaviour5 == (dimensionBehaviour2 = ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) || dimensionBehaviour4 == dimensionBehaviour2) || !C2108.m5585(this.f7192, RecyclerView.AbstractC0269.FLAG_ADAPTER_FULLUPDATE))) {
            i2 = max3;
            i = size;
            dimensionBehaviour = dimensionBehaviour4;
        } else {
            C2088.AbstractC2089 r102 = this.f7198;
            ArrayList<ConstraintWidget> arrayList = this.f7284;
            int size2 = arrayList.size();
            int i9 = 0;
            while (true) {
                if (i9 < size2) {
                    ConstraintWidget constraintWidget2 = arrayList.get(i9);
                    if (C2369.m6342(m508(), m512(), constraintWidget2.m508(), constraintWidget2.m512()) && !(constraintWidget2 instanceof C2106)) {
                        i9++;
                    }
                } else {
                    int i10 = 0;
                    ArrayList arrayList2 = null;
                    ArrayList arrayList3 = null;
                    ArrayList arrayList4 = null;
                    ArrayList arrayList5 = null;
                    ArrayList arrayList6 = null;
                    ArrayList arrayList7 = null;
                    while (i10 < size2) {
                        ConstraintWidget constraintWidget3 = arrayList.get(i10);
                        if (!C2369.m6342(m508(), m512(), constraintWidget3.m508(), constraintWidget3.m512())) {
                            m5467(constraintWidget3, r102, this.f7193, false);
                        }
                        boolean z7 = constraintWidget3 instanceof C2083;
                        if (z7) {
                            C2083 r3 = (C2083) constraintWidget3;
                            if (r3.f7203 == 0) {
                                if (arrayList4 == null) {
                                    arrayList4 = new ArrayList();
                                }
                                arrayList4.add(r3);
                            }
                            if (r3.f7203 == 1) {
                                if (arrayList2 == null) {
                                    arrayList2 = new ArrayList();
                                }
                                arrayList2.add(r3);
                            }
                        }
                        if (constraintWidget3 instanceof C2102) {
                            if (constraintWidget3 instanceof C2103) {
                                C2103 k = (C2103) constraintWidget3;
                                if (k.m5566() == 0) {
                                    if (arrayList3 == null) {
                                        arrayList3 = new ArrayList();
                                    }
                                    arrayList3.add(k);
                                }
                                if (k.m5566() == 1) {
                                    if (arrayList5 == null) {
                                        arrayList5 = new ArrayList();
                                    }
                                    arrayList5.add(k);
                                }
                            } else {
                                C2102 r32 = (C2102) constraintWidget3;
                                if (arrayList3 == null) {
                                    arrayList3 = new ArrayList();
                                }
                                arrayList3.add(r32);
                                if (arrayList5 == null) {
                                    arrayList5 = new ArrayList();
                                }
                                arrayList5.add(r32);
                            }
                        }
                        if (constraintWidget3.f820.f812 == null && constraintWidget3.f833.f812 == null && !z7 && !(constraintWidget3 instanceof C2103)) {
                            if (arrayList6 == null) {
                                arrayList6 = new ArrayList();
                            }
                            arrayList6.add(constraintWidget3);
                        }
                        if (constraintWidget3.f885.f812 == null && constraintWidget3.f841.f812 == null && constraintWidget3.f897.f812 == null && !z7 && !(constraintWidget3 instanceof C2103)) {
                            if (arrayList7 == null) {
                                arrayList7 = new ArrayList();
                            }
                            arrayList7.add(constraintWidget3);
                            arrayList7 = arrayList7;
                        }
                        i10++;
                        size = size;
                        max4 = max4;
                        dimensionBehaviour4 = dimensionBehaviour4;
                        max3 = max3;
                    }
                    i4 = max3;
                    i = size;
                    i5 = max4;
                    dimensionBehaviour3 = dimensionBehaviour4;
                    ArrayList<C2098> arrayList8 = new ArrayList<>();
                    if (arrayList2 != null) {
                        Iterator it2 = arrayList2.iterator();
                        while (it2.hasNext()) {
                            C2369.m6323((C2083) it2.next(), 0, arrayList8, (C2098) null);
                        }
                    }
                    C2098 r4 = null;
                    int i11 = 0;
                    if (arrayList3 != null) {
                        Iterator it3 = arrayList3.iterator();
                        while (it3.hasNext()) {
                            C2102 r33 = (C2102) it3.next();
                            C2098 r7 = C2369.m6323(r33, i11, arrayList8, r4);
                            r33.m5557(arrayList8, i11, r7);
                            r7.m5549(arrayList8);
                            r4 = null;
                            i11 = 0;
                        }
                    }
                    HashSet<ConstraintAnchor> hashSet = m488(ConstraintAnchor.Type.LEFT).f811;
                    if (hashSet != null) {
                        Iterator<ConstraintAnchor> it4 = hashSet.iterator();
                        while (it4.hasNext()) {
                            C2369.m6323(it4.next().f813, 0, arrayList8, (C2098) null);
                        }
                    }
                    HashSet<ConstraintAnchor> hashSet2 = m488(ConstraintAnchor.Type.RIGHT).f811;
                    if (hashSet2 != null) {
                        Iterator<ConstraintAnchor> it5 = hashSet2.iterator();
                        while (it5.hasNext()) {
                            C2369.m6323(it5.next().f813, 0, arrayList8, (C2098) null);
                        }
                    }
                    HashSet<ConstraintAnchor> hashSet3 = m488(ConstraintAnchor.Type.CENTER).f811;
                    if (hashSet3 != null) {
                        Iterator<ConstraintAnchor> it6 = hashSet3.iterator();
                        while (it6.hasNext()) {
                            C2369.m6323(it6.next().f813, 0, arrayList8, (C2098) null);
                        }
                    }
                    C2098 r42 = null;
                    if (arrayList6 != null) {
                        Iterator it7 = arrayList6.iterator();
                        while (it7.hasNext()) {
                            C2369.m6323((ConstraintWidget) it7.next(), 0, arrayList8, (C2098) null);
                        }
                    }
                    if (arrayList4 != null) {
                        Iterator it8 = arrayList4.iterator();
                        while (it8.hasNext()) {
                            C2369.m6323((C2083) it8.next(), 1, arrayList8, (C2098) null);
                        }
                    }
                    int i12 = 1;
                    if (arrayList5 != null) {
                        Iterator it9 = arrayList5.iterator();
                        while (it9.hasNext()) {
                            C2102 r34 = (C2102) it9.next();
                            C2098 r72 = C2369.m6323(r34, i12, arrayList8, r42);
                            r34.m5557(arrayList8, i12, r72);
                            r72.m5549(arrayList8);
                            r42 = null;
                            i12 = 1;
                        }
                    }
                    HashSet<ConstraintAnchor> hashSet4 = m488(ConstraintAnchor.Type.TOP).f811;
                    if (hashSet4 != null) {
                        Iterator<ConstraintAnchor> it10 = hashSet4.iterator();
                        while (it10.hasNext()) {
                            C2369.m6323(it10.next().f813, 1, arrayList8, (C2098) null);
                        }
                    }
                    HashSet<ConstraintAnchor> hashSet5 = m488(ConstraintAnchor.Type.BASELINE).f811;
                    if (hashSet5 != null) {
                        Iterator<ConstraintAnchor> it11 = hashSet5.iterator();
                        while (it11.hasNext()) {
                            C2369.m6323(it11.next().f813, 1, arrayList8, (C2098) null);
                        }
                    }
                    HashSet<ConstraintAnchor> hashSet6 = m488(ConstraintAnchor.Type.BOTTOM).f811;
                    if (hashSet6 != null) {
                        Iterator<ConstraintAnchor> it12 = hashSet6.iterator();
                        while (it12.hasNext()) {
                            C2369.m6323(it12.next().f813, 1, arrayList8, (C2098) null);
                        }
                    }
                    HashSet<ConstraintAnchor> hashSet7 = m488(ConstraintAnchor.Type.CENTER).f811;
                    if (hashSet7 != null) {
                        Iterator<ConstraintAnchor> it13 = hashSet7.iterator();
                        while (it13.hasNext()) {
                            C2369.m6323(it13.next().f813, 1, arrayList8, (C2098) null);
                        }
                    }
                    if (arrayList7 != null) {
                        Iterator it14 = arrayList7.iterator();
                        while (it14.hasNext()) {
                            C2369.m6323((ConstraintWidget) it14.next(), 1, arrayList8, (C2098) null);
                        }
                    }
                    for (int i13 = 0; i13 < size2; i13++) {
                        ConstraintWidget constraintWidget4 = arrayList.get(i13);
                        ConstraintWidget.DimensionBehaviour[] dimensionBehaviourArr2 = constraintWidget4.f886;
                        ConstraintWidget.DimensionBehaviour dimensionBehaviour7 = dimensionBehaviourArr2[0];
                        ConstraintWidget.DimensionBehaviour dimensionBehaviour8 = ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT;
                        if (dimensionBehaviour7 == dimensionBehaviour8 && dimensionBehaviourArr2[1] == dimensionBehaviour8) {
                            C2098 r43 = C2369.m6324(arrayList8, constraintWidget4.f887);
                            C2098 r35 = C2369.m6324(arrayList8, constraintWidget4.f818);
                            if (!(r43 == null || r35 == null)) {
                                r43.m5548(0, r35);
                                r35.f7242 = 2;
                                arrayList8.remove(r43);
                            }
                        }
                    }
                    if (arrayList8.size() > 1) {
                        if (m508() == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) {
                            Iterator<C2098> it15 = arrayList8.iterator();
                            int i14 = 0;
                            r9 = null;
                            while (it15.hasNext()) {
                                C2098 next = it15.next();
                                if (next.f7242 != 1 && (r62 = next.m5547(this.f7191, 0)) > i14) {
                                    r9 = next;
                                    i14 = r62;
                                }
                            }
                            if (r9 != null) {
                                m493(ConstraintWidget.DimensionBehaviour.FIXED);
                                m502(i14);
                                if (m512() == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) {
                                    Iterator<C2098> it16 = arrayList8.iterator();
                                    r2 = null;
                                    int i15 = 0;
                                    while (it16.hasNext()) {
                                        C2098 next2 = it16.next();
                                        if (next2.f7242 != 0 && (r6 = next2.m5547(this.f7191, 1)) > i15) {
                                            r2 = next2;
                                            i15 = r6;
                                        }
                                    }
                                    if (r2 != null) {
                                        m482(ConstraintWidget.DimensionBehaviour.FIXED);
                                        m479(i15);
                                        if (!(r9 == null && r2 == null)) {
                                            z6 = true;
                                        }
                                    }
                                }
                                r2 = null;
                                z6 = true;
                            }
                        }
                        r9 = null;
                        if (m512() == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) {
                        }
                        r2 = null;
                        z6 = true;
                    }
                    z6 = false;
                }
            }
            i4 = max3;
            i = size;
            i5 = max4;
            dimensionBehaviour3 = dimensionBehaviour4;
            if (z6) {
                if (dimensionBehaviour5 == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) {
                    i7 = i4;
                    if (i7 >= m478() || i7 <= 0) {
                        i6 = m478();
                        dimensionBehaviour = dimensionBehaviour3;
                        if (dimensionBehaviour != ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) {
                            max4 = i5;
                            if (max4 >= m473() || max4 <= 0) {
                                max4 = m473();
                            } else {
                                m479(max4);
                                this.f7197 = true;
                            }
                        } else {
                            max4 = i5;
                        }
                        i2 = i6;
                        z = true;
                        boolean z8 = !m5482(64) || m5482(128);
                        C2080 r8 = this.f7191;
                        r8.f7182 = false;
                        r8.f7173 = false;
                        if (this.f7192 != 0 && z8) {
                            r8.f7173 = true;
                        }
                        ArrayList<ConstraintWidget> arrayList9 = this.f7284;
                        boolean z9 = m508() != ConstraintWidget.DimensionBehaviour.WRAP_CONTENT || m512() == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT;
                        this.f7202 = 0;
                        this.f7190 = 0;
                        for (i3 = 0; i3 < i; i3++) {
                            ConstraintWidget constraintWidget5 = this.f7284.get(i3);
                            if (constraintWidget5 instanceof C2104) {
                                ((C2104) constraintWidget5).m5571();
                            }
                        }
                        boolean r103 = m5482(64);
                        z2 = z;
                        int i16 = 0;
                        z3 = true;
                        while (z3) {
                            int i17 = i16 + 1;
                            try {
                                this.f7191.m5451();
                                this.f7202 = 0;
                                this.f7190 = 0;
                                m496(this.f7191);
                                for (int i18 = 0; i18 < i; i18++) {
                                    this.f7284.get(i18).m496(this.f7191);
                                }
                                m5474(this.f7191);
                                try {
                                    if (this.f7201 != null) {
                                        try {
                                            if (this.f7201.get() != null) {
                                                this.f7191.m5449(this.f7191.m5454(this.f7201.get()), this.f7191.m5454(this.f885), 0, 5);
                                                this.f7201 = null;
                                            }
                                        } catch (Exception e2) {
                                            e = e2;
                                            z3 = true;
                                            e.printStackTrace();
                                            PrintStream printStream = System.out;
                                            printStream.println("EXCEPTION : " + e);
                                            if (z3) {
                                            }
                                            if (z9) {
                                            }
                                            z4 = z2;
                                            z5 = false;
                                            max = Math.max(this.f880, m478());
                                            if (max > m478()) {
                                            }
                                            max2 = Math.max(this.f832, m473());
                                            if (max2 > m473()) {
                                            }
                                            if (!z4) {
                                            }
                                            z3 = z5;
                                            z2 = z4;
                                            i16 = i17;
                                        }
                                    }
                                    if (!(this.f7185 == null || this.f7185.get() == null)) {
                                        this.f7191.m5449(this.f7191.m5454(this.f841), this.f7191.m5454(this.f7185.get()), 0, 5);
                                        this.f7185 = null;
                                    }
                                    if (!(this.f7186 == null || this.f7186.get() == null)) {
                                        this.f7191.m5449(this.f7191.m5454(this.f7186.get()), this.f7191.m5454(this.f820), 0, 5);
                                        this.f7186 = null;
                                    }
                                    if (this.f7199 != null && this.f7199.get() != null) {
                                        this.f7191.m5449(this.f7191.m5454(this.f833), this.f7191.m5454(this.f7199.get()), 0, 5);
                                        try {
                                            this.f7199 = null;
                                        } catch (Exception e3) {
                                            e = e3;
                                            z3 = true;
                                            e.printStackTrace();
                                            PrintStream printStream2 = System.out;
                                            printStream2.println("EXCEPTION : " + e);
                                            if (z3) {
                                            }
                                            if (z9) {
                                            }
                                            z4 = z2;
                                            z5 = false;
                                            max = Math.max(this.f880, m478());
                                            if (max > m478()) {
                                            }
                                            max2 = Math.max(this.f832, m473());
                                            if (max2 > m473()) {
                                            }
                                            if (!z4) {
                                            }
                                            z3 = z5;
                                            z2 = z4;
                                            i16 = i17;
                                        }
                                    }
                                    this.f7191.m5445();
                                    z3 = true;
                                } catch (Exception e4) {
                                    e = e4;
                                    z3 = true;
                                    e.printStackTrace();
                                    PrintStream printStream22 = System.out;
                                    printStream22.println("EXCEPTION : " + e);
                                    if (z3) {
                                    }
                                    if (z9) {
                                    }
                                    z4 = z2;
                                    z5 = false;
                                    max = Math.max(this.f880, m478());
                                    if (max > m478()) {
                                    }
                                    max2 = Math.max(this.f832, m473());
                                    if (max2 > m473()) {
                                    }
                                    if (!z4) {
                                    }
                                    z3 = z5;
                                    z2 = z4;
                                    i16 = i17;
                                }
                            } catch (Exception e5) {
                                e = e5;
                                e.printStackTrace();
                                PrintStream printStream222 = System.out;
                                printStream222.println("EXCEPTION : " + e);
                                if (z3) {
                                }
                                if (z9) {
                                }
                                z4 = z2;
                                z5 = false;
                                max = Math.max(this.f880, m478());
                                if (max > m478()) {
                                }
                                max2 = Math.max(this.f832, m473());
                                if (max2 > m473()) {
                                }
                                if (!z4) {
                                }
                                z3 = z5;
                                z2 = z4;
                                i16 = i17;
                            }
                            if (z3) {
                                C2080 r0 = this.f7191;
                                C2108.f7328[2] = false;
                                boolean r113 = m5482(64);
                                m483(r0, r113);
                                int size3 = this.f7284.size();
                                for (int i19 = 0; i19 < size3; i19++) {
                                    this.f7284.get(i19).m483(r0, r113);
                                }
                            } else {
                                m483(this.f7191, r103);
                                for (int i20 = 0; i20 < i; i20++) {
                                    this.f7284.get(i20).m483(this.f7191, r103);
                                }
                            }
                            if (z9 || i17 >= 8 || !C2108.f7328[2]) {
                                z4 = z2;
                                z5 = false;
                            } else {
                                int i21 = 0;
                                int i22 = 0;
                                for (int i23 = 0; i23 < i; i23++) {
                                    ConstraintWidget constraintWidget6 = this.f7284.get(i23);
                                    i21 = Math.max(i21, constraintWidget6.m478() + constraintWidget6.f822);
                                    i22 = Math.max(i22, constraintWidget6.m473() + constraintWidget6.f892);
                                }
                                int max5 = Math.max(this.f880, i21);
                                int max6 = Math.max(this.f832, i22);
                                if (dimensionBehaviour5 != ConstraintWidget.DimensionBehaviour.WRAP_CONTENT || m478() >= max5) {
                                    z5 = false;
                                } else {
                                    m502(max5);
                                    this.f886[0] = ConstraintWidget.DimensionBehaviour.WRAP_CONTENT;
                                    z5 = true;
                                    z2 = true;
                                }
                                if (dimensionBehaviour != ConstraintWidget.DimensionBehaviour.WRAP_CONTENT || m473() >= max6) {
                                    z4 = z2;
                                } else {
                                    m479(max6);
                                    this.f886[1] = ConstraintWidget.DimensionBehaviour.WRAP_CONTENT;
                                    z5 = true;
                                    z4 = true;
                                }
                            }
                            max = Math.max(this.f880, m478());
                            if (max > m478()) {
                                m502(max);
                                this.f886[0] = ConstraintWidget.DimensionBehaviour.FIXED;
                                z5 = true;
                                z4 = true;
                            }
                            max2 = Math.max(this.f832, m473());
                            if (max2 > m473()) {
                                m479(max2);
                                r11 = 1;
                                this.f886[1] = ConstraintWidget.DimensionBehaviour.FIXED;
                                z5 = true;
                                z4 = true;
                            } else {
                                r11 = 1;
                            }
                            if (!z4) {
                                if (this.f886[0] == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT && i2 > 0 && m478() > i2) {
                                    this.f7196 = r11;
                                    this.f886[0] = ConstraintWidget.DimensionBehaviour.FIXED;
                                    m502(i2);
                                    z5 = true;
                                    z4 = true;
                                }
                                ConstraintWidget.DimensionBehaviour[] dimensionBehaviourArr3 = this.f886;
                                char c = r11 == true ? 1 : 0;
                                char c2 = r11 == true ? 1 : 0;
                                char c3 = r11 == true ? 1 : 0;
                                if (dimensionBehaviourArr3[c] == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT && max4 > 0 && m473() > max4) {
                                    this.f7197 = r11;
                                    this.f886[r11] = ConstraintWidget.DimensionBehaviour.FIXED;
                                    m479(max4);
                                    z3 = true;
                                    z2 = true;
                                    i16 = i17;
                                }
                            }
                            z3 = z5;
                            z2 = z4;
                            i16 = i17;
                        }
                        this.f7284 = arrayList9;
                        if (z2) {
                            ConstraintWidget.DimensionBehaviour[] dimensionBehaviourArr4 = this.f886;
                            dimensionBehaviourArr4[0] = dimensionBehaviour5;
                            dimensionBehaviourArr4[1] = dimensionBehaviour;
                        }
                        m5570(this.f7191.f7168);
                    }
                    m502(i7);
                    this.f7196 = true;
                } else {
                    i7 = i4;
                }
                i6 = i7;
                dimensionBehaviour = dimensionBehaviour3;
                if (dimensionBehaviour != ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) {
                }
                i2 = i6;
                z = true;
                if (!m5482(64)) {
                }
                C2080 r82 = this.f7191;
                r82.f7182 = false;
                r82.f7173 = false;
                r82.f7173 = true;
                ArrayList<ConstraintWidget> arrayList92 = this.f7284;
                if (m508() != ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) {
                }
                this.f7202 = 0;
                this.f7190 = 0;
                while (i3 < i) {
                }
                boolean r1032 = m5482(64);
                z2 = z;
                int i162 = 0;
                z3 = true;
                while (z3) {
                }
                this.f7284 = arrayList92;
                if (z2) {
                }
                m5570(this.f7191.f7168);
            }
            max4 = i5;
            dimensionBehaviour = dimensionBehaviour3;
            i2 = i4;
        }
        z = false;
        if (!m5482(64)) {
        }
        C2080 r822 = this.f7191;
        r822.f7182 = false;
        r822.f7173 = false;
        r822.f7173 = true;
        ArrayList<ConstraintWidget> arrayList922 = this.f7284;
        if (m508() != ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) {
        }
        this.f7202 = 0;
        this.f7190 = 0;
        while (i3 < i) {
        }
        boolean r10322 = m5482(64);
        z2 = z;
        int i1622 = 0;
        z3 = true;
        while (z3) {
        }
        this.f7284 = arrayList922;
        if (z2) {
        }
        m5570(this.f7191.f7168);
    }

    /* renamed from: 䁗  reason: contains not printable characters */
    public boolean m5482(int i) {
        return (this.f7192 & i) == i;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public boolean m5474(C2080 r13) {
        boolean r0 = m5482(64);
        m497(r13, r0);
        int size = this.f7284.size();
        boolean z = false;
        for (int i = 0; i < size; i++) {
            ConstraintWidget constraintWidget = this.f7284.get(i);
            boolean[] zArr = constraintWidget.f837;
            zArr[0] = false;
            zArr[1] = false;
            if (constraintWidget instanceof C2103) {
                z = true;
            }
        }
        if (z) {
            for (int i2 = 0; i2 < size; i2++) {
                ConstraintWidget constraintWidget2 = this.f7284.get(i2);
                if (constraintWidget2 instanceof C2103) {
                    C2103 k = (C2103) constraintWidget2;
                    for (int i3 = 0; i3 < k.f7278; i3++) {
                        ConstraintWidget constraintWidget3 = k.f7279[i3];
                        int i4 = k.f7282;
                        if (i4 == 0 || i4 == 1) {
                            constraintWidget3.f837[0] = true;
                        } else if (i4 == 2 || i4 == 3) {
                            constraintWidget3.f837[1] = true;
                        }
                    }
                }
            }
        }
        for (int i5 = 0; i5 < size; i5++) {
            ConstraintWidget constraintWidget4 = this.f7284.get(i5);
            if (constraintWidget4.m501()) {
                constraintWidget4.m497(r13, r0);
            }
        }
        if (C2080.f7165) {
            HashSet<ConstraintWidget> hashSet = new HashSet<>();
            for (int i6 = 0; i6 < size; i6++) {
                ConstraintWidget constraintWidget5 = this.f7284.get(i6);
                if (!constraintWidget5.m501()) {
                    hashSet.add(constraintWidget5);
                }
            }
            m499(this, r13, hashSet, m508() == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT ? 0 : 1, false);
            Iterator<ConstraintWidget> it2 = hashSet.iterator();
            while (it2.hasNext()) {
                ConstraintWidget next = it2.next();
                C2108.m5584(this, r13, next);
                next.m497(r13, r0);
            }
        } else {
            for (int i7 = 0; i7 < size; i7++) {
                ConstraintWidget constraintWidget6 = this.f7284.get(i7);
                if (constraintWidget6 instanceof C2082) {
                    ConstraintWidget.DimensionBehaviour[] dimensionBehaviourArr = constraintWidget6.f886;
                    ConstraintWidget.DimensionBehaviour dimensionBehaviour = dimensionBehaviourArr[0];
                    ConstraintWidget.DimensionBehaviour dimensionBehaviour2 = dimensionBehaviourArr[1];
                    if (dimensionBehaviour == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) {
                        constraintWidget6.m493(ConstraintWidget.DimensionBehaviour.FIXED);
                    }
                    if (dimensionBehaviour2 == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) {
                        constraintWidget6.m482(ConstraintWidget.DimensionBehaviour.FIXED);
                    }
                    constraintWidget6.m497(r13, r0);
                    if (dimensionBehaviour == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) {
                        constraintWidget6.m493(dimensionBehaviour);
                    }
                    if (dimensionBehaviour2 == ConstraintWidget.DimensionBehaviour.WRAP_CONTENT) {
                        constraintWidget6.m482(dimensionBehaviour2);
                    }
                } else {
                    C2108.m5584(this, r13, constraintWidget6);
                    if (!constraintWidget6.m501()) {
                        constraintWidget6.m497(r13, r0);
                    }
                }
            }
        }
        if (this.f7202 > 0) {
            C2369.m6337(this, r13, (ArrayList<ConstraintWidget>) null, 0);
        }
        if (this.f7190 > 0) {
            C2369.m6337(this, r13, (ArrayList<ConstraintWidget>) null, 1);
        }
        return true;
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m5477(C2088.AbstractC2089 r2) {
        this.f7198 = r2;
        this.f7195.f7216 = r2;
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m5475(ConstraintAnchor constraintAnchor) {
        WeakReference<ConstraintAnchor> weakReference = this.f7199;
        if (weakReference == null || weakReference.get() == null || constraintAnchor.m459() > this.f7199.get().m459()) {
            this.f7199 = new WeakReference<>(constraintAnchor);
        }
    }

    @Override // androidx.constraintlayout.solver.widgets.ConstraintWidget
    /* renamed from: K  reason: contains not printable characters */
    public void m5478(boolean z, boolean z2) {
        super.m500(z, z2);
        int size = this.f7284.size();
        for (int i = 0; i < size; i++) {
            this.f7284.get(i).m500(z, z2);
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static boolean m5467(ConstraintWidget constraintWidget, C2088.AbstractC2089 r8, C2088.C2090 k, boolean z) {
        int i;
        int i2;
        if (r8 == null) {
            return false;
        }
        k.f7231 = constraintWidget.m508();
        k.f7229 = constraintWidget.m512();
        k.f7226 = constraintWidget.m478();
        k.f7234 = constraintWidget.m473();
        k.f7228 = false;
        k.f7232 = z;
        boolean z2 = k.f7231 == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT;
        boolean z3 = k.f7229 == ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT;
        boolean z4 = z2 && constraintWidget.f842 > 0.0f;
        boolean z5 = z3 && constraintWidget.f842 > 0.0f;
        if (z2 && constraintWidget.m509(0) && constraintWidget.f874 == 0 && !z4) {
            k.f7231 = ConstraintWidget.DimensionBehaviour.WRAP_CONTENT;
            if (z3 && constraintWidget.f827 == 0) {
                k.f7231 = ConstraintWidget.DimensionBehaviour.FIXED;
            }
            z2 = false;
        }
        if (z3 && constraintWidget.m509(1) && constraintWidget.f827 == 0 && !z5) {
            k.f7229 = ConstraintWidget.DimensionBehaviour.WRAP_CONTENT;
            if (z2 && constraintWidget.f874 == 0) {
                k.f7229 = ConstraintWidget.DimensionBehaviour.FIXED;
            }
            z3 = false;
        }
        if (constraintWidget.m504()) {
            k.f7231 = ConstraintWidget.DimensionBehaviour.FIXED;
            z2 = false;
        }
        if (constraintWidget.m471()) {
            k.f7229 = ConstraintWidget.DimensionBehaviour.FIXED;
            z3 = false;
        }
        if (z4) {
            if (constraintWidget.f847[0] == 4) {
                k.f7231 = ConstraintWidget.DimensionBehaviour.FIXED;
            } else if (!z3) {
                if (k.f7229 == ConstraintWidget.DimensionBehaviour.FIXED) {
                    i2 = k.f7234;
                } else {
                    k.f7231 = ConstraintWidget.DimensionBehaviour.WRAP_CONTENT;
                    ((ConstraintLayout.C0139) r8).m564(constraintWidget, k);
                    i2 = k.f7233;
                }
                k.f7231 = ConstraintWidget.DimensionBehaviour.FIXED;
                int i3 = constraintWidget.f855;
                if (i3 == 0 || i3 == -1) {
                    k.f7226 = (int) (constraintWidget.f842 * ((float) i2));
                } else {
                    k.f7226 = (int) (constraintWidget.f842 / ((float) i2));
                }
            }
        }
        if (z5) {
            if (constraintWidget.f847[1] == 4) {
                k.f7229 = ConstraintWidget.DimensionBehaviour.FIXED;
            } else if (!z2) {
                if (k.f7231 == ConstraintWidget.DimensionBehaviour.FIXED) {
                    i = k.f7226;
                } else {
                    k.f7229 = ConstraintWidget.DimensionBehaviour.WRAP_CONTENT;
                    ((ConstraintLayout.C0139) r8).m564(constraintWidget, k);
                    i = k.f7227;
                }
                k.f7229 = ConstraintWidget.DimensionBehaviour.FIXED;
                int i4 = constraintWidget.f855;
                if (i4 == 0 || i4 == -1) {
                    k.f7234 = (int) (((float) i) / constraintWidget.f842);
                } else {
                    k.f7234 = (int) (((float) i) * constraintWidget.f842);
                }
            }
        }
        ((ConstraintLayout.C0139) r8).m564(constraintWidget, k);
        constraintWidget.m502(k.f7227);
        constraintWidget.m479(k.f7233);
        constraintWidget.f852 = k.f7235;
        constraintWidget.m513(k.f7230);
        k.f7232 = false;
        return k.f7228;
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m5476(ConstraintWidget constraintWidget, int i) {
        if (i == 0) {
            int i2 = this.f7202 + 1;
            C2101[] r1 = this.f7200;
            if (i2 >= r1.length) {
                this.f7200 = (C2101[]) Arrays.copyOf(r1, r1.length * 2);
            }
            this.f7200[this.f7202] = new C2101(constraintWidget, 0, this.f7189);
            this.f7202++;
        } else if (i == 1) {
            int i3 = this.f7190 + 1;
            C2101[] r12 = this.f7188;
            if (i3 >= r12.length) {
                this.f7188 = (C2101[]) Arrays.copyOf(r12, r12.length * 2);
            }
            this.f7188[this.f7190] = new C2101(constraintWidget, 1, this.f7189);
            this.f7190++;
        }
    }
}
