package defpackage;

import android.util.SparseArray;
import androidx.media3.exoplayer.drm.DrmSession$DrmSessionException;
import j$.util.Objects;
import java.io.EOFException;

/* renamed from: ˎʔᵳʕ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public class C1666 implements InterfaceC2154 {

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public boolean f6598;

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final C2221 f6599;

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public int f6600;

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public C3446 f6602;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public long f6603;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public InterfaceC0797 f6604;

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public C3446 f6606;

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public boolean f6608;

    /* renamed from: ᵞʡ, reason: contains not printable characters */
    public int f6610;

    /* renamed from: ᵡʠ, reason: contains not printable characters */
    public int f6611;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public C3446 f6612;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final C4247 f6616;

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public boolean f6617;

    /* renamed from: ᵸʓᵠ, reason: contains not printable characters */
    public int f6626;

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public InterfaceC1660 f6628;

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public long f6629;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final InterfaceC0687 f6630;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public boolean f6631;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final C4395 f6624 = new C4395();

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public int f6609 = 1000;

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public long[] f6625 = new long[1000];

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public long[] f6627 = new long[1000];

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public long[] f6620 = new long[1000];

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public int[] f6622 = new int[1000];

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public int[] f6601 = new int[1000];

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public C5346[] f6623 = new C5346[1000];

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final C4782 f6605 = new C4782(new ᵨᴵᵺ(16));

    /* renamed from: ᵨᵳʝ, reason: contains not printable characters */
    public long f6619 = Long.MIN_VALUE;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public long f6618 = Long.MIN_VALUE;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public long f6614 = Long.MIN_VALUE;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public boolean f6613 = true;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public boolean f6615 = true;

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public boolean f6621 = true;

    /* renamed from: ˑᵱ, reason: contains not printable characters */
    public long f6607 = Long.MIN_VALUE;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public int f6632 = -1;

    public C1666(ᵧˉʙ r1, InterfaceC0687 interfaceC0687, C2221 c2221) {
        this.f6630 = interfaceC0687;
        this.f6599 = c2221;
        this.f6616 = new C4247(r1);
    }

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public final boolean m4760(int i) {
        InterfaceC1660 interfaceC1660 = this.f6628;
        if (interfaceC1660 == null || interfaceC1660.mo4739() == 4) {
            return true;
        }
        return (this.f6622[i] & 1073741824) == 0 && this.f6628.mo4744();
    }

    /* JADX WARN: Removed duplicated region for block: B:13:0x0026  */
    /* JADX WARN: Removed duplicated region for block: B:14:0x0028  */
    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final synchronized boolean m4761(boolean r12, long r13) throws java.lang.Throwable {
        /*
            r11 = this;
            monitor-enter(r11)
            r11.m4767()     // Catch: java.lang.Throwable -> L6b
            int r0 = r11.f6610     // Catch: java.lang.Throwable -> L6b
            int r2 = r11.m4774(r0)     // Catch: java.lang.Throwable -> L6b
            long r0 = r11.f6607     // Catch: java.lang.Throwable -> L6b
            r3 = -9223372036854775808
            int r3 = (r0 > r3 ? 1 : (r0 == r3 ? 0 : -1))
            long r4 = r11.f6614
            if (r3 == 0) goto L1e
            long r4 = java.lang.Math.min(r4, r0)     // Catch: java.lang.Throwable -> L19
            goto L1e
        L19:
            r0 = move-exception
            r12 = r0
            r1 = r11
            goto L73
        L1e:
            int r0 = r11.f6610     // Catch: java.lang.Throwable -> L70
            int r1 = r11.f6600     // Catch: java.lang.Throwable -> L70
            r7 = 1
            r8 = 0
            if (r0 == r1) goto L28
            r3 = r7
            goto L29
        L28:
            r3 = r8
        L29:
            if (r3 == 0) goto L39
            long[] r3 = r11.f6620     // Catch: java.lang.Throwable -> L6b
            r9 = r3[r2]     // Catch: java.lang.Throwable -> L6b
            int r3 = (r13 > r9 ? 1 : (r13 == r9 ? 0 : -1))
            if (r3 < 0) goto L39
            int r3 = (r13 > r4 ? 1 : (r13 == r4 ? 0 : -1))
            if (r3 <= 0) goto L3b
            if (r12 != 0) goto L3b
        L39:
            r1 = r11
            goto L6e
        L3b:
            boolean r3 = r11.f6621     // Catch: java.lang.Throwable -> L6b
            if (r3 == 0) goto L50
            int r3 = r1 - r0
            r1 = r11
            r6 = r12
            r4 = r13
            int r11 = r1.m4762(r2, r3, r4, r6)     // Catch: java.lang.Throwable -> L4b
            r12 = r1
            r1 = r12
            goto L5a
        L4b:
            r0 = move-exception
            r12 = r1
        L4d:
            r11 = r0
            r12 = r11
            goto L73
        L50:
            r12 = r11
            r4 = r13
            int r3 = r1 - r0
            r6 = 1
            r1 = r12
            int r11 = r1.m4771(r2, r3, r4, r6)     // Catch: java.lang.Throwable -> L68
        L5a:
            r12 = -1
            if (r11 != r12) goto L5f
            monitor-exit(r1)
            return r8
        L5f:
            r1.f6619 = r4     // Catch: java.lang.Throwable -> L68
            int r12 = r1.f6610     // Catch: java.lang.Throwable -> L68
            int r12 = r12 + r11
            r1.f6610 = r12     // Catch: java.lang.Throwable -> L68
            monitor-exit(r1)
            return r7
        L68:
            r0 = move-exception
        L69:
            r12 = r0
            goto L73
        L6b:
            r0 = move-exception
            r1 = r11
            goto L69
        L6e:
            monitor-exit(r1)
            return r8
        L70:
            r0 = move-exception
            r1 = r11
            goto L4d
        L73:
            monitor-exit(r1)     // Catch: java.lang.Throwable -> L68
            throw r12
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C1666.m4761(boolean, long):boolean");
    }

    @Override // defpackage.InterfaceC2154
    /* renamed from: ˇʼʤˎ */
    public final /* synthetic */ void mo4406(int i, C3493 c3493) {
        AbstractC2990.m7314(this, c3493, i);
    }

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public final int m4762(int i, int i2, long j, boolean z) {
        for (int i3 = 0; i3 < i2; i3++) {
            if (this.f6620[i] >= j) {
                return i3;
            }
            i++;
            if (i == this.f6609) {
                i = 0;
            }
        }
        if (z) {
            return i2;
        }
        return -1;
    }

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public final void m4763() {
        long jM4784;
        C4247 c4247 = this.f6616;
        synchronized (this) {
            int i = this.f6600;
            jM4784 = i == 0 ? -1L : m4784(i);
        }
        c4247.m9193(jM4784);
    }

    /* JADX WARN: Removed duplicated region for block: B:18:0x0059 A[Catch: all -> 0x0057, TryCatch #0 {all -> 0x0057, blocks: (B:4:0x000a, B:8:0x0016, B:13:0x0028, B:15:0x0041, B:19:0x005b, B:21:0x0069, B:25:0x0072, B:18:0x0059), top: B:35:0x000a }] */
    @Override // defpackage.InterfaceC2154
    /* renamed from: ˎˏʜʾ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void mo4407(defpackage.C3446 r6) {
        /*
            r5 = this;
            ᵤᵛᵖ r0 = r5.mo4759(r6)
            r1 = 0
            r5.f6598 = r1
            r5.f6612 = r6
            monitor-enter(r5)
            r5.f6613 = r1     // Catch: java.lang.Throwable -> L57
            ᵤᵛᵖ r6 = r5.f6606     // Catch: java.lang.Throwable -> L57
            boolean r6 = j$.util.Objects.equals(r0, r6)     // Catch: java.lang.Throwable -> L57
            if (r6 == 0) goto L16
            monitor-exit(r5)
            goto L79
        L16:
            ᵶʿᵛ r6 = r5.f6605     // Catch: java.lang.Throwable -> L57
            java.lang.Object r6 = r6.f17768     // Catch: java.lang.Throwable -> L57
            android.util.SparseArray r6 = (android.util.SparseArray) r6     // Catch: java.lang.Throwable -> L57
            int r6 = r6.size()     // Catch: java.lang.Throwable -> L57
            r2 = 1
            if (r6 != 0) goto L25
            r6 = r2
            goto L26
        L25:
            r6 = r1
        L26:
            if (r6 != 0) goto L59
            ᵶʿᵛ r6 = r5.f6605     // Catch: java.lang.Throwable -> L57
            java.lang.Object r6 = r6.f17768     // Catch: java.lang.Throwable -> L57
            android.util.SparseArray r6 = (android.util.SparseArray) r6     // Catch: java.lang.Throwable -> L57
            int r3 = r6.size()     // Catch: java.lang.Throwable -> L57
            int r3 = r3 - r2
            java.lang.Object r6 = r6.valueAt(r3)     // Catch: java.lang.Throwable -> L57
            ᵴˋˌʤ r6 = (defpackage.C4642) r6     // Catch: java.lang.Throwable -> L57
            ᵤᵛᵖ r6 = r6.f17196     // Catch: java.lang.Throwable -> L57
            boolean r6 = r6.equals(r0)     // Catch: java.lang.Throwable -> L57
            if (r6 == 0) goto L59
            ᵶʿᵛ r6 = r5.f6605     // Catch: java.lang.Throwable -> L57
            java.lang.Object r6 = r6.f17768     // Catch: java.lang.Throwable -> L57
            android.util.SparseArray r6 = (android.util.SparseArray) r6     // Catch: java.lang.Throwable -> L57
            int r0 = r6.size()     // Catch: java.lang.Throwable -> L57
            int r0 = r0 - r2
            java.lang.Object r6 = r6.valueAt(r0)     // Catch: java.lang.Throwable -> L57
            ᵴˋˌʤ r6 = (defpackage.C4642) r6     // Catch: java.lang.Throwable -> L57
            ᵤᵛᵖ r6 = r6.f17196     // Catch: java.lang.Throwable -> L57
            r5.f6606 = r6     // Catch: java.lang.Throwable -> L57
            goto L5b
        L57:
            r6 = move-exception
            goto L83
        L59:
            r5.f6606 = r0     // Catch: java.lang.Throwable -> L57
        L5b:
            boolean r6 = r5.f6621     // Catch: java.lang.Throwable -> L57
            ᵤᵛᵖ r0 = r5.f6606     // Catch: java.lang.Throwable -> L57
            java.lang.String r3 = r0.f12929     // Catch: java.lang.Throwable -> L57
            java.lang.String r0 = r0.f12934     // Catch: java.lang.Throwable -> L57
            int r4 = defpackage.AbstractC2924.m7106(r3)     // Catch: java.lang.Throwable -> L57
            if (r4 != r2) goto L71
            boolean r0 = defpackage.AbstractC2924.m7107(r3, r0)     // Catch: java.lang.Throwable -> L57
            if (r0 == 0) goto L71
            r0 = r2
            goto L72
        L71:
            r0 = r1
        L72:
            r6 = r6 & r0
            r5.f6621 = r6     // Catch: java.lang.Throwable -> L57
            r5.f6617 = r1     // Catch: java.lang.Throwable -> L57
            monitor-exit(r5)
            r1 = r2
        L79:
            ˆʾʗʚ r5 = r5.f6604
            if (r5 == 0) goto L82
            if (r1 == 0) goto L82
            r5.mo2900()
        L82:
            return
        L83:
            monitor-exit(r5)     // Catch: java.lang.Throwable -> L57
            throw r6
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C1666.mo4407(ᵤᵛᵖ):void");
    }

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public final synchronized long m4764() {
        try {
        } catch (Throwable th) {
            throw th;
        }
        return this.f6610 != this.f6600 ? this.f6625[m4774(this.f6610)] : this.f6603;
    }

    @Override // defpackage.InterfaceC2154
    /* renamed from: ˏˋٴ */
    public final int mo4408(InterfaceC1463 interfaceC1463, int i, boolean z) {
        return mo4409(interfaceC1463, i, z);
    }

    @Override // defpackage.InterfaceC2154
    /* renamed from: ˏᵙ */
    public final int mo4409(InterfaceC1463 interfaceC1463, int i, boolean z) throws EOFException {
        C4247 c4247 = this.f6616;
        int iM9191 = c4247.m9191(i);
        C3063 c3063 = c4247.f15908;
        C1197 c1197 = (C1197) c3063.f11726;
        int i2 = interfaceC1463.read(c1197.f5102, ((int) (c4247.f15907 - c3063.f11724)) + c1197.f5103, iM9191);
        if (i2 == -1) {
            if (z) {
                return -1;
            }
            throw new EOFException();
        }
        long j = c4247.f15907 + i2;
        c4247.f15907 = j;
        C3063 c30632 = c4247.f15908;
        if (j == c30632.f11723) {
            c4247.f15908 = (C3063) c30632.f11725;
        }
        return i2;
    }

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public final void m4765(C3446 c3446, C2720 c2720) {
        C3446 c34462;
        C3446 c34463 = this.f6602;
        boolean z = c34463 == null;
        C2119 c2119 = c34463 == null ? null : c34463.f12915;
        this.f6602 = c3446;
        C2119 c21192 = c3446.f12915;
        InterfaceC0687 interfaceC0687 = this.f6630;
        if (interfaceC0687 != null) {
            int iMo2671 = interfaceC0687.mo2671(c3446);
            C2153 c2153M7829 = c3446.m7829();
            c2153M7829.f8499 = iMo2671;
            c34462 = new C3446(c2153M7829);
        } else {
            c34462 = c3446;
        }
        c2720.f10550 = c34462;
        c2720.f10548 = this.f6628;
        if (interfaceC0687 == null) {
            return;
        }
        if (z || !Objects.equals(c2119, c21192)) {
            InterfaceC1660 interfaceC1660 = this.f6628;
            C2221 c2221 = this.f6599;
            InterfaceC1660 interfaceC1660Mo2669 = interfaceC0687.mo2669(c2221, c3446);
            this.f6628 = interfaceC1660Mo2669;
            c2720.f10548 = interfaceC1660Mo2669;
            if (interfaceC1660 != null) {
                interfaceC1660.mo4742(c2221);
            }
        }
    }

    /* renamed from: ˑᵱ, reason: contains not printable characters */
    public final long m4766(int i) {
        long jMax = Long.MIN_VALUE;
        if (i == 0) {
            return Long.MIN_VALUE;
        }
        int iM4774 = m4774(i - 1);
        for (int i2 = 0; i2 < i; i2++) {
            jMax = Math.max(jMax, this.f6620[iM4774]);
            if ((this.f6622[iM4774] & 1) != 0) {
                return jMax;
            }
            iM4774--;
            if (iM4774 == -1) {
                iM4774 = this.f6609 - 1;
            }
        }
        return jMax;
    }

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public final synchronized void m4767() {
        this.f6610 = 0;
        C4247 c4247 = this.f6616;
        c4247.f15906 = c4247.f15912;
    }

    /* JADX WARN: Removed duplicated region for block: B:9:0x000e  */
    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final synchronized void m4768(int r3) {
        /*
            r2 = this;
            monitor-enter(r2)
            if (r3 < 0) goto Le
            int r0 = r2.f6610     // Catch: java.lang.Throwable -> Lc
            int r0 = r0 + r3
            int r1 = r2.f6600     // Catch: java.lang.Throwable -> Lc
            if (r0 > r1) goto Le
            r0 = 1
            goto Lf
        Lc:
            r3 = move-exception
            goto L19
        Le:
            r0 = 0
        Lf:
            ᵛᵾˏ.ᵯٴᵦ(r0)     // Catch: java.lang.Throwable -> Lc
            int r0 = r2.f6610     // Catch: java.lang.Throwable -> Lc
            int r0 = r0 + r3
            r2.f6610 = r0     // Catch: java.lang.Throwable -> Lc
            monitor-exit(r2)
            return
        L19:
            monitor-exit(r2)     // Catch: java.lang.Throwable -> Lc
            throw r3
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C1666.m4768(int):void");
    }

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final int m4769(long j) {
        int i = this.f6600;
        int iM4774 = m4774(i - 1);
        while (i > this.f6610 && this.f6620[iM4774] >= j) {
            i--;
            iM4774--;
            if (iM4774 == -1) {
                iM4774 = this.f6609 - 1;
            }
        }
        return i;
    }

    /* renamed from: ᵞʡ, reason: contains not printable characters */
    public final synchronized long m4770() {
        return this.f6614;
    }

    /* renamed from: ᵡʠ, reason: contains not printable characters */
    public final int m4771(int i, int i2, long j, boolean z) {
        int i3 = -1;
        for (int i4 = 0; i4 < i2; i4++) {
            long j2 = this.f6620[i];
            if (j2 > j) {
                break;
            }
            if (!z || (this.f6622[i] & 1) != 0) {
                if (j2 == j) {
                    return i4;
                }
                i3 = i4;
            }
            i++;
            if (i == this.f6609) {
                i = 0;
            }
        }
        return i3;
    }

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public final void m4772() throws DrmSession$DrmSessionException {
        InterfaceC1660 interfaceC1660 = this.f6628;
        if (interfaceC1660 == null || interfaceC1660.mo4739() != 1) {
            return;
        }
        DrmSession$DrmSessionException drmSession$DrmSessionExceptionMo4740 = this.f6628.mo4740();
        drmSession$DrmSessionExceptionMo4740.getClass();
        throw drmSession$DrmSessionExceptionMo4740;
    }

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public final synchronized boolean m4773(boolean z) {
        C3446 c3446;
        int iM4777 = m4777();
        int i = this.f6632;
        boolean z2 = true;
        if (i != -1 && iM4777 >= i) {
            return true;
        }
        if (this.f6610 != this.f6600) {
            if (((C4642) this.f6605.m10081(iM4777)).f17196 != this.f6602) {
                return true;
            }
            return m4760(m4774(this.f6610));
        }
        if (!z && !this.f6631 && ((c3446 = this.f6606) == null || c3446 == this.f6602)) {
            z2 = false;
        }
        return z2;
    }

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final int m4774(int i) {
        int i2 = this.f6626 + i;
        int i3 = this.f6609;
        return i2 < i3 ? i2 : i2 - i3;
    }

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final synchronized boolean m4775() {
        return this.f6632 != -1;
    }

    /* JADX WARN: Removed duplicated region for block: B:24:0x004b  */
    @Override // defpackage.InterfaceC2154
    /* renamed from: ᵥᵯˎ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void mo4410(long r13, int r15, int r16, int r17, defpackage.C5346 r18) {
        /*
            r12 = this;
            boolean r0 = r12.f6598
            if (r0 == 0) goto Lc
            ᵤᵛᵖ r0 = r12.f6612
            r0.getClass()
            r12.mo4407(r0)
        Lc:
            r0 = r15 & 1
            r2 = 0
            r3 = 1
            if (r0 == 0) goto L14
            r4 = r3
            goto L15
        L14:
            r4 = r2
        L15:
            boolean r5 = r12.f6615
            if (r5 == 0) goto L1f
            if (r4 != 0) goto L1d
            goto L81
        L1d:
            r12.f6615 = r2
        L1f:
            long r5 = r12.f6629
            long r5 = r5 + r13
            boolean r7 = r12.f6621
            if (r7 == 0) goto L4b
            long r7 = r12.f6619
            int r7 = (r5 > r7 ? 1 : (r5 == r7 ? 0 : -1))
            if (r7 >= 0) goto L2d
            goto L81
        L2d:
            if (r0 != 0) goto L4b
            boolean r0 = r12.f6617
            if (r0 != 0) goto L48
            java.lang.StringBuilder r0 = new java.lang.StringBuilder
            java.lang.String r7 = "Overriding unexpected non-sync sample for format: "
            r0.<init>(r7)
            ᵤᵛᵖ r7 = r12.f6606
            r0.append(r7)
            java.lang.String r0 = r0.toString()
            ᵳʿˉ.ᵶʔᵢˊ(r0)
            r12.f6617 = r3
        L48:
            r0 = r15 | 1
            goto L4c
        L4b:
            r0 = r15
        L4c:
            boolean r7 = r12.f6608
            if (r7 == 0) goto L82
            if (r4 == 0) goto L81
            monitor-enter(r12)
            int r4 = r12.f6600     // Catch: java.lang.Throwable -> L61
            if (r4 != 0) goto L63
            long r7 = r12.f6618     // Catch: java.lang.Throwable -> L61
            int r4 = (r5 > r7 ? 1 : (r5 == r7 ? 0 : -1))
            if (r4 <= 0) goto L5e
            goto L5f
        L5e:
            r3 = r2
        L5f:
            monitor-exit(r12)
            goto L79
        L61:
            r0 = move-exception
            goto L7f
        L63:
            long r7 = r12.m4778()     // Catch: java.lang.Throwable -> L61
            int r4 = (r7 > r5 ? 1 : (r7 == r5 ? 0 : -1))
            if (r4 < 0) goto L6e
            monitor-exit(r12)
            r3 = r2
            goto L79
        L6e:
            int r4 = r12.m4769(r5)     // Catch: java.lang.Throwable -> L61
            int r7 = r12.f6611     // Catch: java.lang.Throwable -> L61
            int r7 = r7 + r4
            r12.m4779(r7)     // Catch: java.lang.Throwable -> L61
            monitor-exit(r12)
        L79:
            if (r3 != 0) goto L7c
            goto L81
        L7c:
            r12.f6608 = r2
            goto L82
        L7f:
            monitor-exit(r12)     // Catch: java.lang.Throwable -> L61
            throw r0
        L81:
            return
        L82:
            ᵯʓː r2 = r12.f6616
            long r2 = r2.f15907
            r7 = r16
            long r8 = (long) r7
            long r2 = r2 - r8
            r4 = r17
            long r8 = (long) r4
            long r2 = r2 - r8
            r10 = r5
            r5 = r2
            r2 = r10
            r1 = r12
            r8 = r18
            r4 = r0
            r1.m4786(r2, r4, r5, r7, r8)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C1666.mo4410(long, int, int, int, ᵽᵎˎ):void");
    }

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public final void m4776() {
        m4787(true);
        InterfaceC1660 interfaceC1660 = this.f6628;
        if (interfaceC1660 != null) {
            interfaceC1660.mo4742(this.f6599);
            this.f6628 = null;
            this.f6602 = null;
        }
    }

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final int m4777() {
        return this.f6611 + this.f6610;
    }

    /* renamed from: ᵨᵳʝ, reason: contains not printable characters */
    public final synchronized long m4778() {
        return Math.max(this.f6618, m4766(this.f6610));
    }

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public final long m4779(int i) {
        int i2 = this.f6611;
        int i3 = this.f6600;
        int i4 = (i2 + i3) - i;
        boolean z = false;
        ᵛᵾˏ.ᵯٴᵦ(i4 >= 0 && i4 <= i3 - this.f6610);
        int i5 = this.f6600 - i4;
        this.f6600 = i5;
        this.f6614 = Math.max(this.f6618, m4766(i5));
        if (i4 == 0 && this.f6631) {
            z = true;
        }
        this.f6631 = z;
        int i6 = this.f6632;
        if (i6 != -1 && i < i6) {
            this.f6632 = -1;
        }
        C4782 c4782 = this.f6605;
        SparseArray sparseArray = (SparseArray) c4782.f17768;
        for (int size = sparseArray.size() - 1; size >= 0 && i < sparseArray.keyAt(size); size--) {
            ((ᵨᴵᵺ) c4782.f17767).accept(sparseArray.valueAt(size));
            sparseArray.removeAt(size);
        }
        c4782.f17765 = sparseArray.size() > 0 ? Math.min(c4782.f17765, sparseArray.size() - 1) : -1;
        int i7 = this.f6600;
        if (i7 == 0) {
            return 0L;
        }
        return this.f6627[m4774(i7 - 1)] + this.f6601[r9];
    }

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public final int m4780(C2720 c2720, C2441 c2441, int i, boolean z) {
        int i2;
        boolean z2 = (i & 2) != 0;
        C4395 c4395 = this.f6624;
        synchronized (this) {
            c2441.f9516 = false;
            int iM4777 = m4777();
            int i3 = this.f6632;
            boolean z3 = i3 != -1 && iM4777 >= i3;
            i2 = -5;
            if (!(this.f6610 != this.f6600) || z3) {
                if (!z && !this.f6631 && !z3) {
                    C3446 c3446 = this.f6606;
                    if (c3446 == null || (!z2 && c3446 == this.f6602)) {
                        i2 = -3;
                    } else {
                        m4765(c3446, c2720);
                    }
                }
                c2441.f17323 = 4;
                c2441.f9512 = Long.MIN_VALUE;
                i2 = -4;
            } else {
                C3446 c34462 = ((C4642) this.f6605.m10081(iM4777)).f17196;
                if (!z2 && c34462 == this.f6602) {
                    int iM4774 = m4774(this.f6610);
                    if (m4760(iM4774)) {
                        c2441.f17323 = this.f6622[iM4774];
                        if (this.f6610 == this.f6600 - 1 && (z || this.f6631)) {
                            c2441.m9874(536870912);
                        }
                        c2441.f9512 = this.f6620[iM4774];
                        c4395.f16457 = this.f6601[iM4774];
                        c4395.f16458 = this.f6627[iM4774];
                        c4395.f16456 = this.f6623[iM4774];
                        i2 = -4;
                    } else {
                        c2441.f9516 = true;
                        i2 = -3;
                    }
                }
                m4765(c34462, c2720);
            }
        }
        if (i2 == -4 && !c2441.m9873(4)) {
            boolean z4 = (i & 1) != 0;
            if ((i & 4) == 0) {
                C4247 c4247 = this.f6616;
                C4395 c43952 = this.f6624;
                if (z4) {
                    C4247.m9189(c4247.f15906, c2441, c43952, c4247.f15909);
                } else {
                    c4247.f15906 = C4247.m9189(c4247.f15906, c2441, c43952, c4247.f15909);
                }
            }
            if (!z4) {
                this.f6610++;
            }
        }
        return i2;
    }

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public final void m4781(long j) {
        if (this.f6600 == 0) {
            return;
        }
        ᵛᵾˏ.ᵯٴᵦ(j > m4778());
        m4782(this.f6611 + m4769(j));
    }

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public final void m4782(int i) {
        C3063 c3063;
        C4247 c4247 = this.f6616;
        long jM4779 = m4779(i);
        int i2 = c4247.f15911;
        ᵛᵾˏ.ᵯٴᵦ(jM4779 <= c4247.f15907);
        c4247.f15907 = jM4779;
        if (jM4779 != 0) {
            C3063 c30632 = c4247.f15912;
            if (jM4779 != c30632.f11724) {
                while (true) {
                    long j = c4247.f15907;
                    long j2 = c30632.f11723;
                    c3063 = (C3063) c30632.f11725;
                    if (j <= j2) {
                        break;
                    } else {
                        c30632 = c3063;
                    }
                }
                c3063.getClass();
                if (((C1197) c3063.f11726) != null) {
                    ᵧˉʙ r7 = c4247.f15910;
                    synchronized (r7) {
                        ((C4002) r7.ᵾᵬ).f15051.m2998(c3063);
                        C3063 c30633 = c3063;
                        while (c30633 != null) {
                            C1197 c1197 = (C1197) c30633.f11726;
                            c1197.getClass();
                            r7.ﾞⁱ(c1197);
                            c30633 = (C3063) c30633.f11725;
                            if (c30633 == null || ((C1197) c30633.f11726) == null) {
                                c30633 = null;
                            }
                        }
                    }
                    c3063.f11726 = null;
                    c3063.f11725 = null;
                }
                C3063 c30634 = new C3063(c30632.f11723, i2);
                c30632.f11725 = c30634;
                if (c4247.f15907 == c30632.f11723) {
                    c30632 = c30634;
                }
                c4247.f15908 = c30632;
                if (c4247.f15906 == c3063) {
                    c4247.f15906 = c30634;
                    return;
                }
                return;
            }
        }
        c4247.m9192(c4247.f15912);
        C3063 c30635 = new C3063(c4247.f15907, i2);
        c4247.f15912 = c30635;
        c4247.f15906 = c30635;
        c4247.f15908 = c30635;
    }

    @Override // defpackage.InterfaceC2154
    /* renamed from: ᵴᵳ */
    public final void mo4411(C3493 c3493, int i, int i2) {
        while (true) {
            C4247 c4247 = this.f6616;
            if (i <= 0) {
                c4247.getClass();
                return;
            }
            int iM9191 = c4247.m9191(i);
            C3063 c3063 = c4247.f15908;
            C1197 c1197 = (C1197) c3063.f11726;
            c3493.m7970(c1197.f5102, ((int) (c4247.f15907 - c3063.f11724)) + c1197.f5103, iM9191);
            i -= iM9191;
            long j = c4247.f15907 + iM9191;
            c4247.f15907 = j;
            C3063 c30632 = c4247.f15908;
            if (j == c30632.f11723) {
                c4247.f15908 = (C3063) c30632.f11725;
            }
        }
    }

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public final synchronized boolean m4783(int i) {
        m4767();
        int i2 = this.f6611;
        if (i >= i2 && i <= this.f6600 + i2) {
            int i3 = this.f6632;
            if (i3 != -1 && i >= i3) {
                return false;
            }
            this.f6619 = Long.MIN_VALUE;
            this.f6610 = i - i2;
            return true;
        }
        return false;
    }

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public final long m4784(int i) {
        this.f6618 = Math.max(this.f6618, m4766(i));
        this.f6600 -= i;
        int i2 = this.f6611 + i;
        this.f6611 = i2;
        int i3 = this.f6626 + i;
        this.f6626 = i3;
        int i4 = this.f6609;
        if (i3 >= i4) {
            this.f6626 = i3 - i4;
        }
        int i5 = this.f6610 - i;
        this.f6610 = i5;
        int i6 = 0;
        if (i5 < 0) {
            this.f6610 = 0;
        }
        C4782 c4782 = this.f6605;
        SparseArray sparseArray = (SparseArray) c4782.f17768;
        while (i6 < sparseArray.size() - 1) {
            int i7 = i6 + 1;
            if (i2 < sparseArray.keyAt(i7)) {
                break;
            }
            ((ᵨᴵᵺ) c4782.f17767).accept(sparseArray.valueAt(i6));
            sparseArray.removeAt(i6);
            int i8 = c4782.f17765;
            if (i8 > 0) {
                c4782.f17765 = i8 - 1;
            }
            i6 = i7;
        }
        if (this.f6600 != 0) {
            return this.f6627[this.f6626];
        }
        int i9 = this.f6626;
        if (i9 == 0) {
            i9 = this.f6609;
        }
        return this.f6627[i9 - 1] + this.f6601[r7];
    }

    /* renamed from: ᵸʓᵠ */
    public C3446 mo4759(C3446 c3446) {
        if (this.f6629 == 0 || c3446.f12925 == Long.MAX_VALUE) {
            return c3446;
        }
        C2153 c2153M7829 = c3446.m7829();
        c2153M7829.f8505 = c3446.f12925 + this.f6629;
        return new C3446(c2153M7829);
    }

    /* JADX WARN: Removed duplicated region for block: B:9:0x0013  */
    /* renamed from: ᵸˑ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void m4785(boolean r12, long r13) throws java.lang.Throwable {
        /*
            r11 = this;
            ᵯʓː r0 = r11.f6616
            monitor-enter(r11)
            int r1 = r11.f6600     // Catch: java.lang.Throwable -> L38
            r2 = -1
            if (r1 == 0) goto L13
            long[] r4 = r11.f6620     // Catch: java.lang.Throwable -> L38
            int r6 = r11.f6626     // Catch: java.lang.Throwable -> L38
            r7 = r4[r6]     // Catch: java.lang.Throwable -> L38
            int r4 = (r13 > r7 ? 1 : (r13 == r7 ? 0 : -1))
            if (r4 >= 0) goto L15
        L13:
            r5 = r11
            goto L3b
        L15:
            if (r12 == 0) goto L1d
            int r12 = r11.f6610     // Catch: java.lang.Throwable -> L1f
            if (r12 == r1) goto L1d
            int r1 = r12 + 1
        L1d:
            r7 = r1
            goto L23
        L1f:
            r0 = move-exception
            r12 = r0
            r5 = r11
            goto L40
        L23:
            r10 = 0
            r5 = r11
            r8 = r13
            int r11 = r5.m4771(r6, r7, r8, r10)     // Catch: java.lang.Throwable -> L35
            r12 = -1
            if (r11 != r12) goto L2f
            monitor-exit(r5)
            goto L3c
        L2f:
            long r2 = r5.m4784(r11)     // Catch: java.lang.Throwable -> L35
            monitor-exit(r5)
            goto L3c
        L35:
            r0 = move-exception
        L36:
            r12 = r0
            goto L40
        L38:
            r0 = move-exception
            r5 = r11
            goto L36
        L3b:
            monitor-exit(r5)
        L3c:
            r0.m9193(r2)
            return
        L40:
            monitor-exit(r5)     // Catch: java.lang.Throwable -> L35
            throw r12
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C1666.m4785(boolean, long):void");
    }

    /* JADX WARN: Removed duplicated region for block: B:30:0x009a A[Catch: all -> 0x0021, TryCatch #0 {all -> 0x0021, blocks: (B:3:0x0001, B:5:0x0007, B:9:0x001d, B:12:0x0024, B:16:0x002c, B:18:0x003f, B:22:0x0047, B:23:0x004e, B:28:0x007f, B:51:0x00fa, B:53:0x0103, B:30:0x009a, B:32:0x00a3, B:34:0x00ac, B:36:0x00c0, B:40:0x00c9, B:41:0x00ce, B:43:0x00d4, B:47:0x00e2, B:49:0x00e7, B:50:0x00f7, B:33:0x00aa), top: B:58:0x0001 }] */
    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final synchronized void m4786(long r9, int r11, long r12, int r14, defpackage.C5346 r15) {
        /*
            Method dump skipped, instructions count: 368
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C1666.m4786(long, int, long, int, ᵽᵎˎ):void");
    }

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public final void m4787(boolean z) {
        C4247 c4247 = this.f6616;
        C3063 c3063 = c4247.f15912;
        if (((C1197) c3063.f11726) != null) {
            ᵧˉʙ r2 = c4247.f15910;
            synchronized (r2) {
                ((C4002) r2.ᵾᵬ).f15051.m2998(c3063);
                C3063 c30632 = c3063;
                while (c30632 != null) {
                    C1197 c1197 = (C1197) c30632.f11726;
                    c1197.getClass();
                    r2.ﾞⁱ(c1197);
                    c30632 = (C3063) c30632.f11725;
                    if (c30632 == null || ((C1197) c30632.f11726) == null) {
                        c30632 = null;
                    }
                }
            }
            c3063.f11726 = null;
            c3063.f11725 = null;
        }
        C3063 c30633 = c4247.f15912;
        int i = c4247.f15911;
        ᵛᵾˏ.ᵿʗᵝʽ(((C1197) c30633.f11726) == null);
        c30633.f11724 = 0L;
        c30633.f11723 = i;
        C3063 c30634 = c4247.f15912;
        c4247.f15906 = c30634;
        c4247.f15908 = c30634;
        c4247.f15907 = 0L;
        c4247.f15910.ˀᵗᵩ();
        this.f6600 = 0;
        this.f6611 = 0;
        this.f6626 = 0;
        this.f6610 = 0;
        this.f6632 = -1;
        this.f6615 = true;
        this.f6619 = Long.MIN_VALUE;
        this.f6618 = Long.MIN_VALUE;
        this.f6614 = Long.MIN_VALUE;
        this.f6631 = false;
        C4782 c4782 = this.f6605;
        SparseArray sparseArray = (SparseArray) c4782.f17768;
        for (int i2 = 0; i2 < sparseArray.size(); i2++) {
            ((ᵨᴵᵺ) c4782.f17767).accept(sparseArray.valueAt(i2));
        }
        c4782.f17765 = -1;
        sparseArray.clear();
        if (z) {
            this.f6612 = null;
            this.f6606 = null;
            this.f6613 = true;
            this.f6621 = true;
        }
    }

    @Override // defpackage.InterfaceC2154
    /* renamed from: ᵻᵢﹳᵰ */
    public final /* synthetic */ void mo4412(long j) {
    }

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final synchronized C3446 m4788() {
        return this.f6613 ? null : this.f6606;
    }

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final synchronized int m4789(boolean z, long j) {
        try {
            try {
                int iM4774 = m4774(this.f6610);
                int i = this.f6610;
                int i2 = this.f6600;
                if (!(i != i2) || j < this.f6620[iM4774]) {
                    return 0;
                }
                if (j > this.f6614 && z) {
                    return i2 - i;
                }
                int iM4771 = m4771(iM4774, i2 - i, j, true);
                if (iM4771 == -1) {
                    return 0;
                }
                return iM4771;
            } catch (Throwable th) {
                th = th;
                throw th;
            }
        } catch (Throwable th2) {
            th = th2;
            throw th;
        }
    }

    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public final synchronized void m4790(long j) throws Throwable {
        C1666 c1666;
        Throwable th;
        C1666 c16662;
        long j2;
        int iM4762;
        try {
            try {
                if (j == this.f6607) {
                    return;
                }
                int i = -1;
                if (j == Long.MIN_VALUE) {
                    try {
                        this.f6632 = -1;
                        return;
                    } catch (Throwable th2) {
                        th = th2;
                        c1666 = this;
                        throw th;
                    }
                }
                if (j <= this.f6614) {
                    c16662 = this;
                    j2 = j;
                    iM4762 = c16662.m4762(this.f6626, this.f6600, j2, false);
                } else {
                    c16662 = this;
                    j2 = j;
                    iM4762 = -1;
                }
                if (iM4762 != -1) {
                    i = c16662.f6611 + iM4762;
                }
                c16662.f6632 = i;
                c16662.f6607 = j2;
            } catch (Throwable th3) {
                th = th3;
                th = th;
                throw th;
            }
        } catch (Throwable th4) {
            th = th4;
            c1666 = this;
            th = th;
            throw th;
        }
    }
}
