package p138.p176.p177.p190.p198.p203;

import p000.p001.p002.p003.p004.C0567;
import p138.p176.p177.p190.p198.C3574;
import p138.p176.p177.p190.p198.InterfaceC3571;
import p138.p176.p177.p190.p239.C4150;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ೲ.ޙ.ބ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C3610 implements InterfaceC3607 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final long f10834;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final int f10835;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final long f10836;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public final long f10837;

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public final long f10838;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final long[] f10839;

    public C3610(long j, int i, long j2, long j3, long[] jArr) {
        this.f10834 = j;
        this.f10835 = i;
        this.f10836 = j2;
        this.f10839 = jArr;
        this.f10837 = j3;
        this.f10838 = j3 != -1 ? j + j3 : -1L;
    }

    @Override // p138.p176.p177.p190.p198.p203.InterfaceC3607
    /* JADX INFO: renamed from: ֏ */
    public long mo5934(long j) {
        long j2 = j - this.f10834;
        if (!mo5858() || j2 <= this.f10835) {
            return 0L;
        }
        long[] jArr = this.f10839;
        C0567.m1856(jArr);
        double d = (j2 * 256.0d) / this.f10837;
        int iM6787 = C4150.m6787(jArr, (long) d, true, true);
        long j3 = this.f10836;
        long j4 = (((long) iM6787) * j3) / 100;
        long j5 = jArr[iM6787];
        int i = iM6787 + 1;
        long j6 = (j3 * ((long) i)) / 100;
        return Math.round((j5 == (iM6787 == 99 ? 256L : jArr[i]) ? 0.0d : (d - j5) / (r0 - j5)) * (j6 - j4)) + j4;
    }

    @Override // p138.p176.p177.p190.p198.p203.InterfaceC3607
    /* JADX INFO: renamed from: ؠ */
    public long mo5935() {
        return this.f10838;
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3571
    /* JADX INFO: renamed from: ؠ */
    public InterfaceC3571.C3572 mo5857(long j) {
        if (!mo5858()) {
            return new InterfaceC3571.C3572(new C3574(0L, this.f10834 + ((long) this.f10835)));
        }
        long jM6789 = C4150.m6789(j, 0L, this.f10836);
        double d = (jM6789 * 100.0d) / this.f10836;
        double d2 = 0.0d;
        if (d > 0.0d) {
            if (d >= 100.0d) {
                d2 = 256.0d;
            } else {
                int i = (int) d;
                long[] jArr = this.f10839;
                C0567.m1856(jArr);
                double d3 = jArr[i];
                d2 = d3 + (((i == 99 ? 256.0d : r3[i + 1]) - d3) * (d - ((double) i)));
            }
        }
        return new InterfaceC3571.C3572(new C3574(jM6789, this.f10834 + C4150.m6789(Math.round((d2 / 256.0d) * this.f10837), this.f10835, this.f10837 - 1)));
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3571
    /* JADX INFO: renamed from: ހ */
    public boolean mo5858() {
        return this.f10839 != null;
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3571
    /* JADX INFO: renamed from: ށ */
    public long mo5859() {
        return this.f10836;
    }
}
