package o;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class EP {
    public static EP h;
    public final EnumC1280gK a;
    public final C0733af0 b;
    public final C2375rr c;
    public final InterfaceC2221qA d;
    public final C0733af0 e;
    public float f = Float.NaN;
    public float g = Float.NaN;

    public EP(EnumC1280gK enumC1280gK, C0733af0 c0733af0, C2375rr c2375rr, InterfaceC2221qA interfaceC2221qA) {
        this.a = enumC1280gK;
        this.b = c0733af0;
        this.c = c2375rr;
        this.d = interfaceC2221qA;
        this.e = AbstractC2001nt0.E(c0733af0, enumC1280gK);
    }

    public final long a(int i, long j) {
        int i2;
        float f = this.g;
        float f2 = this.f;
        if (Float.isNaN(f) || Float.isNaN(f2)) {
            String str = FP.a;
            long jB = AbstractC0842bm.b(0, 0, 15);
            C0733af0 c0733af0 = this.e;
            C2375rr c2375rr = this.c;
            float fB = AbstractC0249Jp.h(str, c0733af0, jB, c2375rr, this.d, 1, 96).b();
            float fB2 = AbstractC0249Jp.h(FP.b, this.e, AbstractC0842bm.b(0, 0, 15), c2375rr, this.d, 2, 96).b() - fB;
            this.g = fB;
            this.f = fB2;
            f2 = fB2;
            f = fB;
        }
        if (i != 1) {
            int iRound = Math.round((f2 * (i - 1)) + f);
            i2 = iRound >= 0 ? iRound : 0;
            int iG = C0634Yl.g(j);
            if (i2 > iG) {
                i2 = iG;
            }
        } else {
            i2 = C0634Yl.i(j);
        }
        return AbstractC0842bm.a(C0634Yl.j(j), C0634Yl.h(j), i2, C0634Yl.g(j));
    }
}
