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: ChainHead.java */
/* loaded from: classes.dex */
public class Mqv2r_3 {

    /* renamed from: IFxWkV_5  reason: collision with root package name */
    public IFxWkV_5 f3289IFxWkV_5;

    /* renamed from: IMuAHx_6  reason: collision with root package name */
    public IFxWkV_5 f3290IMuAHx_6;
    public float KQgRr5e_0 = 0.0f;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public int f1188KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public IFxWkV_5 f1189KQgRr5e_0;

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

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

    /* renamed from: Mqv2r_3  reason: collision with root package name */
    public IFxWkV_5 f3291Mqv2r_3;

    /* renamed from: Mqv2r_3  reason: collision with other field name */
    public boolean f1192Mqv2r_3;
    public int PGPF6hQ_2;

    /* renamed from: PGPF6hQ_2  reason: collision with other field name */
    public IFxWkV_5 f1193PGPF6hQ_2;

    /* renamed from: PGPF6hQ_2  reason: collision with other field name */
    public boolean f1194PGPF6hQ_2;
    public int QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public IFxWkV_5 f1195QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public boolean f1196QxJ9d_1;

    /* renamed from: X6FRs_4  reason: collision with root package name */
    public IFxWkV_5 f3292X6FRs_4;

    /* renamed from: X6FRs_4  reason: collision with other field name */
    public boolean f1197X6FRs_4;

    public Mqv2r_3(IFxWkV_5 iFxWkV_5, int i, boolean z) {
        this.f1191KQgRr5e_0 = false;
        this.f1189KQgRr5e_0 = iFxWkV_5;
        this.PGPF6hQ_2 = i;
        this.f1191KQgRr5e_0 = z;
    }

    public static boolean KQgRr5e_0(IFxWkV_5 iFxWkV_5, int i) {
        if (iFxWkV_5.Xgtqvk_8() != 8 && iFxWkV_5.f1163KQgRr5e_0[i] == IFxWkV_5.QxJ9d_1.MATCH_CONSTRAINT) {
            int[] iArr = iFxWkV_5.f1162KQgRr5e_0;
            if (iArr[i] == 0 || iArr[i] == 3) {
                return true;
            }
        }
        return false;
    }

    public final void QxJ9d_1() {
        int i = this.PGPF6hQ_2 * 2;
        IFxWkV_5 iFxWkV_5 = this.f1189KQgRr5e_0;
        boolean z = false;
        IFxWkV_5 iFxWkV_52 = iFxWkV_5;
        boolean z2 = false;
        while (!z2) {
            this.f1188KQgRr5e_0++;
            IFxWkV_5[] iFxWkV_5Arr = iFxWkV_5.f1177QxJ9d_1;
            int i2 = this.PGPF6hQ_2;
            IFxWkV_5 iFxWkV_53 = null;
            iFxWkV_5Arr[i2] = null;
            iFxWkV_5.f1164KQgRr5e_0[i2] = null;
            if (iFxWkV_5.Xgtqvk_8() != 8) {
                if (this.f1195QxJ9d_1 == null) {
                    this.f1195QxJ9d_1 = iFxWkV_5;
                }
                this.f3291Mqv2r_3 = iFxWkV_5;
                IFxWkV_5.QxJ9d_1[] qxJ9d_1Arr = iFxWkV_5.f1163KQgRr5e_0;
                int i3 = this.PGPF6hQ_2;
                if (qxJ9d_1Arr[i3] == IFxWkV_5.QxJ9d_1.MATCH_CONSTRAINT) {
                    int[] iArr = iFxWkV_5.f1162KQgRr5e_0;
                    if (iArr[i3] == 0 || iArr[i3] == 3 || iArr[i3] == 2) {
                        this.QxJ9d_1++;
                        float[] fArr = iFxWkV_5.f1161KQgRr5e_0;
                        int i4 = this.PGPF6hQ_2;
                        float f = fArr[i4];
                        if (f > 0.0f) {
                            this.KQgRr5e_0 += fArr[i4];
                        }
                        if (KQgRr5e_0(iFxWkV_5, this.PGPF6hQ_2)) {
                            if (f < 0.0f) {
                                this.f1196QxJ9d_1 = true;
                            } else {
                                this.f1194PGPF6hQ_2 = true;
                            }
                            if (this.f1190KQgRr5e_0 == null) {
                                this.f1190KQgRr5e_0 = new ArrayList<>();
                            }
                            this.f1190KQgRr5e_0.add(iFxWkV_5);
                        }
                        if (this.f3289IFxWkV_5 == null) {
                            this.f3289IFxWkV_5 = iFxWkV_5;
                        }
                        IFxWkV_5 iFxWkV_54 = this.f3290IMuAHx_6;
                        if (iFxWkV_54 != null) {
                            iFxWkV_54.f1164KQgRr5e_0[this.PGPF6hQ_2] = iFxWkV_5;
                        }
                        this.f3290IMuAHx_6 = iFxWkV_5;
                    }
                }
            }
            if (iFxWkV_52 != iFxWkV_5) {
                iFxWkV_52.f1177QxJ9d_1[this.PGPF6hQ_2] = iFxWkV_5;
            }
            X6FRs_4 x6FRs_4 = iFxWkV_5.f1165KQgRr5e_0[i + 1].f1203KQgRr5e_0;
            if (x6FRs_4 != null) {
                IFxWkV_5 iFxWkV_55 = x6FRs_4.f1200KQgRr5e_0;
                X6FRs_4[] x6FRs_4Arr = iFxWkV_55.f1165KQgRr5e_0;
                if (x6FRs_4Arr[i].f1203KQgRr5e_0 != null && x6FRs_4Arr[i].f1203KQgRr5e_0.f1200KQgRr5e_0 == iFxWkV_5) {
                    iFxWkV_53 = iFxWkV_55;
                }
            }
            if (iFxWkV_53 == null) {
                iFxWkV_53 = iFxWkV_5;
                z2 = true;
            }
            iFxWkV_52 = iFxWkV_5;
            iFxWkV_5 = iFxWkV_53;
        }
        this.f1193PGPF6hQ_2 = iFxWkV_5;
        if (this.PGPF6hQ_2 == 0 && this.f1191KQgRr5e_0) {
            this.f3292X6FRs_4 = iFxWkV_5;
        } else {
            this.f3292X6FRs_4 = this.f1189KQgRr5e_0;
        }
        if (this.f1194PGPF6hQ_2 && this.f1196QxJ9d_1) {
            z = true;
        }
        this.f1192Mqv2r_3 = z;
    }

    public void KQgRr5e_0() {
        if (!this.f1197X6FRs_4) {
            QxJ9d_1();
        }
        this.f1197X6FRs_4 = true;
    }
}
