package defpackage;

/* renamed from: ᵟʜ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3009 extends AbstractC1133 {

    /* renamed from: ʾˋˊᵽ, reason: contains not printable characters */
    public int f11591;

    /* renamed from: ᵎʾ, reason: contains not printable characters */
    public int f11592;

    /* renamed from: ᵷᵦﹳ, reason: contains not printable characters */
    public boolean f11593;

    /* renamed from: ᵺᵜᵰ, reason: contains not printable characters */
    public boolean f11594;

    @Override // defpackage.C0425
    public final String toString() {
        String strM4107 = AbstractC1327.m4107(new StringBuilder("[Barrier] "), this.f2392, " {");
        for (int i = 0; i < this.f4866; i++) {
            C0425 c0425 = this.f4865[i];
            if (i > 0) {
                strM4107 = strM4107.concat(", ");
            }
            StringBuilder sbM4096 = AbstractC1327.m4096(strM4107);
            sbM4096.append(c0425.f2392);
            strM4107 = sbM4096.toString();
        }
        return strM4107.concat("}");
    }

    @Override // defpackage.C0425
    /* renamed from: ˀᵗᵝᵭ */
    public final boolean mo1977() {
        return this.f11593;
    }

    /* renamed from: ˌᵪ, reason: contains not printable characters */
    public final boolean m7351() {
        int i;
        int i2;
        int i3;
        boolean z = true;
        int i4 = 0;
        while (true) {
            i = this.f4866;
            if (i4 >= i) {
                break;
            }
            C0425 c0425 = this.f4865[i4];
            if ((this.f11594 || c0425.mo1986()) && ((((i2 = this.f11591) == 0 || i2 == 1) && !c0425.mo1997()) || (((i3 = this.f11591) == 2 || i3 == 3) && !c0425.mo1977()))) {
                z = false;
            }
            i4++;
        }
        if (!z || i <= 0) {
            return false;
        }
        int iMax = 0;
        boolean z2 = false;
        for (int i5 = 0; i5 < this.f4866; i5++) {
            C0425 c04252 = this.f4865[i5];
            if (this.f11594 || c04252.mo1986()) {
                if (!z2) {
                    int i6 = this.f11591;
                    if (i6 == 0) {
                        iMax = c04252.mo1992(2).m3359();
                    } else if (i6 == 1) {
                        iMax = c04252.mo1992(4).m3359();
                    } else if (i6 == 2) {
                        iMax = c04252.mo1992(3).m3359();
                    } else if (i6 == 3) {
                        iMax = c04252.mo1992(5).m3359();
                    }
                    z2 = true;
                }
                int i7 = this.f11591;
                if (i7 == 0) {
                    iMax = Math.min(iMax, c04252.mo1992(2).m3359());
                } else if (i7 == 1) {
                    iMax = Math.max(iMax, c04252.mo1992(4).m3359());
                } else if (i7 == 2) {
                    iMax = Math.min(iMax, c04252.mo1992(3).m3359());
                } else if (i7 == 3) {
                    iMax = Math.max(iMax, c04252.mo1992(5).m3359());
                }
            }
        }
        int i8 = iMax + this.f11592;
        int i9 = this.f11591;
        if (i9 == 0 || i9 == 1) {
            m2007(i8, i8);
        } else {
            m1979(i8, i8);
        }
        this.f11593 = true;
        return true;
    }

    @Override // defpackage.C0425
    /* renamed from: ˏᵙ */
    public final boolean mo1986() {
        return true;
    }

    @Override // defpackage.C0425
    /* renamed from: ᵡⁱᵥ */
    public final boolean mo1997() {
        return this.f11593;
    }

    /* renamed from: ᵳᵹᵺˋ, reason: contains not printable characters */
    public final int m7352() {
        int i = this.f11591;
        if (i == 0 || i == 1) {
            return 0;
        }
        return (i == 2 || i == 3) ? 1 : -1;
    }

    @Override // defpackage.C0425
    /* renamed from: ᵴᵳ */
    public final void mo2006(C1692 c1692, boolean z) {
        boolean z2;
        int i;
        int i2;
        C0994[] c0994Arr = this.f2357;
        C0994 c0994 = this.f2377;
        c0994Arr[0] = c0994;
        int i3 = 2;
        C0994 c09942 = this.f2407;
        c0994Arr[2] = c09942;
        C0994 c09943 = this.f2358;
        c0994Arr[1] = c09943;
        C0994 c09944 = this.f2420;
        c0994Arr[3] = c09944;
        for (C0994 c09945 : c0994Arr) {
            c09945.f4394 = c1692.m4882(c09945);
        }
        int i4 = this.f11591;
        if (i4 < 0 || i4 >= 4) {
            return;
        }
        C0994 c09946 = c0994Arr[i4];
        if (!this.f11593) {
            m7351();
        }
        if (this.f11593) {
            this.f11593 = false;
            int i5 = this.f11591;
            if (i5 == 0 || i5 == 1) {
                c1692.m4884(c0994.f4394, this.f2400);
                c1692.m4884(c09943.f4394, this.f2400);
                return;
            } else {
                if (i5 == 2 || i5 == 3) {
                    c1692.m4884(c09942.f4394, this.f2416);
                    c1692.m4884(c09944.f4394, this.f2416);
                    return;
                }
                return;
            }
        }
        for (int i6 = 0; i6 < this.f4866; i6++) {
            C0425 c0425 = this.f4865[i6];
            if ((this.f11594 || c0425.mo1986()) && ((((i2 = this.f11591) == 0 || i2 == 1) && c0425.f2382[0] == 3 && c0425.f2377.f4392 != null && c0425.f2358.f4392 != null) || ((i2 == 2 || i2 == 3) && c0425.f2382[1] == 3 && c0425.f2407.f4392 != null && c0425.f2420.f4392 != null))) {
                z2 = true;
                break;
            }
        }
        z2 = false;
        boolean z3 = c0994.m3350() || c09943.m3350();
        boolean z4 = c09942.m3350() || c09944.m3350();
        int i7 = !(!z2 && (((i = this.f11591) == 0 && z3) || ((i == 2 && z4) || ((i == 1 && z3) || (i == 3 && z4))))) ? 4 : 5;
        int i8 = 0;
        while (i8 < this.f4866) {
            C0425 c04252 = this.f4865[i8];
            if (this.f11594 || c04252.mo1986()) {
                C0868 c0868M4882 = c1692.m4882(c04252.f2357[this.f11591]);
                C0994[] c0994Arr2 = c04252.f2357;
                int i9 = this.f11591;
                C0994 c09947 = c0994Arr2[i9];
                c09947.f4394 = c0868M4882;
                C0994 c09948 = c09947.f4392;
                int i10 = (c09948 == null || c09948.f4398 != this) ? 0 : c09947.f4391;
                if (i9 == 0 || i9 == i3) {
                    C0868 c0868 = c09946.f4394;
                    int i11 = this.f11592 - i10;
                    C5247 c5247M4868 = c1692.m4868();
                    C0868 c0868M4877 = c1692.m4877();
                    c0868M4877.f3956 = 0;
                    c5247M4868.m10893(c0868, c0868M4882, c0868M4877, i11);
                    c1692.m4871(c5247M4868);
                } else {
                    C0868 c08682 = c09946.f4394;
                    int i12 = this.f11592 + i10;
                    C5247 c5247M48682 = c1692.m4868();
                    C0868 c0868M48772 = c1692.m4877();
                    c0868M48772.f3956 = 0;
                    c5247M48682.m10895(c08682, c0868M4882, c0868M48772, i12);
                    c1692.m4871(c5247M48682);
                }
                c1692.m4866(c09946.f4394, c0868M4882, this.f11592 + i10, i7);
            }
            i8++;
            i3 = 2;
        }
        int i13 = this.f11591;
        if (i13 == 0) {
            c1692.m4866(c09943.f4394, c0994.f4394, 0, 8);
            c1692.m4866(c0994.f4394, this.f2367.f2358.f4394, 0, 4);
            c1692.m4866(c0994.f4394, this.f2367.f2377.f4394, 0, 0);
            return;
        }
        if (i13 == 1) {
            c1692.m4866(c0994.f4394, c09943.f4394, 0, 8);
            c1692.m4866(c0994.f4394, this.f2367.f2377.f4394, 0, 4);
            c1692.m4866(c0994.f4394, this.f2367.f2358.f4394, 0, 0);
        } else if (i13 == 2) {
            c1692.m4866(c09944.f4394, c09942.f4394, 0, 8);
            c1692.m4866(c09942.f4394, this.f2367.f2420.f4394, 0, 4);
            c1692.m4866(c09942.f4394, this.f2367.f2407.f4394, 0, 0);
        } else if (i13 == 3) {
            c1692.m4866(c09942.f4394, c09944.f4394, 0, 8);
            c1692.m4866(c09942.f4394, this.f2367.f2407.f4394, 0, 4);
            c1692.m4866(c09942.f4394, this.f2367.f2420.f4394, 0, 0);
        }
    }
}
