package defpackage;

import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/* renamed from: ᵹᵔᵥ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C5045 {

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

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

    public C5045() {
        this.f18845 = 1;
        this.f18846 = Collections.singletonList(null);
    }

    public C5045(int i, List list) {
        this.f18845 = i;
        this.f18846 = list;
    }

    public C5045(ArrayList arrayList) {
        this.f18845 = 0;
        this.f18846 = arrayList;
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public boolean m10510(int i) {
        return (this.f18845 & i) != 0;
    }

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARN: Removed duplicated region for block: B:38:0x0061  */
    /* 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 defpackage.InterfaceC3676 m10511(int r8, ʽʽﹶ r9) {
        /*
            Method dump skipped, instructions count: 400
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C5045.m10511(int, ʽʽﹶ):ᵧᵯˁ");
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r12v3 */
    /* JADX WARN: Type inference failed for: r12v4, types: [java.util.List] */
    /* JADX WARN: Type inference failed for: r12v5 */
    /* JADX WARN: Type inference failed for: r12v6, types: [java.util.ArrayList] */
    /* JADX WARN: Type inference failed for: r12v7 */
    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public List m10512(ʽʽﹶ r12) {
        String str;
        int i;
        List listSingletonList;
        boolean zM10510 = m10510(32);
        List list = this.f18846;
        if (!zM10510) {
            try {
                C3493 c3493 = new C3493((byte[]) r12.ᵾᵬ);
                ?? arrayList = list;
                while (c3493.m7959() > 0) {
                    int iM7956 = c3493.m7956();
                    int iM79562 = c3493.f13083 + c3493.m7956();
                    if (iM7956 == 134) {
                        arrayList = new ArrayList();
                        int iM79563 = c3493.m7956() & 31;
                        for (int i2 = 0; i2 < iM79563; i2++) {
                            String strM7973 = c3493.m7973(3, StandardCharsets.UTF_8);
                            int iM79564 = c3493.m7956();
                            boolean z = (iM79564 & 128) != 0;
                            if (z) {
                                str = "application/cea-708";
                                i = iM79564 & 63;
                            } else {
                                str = "application/cea-608";
                                i = 1;
                            }
                            byte bM7956 = (byte) c3493.m7956();
                            c3493.m7946(1);
                            if (z) {
                                boolean z2 = (bM7956 & 64) != 0;
                                byte[] bArr = AbstractC4109.f15351;
                                listSingletonList = Collections.singletonList(z2 ? new byte[]{1} : new byte[]{0});
                            } else {
                                listSingletonList = null;
                            }
                            C2153 c2153 = new C2153();
                            c2153.f8516 = AbstractC2924.m7101(str);
                            c2153.f8527 = strM7973;
                            c2153.f8491 = i;
                            c2153.f8506 = listSingletonList;
                            arrayList.add(new C3446(c2153));
                        }
                    }
                    c3493.m7955(iM79562);
                    arrayList = arrayList;
                }
                return arrayList;
            } catch (Exception unused) {
            }
        }
        return list;
    }
}
