package defpackage;

/* JADX INFO: renamed from: ᵚᵲᵖ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C2744 {

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public static final C2744 f10548 = new C2744(-9223372036854775807L, -3, -1);

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public static C2744 f10549;

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

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

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final /* synthetic */ int f10552 = 1;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public int f10553;

    public /* synthetic */ C2744() {
    }

    public C2744(int i) {
        this.f10553 = i;
    }

    public C2744(long j, int i, long j2) {
        this.f10553 = i;
        this.f10550 = j;
        this.f10551 = j2;
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public static void m6638(C2744 c2744, long j, long j2, int i) {
        if ((i & 1) != 0) {
            j = 0;
        }
        if ((i & 2) != 0) {
            j2 = 0;
        }
        synchronized (c2744) {
            try {
                if (j < 0) {
                    throw new IllegalStateException("Check failed.");
                }
                if (j2 < 0) {
                    throw new IllegalStateException("Check failed.");
                }
                long j3 = c2744.f10550 + j;
                c2744.f10550 = j3;
                long j4 = c2744.f10551 + j2;
                c2744.f10551 = j4;
                if (j4 > j3) {
                    throw new IllegalStateException("Check failed.");
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public String toString() {
        switch (this.f10552) {
            case 2:
                return "WindowCounter(streamId=" + this.f10553 + ", total=" + this.f10550 + ", acknowledged=" + this.f10551 + ", unacknowledged=" + m6639() + ')';
            default:
                return super.toString();
        }
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public synchronized long m6639() {
        return this.f10550 - this.f10551;
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public void m6640(double d, double d2, long j) {
        double d3 = (0.01720197f * ((j - 946728000000L) / 8.64E7f)) + 6.24006f;
        double dSin = (Math.sin(r3 * 3.0f) * 5.236000106378924E-6d) + (Math.sin(2.0f * r3) * 3.4906598739326E-4d) + (Math.sin(d3) * 0.03341960161924362d) + d3 + 1.796593063d + 3.141592653589793d;
        double dSin2 = (Math.sin(2.0d * dSin) * (-0.0069d)) + (Math.sin(d3) * 0.0053d) + ((double) (Math.round(((double) (r2 - 9.0E-4f)) - r6) + 9.0E-4f)) + ((-d2) / 360.0d);
        double dAsin = Math.asin(Math.sin(0.4092797040939331d) * Math.sin(dSin));
        double d4 = 0.01745329238474369d * d;
        double dSin3 = (Math.sin(-0.10471975803375244d) - (Math.sin(dAsin) * Math.sin(d4))) / (Math.cos(dAsin) * Math.cos(d4));
        if (dSin3 >= 1.0d) {
            this.f10553 = 1;
            this.f10550 = -1L;
            this.f10551 = -1L;
        } else {
            if (dSin3 <= -1.0d) {
                this.f10553 = 0;
                this.f10550 = -1L;
                this.f10551 = -1L;
                return;
            }
            double dAcos = (float) (Math.acos(dSin3) / 6.283185307179586d);
            this.f10550 = Math.round((dSin2 + dAcos) * 8.64E7d) + 946728000000L;
            long jRound = Math.round((dSin2 - dAcos) * 8.64E7d) + 946728000000L;
            this.f10551 = jRound;
            if (jRound >= j || this.f10550 <= j) {
                this.f10553 = 1;
            } else {
                this.f10553 = 0;
            }
        }
    }
}
