package defpackage;

import java.util.concurrent.atomic.AtomicReference;

/* renamed from: ᵤᵺᵙ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public abstract class AbstractC3467 {

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public static final AtomicReference[] f13003;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public static final C3514 f13004 = new C3514(new byte[0], 0, 0, false);

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public static final int f13005;

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

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public static final void m7895(C3514 c3514) {
        if (c3514.f13187 != null || c3514.f13186 != null) {
            ᵹˉᵞ.ˌᵜᵹᵩ("Failed requirement.");
            return;
        }
        if (c3514.f13191) {
            return;
        }
        AtomicReference atomicReference = f13003[(int) (Thread.currentThread().getId() & (f13005 - 1))];
        C3514 c35142 = f13004;
        C3514 c35143 = (C3514) atomicReference.getAndSet(c35142);
        if (c35143 == c35142) {
            return;
        }
        int i = c35143 != null ? c35143.f13188 : 0;
        if (i >= 65536) {
            atomicReference.set(c35143);
            return;
        }
        c3514.f13187 = c35143;
        c3514.f13190 = 0;
        c3514.f13188 = i + 8192;
        atomicReference.set(c3514);
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public static final C3514 m7896() {
        AtomicReference atomicReference = f13003[(int) (Thread.currentThread().getId() & (f13005 - 1))];
        C3514 c3514 = f13004;
        C3514 c35142 = (C3514) atomicReference.getAndSet(c3514);
        if (c35142 == c3514) {
            return new C3514();
        }
        if (c35142 == null) {
            atomicReference.set(null);
            return new C3514();
        }
        atomicReference.set(c35142.f13187);
        c35142.f13187 = null;
        c35142.f13188 = 0;
        return c35142;
    }
}
