package X6FRs_4.X6FRs_4.KQgRr5e_0.XnFJ5_9;

import X6FRs_4.X6FRs_4.KQgRr5e_0.XnFJ5_9.IFxWkV_5;
import java.util.ArrayList;
/* compiled from: Barrier.java */
/* loaded from: classes.dex */
public class QxJ9d_1 extends XnFJ5_9 {
    public int NzhupJ_29 = 0;
    public ArrayList<EuDEkJe_12> QxJ9d_1 = new ArrayList<>(4);

    /* renamed from: Mqv2r_3  reason: collision with root package name */
    public boolean f3293Mqv2r_3 = true;

    @Override // X6FRs_4.X6FRs_4.KQgRr5e_0.XnFJ5_9.IFxWkV_5
    public void KQgRr5e_0(int i) {
        EuDEkJe_12 m575KQgRr5e_0;
        EuDEkJe_12 m575KQgRr5e_02;
        IFxWkV_5 iFxWkV_5 = ((IFxWkV_5) this).f1154KQgRr5e_0;
        if (iFxWkV_5 != null && ((IMuAHx_6) iFxWkV_5).QxJ9d_1(2)) {
            int i2 = this.NzhupJ_29;
            if (i2 == 0) {
                m575KQgRr5e_0 = ((IFxWkV_5) this).f1156KQgRr5e_0.m575KQgRr5e_0();
            } else if (i2 == 1) {
                m575KQgRr5e_0 = ((IFxWkV_5) this).f1169PGPF6hQ_2.m575KQgRr5e_0();
            } else if (i2 == 2) {
                m575KQgRr5e_0 = ((IFxWkV_5) this).f1173QxJ9d_1.m575KQgRr5e_0();
            } else if (i2 != 3) {
                return;
            } else {
                m575KQgRr5e_0 = ((IFxWkV_5) this).f1167Mqv2r_3.m575KQgRr5e_0();
            }
            m575KQgRr5e_0.m544KQgRr5e_0(5);
            int i3 = this.NzhupJ_29;
            if (i3 != 0 && i3 != 1) {
                ((IFxWkV_5) this).f1156KQgRr5e_0.m575KQgRr5e_0().KQgRr5e_0((EuDEkJe_12) null, 0.0f);
                ((IFxWkV_5) this).f1169PGPF6hQ_2.m575KQgRr5e_0().KQgRr5e_0((EuDEkJe_12) null, 0.0f);
            } else {
                ((IFxWkV_5) this).f1173QxJ9d_1.m575KQgRr5e_0().KQgRr5e_0((EuDEkJe_12) null, 0.0f);
                ((IFxWkV_5) this).f1167Mqv2r_3.m575KQgRr5e_0().KQgRr5e_0((EuDEkJe_12) null, 0.0f);
            }
            this.QxJ9d_1.clear();
            for (int i4 = 0; i4 < this.XuVgy_28; i4++) {
                IFxWkV_5 iFxWkV_52 = ((XnFJ5_9) this).PGPF6hQ_2[i4];
                if (this.f3293Mqv2r_3 || iFxWkV_52.m561KQgRr5e_0()) {
                    int i5 = this.NzhupJ_29;
                    if (i5 == 0) {
                        m575KQgRr5e_02 = iFxWkV_52.f1156KQgRr5e_0.m575KQgRr5e_0();
                    } else if (i5 == 1) {
                        m575KQgRr5e_02 = iFxWkV_52.f1169PGPF6hQ_2.m575KQgRr5e_0();
                    } else if (i5 != 2) {
                        m575KQgRr5e_02 = i5 != 3 ? null : iFxWkV_52.f1167Mqv2r_3.m575KQgRr5e_0();
                    } else {
                        m575KQgRr5e_02 = iFxWkV_52.f1173QxJ9d_1.m575KQgRr5e_0();
                    }
                    if (m575KQgRr5e_02 != null) {
                        this.QxJ9d_1.add(m575KQgRr5e_02);
                        m575KQgRr5e_02.KQgRr5e_0(m575KQgRr5e_0);
                    }
                }
            }
        }
    }

    @Override // X6FRs_4.X6FRs_4.KQgRr5e_0.XnFJ5_9.IFxWkV_5
    public boolean KQgRr5e_0() {
        return true;
    }

    public void LGe8pk_15(int i) {
        this.NzhupJ_29 = i;
    }

    @Override // X6FRs_4.X6FRs_4.KQgRr5e_0.XnFJ5_9.IFxWkV_5
    public void Mqv2r_3() {
        super.m563Mqv2r_3();
        this.QxJ9d_1.clear();
    }

    public void PGPF6hQ_2(boolean z) {
        this.f3293Mqv2r_3 = z;
    }

