package com.google.android.gms.internal.ads;

/* JADX INFO: loaded from: classes2.dex */
public final class j6 implements o6, k3 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final long f12711a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final long f12712b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final int f12713c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final long f12714d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final int f12715e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final long f12716f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final long f12717g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final int f12718h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final int f12719i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final long f12720j;

    public j6(int i10, int i11, long j10, long j11) {
        long jMax;
        this.f12711a = j10;
        this.f12712b = j11;
        this.f12713c = i11 == -1 ? 1 : i11;
        this.f12715e = i10;
        if (j10 == -1) {
            this.f12714d = -1L;
            jMax = -9223372036854775807L;
        } else {
            long j12 = j10 - j11;
            this.f12714d = j12;
            jMax = (Math.max(0L, j12) * 8000000) / ((long) i10);
        }
        this.f12716f = jMax;
        this.f12717g = j11;
        this.f12718h = i10;
        this.f12719i = i11;
        this.f12720j = j10 == -1 ? -1L : j10;
    }

    @Override // com.google.android.gms.internal.ads.o6
    public final long a(long j10) {
        return (Math.max(0L, j10 - this.f12712b) * 8000000) / ((long) this.f12715e);
    }

    @Override // com.google.android.gms.internal.ads.k3
    public final long zza() {
        return this.f12716f;
    }

    @Override // com.google.android.gms.internal.ads.k3
    public final boolean zzb() {
        return this.f12714d != -1;
    }

    @Override // com.google.android.gms.internal.ads.k3
    public final j3 zzc(long j10) {
        long j11 = this.f12714d;
        long j12 = this.f12712b;
        if (j11 == -1) {
            l3 l3Var = new l3(0L, j12);
            return new j3(l3Var, l3Var);
        }
        int i10 = this.f12715e;
        long j13 = this.f12713c;
        long jMin = (((((long) i10) * j10) / 8000000) / j13) * j13;
        if (j11 != -1) {
            jMin = Math.min(jMin, j11 - j13);
        }
        long jMax = Math.max(jMin, 0L) + j12;
        long jMax2 = (Math.max(0L, jMax - j12) * 8000000) / ((long) i10);
        l3 l3Var2 = new l3(jMax2, jMax);
        if (j11 != -1 && jMax2 < j10) {
            long j14 = jMax + j13;
            if (j14 < this.f12711a) {
                return new j3(l3Var2, new l3((Math.max(0L, j14 - j12) * 8000000) / ((long) i10), j14));
            }
        }
        return new j3(l3Var2, l3Var2);
    }

    @Override // com.google.android.gms.internal.ads.o6
    public final long zzf() {
        return this.f12720j;
    }

    @Override // com.google.android.gms.internal.ads.o6
    public final int zzg() {
        return this.f12718h;
    }
}
