package defpackage;

import android.util.Pair;
import java.util.ArrayList;

/* JADX INFO: renamed from: ˋˉˉ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C1472 {

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public boolean f5976;

    /* JADX INFO: renamed from: ˋˈ, reason: contains not printable characters */
    public int f5977;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final C5084 f5978;

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

    /* JADX INFO: renamed from: ᵟᵹᵙ, reason: contains not printable characters */
    public long f5980;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final ᵳᵢᵺ f5981;

    /* JADX INFO: renamed from: ᵪᵹᵥᵻ, reason: contains not printable characters */
    public Object f5982;

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

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

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public int f5987;

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

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final C3086 f5989;

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public C1091 f5990;

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public long f5991;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final C4593 f5986 = new C4593();

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final C5201 f5975 = new C5201();

    /* JADX INFO: renamed from: ᵱʡˏ, reason: contains not printable characters */
    public ArrayList f5984 = new ArrayList();

    public C1472(C5084 c5084, C3086 c3086, ᵳᵢᵺ r3, C1917 c1917) {
        this.f5978 = c5084;
        this.f5989 = c3086;
        this.f5981 = r3;
    }

    /* JADX INFO: renamed from: ᵪᵹᵥᵻ, reason: contains not printable characters */
    public static C4100 m4214(AbstractC4975 abstractC4975, Object obj, long j, long j2, C5201 c5201, C4593 c4593) {
        abstractC4975.mo7165(obj, c4593);
        abstractC4975.m10284(c4593.f17476, c5201);
        abstractC4975.mo1663(obj);
        int i = c4593.f17479.f4810;
        if (i != 0) {
            if (i == 1) {
                c4593.m9684(0);
            }
            c4593.f17479.getClass();
            c4593.m9682(0);
        }
        abstractC4975.mo7165(obj, c4593);
        int iM9679 = c4593.m9679(j);
        return iM9679 == -1 ? new C4100(obj, j2, c4593.m9677(j)) : new C4100(obj, iM9679, c4593.m9680(iM9679), j2, -1);
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final void m4215() {
        if (this.f5977 == 0) {
            return;
        }
        C1091 c1091 = this.f5990;
        c1091.getClass();
        this.f5982 = c1091.f4636;
        this.f5980 = c1091.f4647.f11205.f15714;
        while (c1091 != null) {
            c1091.m3540();
            c1091 = c1091.f4640;
        }
        this.f5990 = null;
        this.f5983 = null;
        this.f5985 = null;
        this.f5988 = null;
        this.f5977 = 0;
        m4224();
    }

    /* JADX WARN: Removed duplicated region for block: B:61:0x00c9  */
    /* JADX INFO: renamed from: ˉᵲ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final int m4216(AbstractC4975 abstractC4975, long j, long j2, long j3) {
        long j4;
        int i;
        C2909 c2909M6976;
        int i2;
        C1091 c1091 = this.f5990;
        C1091 c10912 = null;
        while (c1091 != null) {
            C2909 c2909 = c1091.f4647;
            if (c10912 != null) {
                C2909 c2909M4220 = m4220(abstractC4975, c10912, j);
                if (c2909M4220 != null) {
                    long j5 = c2909M4220.f11200;
                    C4100 c4100 = c2909.f11205;
                    long j6 = c2909.f11202;
                    j4 = -9223372036854775807L;
                    long j7 = c2909.f11200;
                    i = 0;
                    if (c4100.equals(c2909M4220.f11205)) {
                        if (j7 != j5) {
                            if (j6 != -9223372036854775807L) {
                                long j8 = c2909M4220.f11202;
                                if (j8 != -9223372036854775807L) {
                                    if (Math.abs((j5 - j8) - (j7 - j6)) >= 5000000) {
                                    }
                                }
                            }
                        }
                        c2909M6976 = j7 != j5 ? c2909M4220.m6976(j7, j6) : c2909M4220;
                    }
                }
                return m4219(c10912);
            }
            c2909M6976 = m4218(abstractC4975, c2909);
            j4 = -9223372036854775807L;
            i = 0;
            long j9 = c2909M6976.f11210;
            long j10 = c2909.f11208;
            long j11 = c2909.f11210;
            c1091.f4647 = c2909M6976.m6977(j10);
            if (j11 != j9) {
                c1091.m3538();
                long j12 = j9 == j4 ? Long.MAX_VALUE : j9 + c1091.f4641;
                int i3 = 1;
                int i4 = (c1091 != this.f5985 || c1091.f4647.f11201 || (j2 != Long.MIN_VALUE && j2 < j12)) ? i : 1;
                int i5 = (c1091 != this.f5988 || (j3 != Long.MIN_VALUE && j3 < j12)) ? i : 1;
                int iM4219 = m4219(c1091);
                if (iM4219 != 0) {
                    return iM4219;
                }
                if (j11 == j4 && c2909.f11203 == Long.MIN_VALUE) {
                    long j13 = c2909M6976.f11203;
                    if (j13 != j4 && j13 != Long.MIN_VALUE) {
                        i2 = 1;
                    }
                } else {
                    i2 = i;
                }
                if (i4 == 0 || (j11 == j4 && i2 == 0)) {
                    i3 = i;
                }
                return i5 != 0 ? i3 | 2 : i3;
            }
            c10912 = c1091;
            c1091 = c1091.f4640;
        }
        return 0;
    }

    /* JADX INFO: renamed from: ˊᵙᵾᵲ, reason: contains not printable characters */
    public final int m4217(AbstractC4975 abstractC4975) {
        AbstractC4975 abstractC49752;
        C1091 c1091;
        C1091 c10912 = this.f5990;
        if (c10912 == null) {
            return 0;
        }
        int iMo1663 = abstractC4975.mo1663(c10912.f4636);
        while (true) {
            abstractC49752 = abstractC4975;
            iMo1663 = abstractC49752.m10287(iMo1663, this.f5986, this.f5975, this.f5987, this.f5976);
            while (true) {
                c1091 = c10912.f4640;
                if (c1091 == null || c10912.f4647.f11209) {
                    break;
                }
                c10912 = c1091;
            }
            if (iMo1663 == -1 || c1091 == null || abstractC49752.mo1663(c1091.f4636) != iMo1663) {
                break;
            }
            c10912 = c1091;
            abstractC4975 = abstractC49752;
        }
        int iM4219 = m4219(c10912);
        c10912.f4647 = m4218(abstractC49752, c10912.f4647);
        return iM4219;
    }

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public final C2909 m4218(AbstractC4975 abstractC4975, C2909 c2909) {
        long j;
        C4100 c4100 = c2909.f11205;
        boolean zM8958 = c4100.m8958();
        int i = c4100.f15712;
        boolean z = !zM8958 && i == -1;
        int i2 = c4100.f15710;
        boolean zM4226 = m4226(abstractC4975, c4100);
        boolean zM4231 = m4231(abstractC4975, c4100, z);
        Object obj = c4100.f15713;
        C4593 c4593 = this.f5986;
        abstractC4975.mo7165(obj, c4593);
        if (c4100.m8958() || i == -1) {
            j = -9223372036854775807L;
        } else {
            c4593.m9683(i);
            j = 0;
        }
        long jM9681 = c4100.m8958() ? c4593.m9681(i2, c4100.f15711) : (j == -9223372036854775807L || j == Long.MIN_VALUE) ? c4593.f17480 : j;
        if (c4100.m8958()) {
            c4593.m9682(i2);
        } else if (i != -1) {
            c4593.m9682(i);
        }
        return new C2909(c4100, c2909.f11200, c2909.f11202, c2909.f11208, j, jM9681, c2909.f11206, false, z, zM4226, zM4231);
    }

    /* JADX INFO: renamed from: ˋˈ, reason: contains not printable characters */
    public final int m4219(C1091 c1091) {
        c1091.getClass();
        int i = 0;
        if (c1091 != this.f5983) {
            this.f5983 = c1091;
            while (true) {
                c1091 = c1091.f4640;
                if (c1091 == null) {
                    break;
                }
                if (c1091 == this.f5985) {
                    C1091 c10912 = this.f5990;
                    this.f5985 = c10912;
                    this.f5988 = c10912;
                    i = 3;
                }
                if (c1091 == this.f5988) {
                    this.f5988 = this.f5985;
                    i |= 2;
                }
                c1091.m3540();
                this.f5977--;
            }
            C1091 c10913 = this.f5983;
            c10913.getClass();
            if (c10913.f4640 != null) {
                c10913.m3531();
                c10913.f4640 = null;
                c10913.m3533();
            }
            m4224();
        }
        return i;
    }

    /* JADX WARN: Removed duplicated region for block: B:22:0x008a  */
    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final C2909 m4220(AbstractC4975 abstractC4975, C1091 c1091, long j) {
        AbstractC4975 abstractC49752;
        long j2;
        C2909 c2909;
        C4593 c4593;
        C4100 c4100;
        Object obj;
        long j3;
        long j4;
        long j5;
        long jMax;
        Pair pairM10286;
        long jM4225;
        C2909 c29092 = c1091.f4647;
        long j6 = (c1091.f4641 + c29092.f11210) - j;
        boolean z = c29092.f11209;
        C5201 c5201 = this.f5975;
        long j7 = 0;
        long jMax2 = -9223372036854775807L;
        if (!z) {
            C4100 c41002 = c29092.f11205;
            Object obj2 = c41002.f15713;
            int i = c41002.f15712;
            C4593 c45932 = this.f5986;
            abstractC4975.mo7165(obj2, c45932);
            boolean z2 = c29092.f11201;
            if (!c41002.m8958()) {
                if (i != -1) {
                    c45932.m9684(i);
                }
                int iM9680 = c45932.m9680(i);
                c45932.m9682(i);
                if (iM9680 != c45932.f17479.m3614(i).f13279) {
                    return m4223(abstractC4975, c41002.f15713, c41002.f15712, iM9680, c29092.f11210, c41002.f15714, z2);
                }
                abstractC4975.mo7165(obj2, c45932);
                c45932.m9683(i);
                c45932.f17479.m3614(i).getClass();
                return m4232(abstractC4975, c41002.f15713, 0L, -9223372036854775807L, c29092.f11210, c41002.f15714, false);
            }
            int i2 = c41002.f15710;
            int i3 = c45932.f17479.m3614(i2).f13279;
            if (i3 != -1) {
                int iM7859 = c45932.f17479.m3614(i2).m7859(c41002.f15711);
                if (iM7859 < i3) {
                    return m4223(abstractC4975, c41002.f15713, i2, iM7859, c29092.f11208, c41002.f15714, z2);
                }
                long jLongValue = c29092.f11208;
                if (jLongValue == -9223372036854775807L) {
                    int i4 = c45932.f17476;
                    if (c45932.f17480 == -9223372036854775807L) {
                        abstractC4975.m10284(i4, c5201);
                        if (c5201.f19590 && !c5201.f19597) {
                            jMax2 = Math.max(0L, j6);
                        }
                    }
                    long j8 = jMax2;
                    abstractC49752 = abstractC4975;
                    Pair pairM102862 = abstractC49752.m10286(this.f5975, c45932, c45932.f17476, -9223372036854775807L, j8);
                    if (pairM102862 != null) {
                        jLongValue = ((Long) pairM102862.second).longValue();
                        j2 = j8;
                    }
                } else {
                    abstractC49752 = abstractC4975;
                    j2 = -9223372036854775807L;
                }
                int i5 = c41002.f15710;
                abstractC49752.mo7165(obj2, c45932);
                c45932.m9683(i5);
                c45932.f17479.m3614(i5).getClass();
                return m4232(abstractC49752, c41002.f15713, Math.max(0L, jLongValue), j2, c29092.f11208, c41002.f15714, z2);
            }
            return null;
        }
        C2909 c29093 = c1091.f4647;
        C4100 c41003 = c29093.f11205;
        long j9 = c29093.f11208;
        int iM10287 = abstractC4975.m10287(abstractC4975.mo1663(c41003.f15713), this.f5986, this.f5975, this.f5987, this.f5976);
        if (iM10287 != -1) {
            C4593 c45933 = this.f5986;
            int i6 = abstractC4975.mo1666(iM10287, c45933, true).f17476;
            Object obj3 = c45933.f17475;
            obj3.getClass();
            long j10 = c41003.f15714;
            c2909 = null;
            if (abstractC4975.mo1664(i6, c5201, 0L).f19593 == iM10287) {
                int i7 = c45933.f17476;
                if (c45933.f17480 == -9223372036854775807L) {
                    abstractC4975.m10284(i7, c5201);
                    if (c5201.f19590 && !c5201.f19597) {
                        jMax = Math.max(0L, j6);
                    }
                    c4100 = c41003;
                    long j11 = jMax;
                    c4593 = c45933;
                    pairM10286 = abstractC4975.m10286(this.f5975, this.f5986, i6, -9223372036854775807L, j11);
                    if (pairM10286 != null) {
                        Object obj4 = pairM10286.first;
                        long jLongValue2 = ((Long) pairM10286.second).longValue();
                        C1091 c10912 = c1091.f4640;
                        if (c10912 == null || !c10912.f4636.equals(obj4)) {
                            jM4225 = m4225(obj4);
                            if (jM4225 == -1) {
                                jM4225 = this.f5991;
                                this.f5991 = 1 + jM4225;
                            }
                        } else {
                            jM4225 = c10912.f4647.f11205.f15714;
                        }
                        obj = obj4;
                        j3 = jM4225;
                        j5 = j11;
                        j4 = jLongValue2;
                        j7 = -9223372036854775807L;
                    }
                }
                jMax = -9223372036854775807L;
                c4100 = c41003;
                long j112 = jMax;
                c4593 = c45933;
                pairM10286 = abstractC4975.m10286(this.f5975, this.f5986, i6, -9223372036854775807L, j112);
                if (pairM10286 != null) {
                }
            } else {
                c4593 = c45933;
                c4100 = c41003;
                obj = obj3;
                j3 = j10;
                j4 = 0;
                j5 = -9223372036854775807L;
            }
            C4100 c4100M4214 = m4214(abstractC4975, obj, j4, j3, this.f5975, this.f5986);
            if (j7 != -9223372036854775807L && j9 != -9223372036854775807L) {
                int i8 = abstractC4975.mo7165(c4100.f15713, c4593).f17479.f4810;
                c4593.f17479.getClass();
                if (i8 > 0) {
                    c4593.m9682(0);
                }
            }
            return m4230(abstractC4975, c4100M4214, j7, j4, j5);
        }
        c2909 = null;
        return c2909;
    }

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public final void m4221(long j) {
        C1091 c1091 = this.f5983;
        if (c1091 != null) {
            ᵻᵪ.ˌᴵ(c1091.f4640 == null);
            if (c1091.f4642) {
                c1091.f4646.mo3623(j - c1091.f4641);
            }
        }
    }

    /* JADX INFO: renamed from: ᵟᵹᵙ, reason: contains not printable characters */
    public final C4100 m4222(AbstractC4975 abstractC4975, Object obj, long j) {
        long jM4225;
        int iMo1663;
        Object obj2 = obj;
        C4593 c4593 = this.f5986;
        int i = abstractC4975.mo7165(obj2, c4593).f17476;
        Object obj3 = this.f5982;
        if (obj3 == null || (iMo1663 = abstractC4975.mo1663(obj3)) == -1 || abstractC4975.mo1666(iMo1663, c4593, false).f17476 != i) {
            C1091 c1091 = this.f5990;
            while (true) {
                if (c1091 == null) {
                    C1091 c10912 = this.f5990;
                    while (true) {
                        if (c10912 != null) {
                            int iMo16632 = abstractC4975.mo1663(c10912.f4636);
                            if (iMo16632 != -1 && abstractC4975.mo1666(iMo16632, c4593, false).f17476 == i) {
                                jM4225 = c10912.f4647.f11205.f15714;
                                break;
                            }
                            c10912 = c10912.f4640;
                        } else {
                            jM4225 = m4225(obj2);
                            if (jM4225 == -1) {
                                jM4225 = this.f5991;
                                this.f5991 = 1 + jM4225;
                                if (this.f5990 == null) {
                                    this.f5982 = obj2;
                                    this.f5980 = jM4225;
                                }
                            }
                        }
                    }
                } else {
                    if (c1091.f4636.equals(obj2)) {
                        jM4225 = c1091.f4647.f11205.f15714;
                        break;
                    }
                    c1091 = c1091.f4640;
                }
            }
        } else {
            jM4225 = this.f5980;
        }
        abstractC4975.mo7165(obj2, c4593);
        int i2 = c4593.f17476;
        C5201 c5201 = this.f5975;
        abstractC4975.m10284(i2, c5201);
        boolean z = false;
        for (int iMo16633 = abstractC4975.mo1663(obj); iMo16633 >= c5201.f19593; iMo16633--) {
            abstractC4975.mo1666(iMo16633, c4593, true);
            boolean z2 = c4593.f17479.f4810 > 0;
            z |= z2;
            if (c4593.m9679(c4593.f17480) != -1) {
                obj2 = c4593.f17475;
                obj2.getClass();
            }
            if (z && (!z2 || c4593.f17480 != 0)) {
                break;
            }
        }
        return m4214(abstractC4975, obj2, j, jM4225, this.f5975, this.f5986);
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final C2909 m4223(AbstractC4975 abstractC4975, Object obj, int i, int i2, long j, long j2, boolean z) {
        C4100 c4100 = new C4100(obj, i, i2, j2, -1);
        C4593 c4593 = this.f5986;
        long jM9681 = abstractC4975.mo7165(obj, c4593).m9681(i, i2);
        if (i2 == c4593.m9680(i)) {
            c4593.f17479.getClass();
        }
        c4593.m9682(i);
        long jMax = 0;
        if (jM9681 != -9223372036854775807L && 0 >= jM9681) {
            jMax = Math.max(0L, jM9681 - 1);
        }
        return new C2909(c4100, jMax, -9223372036854775807L, j, -9223372036854775807L, jM9681, z, false, false, false, false);
    }

    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public final void m4224() {
        C3975 c3975M9561 = AbstractC4509.m9561();
        for (C1091 c1091 = this.f5990; c1091 != null; c1091 = c1091.f4640) {
            c3975M9561.m7406(c1091.f4647.f11205);
        }
        C1091 c10912 = this.f5985;
        this.f5989.m7175(new RunnableC3304(this, c3975M9561, c10912 == null ? null : c10912.f4647.f11205, 9));
    }

    /* JADX INFO: renamed from: ᵱʡˏ, reason: contains not printable characters */
    public final long m4225(Object obj) {
        for (int i = 0; i < this.f5984.size(); i++) {
            C1091 c1091 = (C1091) this.f5984.get(i);
            if (c1091.f4636.equals(obj)) {
                return c1091.f4647.f11205.f15714;
            }
        }
        return -1L;
    }

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public final boolean m4226(AbstractC4975 abstractC4975, C4100 c4100) {
        boolean z = !c4100.m8958() && c4100.f15712 == -1;
        Object obj = c4100.f15713;
        if (z) {
            if (abstractC4975.mo1664(abstractC4975.mo7165(obj, this.f5986).f17476, this.f5975, 0L).f19591 == abstractC4975.mo1663(obj)) {
                return true;
            }
        }
        return false;
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final C1091 m4227() {
        C1091 c1091 = this.f5990;
        if (c1091 == null) {
            return null;
        }
        if (c1091 == this.f5985) {
            this.f5985 = c1091.f4640;
        }
        if (c1091 == this.f5988) {
            this.f5988 = c1091.f4640;
        }
        c1091.m3540();
        int i = this.f5977 - 1;
        this.f5977 = i;
        if (i == 0) {
            this.f5983 = null;
            C1091 c10912 = this.f5990;
            this.f5982 = c10912.f4636;
            this.f5980 = c10912.f4647.f11205.f15714;
        }
        this.f5990 = this.f5990.f4640;
        m4224();
        return this.f5990;
    }

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final C1091 m4228() {
        return this.f5988;
    }

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public final void m4229() {
        C1091 c1091 = this.f5979;
        if (c1091 == null || c1091.m3532()) {
            this.f5979 = null;
            for (int i = 0; i < this.f5984.size(); i++) {
                C1091 c10912 = (C1091) this.f5984.get(i);
                if (!c10912.m3532()) {
                    this.f5979 = c10912;
                    return;
                }
            }
        }
    }

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final C2909 m4230(AbstractC4975 abstractC4975, C4100 c4100, long j, long j2, long j3) {
        abstractC4975.mo7165(c4100.f15713, this.f5986);
        boolean zM8958 = c4100.m8958();
        Object obj = c4100.f15713;
        return zM8958 ? m4223(abstractC4975, obj, c4100.f15710, c4100.f15711, j, c4100.f15714, false) : m4232(abstractC4975, obj, j2, j3, j, c4100.f15714, false);
    }

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public final boolean m4231(AbstractC4975 abstractC4975, C4100 c4100, boolean z) {
        int iMo1663 = abstractC4975.mo1663(c4100.f15713);
        if (!abstractC4975.mo1664(abstractC4975.mo1666(iMo1663, this.f5986, false).f17476, this.f5975, 0L).f19590) {
            if (abstractC4975.m10287(iMo1663, this.f5986, this.f5975, this.f5987, this.f5976) == -1 && z) {
                return true;
            }
        }
        return false;
    }

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public final C2909 m4232(AbstractC4975 abstractC4975, Object obj, long j, long j2, long j3, long j4, boolean z) {
        long j5;
        C4593 c4593 = this.f5986;
        abstractC4975.mo7165(obj, c4593);
        int iM9677 = c4593.m9677(j);
        boolean z2 = false;
        if (iM9677 != -1) {
            c4593.m9682(iM9677);
        } else if (c4593.f17479.f4810 > 0) {
            c4593.m9682(0);
        }
        C4100 c4100 = new C4100(obj, j4, iM9677);
        if (!c4100.m8958() && iM9677 == -1) {
            z2 = true;
        }
        boolean zM4226 = m4226(abstractC4975, c4100);
        boolean zM4231 = m4231(abstractC4975, c4100, z2);
        if (iM9677 != -1) {
            c4593.m9682(iM9677);
        }
        if (iM9677 != -1) {
            c4593.m9684(iM9677);
        }
        if (iM9677 != -1) {
            c4593.m9683(iM9677);
            j5 = 0;
        } else {
            j5 = -9223372036854775807L;
        }
        long j6 = (j5 == -9223372036854775807L || j5 == Long.MIN_VALUE) ? c4593.f17480 : j5;
        return new C2909(c4100, (j6 == -9223372036854775807L || j < j6) ? j : Math.max(0L, j6 - 1), j2, j3, j5, j6, z, false, z2, zM4226, zM4231);
    }
}