    @Override // X6FRs_4.X6FRs_4.KQgRr5e_0.XnFJ5_9.IFxWkV_5
    public void X6FRs_4() {
        EuDEkJe_12 m575KQgRr5e_0;
        float f;
        EuDEkJe_12 euDEkJe_12;
        int i = this.NzhupJ_29;
        float f2 = Float.MAX_VALUE;
        if (i != 0) {
            if (i == 1) {
                m575KQgRr5e_0 = ((IFxWkV_5) this).f1169PGPF6hQ_2.m575KQgRr5e_0();
            } else if (i == 2) {
                m575KQgRr5e_0 = ((IFxWkV_5) this).f1173QxJ9d_1.m575KQgRr5e_0();
            } else if (i != 3) {
                return;
            } else {
                m575KQgRr5e_0 = ((IFxWkV_5) this).f1167Mqv2r_3.m575KQgRr5e_0();
            }
            f2 = 0.0f;
        } else {
            m575KQgRr5e_0 = ((IFxWkV_5) this).f1156KQgRr5e_0.m575KQgRr5e_0();
        }
        int size = this.QxJ9d_1.size();
        EuDEkJe_12 euDEkJe_122 = null;
        for (int i2 = 0; i2 < size; i2++) {
            EuDEkJe_12 euDEkJe_123 = this.QxJ9d_1.get(i2);
            if (((YghfZG_14) euDEkJe_123).KQgRr5e_0 != 1) {
                return;
            }
            int i3 = this.NzhupJ_29;
            if (i3 != 0 && i3 != 2) {
                f = euDEkJe_123.QxJ9d_1;
                if (f > f2) {
                    euDEkJe_12 = euDEkJe_123.f1138QxJ9d_1;
                    euDEkJe_122 = euDEkJe_12;
                    f2 = f;
                }
            } else {
                f = euDEkJe_123.QxJ9d_1;
                if (f < f2) {
                    euDEkJe_12 = euDEkJe_123.f1138QxJ9d_1;
                    euDEkJe_122 = euDEkJe_12;
                    f2 = f;
                }
            }
        }
        if (X6FRs_4.X6FRs_4.KQgRr5e_0.X6FRs_4.KQgRr5e_0() != null) {
            X6FRs_4.X6FRs_4.KQgRr5e_0.X6FRs_4.KQgRr5e_0().G83uNX_24++;
        }
        m575KQgRr5e_0.f1138QxJ9d_1 = euDEkJe_122;
        m575KQgRr5e_0.QxJ9d_1 = f2;
        m575KQgRr5e_0.KQgRr5e_0();
        int i4 = this.NzhupJ_29;
        if (i4 == 0) {
            ((IFxWkV_5) this).f1169PGPF6hQ_2.m575KQgRr5e_0().KQgRr5e_0(euDEkJe_122, f2);
        } else if (i4 == 1) {
            ((IFxWkV_5) this).f1156KQgRr5e_0.m575KQgRr5e_0().KQgRr5e_0(euDEkJe_122, f2);
        } else if (i4 == 2) {
            ((IFxWkV_5) this).f1167Mqv2r_3.m575KQgRr5e_0().KQgRr5e_0(euDEkJe_122, f2);
        } else if (i4 == 3) {
            ((IFxWkV_5) this).f1173QxJ9d_1.m575KQgRr5e_0().KQgRr5e_0(euDEkJe_122, f2);
        }
    }

