package U;

import T0.O;
import X0.InterfaceC0807u;
import a.AbstractC0872a;
import e4.C;
import h1.C2069a;

/* JADX INFO: loaded from: classes.dex */
public final class b {

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public static b f6726h;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final h1.m f6727a;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final h1.d f6729c;

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

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public float f6732f = Float.NaN;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public float f6733g = Float.NaN;

    public b(h1.m mVar, O o6, h1.d dVar, InterfaceC0807u interfaceC0807u) {
        this.f6727a = mVar;
        this.f6728b = o6;
        this.f6729c = dVar;
        this.f6730d = interfaceC0807u;
        this.f6731e = C.d0(o6, mVar);
    }

    public final long a(int i6, long j4) {
        int i7;
        float f6 = this.f6733g;
        float f7 = this.f6732f;
        if (Float.isNaN(f6) || Float.isNaN(f7)) {
            String str = c.f6734a;
            long jB = h1.b.b(0, 0, 15);
            h1.d dVar = this.f6729c;
            float fB = AbstractC0872a.k(str, this.f6731e, jB, dVar, this.f6730d, 1, 96).b();
            float fB2 = AbstractC0872a.k(c.f6735b, this.f6731e, h1.b.b(0, 0, 15), dVar, this.f6730d, 2, 96).b() - fB;
            this.f6733g = fB;
            this.f6732f = fB2;
            f7 = fB2;
            f6 = fB;
        }
        if (i6 != 1) {
            int iRound = Math.round((f7 * (i6 - 1)) + f6);
            i7 = iRound >= 0 ? iRound : 0;
            int iG = C2069a.g(j4);
            if (i7 > iG) {
                i7 = iG;
            }
        } else {
            i7 = C2069a.i(j4);
        }
        return h1.b.a(C2069a.j(j4), C2069a.h(j4), i7, C2069a.g(j4));
    }
}
