package defpackage;

import android.net.Uri;
import android.text.TextUtils;
import android.util.Base64;
import androidx.media3.common.ParserException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/* JADX INFO: renamed from: ᵱʟʨ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C4409 implements InterfaceC2793 {

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final C1164 f16798;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final C3096 f16799;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public static final Pattern f16755 = Pattern.compile("AVERAGE-BANDWIDTH=(\\d+)\\b");

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public static final Pattern f16778 = Pattern.compile("VIDEO=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public static final Pattern f16786 = Pattern.compile("AUDIO=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public static final Pattern f16793 = Pattern.compile("SUBTITLES=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public static final Pattern f16735 = Pattern.compile("CLOSED-CAPTIONS=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public static final Pattern f16747 = Pattern.compile("[^-]BANDWIDTH=(\\d+)\\b");

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public static final Pattern f16794 = Pattern.compile("CHANNELS=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public static final Pattern f16754 = Pattern.compile("VIDEO-RANGE=(SDR|PQ|HLG)");

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public static final Pattern f16720 = Pattern.compile("CODECS=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public static final Pattern f16768 = Pattern.compile("SUPPLEMENTAL-CODECS=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ˉᵵᵜ, reason: contains not printable characters */
    public static final Pattern f16738 = Pattern.compile("RESOLUTION=(\\d+x\\d+)");

    /* JADX INFO: renamed from: ˁˌᵩ, reason: contains not printable characters */
    public static final Pattern f16728 = Pattern.compile("FRAME-RATE=([\\d\\.]+)\\b");

    /* JADX INFO: renamed from: ˀᵭ, reason: contains not printable characters */
    public static final Pattern f16726 = Pattern.compile("PATHWAY-ID=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ˊᵾʽʼ, reason: contains not printable characters */
    public static final Pattern f16743 = Pattern.compile("STABLE-VARIANT-ID=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ˊᵡᵗʨ, reason: contains not printable characters */
    public static final Pattern f16741 = Pattern.compile("STABLE-RENDITION-ID=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵛˑﹳ, reason: contains not printable characters */
    public static final Pattern f16764 = Pattern.compile("#EXT-X-TARGETDURATION:(\\d+)\\b");

    /* JADX INFO: renamed from: ᵵᵬᵽ, reason: contains not printable characters */
    public static final Pattern f16791 = Pattern.compile("DURATION=([\\d\\.]+)\\b");

    /* JADX INFO: renamed from: ˑʢ, reason: contains not printable characters */
    public static final Pattern f16753 = Pattern.compile("[:,]DURATION=([\\d\\.]+)\\b");

    /* JADX INFO: renamed from: ʽᵡᵢᵾ, reason: contains not printable characters */
    public static final Pattern f16719 = Pattern.compile("PART-TARGET=([\\d\\.]+)\\b");

    /* JADX INFO: renamed from: ˈⁱᵡ, reason: contains not printable characters */
    public static final Pattern f16736 = Pattern.compile("#EXT-X-VERSION:(\\d+)\\b");

    /* JADX INFO: renamed from: ᵨˈʼﹶ, reason: contains not printable characters */
    public static final Pattern f16777 = Pattern.compile("#EXT-X-PLAYLIST-TYPE:(.+)\\b");

    /* JADX INFO: renamed from: ᵞᵛᵘ, reason: contains not printable characters */
    public static final Pattern f16766 = Pattern.compile("CAN-SKIP-UNTIL=([\\d\\.]+)\\b");

    /* JADX INFO: renamed from: ˊˌˊ, reason: contains not printable characters */
    public static final Pattern f16740 = m9421("CAN-SKIP-DATERANGES");

    /* JADX INFO: renamed from: ˁʢᵛ, reason: contains not printable characters */
    public static final Pattern f16727 = Pattern.compile("SKIPPED-SEGMENTS=(\\d+)\\b");

    /* JADX INFO: renamed from: ˀᵗ, reason: contains not printable characters */
    public static final Pattern f16723 = Pattern.compile("[:|,]HOLD-BACK=([\\d\\.]+)\\b");

    /* JADX INFO: renamed from: ˏᵩʨ, reason: contains not printable characters */
    public static final Pattern f16751 = Pattern.compile("PART-HOLD-BACK=([\\d\\.]+)\\b");

    /* JADX INFO: renamed from: ᵛˀˊ, reason: contains not printable characters */
    public static final Pattern f16763 = m9421("CAN-BLOCK-RELOAD");

    /* JADX INFO: renamed from: ʿᵿʽᵞ, reason: contains not printable characters */
    public static final Pattern f16722 = Pattern.compile("#EXT-X-MEDIA-SEQUENCE:(\\d+)\\b");

    /* JADX INFO: renamed from: ᵡᵶ, reason: contains not printable characters */
    public static final Pattern f16771 = Pattern.compile("#EXTINF:\\s*([\\d\\.]+)\\b");

    /* JADX INFO: renamed from: ᵡᵶᵬʤ, reason: contains not printable characters */
    public static final Pattern f16772 = Pattern.compile("#EXTINF:[\\d\\.]+\\b,(.+)");

    /* JADX INFO: renamed from: ˋʿᐧ, reason: contains not printable characters */
    public static final Pattern f16744 = Pattern.compile("LAST-MSN=(\\d+)\\b");

    /* JADX INFO: renamed from: ˉˆᵗ, reason: contains not printable characters */
    public static final Pattern f16737 = Pattern.compile("LAST-PART=(\\d+)\\b");

    /* JADX INFO: renamed from: ˁᵺˈ, reason: contains not printable characters */
    public static final Pattern f16729 = Pattern.compile("TIME-OFFSET=(-?[\\d\\.]+)\\b");

    /* JADX INFO: renamed from: ˋᵯᵩ, reason: contains not printable characters */
    public static final Pattern f16746 = Pattern.compile("#EXT-X-BYTERANGE:(\\d+(?:@\\d+)?)\\b");

    /* JADX INFO: renamed from: ᵜᵤ, reason: contains not printable characters */
    public static final Pattern f16765 = Pattern.compile("BYTERANGE=\"(\\d+(?:@\\d+)?)\\b\"");

    /* JADX INFO: renamed from: ːᵝٴᵶ, reason: contains not printable characters */
    public static final Pattern f16752 = Pattern.compile("BYTERANGE-START=(\\d+)\\b");

    /* JADX INFO: renamed from: ᵗᵭ, reason: contains not printable characters */
    public static final Pattern f16759 = Pattern.compile("BYTERANGE-LENGTH=(\\d+)\\b");

    /* JADX INFO: renamed from: ᵫˈᵹ, reason: contains not printable characters */
    public static final Pattern f16781 = Pattern.compile("METHOD=(NONE|AES-128|SAMPLE-AES|SAMPLE-AES-CENC|SAMPLE-AES-CTR)\\s*(?:,|$)");

    /* JADX INFO: renamed from: ᵵᵸᵕᵸ, reason: contains not printable characters */
    public static final Pattern f16792 = Pattern.compile("KEYFORMAT=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵬᵦˋ, reason: contains not printable characters */
    public static final Pattern f16782 = Pattern.compile("KEYFORMATVERSIONS=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ˏʜᵪ, reason: contains not printable characters */
    public static final Pattern f16749 = Pattern.compile("URI=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵘᵝ, reason: contains not printable characters */
    public static final Pattern f16760 = Pattern.compile("IV=([^,.*]+)");

    /* JADX INFO: renamed from: ˆʤᵳ, reason: contains not printable characters */
    public static final Pattern f16730 = Pattern.compile("TYPE=(AUDIO|VIDEO|SUBTITLES|CLOSED-CAPTIONS)");

    /* JADX INFO: renamed from: ᵹʾᵢᵯ, reason: contains not printable characters */
    public static final Pattern f16795 = Pattern.compile("TYPE=(PART|MAP)");

    /* JADX INFO: renamed from: ᵮᵟᵡ, reason: contains not printable characters */
    public static final Pattern f16784 = Pattern.compile("LANGUAGE=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ˏʽˊᵰ, reason: contains not printable characters */
    public static final Pattern f16750 = Pattern.compile("NAME=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵯˇ, reason: contains not printable characters */
    public static final Pattern f16785 = Pattern.compile("QUERYPARAM=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵧᵢᵴᵸ, reason: contains not printable characters */
    public static final Pattern f16776 = Pattern.compile("GROUP-ID=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ˆˀᵯ, reason: contains not printable characters */
    public static final Pattern f16731 = Pattern.compile("CHARACTERISTICS=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵚᵹᵔᵜ, reason: contains not printable characters */
    public static final Pattern f16762 = Pattern.compile("INSTREAM-ID=\"((?:CC|SERVICE)\\d+)\"");

    /* JADX INFO: renamed from: ᵱᵭ, reason: contains not printable characters */
    public static final Pattern f16789 = m9421("AUTOSELECT");

    /* JADX INFO: renamed from: ʿᵯᴵ, reason: contains not printable characters */
    public static final Pattern f16721 = m9421("DEFAULT");

    /* JADX INFO: renamed from: ᵕᵜʽᵰ, reason: contains not printable characters */
    public static final Pattern f16758 = m9421("FORCED");

    /* JADX INFO: renamed from: ᵟᵴᵥ, reason: contains not printable characters */
    public static final Pattern f16767 = m9421("INDEPENDENT");

    /* JADX INFO: renamed from: ᵽˀᵥ, reason: contains not printable characters */
    public static final Pattern f16796 = m9421("GAP");

    /* JADX INFO: renamed from: ᵠᵲˁ, reason: contains not printable characters */
    public static final Pattern f16770 = m9421("PRECISE");

    /* JADX INFO: renamed from: ᵠᵚˀᵫ, reason: contains not printable characters */
    public static final Pattern f16769 = Pattern.compile("VALUE=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ˀᵛᵟ, reason: contains not printable characters */
    public static final Pattern f16724 = Pattern.compile("IMPORT=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ˀᵝᵙᵛ, reason: contains not printable characters */
    public static final Pattern f16725 = Pattern.compile("[:,]ID=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵣʚʿ, reason: contains not printable characters */
    public static final Pattern f16773 = Pattern.compile("CLASS=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ˊʧᵖ, reason: contains not printable characters */
    public static final Pattern f16739 = Pattern.compile("START-DATE=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵧᵠᵾ, reason: contains not printable characters */
    public static final Pattern f16775 = Pattern.compile("CUE=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵘᵫᵡ, reason: contains not printable characters */
    public static final Pattern f16761 = Pattern.compile("END-DATE=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ˊᵶᵕᵛ, reason: contains not printable characters */
    public static final Pattern f16742 = Pattern.compile("PLANNED-DURATION=([\\d\\.]+)\\b");

    /* JADX INFO: renamed from: ˆᵱʣ, reason: contains not printable characters */
    public static final Pattern f16733 = m9421("END-ON-NEXT");

    /* JADX INFO: renamed from: ˋᵤᵦ, reason: contains not printable characters */
    public static final Pattern f16745 = Pattern.compile("X-ASSET-URI=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵰʜ, reason: contains not printable characters */
    public static final Pattern f16787 = Pattern.compile("X-ASSET-LIST=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵥﹶ, reason: contains not printable characters */
    public static final Pattern f16774 = Pattern.compile("X-RESUME-OFFSET=(-?[\\d\\.]+)\\b");

    /* JADX INFO: renamed from: ᵱʢᵢ, reason: contains not printable characters */
    public static final Pattern f16788 = Pattern.compile("X-PLAYOUT-LIMIT=([\\d\\.]+)\\b");

    /* JADX INFO: renamed from: ˎʞ, reason: contains not printable characters */
    public static final Pattern f16748 = Pattern.compile("X-SNAP=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵪʚᵯʝ, reason: contains not printable characters */
    public static final Pattern f16779 = Pattern.compile("X-RESTRICT=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵔﹳ, reason: contains not printable characters */
    public static final Pattern f16756 = Pattern.compile("X-CONTENT-MAY-VARY=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵪᵳˀ, reason: contains not printable characters */
    public static final Pattern f16780 = Pattern.compile("X-TIMELINE-OCCUPIES=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵭᵬ, reason: contains not printable characters */
    public static final Pattern f16783 = Pattern.compile("X-TIMELINE-STYLE=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵕˁːᵚ, reason: contains not printable characters */
    public static final Pattern f16757 = Pattern.compile("X-SKIP-CONTROL-OFFSET=([\\d\\.]+)\\b");

    /* JADX INFO: renamed from: ˆˌˁ, reason: contains not printable characters */
    public static final Pattern f16732 = Pattern.compile("X-SKIP-CONTROL-DURATION=([\\d\\.]+)\\b");

    /* JADX INFO: renamed from: ᵾᵻﹳᵮ, reason: contains not printable characters */
    public static final Pattern f16797 = Pattern.compile("X-SKIP-CONTROL-LABEL-ID=\"((?:.|\f)+?)\"");

    /* JADX INFO: renamed from: ᵴˀᵰʒ, reason: contains not printable characters */
    public static final Pattern f16790 = Pattern.compile("\\{\\$([a-zA-Z0-9\\-_]+)\\}");

    /* JADX INFO: renamed from: ˈˊˑˑ, reason: contains not printable characters */
    public static final Pattern f16734 = Pattern.compile("\\b(X-[A-Z0-9-]+)=");

    public C4409(C1164 c1164, C3096 c3096) {
        this.f16798 = c1164;
        this.f16799 = c3096;
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public static C5576 m9415(String str, C4386[] c4386Arr) {
        C4386[] c4386Arr2 = new C4386[c4386Arr.length];
        for (int i = 0; i < c4386Arr.length; i++) {
            C4386 c4386 = c4386Arr[i];
            c4386Arr2[i] = new C4386(c4386.f16666, c4386.f16665, c4386.f16667, null);
        }
        return new C5576(str, true, c4386Arr2);
    }

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public static long m9416(C1497 c1497, String str, Pattern pattern) {
        Matcher matcherM4273 = C1497.m4273(c1497, str, pattern);
        if (!matcherM4273.find()) {
            return -1L;
        }
        String strGroup = matcherM4273.group(1);
        strGroup.getClass();
        return Long.parseLong(strGroup);
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public static C4386 m9417(String str, String str2, HashMap map, C1497 c1497) throws ParserException {
        String strM9425 = m9425(str, f16782, "1", map, c1497);
        boolean zEquals = "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed".equals(str2);
        Pattern pattern = f16749;
        if (zEquals) {
            String strM9420 = m9420(str, pattern, map, c1497);
            return new C4386(AbstractC3361.f12881, null, "video/mp4", Base64.decode(strM9420.substring(strM9420.indexOf(44)), 0));
        }
        if ("com.widevine".equals(str2)) {
            UUID uuid = AbstractC3361.f12881;
            String str3 = AbstractC0956.f4222;
            return new C4386(uuid, null, "hls", str.getBytes(StandardCharsets.UTF_8));
        }
        if (!"com.microsoft.playready".equals(str2) || !"1".equals(strM9425)) {
            return null;
        }
        String strM94202 = m9420(str, pattern, map, c1497);
        byte[] bArrDecode = Base64.decode(strM94202.substring(strM94202.indexOf(44)), 0);
        UUID uuid2 = AbstractC3361.f12879;
        return new C4386(uuid2, null, "video/mp4", ᵲᵧˇ.ʽˈˋ(uuid2, (UUID[]) null, bArrDecode));
    }

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:101:0x0256  */
    /* JADX WARN: Removed duplicated region for block: B:102:0x025c  */
    /* JADX WARN: Removed duplicated region for block: B:104:0x0260  */
    /* JADX WARN: Removed duplicated region for block: B:107:0x026a  */
    /* JADX WARN: Removed duplicated region for block: B:114:0x028e  */
    /* JADX WARN: Removed duplicated region for block: B:117:0x0299  */
    /* JADX WARN: Removed duplicated region for block: B:118:0x029e  */
    /* JADX WARN: Removed duplicated region for block: B:121:0x02c6  */
    /* JADX WARN: Removed duplicated region for block: B:123:0x02d1  */
    /* JADX WARN: Removed duplicated region for block: B:128:0x032a  */
    /* JADX WARN: Removed duplicated region for block: B:178:0x04d9  */
    /* JADX WARN: Removed duplicated region for block: B:83:0x020a  */
    /* JADX WARN: Removed duplicated region for block: B:86:0x0212  */
    /* JADX WARN: Removed duplicated region for block: B:88:0x0216  */
    /* JADX WARN: Type inference failed for: r28v1 */
    /* JADX WARN: Type inference failed for: r28v3 */
    /* JADX WARN: Type inference failed for: r28v8 */
    /* JADX WARN: Type inference failed for: r5v16 */
    /* JADX WARN: Type inference failed for: r5v17, types: [int] */
    /* JADX WARN: Type inference failed for: r5v73 */
    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static C1164 m9418(ᵯᵨᵲ r48, Uri uri, C1497 c1497) throws ParserException {
        String str;
        String strM9420;
        String strM94202;
        ArrayList arrayList;
        String strM9425;
        C4753 c4753;
        C5286 c5286;
        int i;
        Uri uri2;
        C1956 c1956;
        ArrayList arrayList2;
        C2009 c2009;
        String strM9133;
        ArrayList arrayList3;
        int i2;
        String str2;
        C2009 c20092;
        String strM91332;
        C2009 c20093;
        HashMap map;
        HashSet hashSet;
        int i3;
        ArrayList arrayList4;
        int i4;
        ArrayList arrayList5;
        ArrayList arrayList6;
        ArrayList arrayList7;
        HashMap map2;
        int i5;
        String str3;
        String str4;
        String strM3241;
        C3281 c3281;
        String strM94252;
        int i6;
        int i7;
        Uri uri3;
        ArrayList arrayList8;
        int i8;
        String[] strArrM3238;
        C3281 c32812;
        String string = uri.toString();
        HashMap map3 = new HashMap();
        HashMap map4 = new HashMap();
        ArrayList arrayList9 = new ArrayList();
        ArrayList arrayList10 = new ArrayList();
        ArrayList arrayList11 = new ArrayList();
        ArrayList arrayList12 = new ArrayList();
        ArrayList arrayList13 = new ArrayList();
        ArrayList arrayList14 = new ArrayList();
        ArrayList arrayList15 = new ArrayList();
        ArrayList arrayList16 = new ArrayList();
        boolean z = false;
        boolean z2 = false;
        while (true) {
            boolean z3 = r48.ˏᵩʨ();
            Pattern pattern = f16749;
            ArrayList arrayList17 = arrayList13;
            boolean z4 = z;
            Pattern pattern2 = f16750;
            boolean z5 = z2;
            if (!z3) {
                ArrayList arrayList18 = arrayList14;
                ArrayList arrayList19 = arrayList16;
                ArrayList arrayList20 = arrayList10;
                ArrayList arrayList21 = arrayList11;
                ArrayList arrayList22 = arrayList12;
                ArrayList arrayList23 = arrayList15;
                ArrayList arrayList24 = new ArrayList();
                HashSet hashSet2 = new HashSet();
                int i9 = 0;
                while (i9 < arrayList9.size()) {
                    C2009 c20094 = (C2009) arrayList9.get(i9);
                    Uri uri4 = c20094.f7949;
                    C5286 c52862 = c20094.f7945;
                    if (hashSet2.add(uri4)) {
                        ᵻᵪ.ˌᴵ(c52862.f19988 == null);
                        ArrayList arrayList25 = (ArrayList) map3.get(c20094.f7949);
                        arrayList25.getClass();
                        map = map3;
                        hashSet = hashSet2;
                        C1956 c19562 = new C1956(new C5484(null, null, arrayList25));
                        C4753 c4753M10878 = c52862.m10878();
                        c4753M10878.f18125 = c19562;
                        arrayList24.add(new C2009(c20094.f7949, new C5286(c4753M10878), c20094.f7947, c20094.f7951, c20094.f7948, c20094.f7952, c20094.f7950, c20094.f7946));
                    } else {
                        map = map3;
                        hashSet = hashSet2;
                    }
                    i9++;
                    hashSet2 = hashSet;
                    map3 = map;
                }
                int i10 = 0;
                ArrayList arrayList26 = null;
                C5286 c52863 = null;
                while (i10 < arrayList18.size()) {
                    ArrayList arrayList27 = arrayList18;
                    str = (String) arrayList27.get(i10);
                    strM9420 = m9420(str, f16776, map4, c1497);
                    strM94202 = m9420(str, pattern2, map4, c1497);
                    arrayList = arrayList26;
                    ArrayList arrayList28 = arrayList24;
                    strM9425 = m9425(str, f16741, null, map4, c1497);
                    c4753 = new C4753();
                    c5286 = c52863;
                    c4753.f18121 = AbstractC3653.m8223(strM9420, ":", strM94202);
                    c4753.f18089 = strM94202;
                    c4753.f18111 = AbstractC4208.m9132("application/x-mpegURL");
                    boolean zM9426 = m9426(c1497, str, f16721);
                    ?? r28 = zM9426;
                    if (m9426(c1497, str, f16758)) {
                        r28 = (zM9426 ? 1 : 0) | 2;
                    }
                    c4753.f18114 = m9426(c1497, str, f16789) ? r28 | 4 : r28;
                    int i11 = i10;
                    String strM94253 = m9425(str, f16731, null, map4, c1497);
                    if (TextUtils.isEmpty(strM94253)) {
                        arrayList18 = arrayList27;
                        i = 0;
                    } else {
                        String str5 = AbstractC0956.f4222;
                        String[] strArrSplit = strM94253.split(",", -1);
                        i = AbstractC0956.m3247(strArrSplit, "public.accessibility.describes-video") ? 512 : 0;
                        arrayList18 = arrayList27;
                        if (AbstractC0956.m3247(strArrSplit, "public.accessibility.transcribes-spoken-dialog")) {
                            i |= 4096;
                        }
                        if (AbstractC0956.m3247(strArrSplit, "public.accessibility.describes-music-and-sound")) {
                            i |= 1024;
                        }
                        if (AbstractC0956.m3247(strArrSplit, "public.easy-to-read")) {
                            i |= 8192;
                        }
                    }
                    c4753.f18129 = i;
                    c4753.f18126 = m9425(str, f16784, null, map4, c1497);
                    String strM94254 = m9425(str, pattern, null, map4, c1497);
                    uri2 = strM94254 == null ? null : ᵶᵦ.ᵯᵷʽ(string, strM94254);
                    String str6 = string;
                    Pattern pattern3 = pattern;
                    c1956 = new C1956(new C5484(strM9420, strM94202, Collections.EMPTY_LIST));
                    switch (m9420(str, f16730, map4, c1497)) {
                        case "SUBTITLES":
                            arrayList2 = arrayList20;
                            int i12 = 0;
                            while (true) {
                                if (i12 < arrayList9.size()) {
                                    c2009 = (C2009) arrayList9.get(i12);
                                    if (!strM9420.equals(c2009.f7948)) {
                                        i12++;
                                    }
                                } else {
                                    c2009 = null;
                                }
                            }
                            if (c2009 != null) {
                                String strM32412 = AbstractC0956.m3241(3, c2009.f7945.f19996);
                                c4753.f18120 = strM32412;
                                strM9133 = AbstractC4208.m9133(strM32412);
                            } else {
                                strM9133 = null;
                            }
                            if (strM9133 == null) {
                                strM9133 = "text/vtt";
                            }
                            c4753.f18101 = AbstractC4208.m9132(strM9133);
                            c4753.f18125 = c1956;
                            if (uri2 != null) {
                                arrayList3 = arrayList22;
                                arrayList3.add(new C1772(uri2, new C5286(c4753), strM94202, strM9425));
                            } else {
                                arrayList3 = arrayList22;
                                ˋˀᵧ.ʿٴˇ("EXT-X-MEDIA tag with missing mandatory URI attribute: skipping");
                            }
                            arrayList26 = arrayList;
                            c52863 = c5286;
                            break;
                        case "CLOSED-CAPTIONS":
                            ArrayList arrayList29 = arrayList21;
                            arrayList2 = arrayList20;
                            String strM94203 = m9420(str, f16762, map4, c1497);
                            if (strM94203.startsWith("CC")) {
                                i2 = Integer.parseInt(strM94203.substring(2));
                                str2 = "application/cea-608";
                            } else {
                                i2 = Integer.parseInt(strM94203.substring(7));
                                str2 = "application/cea-708";
                            }
                            ArrayList arrayList30 = arrayList == null ? new ArrayList() : arrayList;
                            c4753.f18101 = AbstractC4208.m9132(str2);
                            c4753.f18100 = i2;
                            arrayList30.add(new C5286(c4753));
                            arrayList21 = arrayList29;
                            arrayList26 = arrayList30;
                            arrayList3 = arrayList22;
                            c52863 = c5286;
                            break;
                        case "AUDIO":
                            arrayList2 = arrayList20;
                            int i13 = 0;
                            while (true) {
                                if (i13 < arrayList9.size()) {
                                    c20092 = (C2009) arrayList9.get(i13);
                                    int i14 = i13;
                                    if (!strM9420.equals(c20092.f7951)) {
                                        i13 = i14 + 1;
                                    }
                                } else {
                                    c20092 = null;
                                }
                            }
                            if (c20092 != null) {
                                String strM32413 = AbstractC0956.m3241(1, c20092.f7945.f19996);
                                c4753.f18120 = strM32413;
                                strM91332 = AbstractC4208.m9133(strM32413);
                            } else {
                                strM91332 = null;
                            }
                            C2009 c20095 = c20092;
                            String strM94255 = m9425(str, f16794, null, map4, c1497);
                            if (strM94255 != null) {
                                String str7 = AbstractC0956.f4222;
                                c4753.f18090 = Integer.parseInt(strM94255.split("/", 2)[0]);
                                if ("audio/eac3".equals(strM91332) && strM94255.endsWith("/JOC")) {
                                    c4753.f18120 = "ec+3";
                                    strM91332 = "audio/eac3-joc";
                                }
                            }
                            c4753.f18101 = AbstractC4208.m9132(strM91332);
                            if (uri2 == null) {
                                ArrayList arrayList31 = arrayList21;
                                if (c20095 != null) {
                                    c52863 = new C5286(c4753);
                                    arrayList21 = arrayList31;
                                    arrayList3 = arrayList22;
                                    arrayList26 = arrayList;
                                } else {
                                    arrayList21 = arrayList31;
                                }
                                break;
                            } else {
                                c4753.f18125 = c1956;
                                arrayList21.add(new C1772(uri2, new C5286(c4753), strM94202, strM9425));
                            }
                            arrayList3 = arrayList22;
                            arrayList26 = arrayList;
                            c52863 = c5286;
                            break;
                        case "VIDEO":
                            int i15 = 0;
                            while (true) {
                                if (i15 < arrayList9.size()) {
                                    c20093 = (C2009) arrayList9.get(i15);
                                    if (!strM9420.equals(c20093.f7947)) {
                                        i15++;
                                    }
                                } else {
                                    c20093 = null;
                                }
                            }
                            if (c20093 != null) {
                                C5286 c52864 = c20093.f7945;
                                String strM32414 = AbstractC0956.m3241(2, c52864.f19996);
                                c4753.f18120 = strM32414;
                                c4753.f18101 = AbstractC4208.m9132(AbstractC4208.m9133(strM32414));
                                c4753.f18098 = c52864.f19973;
                                c4753.f18102 = c52864.f19981;
                                c4753.f18115 = c52864.f19989;
                            }
                            if (uri2 != null) {
                                c4753.f18125 = c1956;
                                arrayList2 = arrayList20;
                                arrayList2.add(new C1772(uri2, new C5286(c4753), strM94202, strM9425));
                                arrayList3 = arrayList22;
                                arrayList26 = arrayList;
                                c52863 = c5286;
                                break;
                            }
                        default:
                            arrayList3 = arrayList22;
                            arrayList2 = arrayList20;
                            arrayList26 = arrayList;
                            c52863 = c5286;
                            break;
                    }
                    i10 = i11 + 1;
                    arrayList20 = arrayList2;
                    arrayList22 = arrayList3;
                    arrayList24 = arrayList28;
                    string = str6;
                    pattern = pattern3;
                }
                return new C1164(uri.toString(), arrayList19, arrayList24, arrayList20, arrayList21, arrayList22, arrayList17, c52863, z4 ? Collections.EMPTY_LIST : arrayList26, z5, map4, arrayList23);
            }
            String str8 = r48.ᵡᵶ();
            ArrayList arrayList32 = arrayList12;
            if (str8.startsWith("#EXT")) {
                arrayList16.add(str8);
            }
            boolean zStartsWith = str8.startsWith("#EXT-X-I-FRAME-STREAM-INF");
            ArrayList arrayList33 = arrayList16;
            if (str8.startsWith("#EXT-X-DEFINE")) {
                String strM94256 = m9425(str8, pattern2, null, map4, c1497);
                if (strM94256 != null) {
                    m9419(strM94256, map4);
                    map4.put(strM94256, m9420(str8, f16769, map4, c1497));
                } else {
                    String strM94204 = m9420(str8, f16785, map4, c1497);
                    m9419(strM94204, map4);
                    String queryParameter = uri.getQueryParameter(strM94204);
                    if (queryParameter == null) {
                        throw ParserException.m355("QUERYPARAM \"" + strM94204 + "\" not found in playlist URI", null);
                    }
                    map4.put(strM94204, queryParameter);
                }
            } else if (str8.equals("#EXT-X-INDEPENDENT-SEGMENTS")) {
                arrayList7 = arrayList14;
                arrayList6 = arrayList10;
                arrayList5 = arrayList11;
                arrayList4 = arrayList15;
                z = z4;
                z2 = true;
                arrayList13 = arrayList17;
                arrayList12 = arrayList32;
                arrayList16 = arrayList33;
                arrayList15 = arrayList4;
                arrayList11 = arrayList5;
                arrayList10 = arrayList6;
                arrayList14 = arrayList7;
            } else if (str8.startsWith("#EXT-X-MEDIA")) {
                arrayList14.add(str8);
            } else if (str8.startsWith("#EXT-X-SESSION-KEY")) {
                C4386 c4386M9417 = m9417(str8, m9425(str8, f16792, "identity", map4, c1497), map4, c1497);
                if (c4386M9417 != null) {
                    String strM94205 = m9420(str8, f16781, map4, c1497);
                    arrayList15.add(new C5576(("SAMPLE-AES-CENC".equals(strM94205) || "SAMPLE-AES-CTR".equals(strM94205)) ? "cenc" : "cbcs", true, c4386M9417));
                }
            } else {
                if (str8.startsWith("#EXT-X-STREAM-INF") || zStartsWith) {
                    boolean zContains = z4 | str8.contains("CLOSED-CAPTIONS=NONE");
                    if (zStartsWith) {
                        z4 = zContains;
                        i3 = 16384;
                    } else {
                        z4 = zContains;
                        i3 = 0;
                    }
                    int i16 = Integer.parseInt(m9420(str8, f16747, Collections.EMPTY_MAP, c1497));
                    Matcher matcherM4273 = C1497.m4273(c1497, str8, f16755);
                    if (matcherM4273.find()) {
                        arrayList4 = arrayList15;
                        String strGroup = matcherM4273.group(1);
                        strGroup.getClass();
                        i4 = Integer.parseInt(strGroup);
                    } else {
                        arrayList4 = arrayList15;
                        i4 = -1;
                    }
                    arrayList5 = arrayList11;
                    String strM94257 = m9425(str8, f16754, null, map4, c1497);
                    arrayList6 = arrayList10;
                    String strM94258 = m9425(str8, f16720, null, map4, c1497);
                    arrayList7 = arrayList14;
                    String strM94259 = m9425(str8, f16768, null, map4, c1497);
                    if (strM94259 != null) {
                        String str9 = AbstractC0956.f4222;
                        String[] strArrSplit2 = strM94259.split(",", 2)[0].split("/", -1);
                        str3 = strArrSplit2[0];
                        if (strArrSplit2.length > 1) {
                            str4 = strArrSplit2[1];
                            map2 = map3;
                            i5 = 2;
                            strM3241 = AbstractC0956.m3241(i5, strM94258);
                            if (!!AbstractC4208.m9135(strM3241, str3) && (str3 == null || !(strM94257 == null || str4 == null || ((strM94257.equals("PQ") && !str4.equals("db1p")) || ((strM94257.equals("SDR") && !str4.equals("db2g")) || (strM94257.equals("HLG") && !str4.startsWith("db4"))))))) {
                                C3281 c3281M3255 = AbstractC0956.m3255(strM94258, str3, str4);
                                if (str3 == null) {
                                    str3 = strM3241;
                                }
                                strArrM3238 = AbstractC0956.m3238(strM94258);
                                if (strArrM3238.length != 0) {
                                    c32812 = c3281M3255;
                                } else {
                                    StringBuilder sb = new StringBuilder();
                                    int length = strArrM3238.length;
                                    int i17 = 0;
                                    while (i17 < length) {
                                        String[] strArr = strArrM3238;
                                        String str10 = strArr[i17];
                                        C3281 c32813 = c3281M3255;
                                        int i18 = length;
                                        if (2 != AbstractC4208.m9141(AbstractC4208.m9133(str10))) {
                                            if (sb.length() > 0) {
                                                sb.append(",");
                                            }
                                            sb.append(str10);
                                        }
                                        i17++;
                                        strArrM3238 = strArr;
                                        length = i18;
                                        c3281M3255 = c32813;
                                    }
                                    c32812 = c3281M3255;
                                    String string2 = sb.length() > 0 ? sb.toString() : null;
                                    strM94258 = string2 != null ? AbstractC3653.m8223(str3, ",", string2) : str3;
                                    c3281 = c32812;
                                }
                                if (string2 != null) {
                                }
                                c3281 = c32812;
                            } else {
                                c3281 = null;
                            }
                            strM94252 = m9425(str8, f16738, null, map4, c1497);
                            if (strM94252 == null) {
                                String[] strArrSplit3 = strM94252.split("x", -1);
                                int i19 = Integer.parseInt(strArrSplit3[0]);
                                int i20 = Integer.parseInt(strArrSplit3[1]);
                                if (i19 <= 0 || i20 <= 0) {
                                    i20 = -1;
                                    i8 = -1;
                                } else {
                                    i8 = i19;
                                }
                                i7 = i20;
                                i6 = i8;
                            } else {
                                i6 = -1;
                                i7 = -1;
                            }
                            String strM942510 = m9425(str8, f16728, null, map4, c1497);
                            float f = strM942510 == null ? Float.parseFloat(strM942510) : -1.0f;
                            String strM942511 = m9425(str8, f16726, null, map4, c1497);
                            String strM942512 = m9425(str8, f16778, null, map4, c1497);
                            String strM942513 = m9425(str8, f16786, null, map4, c1497);
                            String strM942514 = m9425(str8, f16793, null, map4, c1497);
                            String strM942515 = m9425(str8, f16735, null, map4, c1497);
                            String strM942516 = m9425(str8, f16743, null, map4, c1497);
                            if (!zStartsWith) {
                                uri3 = ᵶᵦ.ᵯᵷʽ(string, m9420(str8, pattern, map4, c1497));
                            } else {
                                if (!r48.ˏᵩʨ()) {
                                    throw ParserException.m355("#EXT-X-STREAM-INF must be followed by another line", null);
                                }
                                uri3 = ᵶᵦ.ᵯᵷʽ(string, m9423(r48.ᵡᵶ(), map4, c1497));
                            }
                            Uri uri5 = uri3;
                            C4753 c47532 = new C4753();
                            c47532.f18121 = Integer.toString(arrayList9.size());
                            c47532.f18111 = AbstractC4208.m9132("application/x-mpegURL");
                            c47532.f18120 = strM94258;
                            c47532.f18099 = i4;
                            c47532.f18128 = i16;
                            c47532.f18098 = i6;
                            c47532.f18102 = i7;
                            c47532.f18115 = f;
                            c47532.f18129 = i3;
                            c47532.f18127 = c3281;
                            arrayList9.add(new C2009(uri5, new C5286(c47532), strM942512, strM942513, strM942514, strM942515, strM942511, strM942516));
                            map3 = map2;
                            arrayList8 = (ArrayList) map3.get(uri5);
                            if (arrayList8 == null) {
                                arrayList8 = new ArrayList();
                                map3.put(uri5, arrayList8);
                            }
                            arrayList8.add(new C2625(i4, i16, strM942512, strM942513, strM942514, strM942515));
                        } else {
                            map2 = map3;
                            i5 = 2;
                        }
                    } else {
                        map2 = map3;
                        i5 = 2;
                        str3 = null;
                    }
                    str4 = null;
                    strM3241 = AbstractC0956.m3241(i5, strM94258);
                    if (!AbstractC4208.m9135(strM3241, str3)) {
                        C3281 c3281M32552 = AbstractC0956.m3255(strM94258, str3, str4);
                        if (str3 == null) {
                        }
                        strArrM3238 = AbstractC0956.m3238(strM94258);
                        if (strArrM3238.length != 0) {
                        }
                        if (string2 != null) {
                        }
                        c3281 = c32812;
                        strM94252 = m9425(str8, f16738, null, map4, c1497);
                        if (strM94252 == null) {
                        }
                        String strM9425102 = m9425(str8, f16728, null, map4, c1497);
                        if (strM9425102 == null) {
                        }
                        String strM9425112 = m9425(str8, f16726, null, map4, c1497);
                        String strM9425122 = m9425(str8, f16778, null, map4, c1497);
                        String strM9425132 = m9425(str8, f16786, null, map4, c1497);
                        String strM9425142 = m9425(str8, f16793, null, map4, c1497);
                        String strM9425152 = m9425(str8, f16735, null, map4, c1497);
                        String strM9425162 = m9425(str8, f16743, null, map4, c1497);
                        if (!zStartsWith) {
                        }
                        Uri uri52 = uri3;
                        C4753 c475322 = new C4753();
                        c475322.f18121 = Integer.toString(arrayList9.size());
                        c475322.f18111 = AbstractC4208.m9132("application/x-mpegURL");
                        c475322.f18120 = strM94258;
                        c475322.f18099 = i4;
                        c475322.f18128 = i16;
                        c475322.f18098 = i6;
                        c475322.f18102 = i7;
                        c475322.f18115 = f;
                        c475322.f18129 = i3;
                        c475322.f18127 = c3281;
                        arrayList9.add(new C2009(uri52, new C5286(c475322), strM9425122, strM9425132, strM9425142, strM9425152, strM9425112, strM9425162));
                        map3 = map2;
                        arrayList8 = (ArrayList) map3.get(uri52);
                        if (arrayList8 == null) {
                        }
                        arrayList8.add(new C2625(i4, i16, strM9425122, strM9425132, strM9425142, strM9425152));
                    }
                    arrayList13 = arrayList17;
                    arrayList12 = arrayList32;
                    arrayList16 = arrayList33;
                    arrayList15 = arrayList4;
                    arrayList11 = arrayList5;
                    arrayList10 = arrayList6;
                    arrayList14 = arrayList7;
                }
                z = z4;
                z2 = z5;
                arrayList13 = arrayList17;
                arrayList12 = arrayList32;
                arrayList16 = arrayList33;
                arrayList15 = arrayList4;
                arrayList11 = arrayList5;
                arrayList10 = arrayList6;
                arrayList14 = arrayList7;
            }
            arrayList7 = arrayList14;
            arrayList6 = arrayList10;
            arrayList5 = arrayList11;
            arrayList4 = arrayList15;
            z = z4;
            z2 = z5;
            arrayList13 = arrayList17;
            arrayList12 = arrayList32;
            arrayList16 = arrayList33;
            arrayList15 = arrayList4;
            arrayList11 = arrayList5;
            arrayList10 = arrayList6;
            arrayList14 = arrayList7;
        }
    }

    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public static void m9419(String str, HashMap map) throws ParserException {
        if (map.containsKey(str)) {
            throw ParserException.m355("duplicate variable name \"" + str + "\"", null);
        }
    }

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public static String m9420(String str, Pattern pattern, Map map, C1497 c1497) throws ParserException {
        String strM9425 = m9425(str, pattern, null, map, c1497);
        if (strM9425 != null) {
            return strM9425;
        }
        throw ParserException.m355("Couldn't match " + pattern.pattern() + " in " + str, null);
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public static Pattern m9421(String str) {
        return Pattern.compile(str.concat("=(NO|YES)"));
    }

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public static double m9422(String str, Pattern pattern, double d, C1497 c1497) {
        Matcher matcherM4273 = C1497.m4273(c1497, str, pattern);
        if (!matcherM4273.find()) {
            return d;
        }
        String strGroup = matcherM4273.group(1);
        strGroup.getClass();
        return Double.parseDouble(strGroup);
    }

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public static String m9423(String str, Map map, C1497 c1497) {
        Matcher matcherM4273 = C1497.m4273(c1497, str, f16790);
        StringBuffer stringBuffer = new StringBuffer();
        while (matcherM4273.find()) {
            String strGroup = matcherM4273.group(1);
            if (map.containsKey(strGroup)) {
                matcherM4273.appendReplacement(stringBuffer, Matcher.quoteReplacement((String) map.get(strGroup)));
            }
        }
        matcherM4273.appendTail(stringBuffer);
        return stringBuffer.toString();
    }

    /*  JADX ERROR: Type inference failed with stack overflow
        jadx.core.utils.exceptions.JadxOverflowException
        	at jadx.core.utils.ErrorsCounter.addError(ErrorsCounter.java:59)
        	at jadx.core.utils.ErrorsCounter.error(ErrorsCounter.java:31)
        	at jadx.core.dex.attributes.nodes.NotificationAttrNode.addError(NotificationAttrNode.java:19)
        	at jadx.core.dex.visitors.typeinference.TypeInferenceVisitor.visit(TypeInferenceVisitor.java:77)
        */
    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public static defpackage.C3096 m9424(defpackage.C1164 r140, defpackage.C3096 r141, ᵯᵨᵲ r142, android.net.Uri r143, defpackage.C1497 r144) {
        /*
            Method dump skipped, instruction units count: 4786
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C4409.m9424(ˉˆˏˉ, ᵟᵥ, ᵯᵨᵲ, android.net.Uri, ˋᴵᵭ):ᵟᵥ");
    }

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public static String m9425(String str, Pattern pattern, String str2, Map map, C1497 c1497) {
        Matcher matcherM4273 = C1497.m4273(c1497, str, pattern);
        if (matcherM4273.find()) {
            str2 = matcherM4273.group(1);
            str2.getClass();
        }
        return (map.isEmpty() || str2 == null) ? str2 : m9423(str2, map, c1497);
    }

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public static boolean m9426(C1497 c1497, String str, Pattern pattern) {
        Matcher matcherM4273 = C1497.m4273(c1497, str, pattern);
        if (matcherM4273.find()) {
            return "YES".equals(matcherM4273.group(1));
        }
        return false;
    }

    /* JADX WARN: Removed duplicated region for block: B:19:0x004a A[Catch: all -> 0x009d, TryCatch #0 {all -> 0x009d, blocks: (B:3:0x001a, B:5:0x0023, B:7:0x002b, B:10:0x0034, B:32:0x0074, B:34:0x007a, B:37:0x0085, B:39:0x008d, B:44:0x009f, B:46:0x00a7, B:48:0x00af, B:50:0x00b7, B:52:0x00bf, B:54:0x00c7, B:56:0x00cf, B:58:0x00d7, B:61:0x00e0, B:62:0x00e4, B:67:0x0102, B:68:0x0108, B:13:0x003b, B:15:0x0041, B:19:0x004a, B:22:0x0053, B:24:0x005c, B:26:0x0062, B:28:0x0068, B:29:0x006d), top: B:71:0x001a }] */
    /* JADX WARN: Removed duplicated region for block: B:90:0x005a A[SYNTHETIC] */
    @Override // defpackage.InterfaceC2793
    /* JADX INFO: renamed from: ᵜᵪʾ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object mo6779(Uri uri, C4437 c4437) throws ParserException {
        int i;
        String strTrim;
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(c4437));
        ArrayDeque arrayDeque = new ArrayDeque();
        C1497 c1497 = new C1497(16, 0.75f, true, 2);
        try {
            int i2 = bufferedReader.read();
            boolean zM3224 = false;
            if (i2 != 239) {
                while (i2 != -1 && Character.isWhitespace(i2)) {
                    i2 = bufferedReader.read();
                }
                i = 0;
                while (true) {
                    if (i < 7) {
                        while (i2 != -1 && Character.isWhitespace(i2) && !AbstractC0956.m3224(i2)) {
                            i2 = bufferedReader.read();
                        }
                        zM3224 = AbstractC0956.m3224(i2);
                    } else {
                        if (i2 != "#EXTM3U".charAt(i)) {
                            break;
                        }
                        i2 = bufferedReader.read();
                        i++;
                    }
                }
            } else if (bufferedReader.read() == 187 && bufferedReader.read() == 191) {
                i2 = bufferedReader.read();
                while (i2 != -1) {
                    i2 = bufferedReader.read();
                }
                i = 0;
                while (true) {
                    if (i < 7) {
                    }
                    i2 = bufferedReader.read();
                    i++;
                }
            }
            if (!zM3224) {
                throw ParserException.m355("Input does not start with the #EXTM3U header.", null);
            }
            while (true) {
                String line = bufferedReader.readLine();
                if (line == null) {
                    AbstractC0956.m3228(bufferedReader);
                    throw ParserException.m355("Failed to parse the playlist, could not identify any tags.", null);
                }
                strTrim = line.trim();
                if (!strTrim.isEmpty()) {
                    if (!strTrim.startsWith("#EXT-X-STREAM-INF")) {
                        if (strTrim.startsWith("#EXT-X-TARGETDURATION") || strTrim.startsWith("#EXT-X-MEDIA-SEQUENCE") || strTrim.startsWith("#EXTINF") || strTrim.startsWith("#EXT-X-KEY") || strTrim.startsWith("#EXT-X-BYTERANGE") || strTrim.equals("#EXT-X-DISCONTINUITY") || strTrim.equals("#EXT-X-DISCONTINUITY-SEQUENCE") || strTrim.equals("#EXT-X-ENDLIST")) {
                            break;
                        }
                        arrayDeque.add(strTrim);
                    } else {
                        arrayDeque.add(strTrim);
                        return m9418(new ᵯᵨᵲ(arrayDeque, bufferedReader), uri, c1497);
                    }
                }
            }
            arrayDeque.add(strTrim);
            return m9424(this.f16798, this.f16799, new ᵯᵨᵲ(arrayDeque, bufferedReader), uri, c1497);
        } finally {
            AbstractC0956.m3228(bufferedReader);
        }
    }
}
