package c3;

import L1.A;
import a3.j;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final long f4737d = TimeUnit.HOURS.toMillis(24);

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static final long f4738e = TimeUnit.MINUTES.toMillis(30);

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

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

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

    public d() {
        if (A.f1275B == null) {
            Pattern pattern = j.f3629c;
            A.f1275B = new A(24);
        }
        A a5 = A.f1275B;
        if (j.f3630d == null) {
            j.f3630d = new j(a5);
        }
        this.f4739a = j.f3630d;
    }

    /* JADX WARN: Removed duplicated region for block: B:12:0x001b  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    public final synchronized boolean a() {
        /*
            r4 = this;
            monitor-enter(r4)
            int r0 = r4.f4741c     // Catch: java.lang.Throwable -> L19
            if (r0 == 0) goto L1b
            a3.j r0 = r4.f4739a     // Catch: java.lang.Throwable -> L19
            L1.A r0 = r0.f3631a     // Catch: java.lang.Throwable -> L19
            r0.getClass()     // Catch: java.lang.Throwable -> L19
            long r0 = java.lang.System.currentTimeMillis()     // Catch: java.lang.Throwable -> L19
            long r2 = r4.f4740b     // Catch: java.lang.Throwable -> L19
            int r0 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1))
            if (r0 <= 0) goto L17
            goto L1b
        L17:
            r0 = 0
            goto L1c
        L19:
            r0 = move-exception
            goto L1e
        L1b:
            r0 = 1
        L1c:
            monitor-exit(r4)
            return r0
        L1e:
            monitor-exit(r4)     // Catch: java.lang.Throwable -> L19
            throw r0
        */
        throw new UnsupportedOperationException("Method not decompiled: c3.d.a():boolean");
    }

    public final synchronized void b(int i) {
        long jMin;
        if ((i >= 200 && i < 300) || i == 401 || i == 404) {
            synchronized (this) {
                this.f4741c = 0;
            }
            return;
        }
        this.f4741c++;
        synchronized (this) {
            if (i == 429 || (i >= 500 && i < 600)) {
                double dPow = Math.pow(2.0d, this.f4741c);
                this.f4739a.getClass();
                jMin = (long) Math.min(dPow + ((long) (Math.random() * 1000.0d)), f4738e);
            } else {
                jMin = f4737d;
            }
            this.f4739a.f3631a.getClass();
            this.f4740b = System.currentTimeMillis() + jMin;
        }
        return;
    }
}
