package V0;

import T0.A;
import T0.F;
import T0.y;
import java.math.RoundingMode;
import x0.AbstractC1709a;
import x0.v;

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

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

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

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

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

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public int f6839f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public int f6840g;

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

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public int f6842j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public int f6843k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public long f6844l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public long[] f6845m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public int[] f6846n;

    public e(int i, d dVar, F f3) {
        this.f6834a = dVar;
        int iB = dVar.b();
        boolean z8 = true;
        if (iB != 1 && iB != 2) {
            z8 = false;
        }
        AbstractC1709a.d(z8);
        int i5 = (((i % 10) + 48) << 8) | ((i / 10) + 48);
        this.f6836c = (iB == 2 ? 1667497984 : 1651965952) | i5;
        int i8 = dVar.f6831d;
        long j8 = ((long) dVar.f6829b) * 1000000;
        long j9 = dVar.f6830c;
        int i9 = v.f18553a;
        this.f6838e = v.S(i8, j8, j9, RoundingMode.DOWN);
        this.f6835b = f3;
        this.f6837d = iB == 2 ? i5 | 1650720768 : -1;
        this.f6844l = -1L;
        this.f6845m = new long[512];
        this.f6846n = new int[512];
        this.f6839f = i8;
    }

    public final A a(int i) {
        return new A(((this.f6838e * ((long) 1)) / ((long) this.f6839f)) * ((long) this.f6846n[i]), this.f6845m[i]);
    }

    public final y b(long j8) {
        if (this.f6843k == 0) {
            A a3 = new A(0L, this.f6844l);
            return new y(a3, a3);
        }
        int i = (int) (j8 / ((this.f6838e * ((long) 1)) / ((long) this.f6839f)));
        int iD = v.d(this.f6846n, i, true, true);
        if (this.f6846n[iD] == i) {
            A a8 = a(iD);
            return new y(a8, a8);
        }
        A a9 = a(iD);
        int i5 = iD + 1;
        return i5 < this.f6845m.length ? new y(a9, a(i5)) : new y(a9, a9);
    }
}
