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

import java.math.RoundingMode;

/* JADX INFO: loaded from: classes2.dex */
public final class e4 {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    public e4(int i10, d4 d4Var, u3 u3Var) {
        this.f10613a = d4Var;
        int iA = d4Var.a();
        boolean z10 = true;
        if (iA != 1) {
            if (iA == 2) {
                iA = 2;
            } else {
                z10 = false;
            }
        }
        ih1.x(z10);
        int i11 = ((i10 / 10) + 48) | (((i10 % 10) + 48) << 8);
        this.f10615c = (iA == 2 ? 1667497984 : 1651965952) | i11;
        long j10 = ((long) d4Var.f10176b) * 1000000;
        long j11 = d4Var.f10177c;
        RoundingMode roundingMode = RoundingMode.DOWN;
        int i12 = d4Var.f10178d;
        this.f10617e = bb1.r(i12, j10, j11, roundingMode);
        this.f10614b = u3Var;
        this.f10616d = iA == 2 ? 1650720768 | i11 : -1;
        this.f10624l = -1L;
        this.f10625m = new long[512];
        this.f10626n = new int[512];
        this.f10618f = i12;
    }

    public final j3 a(long j10) {
        if (this.f10623k == 0) {
            l3 l3Var = new l3(0L, this.f10624l);
            return new j3(l3Var, l3Var);
        }
        int i10 = (int) (j10 / ((this.f10617e * ((long) 1)) / ((long) this.f10618f)));
        int iM = bb1.m(this.f10626n, i10, true, true);
        if (this.f10626n[iM] == i10) {
            l3 l3VarB = b(iM);
            return new j3(l3VarB, l3VarB);
        }
        l3 l3VarB2 = b(iM);
        int i11 = iM + 1;
        return i11 < this.f10625m.length ? new j3(l3VarB2, b(i11)) : new j3(l3VarB2, l3VarB2);
    }

    public final l3 b(int i10) {
        return new l3(((this.f10617e * ((long) 1)) / ((long) this.f10618f)) * ((long) this.f10626n[i10]), this.f10625m[i10]);
    }
}
