package y;

import com.google.android.gms.maps.model.BitmapDescriptorFactory;

/* loaded from: classes.dex */
public final class k0 implements h0 {

    /* renamed from: a, reason: collision with root package name */
    private final int f51188a;

    /* renamed from: b, reason: collision with root package name */
    private final int f51189b;

    /* renamed from: c, reason: collision with root package name */
    private final d0 f51190c;

    /* renamed from: d, reason: collision with root package name */
    private final long f51191d;

    /* renamed from: e, reason: collision with root package name */
    private final long f51192e;

    public k0(int i10, int i11, d0 d0Var) {
        this.f51188a = i10;
        this.f51189b = i11;
        this.f51190c = d0Var;
        this.f51191d = i10 * 1000000;
        this.f51192e = i11 * 1000000;
    }

    private final long f(long j10) {
        long l10;
        l10 = jn.o.l(j10 - this.f51192e, 0L, this.f51191d);
        return l10;
    }

    @Override // y.h0
    public float b(long j10, float f10, float f11, float f12) {
        long f13 = f(j10);
        if (f13 < 0) {
            return BitmapDescriptorFactory.HUE_RED;
        }
        if (f13 == 0) {
            return f12;
        }
        return (e(f13, f10, f11, f12) - e(f13 - 1000000, f10, f11, f12)) * 1000.0f;
    }

    @Override // y.h0
    public long c(float f10, float f11, float f12) {
        return (this.f51189b + this.f51188a) * 1000000;
    }

    @Override // y.h0
    public float e(long j10, float f10, float f11, float f12) {
        float f13 = this.f51188a == 0 ? 1.0f : ((float) f(j10)) / ((float) this.f51191d);
        d0 d0Var = this.f51190c;
        if (f13 < BitmapDescriptorFactory.HUE_RED) {
            f13 = 0.0f;
        }
        return s1.k(f10, f11, d0Var.a(f13 <= 1.0f ? f13 : 1.0f));
    }
}
