package o;

import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.gl, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public abstract class AbstractC1318gl {
    public static final /* synthetic */ AtomicReferenceFieldUpdater a = AtomicReferenceFieldUpdater.newUpdater(AbstractC1318gl.class, Object.class, "_next$volatile");
    public static final /* synthetic */ AtomicReferenceFieldUpdater b = AtomicReferenceFieldUpdater.newUpdater(AbstractC1318gl.class, Object.class, "_prev$volatile");
    private volatile /* synthetic */ Object _next$volatile;
    private volatile /* synthetic */ Object _prev$volatile;

    public AbstractC1318gl(AbstractC2591u50 abstractC2591u50) {
        this._prev$volatile = abstractC2591u50;
    }

    public final void b() {
        b.set(this, null);
    }

    public final AbstractC1318gl c() {
        Object obj = a.get(this);
        if (obj == AbstractC2841wm0.b) {
            return null;
        }
        return (AbstractC1318gl) obj;
    }

    public abstract boolean d();

    public final void e() {
        AbstractC1318gl abstractC1318glC;
        if (c() == null) {
            return;
        }
        while (true) {
            AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = b;
            AbstractC1318gl abstractC1318gl = (AbstractC1318gl) atomicReferenceFieldUpdater.get(this);
            while (abstractC1318gl != null && abstractC1318gl.d()) {
                abstractC1318gl = (AbstractC1318gl) atomicReferenceFieldUpdater.get(abstractC1318gl);
            }
            AbstractC1318gl abstractC1318glC2 = c();
            while (abstractC1318glC2.d() && (abstractC1318glC = abstractC1318glC2.c()) != null) {
                abstractC1318glC2 = abstractC1318glC;
            }
            while (true) {
                Object obj = atomicReferenceFieldUpdater.get(abstractC1318glC2);
                AbstractC1318gl abstractC1318gl2 = ((AbstractC1318gl) obj) == null ? null : abstractC1318gl;
                while (!atomicReferenceFieldUpdater.compareAndSet(abstractC1318glC2, obj, abstractC1318gl2)) {
                    if (atomicReferenceFieldUpdater.get(abstractC1318glC2) != obj) {
                        break;
                    }
                }
            }
            if (abstractC1318gl != null) {
                a.set(abstractC1318gl, abstractC1318glC2);
            }
            if (!abstractC1318glC2.d() || abstractC1318glC2.c() == null) {
                if (abstractC1318gl == null || !abstractC1318gl.d()) {
                    return;
                }
            }
        }
    }
}
