package X6FRs_4.X6FRs_4.KQgRr5e_0.XnFJ5_9;

import X6FRs_4.X6FRs_4.KQgRr5e_0.XnFJ5_9.X6FRs_4;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/* compiled from: ConstraintWidgetGroup.java */
/* loaded from: classes.dex */
public class FSaI4_7 {
    public int KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public HashSet<IFxWkV_5> f1140KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public List<IFxWkV_5> f1141KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public boolean f1142KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final int[] f1143KQgRr5e_0;

    /* renamed from: Mqv2r_3  reason: collision with root package name */
    public List<IFxWkV_5> f3269Mqv2r_3;
    public List<IFxWkV_5> PGPF6hQ_2;
    public int QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public HashSet<IFxWkV_5> f1144QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public List<IFxWkV_5> f1145QxJ9d_1;

    /* renamed from: X6FRs_4  reason: collision with root package name */
    public List<IFxWkV_5> f3270X6FRs_4;

    public FSaI4_7(List<IFxWkV_5> list) {
        this.KQgRr5e_0 = -1;
        this.QxJ9d_1 = -1;
        this.f1142KQgRr5e_0 = false;
        this.f1143KQgRr5e_0 = new int[]{-1, -1};
        this.f1145QxJ9d_1 = new ArrayList();
        this.PGPF6hQ_2 = new ArrayList();
        this.f1140KQgRr5e_0 = new HashSet<>();
        this.f1144QxJ9d_1 = new HashSet<>();
        this.f3269Mqv2r_3 = new ArrayList();
        this.f3270X6FRs_4 = new ArrayList();
        this.f1141KQgRr5e_0 = list;
    }

