package defpackage;

import java.util.concurrent.atomic.AtomicReference;

/* JADX INFO: renamed from: ᵼᵵﹳᵟ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public abstract class AbstractC5318 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public static final int f20069;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public static final AtomicReference[] f20070;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public static final C2131 f20071 = new C2131(new byte[0], 0, 0, false);

    static {
        int iHighestOneBit = Integer.highestOneBit((Runtime.getRuntime().availableProcessors() * 2) - 1);
        f20069 = iHighestOneBit;
        AtomicReference[] atomicReferenceArr = new AtomicReference[iHighestOneBit];
        for (int i = 0; i < iHighestOneBit; i++) {
            atomicReferenceArr[i] = new AtomicReference();
        }
        f20070 = atomicReferenceArr;
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public static final C2131 m10903() {
        AtomicReference atomicReference = f20070[(int) (Thread.currentThread().getId() & (((long) f20069) - 1))];
        C2131 c2131 = f20071;
        C2131 c21312 = (C2131) atomicReference.getAndSet(c2131);
        if (c21312 == c2131) {
            return new C2131();
        }
        if (c21312 == null) {
            atomicReference.set(null);
            return new C2131();
        }
        atomicReference.set(c21312.f8454);
        c21312.f8454 = null;
        c21312.f8449 = 0;
        return c21312;
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public static final void m10904(C2131 c2131) {
        if (c2131.f8454 != null || c2131.f8452 != null) {
            ᵕᵩʽᵲ.ᵮᵣᵗˈ("Failed requirement.");
            return;
        }
        if (c2131.f8453) {
            return;
        }
        AtomicReference atomicReference = f20070[(int) (Thread.currentThread().getId() & (((long) f20069) - 1))];
        C2131 c21312 = f20071;
        C2131 c21313 = (C2131) atomicReference.getAndSet(c21312);
        if (c21313 == c21312) {
            return;
        }
        int i = c21313 != null ? c21313.f8449 : 0;
        if (i >= 65536) {
            atomicReference.set(c21313);
            return;
        }
        c2131.f8454 = c21313;
        c2131.f8448 = 0;
        c2131.f8449 = i + 8192;
        atomicReference.set(c2131);
    }
}
