package defpackage;

import androidx.leanback.widget.GridLayoutManager;

/* JADX INFO: renamed from: ˆˋ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C0832 extends AbstractC5529 {

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public int f3721;

    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public Object f3722;

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public C4349 f3723;

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public int f3724;

    @Override // defpackage.AbstractC5529
    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final boolean mo2955(int i) {
        if (this.f20866 < 0) {
            return false;
        }
        if (this.f20863) {
            for (int i2 = 0; i2 < this.f20864; i2++) {
                int iM2963 = m2963(i2);
                if (iM2963 != Integer.MAX_VALUE && iM2963 > this.f20867 + i) {
                    return false;
                }
            }
            return true;
        }
        for (int i3 = 0; i3 < this.f20864; i3++) {
            int iM2959 = m2959(i3);
            if (iM2959 != Integer.MIN_VALUE && iM2959 < i - this.f20867) {
                return false;
            }
        }
        return true;
    }

    /* JADX INFO: renamed from: ˉᵲ, reason: contains not printable characters */
    public final int m2956(boolean z) {
        boolean z2 = false;
        if (z) {
            for (int i = this.f20866; i >= this.f20869; i--) {
                int i2 = ((ᵾːʿ) mo1219(i)).ᵜᵪʾ;
                if (i2 == 0) {
                    z2 = true;
                } else if (z2 && i2 == this.f20864 - 1) {
                    return i;
                }
            }
            return -1;
        }
        for (int i3 = this.f20869; i3 <= this.f20866; i3++) {
            int i4 = ((ᵾːʿ) mo1219(i3)).ᵜᵪʾ;
            if (i4 == this.f20864 - 1) {
                z2 = true;
            } else if (z2 && i4 == 0) {
                return i3;
            }
        }
        return -1;
    }

    /* JADX WARN: Code restructure failed: missing block: B:102:0x012a, code lost:
    
        return true;
     */
    /* JADX WARN: Removed duplicated region for block: B:104:0x012d  */
    /* JADX WARN: Removed duplicated region for block: B:67:0x00c5 A[PHI: r9 r11
      0x00c5: PHI (r9v19 int) = (r9v11 int), (r9v4 int) binds: [B:78:0x00e3, B:66:0x00c3] A[DONT_GENERATE, DONT_INLINE]
      0x00c5: PHI (r11v9 int) = (r11v2 int), (r11v11 int) binds: [B:78:0x00e3, B:66:0x00c3] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:85:0x00fd A[LOOP:2: B:85:0x00fd->B:101:0x011f, LOOP_START, PHI: r6 r9 r10
      0x00fd: PHI (r6v12 int) = (r6v6 int), (r6v16 int) binds: [B:84:0x00fb, B:101:0x011f] A[DONT_GENERATE, DONT_INLINE]
      0x00fd: PHI (r9v15 int) = (r9v13 int), (r9v16 int) binds: [B:84:0x00fb, B:101:0x011f] A[DONT_GENERATE, DONT_INLINE]
      0x00fd: PHI (r10v5 int) = (r10v3 int), (r10v7 int) binds: [B:84:0x00fb, B:101:0x011f] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX INFO: renamed from: ˊᵙᵾᵲ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean m2957(int i, boolean z) {
        int i2;
        int i3;
        boolean z2;
        int iM2963;
        int i4;
        int i5 = this.f20861.ᵱᵽʡᵚ();
        int i6 = this.f20866;
        if (i6 < 0) {
            int i7 = this.f20868;
            i2 = i7 != -1 ? i7 : 0;
            i3 = (this.f3723.m9371() > 0 ? ((ᵾːʿ) mo1219(m2960())).ᵜᵪʾ + 1 : i2) % this.f20864;
            z2 = false;
            iM2963 = 0;
        } else {
            if (i6 < m2960()) {
                return false;
            }
            int i8 = this.f20866;
            i2 = i8 + 1;
            i3 = ((ᵾːʿ) mo1219(i8)).ᵜᵪʾ;
            int iM2956 = m2956(true);
            if (iM2956 < 0) {
                iM2963 = Integer.MIN_VALUE;
                for (int i9 = 0; i9 < this.f20864; i9++) {
                    iM2963 = this.f20863 ? m2963(i9) : m2959(i9);
                    if (iM2963 != Integer.MIN_VALUE) {
                        break;
                    }
                }
            } else {
                iM2963 = this.f20863 ? mo1216(null, iM2956) : mo1224(null, iM2956);
            }
            if (!this.f20863 ? m2959(i3) >= iM2963 : m2963(i3) <= iM2963) {
                i3++;
                if (i3 == this.f20864) {
                    iM2963 = this.f20863 ? m11156(null) : m11154(null);
                    i3 = 0;
                }
            }
            z2 = true;
        }
        boolean z3 = false;
        loop1: while (true) {
            if (i3 < this.f20864) {
                if (i2 == i5 || (!z && mo2955(i))) {
                    break;
                }
                int iM29632 = this.f20863 ? m2963(i3) : m2959(i3);
                if (iM29632 == Integer.MAX_VALUE || iM29632 == Integer.MIN_VALUE) {
                    boolean z4 = this.f20863;
                    if (i3 == 0) {
                        int i10 = this.f20864 - 1;
                        iM29632 = z4 ? m2963(i10) : m2959(i10);
                        if (iM29632 != Integer.MAX_VALUE && iM29632 != Integer.MIN_VALUE) {
                            boolean z5 = this.f20863;
                            i4 = this.f20867;
                            if (z5) {
                                i4 = -i4;
                            }
                            iM29632 += i4;
                        }
                    } else {
                        iM29632 = z4 ? m2959(i3 - 1) : m2963(i3 - 1);
                    }
                    int i11 = i2 + 1;
                    int iM2968 = m2968(i2, i3, iM29632);
                    if (!z2) {
                        while (true) {
                            if (!this.f20863) {
                                if (iM29632 + iM2968 >= iM2963) {
                                    break;
                                }
                                if (i11 == i5) {
                                    break loop1;
                                }
                                break loop1;
                                break loop1;
                            }
                            if (iM29632 - iM2968 <= iM2963) {
                                break;
                            }
                            if (i11 == i5 || (!z && mo2955(i))) {
                                break loop1;
                            }
                            boolean z6 = this.f20863;
                            int i12 = this.f20867;
                            iM29632 += z6 ? (-iM2968) - i12 : iM2968 + i12;
                            int i13 = i11 + 1;
                            int iM29682 = m2968(i11, i3, iM29632);
                            i11 = i13;
                            iM2968 = iM29682;
                        }
                    } else {
                        z2 = true;
                        iM2963 = this.f20863 ? m2963(i3) : m2959(i3);
                    }
                    i2 = i11;
                    i3++;
                    z3 = true;
                } else {
                    boolean z7 = this.f20863;
                    i4 = this.f20867;
                    if (z7) {
                    }
                    iM29632 += i4;
                    int i112 = i2 + 1;
                    int iM29683 = m2968(i2, i3, iM29632);
                    if (!z2) {
                    }
                    i2 = i112;
                    i3++;
                    z3 = true;
                }
            } else {
                if (z) {
                    break;
                }
                iM2963 = this.f20863 ? m11156(null) : m11154(null);
                i3 = 0;
            }
        }
        return z3;
    }

    @Override // defpackage.AbstractC5529
    /* JADX INFO: renamed from: ˊᵨᵧ, reason: contains not printable characters and merged with bridge method [inline-methods] */
    public final C4740 mo1219(int i) {
        C4349 c4349 = this.f3723;
        int i2 = i - this.f3724;
        if (i2 < 0 || i2 >= c4349.m9371()) {
            return null;
        }
        if (i2 < 0 || i2 >= c4349.m9371()) {
            throw new ArrayIndexOutOfBoundsException();
        }
        return (C4740) ((Object[]) c4349.f16540)[c4349.f16542 & (c4349.f16538 + i2)];
    }

    @Override // defpackage.AbstractC5529
    /* JADX INFO: renamed from: ˊᵫᵗ */
    public final int mo1216(int[] iArr, int i) {
        int i2;
        int i3 = this.f20861.ᵶᵥᵝ(i);
        C4740 c4740Mo1219 = mo1219(i);
        int i4 = ((ᵾːʿ) c4740Mo1219).ᵜᵪʾ;
        if (this.f20863) {
            int i5 = 1;
            i2 = i3 - this.f20861.ᵮᵣᵗˈ(i);
            int i6 = i4;
            for (int i7 = i - 1; i5 < this.f20864 && i7 >= this.f20869; i7--) {
                i3 -= c4740Mo1219.f18032;
                c4740Mo1219 = mo1219(i7);
                int i8 = ((ᵾːʿ) c4740Mo1219).ᵜᵪʾ;
                if (i8 != i6) {
                    i5++;
                    int i9 = i3 - this.f20861.ᵮᵣᵗˈ(i7);
                    if (i9 < i2) {
                        i2 = i9;
                        i = i7;
                        i4 = i8;
                        i6 = i4;
                    } else {
                        i6 = i8;
                    }
                }
            }
        } else {
            int i10 = i4;
            int i11 = i10;
            int i12 = 1;
            int i13 = i3;
            for (int i14 = i + 1; i12 < this.f20864 && i14 <= this.f20866; i14++) {
                C4740 c4740Mo12192 = mo1219(i14);
                i13 += c4740Mo12192.f18032;
                int i15 = ((ᵾːʿ) c4740Mo12192).ᵜᵪʾ;
                if (i15 != i11) {
                    i12++;
                    if (i13 < i3) {
                        i3 = i13;
                        i = i14;
                        i10 = i15;
                        i11 = i10;
                    } else {
                        i11 = i15;
                    }
                }
            }
            i2 = i3;
            i4 = i10;
        }
        if (iArr != null) {
            iArr[0] = i4;
            iArr[1] = i;
        }
        return i2;
    }

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final int m2959(int i) {
        int i2;
        C4740 c4740Mo1219;
        int i3 = this.f20869;
        if (i3 < 0) {
            return Integer.MIN_VALUE;
        }
        boolean z = this.f20863;
        ᵟˑʽ r3 = this.f20861;
        if (z) {
            int i4 = r3.ᵶᵥᵝ(i3);
            if (((ᵾːʿ) mo1219(this.f20869)).ᵜᵪʾ == i) {
                return i4;
            }
            int i5 = this.f20869;
            do {
                i5++;
                if (i5 <= m2960()) {
                    c4740Mo1219 = mo1219(i5);
                    i4 += c4740Mo1219.f18032;
                }
            } while (((ᵾːʿ) c4740Mo1219).ᵜᵪʾ != i);
            return i4;
        }
        int i6 = r3.ᵶᵥᵝ(this.f20866);
        C4740 c4740Mo12192 = mo1219(this.f20866);
        if (((ᵾːʿ) c4740Mo12192).ᵜᵪʾ == i) {
            i2 = c4740Mo12192.f18033;
        } else {
            int i7 = this.f20866;
            do {
                i7--;
                if (i7 >= this.f3724) {
                    i6 -= c4740Mo12192.f18032;
                    c4740Mo12192 = mo1219(i7);
                }
            } while (((ᵾːʿ) c4740Mo12192).ᵜᵪʾ != i);
            i2 = c4740Mo12192.f18033;
        }
        return i6 + i2;
        return Integer.MIN_VALUE;
    }

    /* JADX INFO: renamed from: ˏːˆ, reason: contains not printable characters */
    public final int m2960() {
        return (this.f3723.m9371() + this.f3724) - 1;
    }

    @Override // defpackage.AbstractC5529
    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final boolean mo2961(int i) {
        if (this.f20866 < 0) {
            return false;
        }
        if (this.f20863) {
            for (int i2 = 0; i2 < this.f20864; i2++) {
                int iM2959 = m2959(i2);
                if (iM2959 != Integer.MIN_VALUE && iM2959 < i - this.f20867) {
                    return false;
                }
            }
            return true;
        }
        for (int i3 = 0; i3 < this.f20864; i3++) {
            int iM2963 = m2963(i3);
            if (iM2963 != Integer.MAX_VALUE && iM2963 > this.f20867 + i) {
                return false;
            }
        }
        return true;
    }

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public final boolean m2962(int i) {
        int i2;
        int i3;
        int i4;
        C4349 c4349 = this.f3723;
        if (c4349.m9371() != 0) {
            int i5 = this.f20869;
            if (i5 < 0) {
                int i6 = this.f20868;
                i2 = i6 != -1 ? i6 : 0;
                if (i2 <= m2960()) {
                    int i7 = this.f3724;
                    if (i2 >= i7 - 1) {
                        if (i2 >= i7) {
                            i3 = Integer.MAX_VALUE;
                            i4 = 0;
                        }
                    }
                }
                c4349.m9357(c4349.m9371());
                return false;
            }
            i3 = this.f20861.ᵶᵥᵝ(i5);
            i4 = mo1219(this.f20869).f18032;
            i2 = this.f20869 - 1;
            int iMax = Math.max(((GridLayoutManager) this.f20861.ˌᴵ).f424, this.f3724);
            int i8 = i2;
            while (i8 >= iMax) {
                C4740 c4740Mo1219 = mo1219(i8);
                int i9 = ((ᵾːʿ) c4740Mo1219).ᵜᵪʾ;
                ᵟˑʽ r7 = this.f20861;
                Object[] objArr = this.f20865;
                int i10 = r7.ˊᵫᵗ(i8, 1, false, objArr, false);
                if (i10 != c4740Mo1219.f18033) {
                    c4349.m9357((i8 + 1) - this.f3724);
                    this.f3724 = this.f20869;
                    this.f3722 = objArr[0];
                    this.f3721 = i10;
                    return false;
                }
                this.f20869 = i8;
                if (this.f20866 < 0) {
                    this.f20866 = i8;
                }
                int i11 = i8;
                this.f20861.ːˏᵟᵯ(objArr[0], i11, i10, i9, i3 - i4);
                if (mo2961(i)) {
                    return true;
                }
                i3 = this.f20861.ᵶᵥᵝ(i11);
                i4 = c4740Mo1219.f18032;
                i8 = i11 - 1;
            }
        }
        return false;
    }

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final int m2963(int i) {
        C4740 c4740Mo1219;
        int i2;
        int i3 = this.f20869;
        if (i3 < 0) {
            return Integer.MAX_VALUE;
        }
        boolean z = this.f20863;
        ᵟˑʽ r3 = this.f20861;
        if (!z) {
            int i4 = r3.ᵶᵥᵝ(i3);
            if (((ᵾːʿ) mo1219(this.f20869)).ᵜᵪʾ == i) {
                return i4;
            }
            int i5 = this.f20869;
            do {
                i5++;
                if (i5 <= m2960()) {
                    c4740Mo1219 = mo1219(i5);
                    i4 += c4740Mo1219.f18032;
                }
            } while (((ᵾːʿ) c4740Mo1219).ᵜᵪʾ != i);
            return i4;
        }
        int i6 = r3.ᵶᵥᵝ(this.f20866);
        C4740 c4740Mo12192 = mo1219(this.f20866);
        if (((ᵾːʿ) c4740Mo12192).ᵜᵪʾ == i) {
            i2 = c4740Mo12192.f18033;
        } else {
            int i7 = this.f20866;
            do {
                i7--;
                if (i7 >= this.f3724) {
                    i6 -= c4740Mo12192.f18032;
                    c4740Mo12192 = mo1219(i7);
                }
            } while (((ᵾːʿ) c4740Mo12192).ᵜᵪʾ != i);
            i2 = c4740Mo12192.f18033;
        }
        return i6 - i2;
        return Integer.MAX_VALUE;
    }

    @Override // defpackage.AbstractC5529
    /* JADX INFO: renamed from: ᵝᵶ */
    public final boolean mo1217(int i) {
        Object[] objArr = this.f20865;
        if (this.f20861.ᵱᵽʡᵚ() == 0 || mo2961(i)) {
            return false;
        }
        try {
            if (!m2962(i)) {
                return m2967(i);
            }
            objArr[0] = null;
            this.f3722 = null;
            return true;
        } finally {
            objArr[0] = null;
            this.f3722 = null;
        }
    }

    /* JADX INFO: renamed from: ᵟᵹᵙ, reason: contains not printable characters */
    public final boolean m2964(int i, boolean z) {
        int i2;
        int i3;
        C4349 c4349 = this.f3723;
        if (c4349.m9371() != 0) {
            int i4 = this.f20861.ᵱᵽʡᵚ();
            int i5 = this.f20866;
            if (i5 >= 0) {
                i2 = i5 + 1;
                i3 = this.f20861.ᵶᵥᵝ(i5);
            } else {
                int i6 = this.f20868;
                i2 = i6 != -1 ? i6 : 0;
                if (i2 > m2960() + 1 || i2 < this.f3724) {
                    c4349.m9357(c4349.m9371());
                    return false;
                }
                if (i2 <= m2960()) {
                    i3 = Integer.MAX_VALUE;
                }
            }
            int iM2960 = m2960();
            int i7 = i2;
            while (i7 < i4 && i7 <= iM2960) {
                C4740 c4740Mo1219 = mo1219(i7);
                if (i3 != Integer.MAX_VALUE) {
                    i3 += c4740Mo1219.f18032;
                }
                int i8 = ((ᵾːʿ) c4740Mo1219).ᵜᵪʾ;
                ᵟˑʽ r7 = this.f20861;
                Object[] objArr = this.f20865;
                int i9 = r7.ˊᵫᵗ(i7, 1, true, objArr, false);
                if (i9 != c4740Mo1219.f18033) {
                    c4740Mo1219.f18033 = i9;
                    c4349.m9368(iM2960 - i7);
                    iM2960 = i7;
                }
                this.f20866 = i7;
                if (this.f20869 < 0) {
                    this.f20869 = i7;
                }
                int i10 = i7;
                int i11 = i3;
                this.f20861.ːˏᵟᵯ(objArr[0], i10, i9, i8, i11);
                if (z || !mo2955(i)) {
                    i3 = i11 == Integer.MAX_VALUE ? this.f20861.ᵶᵥᵝ(i10) : i11;
                    if (i8 != this.f20864 - 1 || !z) {
                        i7 = i10 + 1;
                    }
                }
                return true;
            }
        }
        return false;
    }

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public final int m2965(int i, int i2, int i3) {
        int i4 = this.f20869;
        if (i4 >= 0 && (i4 != this.f3724 || i4 != i + 1)) {
            ᵷᵝˎ.ᵱʡˏ();
            return 0;
        }
        int i5 = this.f3724;
        C4740 c4740Mo1219 = i5 >= 0 ? mo1219(i5) : null;
        int i6 = this.f20861.ᵶᵥᵝ(this.f3724);
        C4740 c4740 = new C4740(i2, 0);
        C4349 c4349 = this.f3723;
        int i7 = (c4349.f16538 - 1) & c4349.f16542;
        c4349.f16538 = i7;
        ((Object[]) c4349.f16540)[i7] = c4740;
        if (i7 == c4349.f16539) {
            c4349.m9350();
        }
        Object obj = this.f3722;
        if (obj != null) {
            c4740.f18033 = this.f3721;
            this.f3722 = null;
        } else {
            ᵟˑʽ r1 = this.f20861;
            Object[] objArr = this.f20865;
            c4740.f18033 = r1.ˊᵫᵗ(i, 1, false, objArr, false);
            obj = objArr[0];
        }
        this.f20869 = i;
        this.f3724 = i;
        if (this.f20866 < 0) {
            this.f20866 = i;
        }
        boolean z = this.f20863;
        int i8 = c4740.f18033;
        int i9 = !z ? i3 - i8 : i3 + i8;
        if (c4740Mo1219 != null) {
            c4740Mo1219.f18032 = i6 - i9;
        }
        this.f20861.ːˏᵟᵯ(obj, i, i8, i2, i9);
        return c4740.f18033;
    }

    @Override // defpackage.AbstractC5529
    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public final void mo2966(int i) {
        super.mo2966(i);
        C4349 c4349 = this.f3723;
        c4349.m9368((m2960() - i) + 1);
        if (c4349.m9371() == 0) {
            this.f3724 = -1;
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:106:0x0133, code lost:
    
        return r8;
     */
    /* JADX WARN: Removed duplicated region for block: B:100:0x011e  */
    /* JADX WARN: Removed duplicated region for block: B:64:0x00bb A[PHI: r8 r10
      0x00bb: PHI (r8v19 int) = (r8v11 int), (r8v4 int) binds: [B:74:0x00d8, B:62:0x00b8] A[DONT_GENERATE, DONT_INLINE]
      0x00bb: PHI (r10v8 int) = (r10v1 int), (r10v10 int) binds: [B:74:0x00d8, B:62:0x00b8] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:82:0x00f0 A[LOOP:2: B:82:0x00f0->B:97:0x0110, LOOP_START, PHI: r5 r8 r9
      0x00f0: PHI (r5v12 int) = (r5v6 int), (r5v17 int) binds: [B:81:0x00ee, B:97:0x0110] A[DONT_GENERATE, DONT_INLINE]
      0x00f0: PHI (r8v15 int) = (r8v13 int), (r8v16 int) binds: [B:81:0x00ee, B:97:0x0110] A[DONT_GENERATE, DONT_INLINE]
      0x00f0: PHI (r9v5 int) = (r9v3 int), (r9v7 int) binds: [B:81:0x00ee, B:97:0x0110] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean m2967(int i) {
        int i2;
        int i3;
        boolean z;
        int iM2959;
        int i4;
        int i5 = this.f20869;
        if (i5 < 0) {
            int i6 = this.f20868;
            i2 = i6 != -1 ? i6 : 0;
            i3 = (this.f3723.m9371() > 0 ? (((ᵾːʿ) mo1219(this.f3724)).ᵜᵪʾ + this.f20864) - 1 : i2) % this.f20864;
            z = false;
            iM2959 = 0;
        } else {
            if (i5 > this.f3724) {
                return false;
            }
            i2 = i5 - 1;
            i3 = ((ᵾːʿ) mo1219(i5)).ᵜᵪʾ;
            int iM2956 = m2956(false);
            if (iM2956 < 0) {
                i3--;
                iM2959 = Integer.MAX_VALUE;
                for (int i7 = this.f20864 - 1; i7 >= 0; i7--) {
                    iM2959 = this.f20863 ? m2959(i7) : m2963(i7);
                    if (iM2959 != Integer.MAX_VALUE) {
                        break;
                    }
                }
            } else {
                iM2959 = this.f20863 ? mo1224(null, iM2956) : mo1216(null, iM2956);
            }
            if (!this.f20863 ? m2963(i3) <= iM2959 : m2959(i3) >= iM2959) {
                i3--;
                if (i3 < 0) {
                    i3 = this.f20864 - 1;
                    iM2959 = this.f20863 ? m11154(null) : m11156(null);
                }
            }
            z = true;
        }
        boolean z2 = false;
        loop1: while (true) {
            if (i3 < 0) {
                iM2959 = this.f20863 ? m11154(null) : m11156(null);
                i3 = this.f20864 - 1;
            } else {
                if (i2 < 0 || mo2961(i)) {
                    break;
                }
                int iM29592 = this.f20863 ? m2959(i3) : m2963(i3);
                if (iM29592 == Integer.MAX_VALUE || iM29592 == Integer.MIN_VALUE) {
                    int i8 = this.f20864 - 1;
                    boolean z3 = this.f20863;
                    if (i3 == i8) {
                        iM29592 = z3 ? m2959(0) : m2963(0);
                        if (iM29592 != Integer.MAX_VALUE && iM29592 != Integer.MIN_VALUE) {
                            boolean z4 = this.f20863;
                            i4 = this.f20867;
                            if (!z4) {
                                i4 = -i4;
                            }
                            iM29592 += i4;
                        }
                    } else {
                        int i9 = i3 + 1;
                        iM29592 = z3 ? m2963(i9) : m2959(i9);
                    }
                    int i10 = i2 - 1;
                    int iM2965 = m2965(i2, i3, iM29592);
                    if (!z) {
                        while (true) {
                            if (!this.f20863) {
                                if (iM29592 - iM2965 <= iM2959) {
                                    break;
                                }
                                if (i10 < 0) {
                                    break loop1;
                                }
                                break loop1;
                                break loop1;
                            }
                            if (iM29592 + iM2965 >= iM2959) {
                                break;
                            }
                            if (i10 < 0 || mo2961(i)) {
                                break loop1;
                            }
                            boolean z5 = this.f20863;
                            int i11 = this.f20867;
                            iM29592 += z5 ? iM2965 + i11 : (-iM2965) - i11;
                            int i12 = i10 - 1;
                            int iM29652 = m2965(i10, i3, iM29592);
                            i10 = i12;
                            iM2965 = iM29652;
                        }
                    } else {
                        z = true;
                        iM2959 = this.f20863 ? m2959(i3) : m2963(i3);
                    }
                    i2 = i10;
                    i3--;
                    z2 = true;
                } else {
                    boolean z6 = this.f20863;
                    i4 = this.f20867;
                    if (!z6) {
                    }
                    iM29592 += i4;
                    int i102 = i2 - 1;
                    int iM29653 = m2965(i2, i3, iM29592);
                    if (!z) {
                    }
                    i2 = i102;
                    i3--;
                    z2 = true;
                }
            }
        }
        return true;
    }

    /* JADX INFO: renamed from: ᵱʡˏ, reason: contains not printable characters */
    public final int m2968(int i, int i2, int i3) {
        int i4;
        C4349 c4349 = this.f3723;
        int i5 = this.f20866;
        if (i5 >= 0 && (i5 != m2960() || this.f20866 != i - 1)) {
            ᵷᵝˎ.ᵱʡˏ();
            return 0;
        }
        int i6 = this.f20866;
        if (i6 >= 0) {
            i4 = i3 - this.f20861.ᵶᵥᵝ(i6);
        } else if (c4349.m9371() <= 0 || i != m2960() + 1) {
            i4 = 0;
        } else {
            int iM2960 = m2960();
            while (true) {
                if (iM2960 < this.f3724) {
                    iM2960 = m2960();
                    break;
                }
                if (((ᵾːʿ) mo1219(iM2960)).ᵜᵪʾ == i2) {
                    break;
                }
                iM2960--;
            }
            i4 = this.f20863 ? (-mo1219(iM2960).f18033) - this.f20867 : mo1219(iM2960).f18033 + this.f20867;
            for (int i7 = iM2960 + 1; i7 <= m2960(); i7++) {
                i4 -= mo1219(i7).f18032;
            }
        }
        C4740 c4740 = new C4740(i2, i4);
        c4349.m9340(c4740);
        Object obj = this.f3722;
        if (obj != null) {
            c4740.f18033 = this.f3721;
            this.f3722 = null;
        } else {
            ᵟˑʽ r1 = this.f20861;
            Object[] objArr = this.f20865;
            c4740.f18033 = r1.ˊᵫᵗ(i, 1, true, objArr, false);
            obj = objArr[0];
        }
        if (c4349.m9371() == 1) {
            this.f20866 = i;
            this.f20869 = i;
            this.f3724 = i;
        } else {
            int i8 = this.f20866;
            if (i8 < 0) {
                this.f20866 = i;
                this.f20869 = i;
            } else {
                this.f20866 = i8 + 1;
            }
        }
        this.f20861.ːˏᵟᵯ(obj, i, c4740.f18033, i2, i3);
        return c4740.f18033;
    }

    @Override // defpackage.AbstractC5529
    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public final boolean mo1220(int i, boolean z) {
        Object[] objArr = this.f20865;
        if (this.f20861.ᵱᵽʡᵚ() == 0 || (!z && mo2955(i))) {
            return false;
        }
        try {
            if (!m2964(i, z)) {
                return m2957(i, z);
            }
            objArr[0] = null;
            this.f3722 = null;
            return true;
        } finally {
            objArr[0] = null;
            this.f3722 = null;
        }
    }

    @Override // defpackage.AbstractC5529
    /* JADX INFO: renamed from: ᵶᵥᵝ */
    public final int mo1221(int i, int i2, int i3) {
        int i4 = i3 * this.f20864;
        int i5 = this.f20863 ? i - i4 : i + i4;
        if (i5 < 0) {
            return 0;
        }
        int i6 = i2 - 1;
        return i5 > i6 ? i6 : i5;
    }

    /* JADX WARN: Removed duplicated region for block: B:19:0x004d  */
    @Override // defpackage.AbstractC5529
    /* JADX INFO: renamed from: ᵻʽᵯ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final C3673[] mo1223(int i, int i2) {
        for (int i3 = 0; i3 < this.f20864; i3++) {
            this.f20862[i3].f13945 = 0;
        }
        if (i >= 0) {
            while (i <= i2) {
                C3673 c3673 = this.f20862[((ᵾːʿ) mo1219(i)).ᵜᵪʾ];
                int i4 = c3673.f13945;
                int i5 = c3673.f13947;
                if ((i4 & i5) <= 0) {
                    c3673.m8288(i);
                    c3673.m8288(i);
                } else {
                    if (i4 == 0) {
                        throw new ArrayIndexOutOfBoundsException();
                    }
                    int[] iArr = (int[]) c3673.f13946;
                    if (iArr[(i4 - 1) & i5] == i - 1) {
                        if (i4 == 0) {
                            throw new ArrayIndexOutOfBoundsException();
                        }
                        int i6 = (i4 - 1) & i5;
                        int i7 = iArr[i6];
                        c3673.f13945 = i6;
                        c3673.m8288(i);
                    }
                }
                i++;
            }
        }
        return this.f20862;
    }

    @Override // defpackage.AbstractC5529
    /* JADX INFO: renamed from: ᵻˈᵦʼ */
    public final int mo1224(int[] iArr, int i) {
        int i2;
        int i3 = this.f20861.ᵶᵥᵝ(i);
        C4740 c4740Mo1219 = mo1219(i);
        int i4 = ((ᵾːʿ) c4740Mo1219).ᵜᵪʾ;
        if (this.f20863) {
            i2 = i4;
            int i5 = i2;
            int i6 = 1;
            int i7 = i3;
            for (int i8 = i + 1; i6 < this.f20864 && i8 <= this.f20866; i8++) {
                C4740 c4740Mo12192 = mo1219(i8);
                i7 += c4740Mo12192.f18032;
                int i9 = ((ᵾːʿ) c4740Mo12192).ᵜᵪʾ;
                if (i9 != i5) {
                    i6++;
                    if (i7 > i3) {
                        i3 = i7;
                        i = i8;
                        i2 = i9;
                        i5 = i2;
                    } else {
                        i5 = i9;
                    }
                }
            }
        } else {
            int i10 = 1;
            int i11 = i4;
            C4740 c4740Mo12193 = c4740Mo1219;
            int i12 = i3;
            i3 = this.f20861.ᵮᵣᵗˈ(i) + i3;
            i2 = i11;
            for (int i13 = i - 1; i10 < this.f20864 && i13 >= this.f20869; i13--) {
                i12 -= c4740Mo12193.f18032;
                c4740Mo12193 = mo1219(i13);
                int i14 = ((ᵾːʿ) c4740Mo12193).ᵜᵪʾ;
                if (i14 != i11) {
                    i10++;
                    int i15 = this.f20861.ᵮᵣᵗˈ(i13) + i12;
                    if (i15 > i3) {
                        i3 = i15;
                        i = i13;
                        i2 = i14;
                        i11 = i2;
                    } else {
                        i11 = i14;
                    }
                }
            }
        }
        if (iArr != null) {
            iArr[0] = i2;
            iArr[1] = i;
        }
        return i3;
    }
}
