package defpackage;

/* JADX INFO: renamed from: ᵦˁᵚˈ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C3556 extends AbstractC0268 {

    /* JADX INFO: renamed from: ˆˀᵯ, reason: contains not printable characters */
    public boolean f13621;

    /* JADX INFO: renamed from: ᵚᵹᵔᵜ, reason: contains not printable characters */
    public int f13622;

    /* JADX INFO: renamed from: ᵧᵢᵴᵸ, reason: contains not printable characters */
    public int f13623;

    /* JADX INFO: renamed from: ᵱᵭ, reason: contains not printable characters */
    public boolean f13624;

    @Override // defpackage.C2622
    public final String toString() {
        String strM8231 = AbstractC3653.m8231(new StringBuilder("[Barrier] "), this.f10178, " {");
        for (int i = 0; i < this.f1884; i++) {
            C2622 c2622 = this.f1883[i];
            if (i > 0) {
                strM8231 = strM8231.concat(", ");
            }
            StringBuilder sbM8219 = AbstractC3653.m8219(strM8231);
            sbM8219.append(c2622.f10178);
            strM8231 = sbM8219.toString();
        }
        return strM8231.concat("}");
    }

    @Override // defpackage.C2622
    /* JADX INFO: renamed from: ʽˈˋ */
    public final void mo1271(C1873 c1873, boolean z) {
        boolean z2;
        int i;
        int i2;
        C4214[] c4214Arr = this.f10155;
        C4214 c4214 = this.f10151;
        c4214Arr[0] = c4214;
        int i3 = 2;
        C4214 c42142 = this.f10149;
        c4214Arr[2] = c42142;
        C4214 c42143 = this.f10164;
        c4214Arr[1] = c42143;
        C4214 c42144 = this.f10161;
        c4214Arr[3] = c42144;
        for (C4214 c42145 : c4214Arr) {
            c42145.f16035 = c1873.m5103(c42145);
        }
        int i4 = this.f13623;
        if (i4 < 0 || i4 >= 4) {
            return;
        }
        C4214 c42146 = c4214Arr[i4];
        if (!this.f13624) {
            m8069();
        }
        if (this.f13624) {
            this.f13624 = false;
            int i5 = this.f13623;
            if (i5 == 0 || i5 == 1) {
                c1873.m5104(c4214.f16035, this.f10147);
                c1873.m5104(c42143.f16035, this.f10147);
                return;
            } else {
                if (i5 == 2 || i5 == 3) {
                    c1873.m5104(c42142.f16035, this.f10188);
                    c1873.m5104(c42144.f16035, this.f10188);
                    return;
                }
                return;
            }
        }
        for (int i6 = 0; i6 < this.f1884; i6++) {
            C2622 c2622 = this.f1883[i6];
            if ((this.f13621 || c2622.mo1274()) && ((((i2 = this.f13623) == 0 || i2 == 1) && c2622.f10196[0] == 3 && c2622.f10151.f16036 != null && c2622.f10164.f16036 != null) || ((i2 == 2 || i2 == 3) && c2622.f10196[1] == 3 && c2622.f10149.f16036 != null && c2622.f10161.f16036 != null))) {
                z2 = true;
                break;
            }
        }
        z2 = false;
        boolean z3 = c4214.m9153() || c42143.m9153();
        boolean z4 = c42142.m9153() || c42144.m9153();
        int i7 = !(!z2 && (((i = this.f13623) == 0 && z3) || ((i == 2 && z4) || ((i == 1 && z3) || (i == 3 && z4))))) ? 4 : 5;
        int i8 = 0;
        while (i8 < this.f1884) {
            C2622 c26222 = this.f1883[i8];
            if (this.f13621 || c26222.mo1274()) {
                C4996 c4996M5103 = c1873.m5103(c26222.f10155[this.f13623]);
                C4214[] c4214Arr2 = c26222.f10155;
                int i9 = this.f13623;
                C4214 c42147 = c4214Arr2[i9];
                c42147.f16035 = c4996M5103;
                C4214 c42148 = c42147.f16036;
                int i10 = (c42148 == null || c42148.f16034 != this) ? 0 : c42147.f16033;
                if (i9 == 0 || i9 == i3) {
                    C4996 c4996 = c42146.f16035;
                    int i11 = this.f13622 - i10;
                    C5184 c5184M5098 = c1873.m5098();
                    C4996 c4996M5094 = c1873.m5094();
                    c4996M5094.f18939 = 0;
                    c5184M5098.m10730(c4996, c4996M5103, c4996M5094, i11);
                    c1873.m5093(c5184M5098);
                } else {
                    C4996 c49962 = c42146.f16035;
                    int i12 = this.f13622 + i10;
                    C5184 c5184M50982 = c1873.m5098();
                    C4996 c4996M50942 = c1873.m5094();
                    c4996M50942.f18939 = 0;
                    c5184M50982.m10728(c49962, c4996M5103, c4996M50942, i12);
                    c1873.m5093(c5184M50982);
                }
                c1873.m5096(c42146.f16035, c4996M5103, this.f13622 + i10, i7);
            }
            i8++;
            i3 = 2;
        }
        int i13 = this.f13623;
        if (i13 == 0) {
            c1873.m5096(c42143.f16035, c4214.f16035, 0, 8);
            c1873.m5096(c4214.f16035, this.f10159.f10164.f16035, 0, 4);
            c1873.m5096(c4214.f16035, this.f10159.f10151.f16035, 0, 0);
            return;
        }
        if (i13 == 1) {
            c1873.m5096(c4214.f16035, c42143.f16035, 0, 8);
            c1873.m5096(c4214.f16035, this.f10159.f10151.f16035, 0, 4);
            c1873.m5096(c4214.f16035, this.f10159.f10164.f16035, 0, 0);
        } else if (i13 == 2) {
            c1873.m5096(c42144.f16035, c42142.f16035, 0, 8);
            c1873.m5096(c42142.f16035, this.f10159.f10161.f16035, 0, 4);
            c1873.m5096(c42142.f16035, this.f10159.f10149.f16035, 0, 0);
        } else if (i13 == 3) {
            c1873.m5096(c42142.f16035, c42144.f16035, 0, 8);
            c1873.m5096(c42142.f16035, this.f10159.f10149.f16035, 0, 4);
            c1873.m5096(c42142.f16035, this.f10159.f10161.f16035, 0, 0);
        }
    }

    /* JADX INFO: renamed from: ˁʢᵛ, reason: contains not printable characters */
    public final int m8068() {
        int i = this.f13623;
        if (i == 0 || i == 1) {
            return 0;
        }
        return (i == 2 || i == 3) ? 1 : -1;
    }

    @Override // defpackage.C2622
    /* JADX INFO: renamed from: ˈᵲᵢ */
    public final boolean mo1272() {
        return this.f13624;
    }

    /* JADX INFO: renamed from: ˊˌˊ, reason: contains not printable characters */
    public final boolean m8069() {
        int i;
        int i2;
        int i3;
        boolean z = true;
        int i4 = 0;
        while (true) {
            i = this.f1884;
            if (i4 >= i) {
                break;
            }
            C2622 c2622 = this.f1883[i4];
            if ((this.f13621 || c2622.mo1274()) && ((((i2 = this.f13623) == 0 || i2 == 1) && !c2622.mo1277()) || (((i3 = this.f13623) == 2 || i3 == 3) && !c2622.mo1272()))) {
                z = false;
            }
            i4++;
        }
        if (!z || i <= 0) {
            return false;
        }
        int iMax = 0;
        boolean z2 = false;
        for (int i5 = 0; i5 < this.f1884; i5++) {
            C2622 c26222 = this.f1883[i5];
            if (this.f13621 || c26222.mo1274()) {
                if (!z2) {
                    int i6 = this.f13623;
                    if (i6 == 0) {
                        iMax = c26222.mo1278(2).m9155();
                    } else if (i6 == 1) {
                        iMax = c26222.mo1278(4).m9155();
                    } else if (i6 == 2) {
                        iMax = c26222.mo1278(3).m9155();
                    } else if (i6 == 3) {
                        iMax = c26222.mo1278(5).m9155();
                    }
                    z2 = true;
                }
                int i7 = this.f13623;
                if (i7 == 0) {
                    iMax = Math.min(iMax, c26222.mo1278(2).m9155());
                } else if (i7 == 1) {
                    iMax = Math.max(iMax, c26222.mo1278(4).m9155());
                } else if (i7 == 2) {
                    iMax = Math.min(iMax, c26222.mo1278(3).m9155());
                } else if (i7 == 3) {
                    iMax = Math.max(iMax, c26222.mo1278(5).m9155());
                }
            }
        }
        int i8 = iMax + this.f13622;
        int i9 = this.f13623;
        if (i9 == 0 || i9 == 1) {
            m6352(i8, i8);
        } else {
            m6359(i8, i8);
        }
        this.f13624 = true;
        return true;
    }

    @Override // defpackage.C2622
    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public final boolean mo1274() {
        return true;
    }

    @Override // defpackage.C2622
    /* JADX INFO: renamed from: ᵶˇᵱ */
    public final boolean mo1277() {
        return this.f13624;
    }
}
