package A;

import androidx.core.location.LocationRequestCompat;

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

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private final long f143a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private long f144b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private volatile long f145c = Long.MIN_VALUE;

    public n(long j2) {
        this.f143a = j2;
    }

    public static long c(long j2) {
        return (j2 * 1000000) / 90000;
    }

    public static long e(long j2) {
        return (j2 * 90000) / 1000000;
    }

    public long a(long j2) {
        if (this.f145c != Long.MIN_VALUE) {
            long j3 = (this.f145c + 4294967296L) / 8589934592L;
            long j4 = ((j3 - 1) * 8589934592L) + j2;
            j2 += j3 * 8589934592L;
            if (Math.abs(j4 - this.f145c) < Math.abs(j2 - this.f145c)) {
                j2 = j4;
            }
        }
        long jC = c(j2);
        if (this.f143a != LocationRequestCompat.PASSIVE_INTERVAL && this.f145c == Long.MIN_VALUE) {
            this.f144b = this.f143a - jC;
        }
        this.f145c = j2;
        return jC + this.f144b;
    }

    public boolean b() {
        return this.f145c != Long.MIN_VALUE;
    }

    public void d() {
        this.f145c = Long.MIN_VALUE;
    }
}