    @Override // X6FRs_4.X6FRs_4.KQgRr5e_0.XnFJ5_9.IFxWkV_5
    public void KQgRr5e_0(X6FRs_4.X6FRs_4.KQgRr5e_0.X6FRs_4 x6FRs_4) {
        Object[] objArr;
        boolean z;
        int i;
        int i2;
        X6FRs_4[] x6FRs_4Arr = ((IFxWkV_5) this).f1165KQgRr5e_0;
        x6FRs_4Arr[0] = ((IFxWkV_5) this).f1156KQgRr5e_0;
        x6FRs_4Arr[2] = ((IFxWkV_5) this).f1173QxJ9d_1;
        x6FRs_4Arr[1] = ((IFxWkV_5) this).f1169PGPF6hQ_2;
        x6FRs_4Arr[3] = ((IFxWkV_5) this).f1167Mqv2r_3;
        int i3 = 0;
        while (true) {
            objArr = ((IFxWkV_5) this).f1165KQgRr5e_0;
            if (i3 >= objArr.length) {
                break;
            }
            objArr[i3].f1198KQgRr5e_0 = x6FRs_4.m539KQgRr5e_0((Object) objArr[i3]);
            i3++;
        }
        int i4 = this.NzhupJ_29;
        if (i4 < 0 || i4 >= 4) {
            return;
        }
        X6FRs_4 x6FRs_42 = objArr[i4];
        for (int i5 = 0; i5 < this.XuVgy_28; i5++) {
            IFxWkV_5 iFxWkV_5 = ((XnFJ5_9) this).PGPF6hQ_2[i5];
            if ((this.f3293Mqv2r_3 || iFxWkV_5.m561KQgRr5e_0()) && ((((i = this.NzhupJ_29) == 0 || i == 1) && iFxWkV_5.m552KQgRr5e_0() == IFxWkV_5.QxJ9d_1.MATCH_CONSTRAINT) || (((i2 = this.NzhupJ_29) == 2 || i2 == 3) && iFxWkV_5.m567QxJ9d_1() == IFxWkV_5.QxJ9d_1.MATCH_CONSTRAINT))) {
                z = true;
                break;
            }
        }
        z = false;
        int i6 = this.NzhupJ_29;
        if (i6 == 0 || i6 == 1 ? m554KQgRr5e_0().m552KQgRr5e_0() == IFxWkV_5.QxJ9d_1.WRAP_CONTENT : m554KQgRr5e_0().m567QxJ9d_1() == IFxWkV_5.QxJ9d_1.WRAP_CONTENT) {
            z = false;
        }
        for (int i7 = 0; i7 < this.XuVgy_28; i7++) {
            IFxWkV_5 iFxWkV_52 = ((XnFJ5_9) this).PGPF6hQ_2[i7];
            if (this.f3293Mqv2r_3 || iFxWkV_52.m561KQgRr5e_0()) {
                X6FRs_4.X6FRs_4.KQgRr5e_0.Xgtqvk_8 m539KQgRr5e_0 = x6FRs_4.m539KQgRr5e_0(iFxWkV_52.f1165KQgRr5e_0[this.NzhupJ_29]);
                X6FRs_4[] x6FRs_4Arr2 = iFxWkV_52.f1165KQgRr5e_0;
                int i8 = this.NzhupJ_29;
                x6FRs_4Arr2[i8].f1198KQgRr5e_0 = m539KQgRr5e_0;
                if (i8 != 0 && i8 != 2) {
                    x6FRs_4.KQgRr5e_0(x6FRs_42.f1198KQgRr5e_0, m539KQgRr5e_0, z);
                } else {
                    x6FRs_4.QxJ9d_1(x6FRs_42.f1198KQgRr5e_0, m539KQgRr5e_0, z);
                }
            }
        }
        int i9 = this.NzhupJ_29;
        if (i9 == 0) {
            x6FRs_4.KQgRr5e_0(((IFxWkV_5) this).f1169PGPF6hQ_2.f1198KQgRr5e_0, ((IFxWkV_5) this).f1156KQgRr5e_0.f1198KQgRr5e_0, 0, 6);
            if (z) {
                return;
            }
            x6FRs_4.KQgRr5e_0(((IFxWkV_5) this).f1156KQgRr5e_0.f1198KQgRr5e_0, ((IFxWkV_5) this).f1154KQgRr5e_0.f1169PGPF6hQ_2.f1198KQgRr5e_0, 0, 5);
        } else if (i9 == 1) {
            x6FRs_4.KQgRr5e_0(((IFxWkV_5) this).f1156KQgRr5e_0.f1198KQgRr5e_0, ((IFxWkV_5) this).f1169PGPF6hQ_2.f1198KQgRr5e_0, 0, 6);
            if (z) {
                return;
            }
            x6FRs_4.KQgRr5e_0(((IFxWkV_5) this).f1156KQgRr5e_0.f1198KQgRr5e_0, ((IFxWkV_5) this).f1154KQgRr5e_0.f1156KQgRr5e_0.f1198KQgRr5e_0, 0, 5);
        } else if (i9 == 2) {
            x6FRs_4.KQgRr5e_0(((IFxWkV_5) this).f1167Mqv2r_3.f1198KQgRr5e_0, ((IFxWkV_5) this).f1173QxJ9d_1.f1198KQgRr5e_0, 0, 6);
            if (z) {
                return;
            }
            x6FRs_4.KQgRr5e_0(((IFxWkV_5) this).f1173QxJ9d_1.f1198KQgRr5e_0, ((IFxWkV_5) this).f1154KQgRr5e_0.f1167Mqv2r_3.f1198KQgRr5e_0, 0, 5);
        } else if (i9 == 3) {
            x6FRs_4.KQgRr5e_0(((IFxWkV_5) this).f1173QxJ9d_1.f1198KQgRr5e_0, ((IFxWkV_5) this).f1167Mqv2r_3.f1198KQgRr5e_0, 0, 6);
            if (z) {
                return;
            }
            x6FRs_4.KQgRr5e_0(((IFxWkV_5) this).f1173QxJ9d_1.f1198KQgRr5e_0, ((IFxWkV_5) this).f1154KQgRr5e_0.f1173QxJ9d_1.f1198KQgRr5e_0, 0, 5);
        }
    }
}
