package defpackage;

import java.math.RoundingMode;

/* JADX INFO: renamed from: ʽˁᴵ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C0085 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public long f1295;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public long f1296;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public long f1297;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final ThreadLocal f1298 = new ThreadLocal();

    public C0085(long j) {
        m1138(j);
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final synchronized long m1133(long j) {
        if (j == -9223372036854775807L) {
            return -9223372036854775807L;
        }
        try {
            long j2 = this.f1296;
            if (j2 != -9223372036854775807L) {
                String str = AbstractC0956.f4222;
                long jM3218 = AbstractC0956.m3218(j2, 90000L, 1000000L, RoundingMode.DOWN);
                long j3 = (4294967296L + jM3218) / 8589934592L;
                long j4 = ((j3 - 1) * 8589934592L) + j;
                long j5 = (j3 * 8589934592L) + j;
                j = Math.abs(j4 - jM3218) < Math.abs(j5 - jM3218) ? j4 : j5;
            }
            long j6 = j;
            String str2 = AbstractC0956.f4222;
            return m1137(AbstractC0956.m3218(j6, 1000000L, 90000L, RoundingMode.DOWN));
        } catch (Throwable th) {
            throw th;
        }
    }

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public final synchronized void m1134(boolean z, long j) {
        try {
            ᵻᵪ.ˌᴵ(this.f1297 == 9223372036854775806L);
            if (m1140()) {
                return;
            }
            if (z) {
                this.f1298.set(Long.valueOf(j));
            } else {
                while (!m1140()) {
                    wait();
                }
            }
        } catch (Throwable th) {
            throw th;
        }
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final synchronized long m1135(long j) {
        if (j == -9223372036854775807L) {
            return -9223372036854775807L;
        }
        long j2 = this.f1296;
        if (j2 != -9223372036854775807L) {
            String str = AbstractC0956.f4222;
            long jM3218 = AbstractC0956.m3218(j2, 90000L, 1000000L, RoundingMode.DOWN);
            long j3 = jM3218 / 8589934592L;
            Long.signum(j3);
            long j4 = (j3 * 8589934592L) + j;
            j = j4 >= jM3218 ? j4 : ((j3 + 1) * 8589934592L) + j;
        }
        long j5 = j;
        String str2 = AbstractC0956.f4222;
        return m1137(AbstractC0956.m3218(j5, 1000000L, 90000L, RoundingMode.DOWN));
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final synchronized long m1136() {
        return this.f1295;
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final synchronized long m1137(long j) {
        if (j == -9223372036854775807L) {
            return -9223372036854775807L;
        }
        try {
            if (!m1140()) {
                long jLongValue = this.f1297;
                if (jLongValue == 9223372036854775806L) {
                    Long l = (Long) this.f1298.get();
                    l.getClass();
                    jLongValue = l.longValue();
                }
                this.f1295 = jLongValue - j;
                notifyAll();
            }
            this.f1296 = j;
            return j + this.f1295;
        } catch (Throwable th) {
            throw th;
        }
    }

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final synchronized void m1138(long j) {
        this.f1297 = j;
        this.f1295 = j == Long.MAX_VALUE ? 0L : -9223372036854775807L;
        this.f1296 = -9223372036854775807L;
    }

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final synchronized long m1139() {
        long j;
        j = this.f1297;
        if (j == Long.MAX_VALUE || j == 9223372036854775806L) {
            j = -9223372036854775807L;
        }
        return j;
    }

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public final synchronized boolean m1140() {
        return this.f1295 != -9223372036854775807L;
    }
}
