package defpackage;

import java.util.List;

/* JADX INFO: renamed from: ᵭᵟᵔ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C4157 extends AbstractC4975 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final long f15855;

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public final long f15856;

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

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final int f15858;

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public final C4838 f15859;

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final long f15860;

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public final C0707 f15861;

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

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public final C2906 f15863;

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

    public C4157(long j, long j2, long j3, int i, long j4, long j5, long j6, C2906 c2906, C4838 c4838, C0707 c0707) {
        ᵻᵪ.ˌᴵ(c2906.f11185 == (c0707 != null));
        this.f15855 = j;
        this.f15857 = j2;
        this.f15862 = j3;
        this.f15858 = i;
        this.f15864 = j4;
        this.f15860 = j5;
        this.f15856 = j6;
        this.f15863 = c2906;
        this.f15859 = c4838;
        this.f15861 = c0707;
    }

    @Override // defpackage.AbstractC4975
    /* JADX INFO: renamed from: ʽˈˋ */
    public final int mo1663(Object obj) {
        int iIntValue;
        if ((obj instanceof Integer) && (iIntValue = ((Integer) obj).intValue() - this.f15858) >= 0 && iIntValue < mo5884()) {
            return iIntValue;
        }
        return -1;
    }

    @Override // defpackage.AbstractC4975
    /* JADX INFO: renamed from: ˊᵫᵗ */
    public final int mo5884() {
        return this.f15863.f11178.size();
    }

    /* JADX WARN: Removed duplicated region for block: B:44:0x00c7  */
    @Override // defpackage.AbstractC4975
    /* JADX INFO: renamed from: ᵝᵶ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final C5201 mo1664(int i, C5201 c5201, long j) {
        boolean z;
        long j2;
        long j3;
        long j4;
        InterfaceC1674 interfaceC1674Mo2987;
        ᵻᵪ.ˋˈ(i, 1);
        C2906 c2906 = this.f15863;
        boolean z2 = c2906.f11185;
        long jMo3007 = this.f15856;
        if (z2 && c2906.f11179 != -9223372036854775807L && c2906.f11175 == -9223372036854775807L) {
            long j5 = 0;
            if (j > 0) {
                jMo3007 += j;
                if (jMo3007 > this.f15860) {
                    z = true;
                    j3 = -9223372036854775807L;
                    j2 = -9223372036854775807L;
                    Object obj = C5201.f19587;
                    c5201.m10742(this.f15859, c2906, this.f15855, this.f15857, this.f15862, true, (c2906.f11185 || c2906.f11179 == j2 || c2906.f11175 != j2) ? false : z, this.f15861, j3, this.f15860, mo5884() - 1, this.f15864);
                    return c5201;
                }
            }
            long j6 = this.f15864 + jMo3007;
            long jM6972 = c2906.m6972(0);
            int i2 = 0;
            while (i2 < c2906.f11178.size() - 1 && j6 >= jM6972) {
                j6 -= jM6972;
                i2++;
                jM6972 = c2906.m6972(i2);
            }
            C1736 c1736M6970 = c2906.m6970(i2);
            List list = c1736M6970.f6965;
            z = true;
            int size = list.size();
            j2 = -9223372036854775807L;
            int i3 = 0;
            while (true) {
                if (i3 >= size) {
                    j4 = j5;
                    i3 = -1;
                    break;
                }
                j4 = j5;
                if (((C2104) list.get(i3)).f8363 == 2) {
                    break;
                }
                i3++;
                j5 = j4;
            }
            if (i3 != -1 && (interfaceC1674Mo2987 = ((AbstractC0841) ((C2104) c1736M6970.f6965.get(i3)).f8364.get(0)).mo2987()) != null && interfaceC1674Mo2987.mo3009(jM6972) != j4) {
                jMo3007 = (interfaceC1674Mo2987.mo3007(interfaceC1674Mo2987.mo3001(j6, jM6972)) + jMo3007) - j6;
            }
        } else {
            z = true;
            j2 = -9223372036854775807L;
        }
        j3 = jMo3007;
        Object obj2 = C5201.f19587;
        c5201.m10742(this.f15859, c2906, this.f15855, this.f15857, this.f15862, true, (c2906.f11185 || c2906.f11179 == j2 || c2906.f11175 != j2) ? false : z, this.f15861, j3, this.f15860, mo5884() - 1, this.f15864);
        return c5201;
    }

    @Override // defpackage.AbstractC4975
    /* JADX INFO: renamed from: ᵪᵹᵥᵻ */
    public final int mo5885() {
        return 1;
    }

    @Override // defpackage.AbstractC4975
    /* JADX INFO: renamed from: ᵮᵣᵗˈ */
    public final Object mo1665(int i) {
        ᵻᵪ.ˋˈ(i, mo5884());
        return Integer.valueOf(this.f15858 + i);
    }

    @Override // defpackage.AbstractC4975
    /* JADX INFO: renamed from: ᵻˈᵦʼ */
    public final C4593 mo1666(int i, C4593 c4593, boolean z) {
        ᵻᵪ.ˋˈ(i, mo5884());
        C2906 c2906 = this.f15863;
        String str = z ? c2906.m6970(i).f6966 : null;
        Integer numValueOf = z ? Integer.valueOf(this.f15858 + i) : null;
        long jM6972 = c2906.m6972(i);
        long jM3214 = AbstractC0956.m3214(c2906.m6970(i).f6964 - c2906.m6970(0).f6964) - this.f15864;
        c4593.getClass();
        c4593.m9678(str, numValueOf, 0, jM6972, jM3214, C1124.f4807, false);
        return c4593;
    }
}