    public List<IFxWkV_5> KQgRr5e_0(int i) {
        if (i == 0) {
            return this.f1145QxJ9d_1;
        }
        if (i == 1) {
            return this.PGPF6hQ_2;
        }
        return null;
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public Set<IFxWkV_5> m545KQgRr5e_0(int i) {
        if (i == 0) {
            return this.f1140KQgRr5e_0;
        }
        if (i == 1) {
            return this.f1144QxJ9d_1;
        }
        return null;
    }

    public void KQgRr5e_0(IFxWkV_5 iFxWkV_5, int i) {
        if (i == 0) {
            this.f1140KQgRr5e_0.add(iFxWkV_5);
        } else if (i == 1) {
            this.f1144QxJ9d_1.add(iFxWkV_5);
        }
    }

    public List<IFxWkV_5> KQgRr5e_0() {
        if (!this.f3269Mqv2r_3.isEmpty()) {
            return this.f3269Mqv2r_3;
        }
        int size = this.f1141KQgRr5e_0.size();
        for (int i = 0; i < size; i++) {
            IFxWkV_5 iFxWkV_5 = this.f1141KQgRr5e_0.get(i);
            if (!iFxWkV_5.f1160KQgRr5e_0) {
                KQgRr5e_0((ArrayList) this.f3269Mqv2r_3, iFxWkV_5);
            }
        }
        this.f3270X6FRs_4.clear();
        this.f3270X6FRs_4.addAll(this.f1141KQgRr5e_0);
        this.f3270X6FRs_4.removeAll(this.f3269Mqv2r_3);
        return this.f3269Mqv2r_3;
    }

    public FSaI4_7(List<IFxWkV_5> list, boolean z) {
        this.KQgRr5e_0 = -1;
        this.QxJ9d_1 = -1;
        this.f1142KQgRr5e_0 = false;
        this.f1143KQgRr5e_0 = new int[]{-1, -1};
        this.f1145QxJ9d_1 = new ArrayList();
        this.PGPF6hQ_2 = new ArrayList();
        this.f1140KQgRr5e_0 = new HashSet<>();
        this.f1144QxJ9d_1 = new HashSet<>();
        this.f3269Mqv2r_3 = new ArrayList();
        this.f3270X6FRs_4 = new ArrayList();
        this.f1141KQgRr5e_0 = list;
        this.f1142KQgRr5e_0 = z;
    }

    public final void KQgRr5e_0(ArrayList<IFxWkV_5> arrayList, IFxWkV_5 iFxWkV_5) {
        if (iFxWkV_5.f1170PGPF6hQ_2) {
            return;
        }
        arrayList.add(iFxWkV_5);
        iFxWkV_5.f1170PGPF6hQ_2 = true;
        if (iFxWkV_5.m566PGPF6hQ_2()) {
            return;
        }
        if (iFxWkV_5 instanceof XnFJ5_9) {
            XnFJ5_9 xnFJ5_9 = (XnFJ5_9) iFxWkV_5;
            int i = xnFJ5_9.XuVgy_28;
            for (int i2 = 0; i2 < i; i2++) {
                KQgRr5e_0(arrayList, xnFJ5_9.PGPF6hQ_2[i2]);
            }
        }
        int length = iFxWkV_5.f1165KQgRr5e_0.length;
        for (int i3 = 0; i3 < length; i3++) {
            X6FRs_4 x6FRs_4 = iFxWkV_5.f1165KQgRr5e_0[i3].f1203KQgRr5e_0;
            if (x6FRs_4 != null) {
                IFxWkV_5 iFxWkV_52 = x6FRs_4.f1200KQgRr5e_0;
                if (x6FRs_4 != null && iFxWkV_52 != iFxWkV_5.m554KQgRr5e_0()) {
                    KQgRr5e_0(arrayList, iFxWkV_52);
                }
            }
        }
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public void m546KQgRr5e_0() {
        int size = this.f3270X6FRs_4.size();
        for (int i = 0; i < size; i++) {
            KQgRr5e_0(this.f3270X6FRs_4.get(i));
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:26:0x0048  */
    /* JADX WARN: Removed duplicated region for block: B:27:0x0050  */
    /* JADX WARN: Removed duplicated region for block: B:30:0x006b  */
    /* JADX WARN: Removed duplicated region for block: B:35:0x0087  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void KQgRr5e_0(IFxWkV_5 iFxWkV_5) {
        X6FRs_4 x6FRs_4;
        int i;
        int QxJ9d_1;
        X6FRs_4 x6FRs_42;
        X6FRs_4 x6FRs_43;
        int QxJ9d_12;
        if (!iFxWkV_5.f1160KQgRr5e_0 || iFxWkV_5.m566PGPF6hQ_2()) {
            return;
        }
        boolean z = iFxWkV_5.f1169PGPF6hQ_2.f1203KQgRr5e_0 != null;
        if (z) {
            x6FRs_4 = iFxWkV_5.f1169PGPF6hQ_2.f1203KQgRr5e_0;
        } else {
            x6FRs_4 = iFxWkV_5.f1156KQgRr5e_0.f1203KQgRr5e_0;
        }
        if (x6FRs_4 != null) {
            IFxWkV_5 iFxWkV_52 = x6FRs_4.f1200KQgRr5e_0;
            if (!iFxWkV_52.f1175QxJ9d_1) {
                KQgRr5e_0(iFxWkV_52);
            }
            X6FRs_4.Mqv2r_3 mqv2r_3 = x6FRs_4.f1201KQgRr5e_0;
            if (mqv2r_3 == X6FRs_4.Mqv2r_3.RIGHT) {
                IFxWkV_5 iFxWkV_53 = x6FRs_4.f1200KQgRr5e_0;
                i = iFxWkV_53.EuDEkJe_12 + iFxWkV_53.XnFJ5_9();
            } else if (mqv2r_3 == X6FRs_4.Mqv2r_3.LEFT) {
                i = x6FRs_4.f1200KQgRr5e_0.EuDEkJe_12;
            }
            if (!z) {
                QxJ9d_1 = i - iFxWkV_5.f1169PGPF6hQ_2.QxJ9d_1();
            } else {
                QxJ9d_1 = i + iFxWkV_5.f1156KQgRr5e_0.QxJ9d_1() + iFxWkV_5.XnFJ5_9();
            }
            iFxWkV_5.KQgRr5e_0(QxJ9d_1 - iFxWkV_5.XnFJ5_9(), QxJ9d_1);
            x6FRs_42 = iFxWkV_5.f1179X6FRs_4.f1203KQgRr5e_0;
            if (x6FRs_42 == null) {
                IFxWkV_5 iFxWkV_54 = x6FRs_42.f1200KQgRr5e_0;
                if (!iFxWkV_54.f1175QxJ9d_1) {
                    KQgRr5e_0(iFxWkV_54);
                }
                IFxWkV_5 iFxWkV_55 = x6FRs_42.f1200KQgRr5e_0;
                int i2 = (iFxWkV_55.WwEq_13 + iFxWkV_55.ZzDuCHW_20) - iFxWkV_5.ZzDuCHW_20;
                iFxWkV_5.X6FRs_4(i2, iFxWkV_5.f3276Nm6q_10 + i2);
                iFxWkV_5.f1175QxJ9d_1 = true;
                return;
            }
            boolean z2 = iFxWkV_5.f1167Mqv2r_3.f1203KQgRr5e_0 != null;
            if (z2) {
                x6FRs_43 = iFxWkV_5.f1167Mqv2r_3.f1203KQgRr5e_0;
            } else {
                x6FRs_43 = iFxWkV_5.f1173QxJ9d_1.f1203KQgRr5e_0;
            }
            if (x6FRs_43 != null) {
                IFxWkV_5 iFxWkV_56 = x6FRs_43.f1200KQgRr5e_0;
                if (!iFxWkV_56.f1175QxJ9d_1) {
                    KQgRr5e_0(iFxWkV_56);
                }
                X6FRs_4.Mqv2r_3 mqv2r_32 = x6FRs_43.f1201KQgRr5e_0;
                if (mqv2r_32 == X6FRs_4.Mqv2r_3.BOTTOM) {
                    IFxWkV_5 iFxWkV_57 = x6FRs_43.f1200KQgRr5e_0;
                    QxJ9d_1 = iFxWkV_57.WwEq_13 + iFxWkV_57.X6FRs_4();
                } else if (mqv2r_32 == X6FRs_4.Mqv2r_3.TOP) {
                    QxJ9d_1 = x6FRs_43.f1200KQgRr5e_0.WwEq_13;
                }
            }
            if (z2) {
                QxJ9d_12 = QxJ9d_1 - iFxWkV_5.f1167Mqv2r_3.QxJ9d_1();
            } else {
                QxJ9d_12 = QxJ9d_1 + iFxWkV_5.f1173QxJ9d_1.QxJ9d_1() + iFxWkV_5.X6FRs_4();
            }
            iFxWkV_5.X6FRs_4(QxJ9d_12 - iFxWkV_5.X6FRs_4(), QxJ9d_12);
            iFxWkV_5.f1175QxJ9d_1 = true;
            return;
        }
        i = 0;
        if (!z) {
        }
        iFxWkV_5.KQgRr5e_0(QxJ9d_1 - iFxWkV_5.XnFJ5_9(), QxJ9d_1);
        x6FRs_42 = iFxWkV_5.f1179X6FRs_4.f1203KQgRr5e_0;
        if (x6FRs_42 == null) {
        }
    }
}
