package o;

import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.vM, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public class C2707vM {
    public static final /* synthetic */ AtomicReferenceFieldUpdater l = AtomicReferenceFieldUpdater.newUpdater(C2707vM.class, Object.class, "_next$volatile");
    public static final /* synthetic */ AtomicReferenceFieldUpdater m = AtomicReferenceFieldUpdater.newUpdater(C2707vM.class, Object.class, "_prev$volatile");
    public static final /* synthetic */ AtomicReferenceFieldUpdater n = AtomicReferenceFieldUpdater.newUpdater(C2707vM.class, Object.class, "_removedRef$volatile");
    private volatile /* synthetic */ Object _next$volatile = this;
    private volatile /* synthetic */ Object _prev$volatile = this;
    private volatile /* synthetic */ Object _removedRef$volatile;

    public final boolean e(C2707vM c2707vM, int i) {
        while (true) {
            C2707vM c2707vMF = f();
            AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = m;
            if (c2707vMF == null) {
                Object obj = atomicReferenceFieldUpdater.get(this);
                while (true) {
                    c2707vMF = (C2707vM) obj;
                    if (!c2707vMF.i()) {
                        break;
                    }
                    obj = atomicReferenceFieldUpdater.get(c2707vMF);
                }
            }
            if (c2707vMF instanceof IL) {
                return (((IL) c2707vMF).f157o & i) == 0 && c2707vMF.e(c2707vM, i);
            }
            atomicReferenceFieldUpdater.set(c2707vM, c2707vMF);
            AtomicReferenceFieldUpdater atomicReferenceFieldUpdater2 = l;
            atomicReferenceFieldUpdater2.set(c2707vM, this);
            while (!atomicReferenceFieldUpdater2.compareAndSet(c2707vMF, this, c2707vM)) {
                if (atomicReferenceFieldUpdater2.get(c2707vMF) != this) {
                    break;
                }
            }
            c2707vM.g(this);
            return true;
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:20:0x0031, code lost:
    
        r6 = ((o.C0777b20) r6).a;
     */
    /* JADX WARN: Code restructure failed: missing block: B:22:0x0039, code lost:
    
        if (r5.compareAndSet(r4, r3, r6) == false) goto L24;
     */
    /* JADX WARN: Code restructure failed: missing block: B:25:0x0041, code lost:
    
        if (r5.get(r4) == r3) goto L43;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final o.C2707vM f() {
        /*
            r9 = this;
        L0:
            java.util.concurrent.atomic.AtomicReferenceFieldUpdater r0 = o.C2707vM.m
            java.lang.Object r1 = r0.get(r9)
            o.vM r1 = (o.C2707vM) r1
            r2 = 0
            r3 = r1
        La:
            r4 = r2
        Lb:
            java.util.concurrent.atomic.AtomicReferenceFieldUpdater r5 = o.C2707vM.l
            java.lang.Object r6 = r5.get(r3)
            if (r6 != r9) goto L24
            if (r1 != r3) goto L16
            return r3
        L16:
            boolean r2 = r0.compareAndSet(r9, r1, r3)
            if (r2 == 0) goto L1d
            return r3
        L1d:
            java.lang.Object r2 = r0.get(r9)
            if (r2 == r1) goto L16
            goto L0
        L24:
            boolean r7 = r9.i()
            if (r7 == 0) goto L2b
            return r2
        L2b:
            boolean r7 = r6 instanceof o.C0777b20
            if (r7 == 0) goto L4b
            if (r4 == 0) goto L44
            o.b20 r6 = (o.C0777b20) r6
            o.vM r6 = r6.a
        L35:
            boolean r7 = r5.compareAndSet(r4, r3, r6)
            if (r7 == 0) goto L3d
            r3 = r4
            goto La
        L3d:
            java.lang.Object r7 = r5.get(r4)
            if (r7 == r3) goto L35
            goto L0
        L44:
            java.lang.Object r3 = r0.get(r3)
            o.vM r3 = (o.C2707vM) r3
            goto Lb
        L4b:
            r4 = r6
            o.vM r4 = (o.C2707vM) r4
            r8 = r4
            r4 = r3
            r3 = r8
            goto Lb
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C2707vM.f():o.vM");
    }

    public final void g(C2707vM c2707vM) {
        while (true) {
            AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = m;
            C2707vM c2707vM2 = (C2707vM) atomicReferenceFieldUpdater.get(c2707vM);
            if (l.get(this) != c2707vM) {
                return;
            }
            while (!atomicReferenceFieldUpdater.compareAndSet(c2707vM, c2707vM2, this)) {
                if (atomicReferenceFieldUpdater.get(c2707vM) != c2707vM2) {
                    break;
                }
            }
            if (i()) {
                c2707vM.f();
                return;
            }
            return;
        }
    }

    public final C2707vM h() {
        C2707vM c2707vM;
        Object obj = l.get(this);
        C0777b20 c0777b20 = obj instanceof C0777b20 ? (C0777b20) obj : null;
        return (c0777b20 == null || (c2707vM = c0777b20.a) == null) ? (C2707vM) obj : c2707vM;
    }

    public boolean i() {
        return l.get(this) instanceof C0777b20;
    }

    public String toString() {
        return new C2612uM(1, 0, AbstractC0249Jp.class, this, "classSimpleName", "getClassSimpleName(Ljava/lang/Object;)Ljava/lang/String;") + '@' + AbstractC0249Jp.K(this);
    }
}
