package defpackage;

import android.util.Pair;
import android.util.SparseArray;
import androidx.media3.common.ParserException;
import j$.util.DesugarCollections;
import java.math.RoundingMode;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.PriorityQueue;
import java.util.UUID;

/* renamed from: ᵜᵫˑ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C2851 implements InterfaceC2689 {

    /* renamed from: ˀᵗᵩ, reason: contains not printable characters */
    public static final C3446 f11014;

    /* renamed from: ˊᵸˊ, reason: contains not printable characters */
    public static final byte[] f11015 = {-94, 57, 79, 82, 90, -101, 79, 20, -94, 68, 108, 66, 124, 100, -115, -12};

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

    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    public InterfaceC2154[] f11017;

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public final C1611 f11019;

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

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final C0904 f11024;

    /* renamed from: ˑᵝﹳᵜ, reason: contains not printable characters */
    public long f11025;

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

    /* renamed from: ˑᵱ, reason: contains not printable characters */
    public int f11027;

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

    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    public boolean f11029;

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final byte[] f11030;

    /* renamed from: ᵞʡ, reason: contains not printable characters */
    public C4471 f11031;

    /* renamed from: ᵡʠ, reason: contains not printable characters */
    public final InterfaceC2154 f11032;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public long f11033;

    /* renamed from: ᵡᵘˎʽ, reason: contains not printable characters */
    public boolean f11034;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public long f11035;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public int f11036;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public int f11037;

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

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

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public long f11040;

    /* renamed from: ᵨᵳʝ, reason: contains not printable characters */
    public int f11041;

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public int f11043;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final int f11046;

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public InterfaceC1982 f11047;

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public final C3493 f11048;

    /* renamed from: ᵸʓᵠ, reason: contains not printable characters */
    public final C4752 f11049;

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public final C1240 f11050;

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public boolean f11052;

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

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public long f11054;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public C3493 f11055;

    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public InterfaceC2154[] f11056;

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public final C2720 f11020 = new C2720(19);

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public final C3493 f11044 = new C3493(16);

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final C3493 f11023 = new C3493(ˊˉʤﹳ.ˏˋٴ);

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final C3493 f11021 = new C3493(6);

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final C3493 f11051 = new C3493();

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public final ArrayDeque f11042 = new ArrayDeque();

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public final ArrayDeque f11045 = new ArrayDeque();

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final SparseArray f11018 = new SparseArray();

    static {
        C2153 c2153 = new C2153();
        c2153.f8516 = AbstractC2924.m7101("application/x-emsg");
        f11014 = new C3446(c2153);
    }

    public C2851(InterfaceC1889 interfaceC1889, int i, C1240 c1240, C0904 c0904, List list, C1821 c1821) {
        this.f11038 = interfaceC1889;
        this.f11046 = i;
        this.f11050 = c1240;
        this.f11024 = c0904;
        this.f11053 = DesugarCollections.unmodifiableList(list);
        this.f11032 = c1821;
        byte[] bArr = new byte[16];
        this.f11030 = bArr;
        this.f11048 = new C3493(bArr);
        C4421 c4421 = AbstractC2692.f10429;
        this.f11031 = C4471.f16684;
        this.f11016 = -9223372036854775807L;
        this.f11035 = -9223372036854775807L;
        this.f11033 = -9223372036854775807L;
        this.f11047 = InterfaceC1982.f7966;
        this.f11017 = new InterfaceC2154[0];
        this.f11056 = new InterfaceC2154[0];
        this.f11019 = new C1611((InterfaceC2537) new ʾᵛ(28, this));
        this.f11049 = new C4752(1);
        this.f11025 = -1L;
    }

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public static Pair m6979(long j, C3493 c3493) throws ParserException {
        long jM7960;
        long jM79602;
        C3493 c34932 = c3493;
        c34932.m7955(8);
        int iM8793 = AbstractC3974.m8793(c34932.m7965());
        c34932.m7946(4);
        long jM7954 = c34932.m7954();
        if (iM8793 == 0) {
            jM7960 = c34932.m7954();
            jM79602 = c34932.m7954();
        } else {
            jM7960 = c34932.m7960();
            jM79602 = c34932.m7960();
        }
        long j2 = jM79602 + j;
        String str = AbstractC3558.f13329;
        long jM8115 = AbstractC3558.m8115(jM7960, 1000000L, jM7954, RoundingMode.DOWN);
        c34932.m7946(2);
        int iM7972 = c34932.m7972();
        int[] iArr = new int[iM7972];
        long[] jArr = new long[iM7972];
        long[] jArr2 = new long[iM7972];
        long[] jArr3 = new long[iM7972];
        long j3 = j2;
        long j4 = jM8115;
        int i = 0;
        while (i < iM7972) {
            int iM7965 = c34932.m7965();
            if ((Integer.MIN_VALUE & iM7965) != 0) {
                throw ParserException.m356("Unhandled indirect reference", null);
            }
            long jM79542 = c34932.m7954();
            iArr[i] = iM7965 & Integer.MAX_VALUE;
            jArr[i] = j3;
            jArr3[i] = j4;
            jM7960 += jM79542;
            long[] jArr4 = jArr2;
            long[] jArr5 = jArr3;
            long jM81152 = AbstractC3558.m8115(jM7960, 1000000L, jM7954, RoundingMode.DOWN);
            jArr4[i] = jM81152 - jArr5[i];
            c34932.m7946(4);
            j3 += iArr[i];
            i++;
            iM7972 = iM7972;
            c34932 = c3493;
            j4 = jM81152;
            jArr2 = jArr4;
            jArr3 = jArr5;
        }
        return Pair.create(Long.valueOf(jM8115), new C5392(iArr, jArr, jArr2, jArr3));
    }

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public static C2119 m6980(List list) {
        int size = list.size();
        ArrayList arrayList = null;
        for (int i = 0; i < size; i++) {
            C5396 c5396 = (C5396) list.get(i);
            if (c5396.f17323 == 1886614376) {
                if (arrayList == null) {
                    arrayList = new ArrayList();
                }
                byte[] bArr = c5396.f20227.f13082;
                ʽʽﹶ r6 = ᵙᵛᵯ.ᵾᵬ(bArr);
                UUID uuid = r6 == null ? null : (UUID) r6.ᵢˇᵭ;
                if (uuid == null) {
                    ᵳʿˉ.ᵶʔᵢˊ("Skipped pssh atom (failed to extract uuid)");
                } else {
                    arrayList.add(new C1542(uuid, null, "video/mp4", bArr));
                }
            }
        }
        if (arrayList == null) {
            return null;
        }
        return new C2119(null, false, (C1542[]) arrayList.toArray(new C1542[0]));
    }

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public static void m6981(C3493 c3493, int i, C2038 c2038) throws ParserException {
        c3493.m7955(i + 8);
        int iM7965 = c3493.m7965();
        byte[] bArr = AbstractC3974.f15002;
        if ((iM7965 & 1) != 0) {
            throw ParserException.m355("Overriding TrackEncryptionBox parameters is unsupported.");
        }
        boolean z = (iM7965 & 2) != 0;
        int iM7943 = c3493.m7943();
        if (iM7943 == 0) {
            Arrays.fill(c2038.f8166, 0, c2038.f8164, false);
            return;
        }
        int i2 = c2038.f8164;
        C3493 c34932 = c2038.f8173;
        if (iM7943 != i2) {
            StringBuilder sbM4097 = AbstractC1327.m4097(iM7943, "Senc sample count ", " is different from fragment sample count");
            sbM4097.append(c2038.f8164);
            throw ParserException.m356(sbM4097.toString(), null);
        }
        Arrays.fill(c2038.f8166, 0, iM7943, z);
        c34932.m7939(c3493.m7959());
        c2038.f8178 = true;
        c2038.f8175 = true;
        c3493.m7970(c34932.f13082, 0, c34932.f13081);
        c34932.m7955(0);
        c2038.f8175 = false;
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public static int m6982(int i) {
        int i2 = (i & 1) != 0 ? 64 : 0;
        return (i & 2) != 0 ? i2 | 128 : i2;
    }

    @Override // defpackage.InterfaceC2689
    /* renamed from: ˇʼʤˎ */
    public final boolean mo1572(InterfaceC1383 interfaceC1383) {
        C4471 c4471M6702;
        InterfaceC5524 interfaceC5524 = ᵺᵣᵬ.ᵧـˌᵎ(interfaceC1383, true, false);
        if (interfaceC5524 != null) {
            c4471M6702 = AbstractC2692.m6702(interfaceC5524);
        } else {
            C4421 c4421 = AbstractC2692.f10429;
            c4471M6702 = C4471.f16684;
        }
        this.f11031 = c4471M6702;
        return interfaceC5524 == null;
    }

    /* JADX WARN: Removed duplicated region for block: B:36:0x00b8  */
    @Override // defpackage.InterfaceC2689
    /* renamed from: ˎˏʜʾ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void mo1573(defpackage.InterfaceC1982 r18) {
        /*
            Method dump skipped, instructions count: 249
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C2851.mo1573(ːᵪᵦʡ):void");
    }

    @Override // defpackage.InterfaceC2689
    /* renamed from: ˏˋٴ */
    public final List mo1574() {
        return this.f11031;
    }

    @Override // defpackage.InterfaceC2689
    /* renamed from: ˏᵙ */
    public final InterfaceC2689 mo1575() {
        return this;
    }

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final void m6983() {
        this.f11041 = 0;
        this.f11036 = 0;
    }

    @Override // defpackage.InterfaceC2689
    /* renamed from: ᵥᵯˎ */
    public final void mo1576() {
    }

    /* JADX WARN: Code restructure failed: missing block: B:364:0x0827, code lost:
    
        m6983();
     */
    /* JADX WARN: Code restructure failed: missing block: B:365:0x082a, code lost:
    
        return;
     */
    /* JADX WARN: Removed duplicated region for block: B:174:0x044d  */
    /* JADX WARN: Removed duplicated region for block: B:324:0x073b  */
    /* 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 m6984(long r55) throws androidx.media3.common.ParserException {
        /*
            Method dump skipped, instructions count: 2091
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C2851.m6984(long):void");
    }

    @Override // defpackage.InterfaceC2689
    /* renamed from: ᵴᵳ */
    public final void mo1577(long j, long j2) {
        SparseArray sparseArray = this.f11018;
        int size = sparseArray.size();
        for (int i = 0; i < size; i++) {
            ((C1359) sparseArray.valueAt(i)).m4196();
        }
        this.f11045.clear();
        this.f11037 = 0;
        ((PriorityQueue) this.f11019.f6398).clear();
        this.f11035 = j2;
        this.f11042.clear();
        m6983();
    }

    /* JADX WARN: Code restructure failed: missing block: B:101:0x01e6, code lost:
    
        if (r32.f11056.length > 0) goto L104;
     */
    /* JADX WARN: Code restructure failed: missing block: B:103:0x01ea, code lost:
    
        if (r32.f11052 != false) goto L107;
     */
    /* JADX WARN: Code restructure failed: missing block: B:104:0x01ec, code lost:
    
        r2 = ˊˉʤﹳ.ﾞⁱ(r5);
     */
    /* JADX WARN: Code restructure failed: missing block: B:105:0x01fc, code lost:
    
        if ((r20 + r2) > (r32.f11022 - r32.f11043)) goto L107;
     */
    /* JADX WARN: Code restructure failed: missing block: B:106:0x01fe, code lost:
    
        r2 = r2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:107:0x0201, code lost:
    
        r2 = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:108:0x0202, code lost:
    
        r33.readFully(r12, r13, r20 + r2);
        r8.m7955(0);
        r21 = r8.m7965();
     */
    /* JADX WARN: Code restructure failed: missing block: B:109:0x020f, code lost:
    
        if (r21 < 0) goto L523;
     */
    /* JADX WARN: Code restructure failed: missing block: B:110:0x0211, code lost:
    
        r32.f11039 = r21 - r2;
        r4 = r32.f11023;
        r26 = r13;
        r4.m7955(0);
        r9.mo4406(4, r4);
        r32.f11043 += 4;
        r32.f11022 += r26;
     */
    /* JADX WARN: Code restructure failed: missing block: B:111:0x022f, code lost:
    
        if (r32.f11056.length <= 0) goto L142;
     */
    /* JADX WARN: Code restructure failed: missing block: B:112:0x0231, code lost:
    
        if (r2 <= 0) goto L142;
     */
    /* JADX WARN: Code restructure failed: missing block: B:113:0x0233, code lost:
    
        r4 = ˊˉʤﹳ.ˑᵱ(r5);
     */
    /* JADX WARN: Code restructure failed: missing block: B:114:0x0237, code lost:
    
        if (r4 != null) goto L116;
     */
    /* JADX WARN: Code restructure failed: missing block: B:117:0x023e, code lost:
    
        switch(r4.hashCode()) {
            case -1662541442: goto L127;
            case 1331836730: goto L123;
            case 1331856911: goto L119;
            default: goto L118;
        };
     */
    /* JADX WARN: Code restructure failed: missing block: B:118:0x0241, code lost:
    
        r4 = 65535;
     */
    /* JADX WARN: Code restructure failed: missing block: B:120:0x0249, code lost:
    
        if (r4.equals("video/vvc") != false) goto L122;
     */
    /* JADX WARN: Code restructure failed: missing block: B:122:0x024c, code lost:
    
        r4 = r19;
     */
    /* JADX WARN: Code restructure failed: missing block: B:124:0x0253, code lost:
    
        if (r4.equals("video/avc") != false) goto L126;
     */
    /* JADX WARN: Code restructure failed: missing block: B:126:0x0256, code lost:
    
        r4 = 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:128:0x025c, code lost:
    
        if (r4.equals("video/hevc") != false) goto L130;
     */
    /* JADX WARN: Code restructure failed: missing block: B:130:0x025f, code lost:
    
        r4 = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:131:0x0260, code lost:
    
        switch(r4) {
            case 0: goto L139;
            case 1: goto L136;
            case 2: goto L133;
            default: goto L142;
        };
     */
    /* JADX WARN: Code restructure failed: missing block: B:134:0x026f, code lost:
    
        if (((r12[5] & 248) >> 3) != 23) goto L142;
     */
    /* JADX WARN: Code restructure failed: missing block: B:137:0x0279, code lost:
    
        if ((r12[4] & 31) != 6) goto L142;
     */
    /* JADX WARN: Code restructure failed: missing block: B:140:0x0289, code lost:
    
        if (((r12[4] & 126) >> 1) != 39) goto L142;
     */
    /* JADX WARN: Code restructure failed: missing block: B:141:0x028b, code lost:
    
        r4 = true;
     */
    /* JADX WARN: Code restructure failed: missing block: B:142:0x028d, code lost:
    
        r4 = false;
     */
    /* JADX WARN: Code restructure failed: missing block: B:143:0x028e, code lost:
    
        r32.f11028 = r4;
        r9.mo4406(r2, r8);
        r32.f11043 += r2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:144:0x0298, code lost:
    
        if (r2 <= 0) goto L150;
     */
    /* JADX WARN: Code restructure failed: missing block: B:146:0x029c, code lost:
    
        if (r32.f11052 != false) goto L150;
     */
    /* JADX WARN: Code restructure failed: missing block: B:148:0x02a2, code lost:
    
        if (ˊˉʤﹳ.ᐧﾞ(r12, r2, r5) == false) goto L150;
     */
    /* JADX WARN: Code restructure failed: missing block: B:149:0x02a4, code lost:
    
        r32.f11052 = true;
     */
    /* JADX WARN: Code restructure failed: missing block: B:150:0x02a7, code lost:
    
        r4 = r20;
     */
    /* JADX WARN: Code restructure failed: missing block: B:151:0x02a9, code lost:
    
        r13 = r26;
     */
    /* JADX WARN: Code restructure failed: missing block: B:153:0x02b4, code lost:
    
        throw androidx.media3.common.ParserException.m356("Invalid NAL length", null);
     */
    /* JADX WARN: Code restructure failed: missing block: B:154:0x02b5, code lost:
    
        r26 = r13;
     */
    /* JADX WARN: Code restructure failed: missing block: B:155:0x02b9, code lost:
    
        if (r32.f11028 == false) goto L168;
     */
    /* JADX WARN: Code restructure failed: missing block: B:156:0x02bb, code lost:
    
        r4 = r32.f11051;
        r4.m7939(r2);
        r25 = r8;
        r33.readFully(r4.f13082, 0, r32.f11039);
        r9.mo4406(r32.f11039, r4);
        r2 = r32.f11039;
        r2 = ˊˉʤﹳ.ˌᵹᵨˑ(r4.f13081, r4.f13082);
        r4.m7955(0);
        r4.m7950(r2);
        r2 = r5.f12916;
     */
    /* JADX WARN: Code restructure failed: missing block: B:157:0x02e4, code lost:
    
        if (r2 != (-1)) goto L161;
     */
    /* JADX WARN: Code restructure failed: missing block: B:159:0x02e8, code lost:
    
        if (r7.f6401 == 0) goto L164;
     */
    /* JADX WARN: Code restructure failed: missing block: B:160:0x02ea, code lost:
    
        r7.m4614(0);
     */
    /* JADX WARN: Code restructure failed: missing block: B:162:0x02f0, code lost:
    
        if (r7.f6401 == r2) goto L164;
     */
    /* JADX WARN: Code restructure failed: missing block: B:163:0x02f2, code lost:
    
        r7.m4614(r2);
     */
    /* JADX WARN: Code restructure failed: missing block: B:164:0x02f5, code lost:
    
        r7.m4613(r14, r4);
     */
    /* JADX WARN: Code restructure failed: missing block: B:165:0x0301, code lost:
    
        if ((r17.m4198() & 4) == 0) goto L167;
     */
    /* JADX WARN: Code restructure failed: missing block: B:166:0x0303, code lost:
    
        r7.m4608(0);
     */
    /* JADX WARN: Code restructure failed: missing block: B:167:0x0306, code lost:
    
        r2 = r2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:168:0x0309, code lost:
    
        r25 = r8;
        r2 = r9.mo4408(r33, r2, false);
     */
    /* JADX WARN: Code restructure failed: missing block: B:169:0x0312, code lost:
    
        r32.f11043 += r2;
        r32.f11039 -= r2;
        r4 = r20;
        r8 = r25;
     */
    /* JADX WARN: Code restructure failed: missing block: B:170:0x0321, code lost:
    
        r17 = r2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:171:0x0323, code lost:
    
        r2 = r32.f11043;
        r4 = r32.f11022;
     */
    /* JADX WARN: Code restructure failed: missing block: B:172:0x0327, code lost:
    
        if (r2 >= r4) goto L530;
     */
    /* JADX WARN: Code restructure failed: missing block: B:173:0x0329, code lost:
    
        r32.f11043 += r9.mo4408(r33, r4 - r2, false);
     */
    /* JADX WARN: Code restructure failed: missing block: B:174:0x0335, code lost:
    
        r1 = r17.m4198();
     */
    /* JADX WARN: Code restructure failed: missing block: B:175:0x033b, code lost:
    
        if (r32.f11052 != false) goto L177;
     */
    /* JADX WARN: Code restructure failed: missing block: B:176:0x033d, code lost:
    
        r1 = r1 | 67108864;
     */
    /* JADX WARN: Code restructure failed: missing block: B:177:0x0340, code lost:
    
        r28 = r1;
        r1 = r17.m4199();
     */
    /* JADX WARN: Code restructure failed: missing block: B:178:0x0346, code lost:
    
        if (r1 == null) goto L180;
     */
    /* JADX WARN: Code restructure failed: missing block: B:179:0x0348, code lost:
    
        r31 = r1.f16471;
     */
    /* JADX WARN: Code restructure failed: missing block: B:180:0x034d, code lost:
    
        r31 = null;
     */
    /* JADX WARN: Code restructure failed: missing block: B:181:0x034f, code lost:
    
        r26 = r14;
        r9.mo4410(r26, r28, r32.f11022, 0, r31);
     */
    /* JADX WARN: Code restructure failed: missing block: B:183:0x0360, code lost:
    
        if (r3.isEmpty() != false) goto L526;
     */
    /* JADX WARN: Code restructure failed: missing block: B:184:0x0362, code lost:
    
        r1 = (defpackage.C3577) r3.removeFirst();
        r32.f11037 -= r1.f13383;
        r4 = r1.f13384;
     */
    /* JADX WARN: Code restructure failed: missing block: B:185:0x0373, code lost:
    
        if (r1.f13385 == false) goto L187;
     */
    /* JADX WARN: Code restructure failed: missing block: B:186:0x0375, code lost:
    
        r4 = r4 + r26;
     */
    /* JADX WARN: Code restructure failed: missing block: B:187:0x0377, code lost:
    
        if (r6 == null) goto L189;
     */
    /* JADX WARN: Code restructure failed: missing block: B:188:0x0379, code lost:
    
        r4 = r6.m3775(r4);
     */
    /* JADX WARN: Code restructure failed: missing block: B:189:0x037d, code lost:
    
        r8 = r4;
        r2 = r32.f11017;
        r4 = r2.length;
        r5 = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:190:0x0382, code lost:
    
        if (r5 >= r4) goto L529;
     */
    /* JADX WARN: Code restructure failed: missing block: B:191:0x0384, code lost:
    
        r2[r5].mo4410(r8, 1, r1.f13383, r32.f11037, null);
        r5 = r5 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:193:0x0396, code lost:
    
        if (r17.m4197() != false) goto L195;
     */
    /* JADX WARN: Code restructure failed: missing block: B:194:0x0398, code lost:
    
        r32.f11026 = null;
     */
    /* JADX WARN: Code restructure failed: missing block: B:195:0x039b, code lost:
    
        r32.f11041 = 3;
     */
    /* JADX WARN: Code restructure failed: missing block: B:196:0x03a0, code lost:
    
        return 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:305:0x0666, code lost:
    
        throw androidx.media3.common.ParserException.m355("Atom size less than header length (unsupported).");
     */
    /* JADX WARN: Code restructure failed: missing block: B:44:0x00c8, code lost:
    
        r5 = r2.f5599;
     */
    /* JADX WARN: Code restructure failed: missing block: B:45:0x00d3, code lost:
    
        if (r32.f11041 != 3) goto L87;
     */
    /* JADX WARN: Code restructure failed: missing block: B:47:0x00d7, code lost:
    
        if (r2.f5598 != false) goto L49;
     */
    /* JADX WARN: Code restructure failed: missing block: B:48:0x00d9, code lost:
    
        r9 = r2.f5603.f16327[r2.f5594];
     */
    /* JADX WARN: Code restructure failed: missing block: B:49:0x00e2, code lost:
    
        r9 = r5.f8179[r2.f5594];
     */
    /* JADX WARN: Code restructure failed: missing block: B:50:0x00e8, code lost:
    
        r32.f11022 = r9;
        r9 = r2.f5603.f16323.f4085;
     */
    /* JADX WARN: Code restructure failed: missing block: B:51:0x00f6, code lost:
    
        if (j$.util.Objects.equals(r9.f12929, "video/avc") == false) goto L56;
     */
    /* JADX WARN: Code restructure failed: missing block: B:53:0x00fa, code lost:
    
        if ((r4 & 64) == 0) goto L55;
     */
    /* JADX WARN: Code restructure failed: missing block: B:54:0x00fc, code lost:
    
        r4 = r22;
     */
    /* JADX WARN: Code restructure failed: missing block: B:55:0x00ff, code lost:
    
        r4 = r21;
     */
    /* JADX WARN: Code restructure failed: missing block: B:57:0x0108, code lost:
    
        if (j$.util.Objects.equals(r9.f12929, "video/hevc") == false) goto L55;
     */
    /* JADX WARN: Code restructure failed: missing block: B:59:0x010c, code lost:
    
        if ((r4 & 128) == 0) goto L55;
     */
    /* JADX WARN: Code restructure failed: missing block: B:61:0x010f, code lost:
    
        r32.f11052 = r4 ^ 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:62:0x0117, code lost:
    
        if (r2.f5594 >= r2.f5596) goto L79;
     */
    /* JADX WARN: Code restructure failed: missing block: B:63:0x0119, code lost:
    
        r33.mo4248(r32.f11022);
        r1 = r2.m4199();
     */
    /* JADX WARN: Code restructure failed: missing block: B:64:0x0122, code lost:
    
        if (r1 != null) goto L66;
     */
    /* JADX WARN: Code restructure failed: missing block: B:66:0x0125, code lost:
    
        r3 = r5.f8173;
        r1 = r1.f16474;
     */
    /* JADX WARN: Code restructure failed: missing block: B:67:0x0129, code lost:
    
        if (r1 == 0) goto L69;
     */
    /* JADX WARN: Code restructure failed: missing block: B:68:0x012b, code lost:
    
        r3.m7946(r1);
     */
    /* JADX WARN: Code restructure failed: missing block: B:69:0x012e, code lost:
    
        r1 = r2.f5594;
     */
    /* JADX WARN: Code restructure failed: missing block: B:70:0x0132, code lost:
    
        if (r5.f8178 == false) goto L74;
     */
    /* JADX WARN: Code restructure failed: missing block: B:72:0x0138, code lost:
    
        if (r5.f8166[r1] == false) goto L74;
     */
    /* JADX WARN: Code restructure failed: missing block: B:73:0x013a, code lost:
    
        r3.m7946(r3.m7972() * 6);
     */
    /* JADX WARN: Code restructure failed: missing block: B:75:0x0146, code lost:
    
        if (r2.m4197() != false) goto L77;
     */
    /* JADX WARN: Code restructure failed: missing block: B:76:0x0148, code lost:
    
        r32.f11026 = null;
     */
    /* JADX WARN: Code restructure failed: missing block: B:77:0x014b, code lost:
    
        r32.f11041 = 3;
     */
    /* JADX WARN: Code restructure failed: missing block: B:78:0x014e, code lost:
    
        return r21;
     */
    /* JADX WARN: Code restructure failed: missing block: B:80:0x0157, code lost:
    
        if (r2.f5603.f16323.f4093 != r22) goto L82;
     */
    /* JADX WARN: Code restructure failed: missing block: B:81:0x0159, code lost:
    
        r32.f11022 -= 8;
        r33.mo4248(r20);
     */
    /* JADX WARN: Code restructure failed: missing block: B:82:0x0164, code lost:
    
        r4 = "audio/ac4".equals(r2.f5603.f16323.f4085.f12929);
        r9 = r32.f11022;
     */
    /* JADX WARN: Code restructure failed: missing block: B:83:0x0174, code lost:
    
        if (r4 == false) goto L85;
     */
    /* JADX WARN: Code restructure failed: missing block: B:84:0x0176, code lost:
    
        r32.f11043 = r2.m4200(r9, 7);
        ᵳـᵔʤ.ᵳٴᵶ(r32.f11022, r8);
        r2.f5597.mo4406(7, r8);
        r32.f11043 += 7;
        r4 = r21;
     */
    /* JADX WARN: Code restructure failed: missing block: B:85:0x018f, code lost:
    
        r4 = r21;
        r32.f11043 = r2.m4200(r9, r4);
     */
    /* JADX WARN: Code restructure failed: missing block: B:86:0x0197, code lost:
    
        r32.f11022 += r32.f11043;
        r32.f11041 = 4;
        r32.f11039 = r4;
     */
    /* JADX WARN: Code restructure failed: missing block: B:87:0x01a2, code lost:
    
        r4 = r2.f5603;
        r8 = r4.f16323;
        r9 = r2.f5597;
     */
    /* JADX WARN: Code restructure failed: missing block: B:88:0x01aa, code lost:
    
        if (r2.f5598 != false) goto L90;
     */
    /* JADX WARN: Code restructure failed: missing block: B:89:0x01ac, code lost:
    
        r14 = r4.f16320[r2.f5594];
     */
    /* JADX WARN: Code restructure failed: missing block: B:90:0x01b3, code lost:
    
        r14 = r5.f8170[r2.f5594];
     */
    /* JADX WARN: Code restructure failed: missing block: B:91:0x01b9, code lost:
    
        if (r6 == null) goto L93;
     */
    /* JADX WARN: Code restructure failed: missing block: B:92:0x01bb, code lost:
    
        r14 = r6.m3775(r14);
     */
    /* JADX WARN: Code restructure failed: missing block: B:93:0x01bf, code lost:
    
        r4 = r8.f4092;
        r5 = r8.f4085;
     */
    /* JADX WARN: Code restructure failed: missing block: B:94:0x01c3, code lost:
    
        if (r4 == 0) goto L170;
     */
    /* JADX WARN: Code restructure failed: missing block: B:95:0x01c5, code lost:
    
        r8 = r32.f11021;
        r12 = r8.f13082;
        r12[0] = 0;
        r12[1] = 0;
        r12[r19] = 0;
        r13 = 4 - r4;
        r17 = r2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:96:0x01d7, code lost:
    
        r20 = r4;
     */
    /* JADX WARN: Code restructure failed: missing block: B:97:0x01dd, code lost:
    
        if (r32.f11043 >= r32.f11022) goto L522;
     */
    /* JADX WARN: Code restructure failed: missing block: B:98:0x01df, code lost:
    
        r2 = r32.f11039;
     */
    /* JADX WARN: Code restructure failed: missing block: B:99:0x01e1, code lost:
    
        if (r2 != 0) goto L154;
     */
    /* JADX WARN: Multi-variable type inference failed */
    @Override // defpackage.InterfaceC2689
    /* renamed from: ᵻᵢﹳᵰ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final int mo1578(defpackage.InterfaceC1383 r33, defpackage.C4184 r34) throws androidx.media3.common.ParserException {
        /*
            Method dump skipped, instructions count: 2168
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C2851.mo1578(ˊᵬᐧ, ᵮˆ):int");
    }
}
