package b7;

import Z6.B0;
import h7.C1040e;
import h7.InterfaceC1041f;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;

/* JADX INFO: renamed from: b7.d, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class C0554d extends P6.f implements O6.q {

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public static final C0554d f9228y = new C0554d(3, C0556f.class, "registerSelectForReceive", "registerSelectForReceive(Lkotlinx/coroutines/selects/SelectInstance;Ljava/lang/Object;)V", 0);

    /* JADX WARN: Code restructure failed: missing block: B:32:0x0075, code lost:
    
        return A6.n.f457a;
     */
    @Override // O6.q
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object j(Object obj, Object obj2, Object obj3) {
        n nVar;
        C0556f c0556f = (C0556f) obj;
        InterfaceC1041f interfaceC1041f = (InterfaceC1041f) obj2;
        AtomicLongFieldUpdater atomicLongFieldUpdater = C0556f.f9230r;
        c0556f.getClass();
        n nVar2 = (n) C0556f.f9235w.get(c0556f);
        while (true) {
            if (c0556f.t()) {
                ((C1040e) interfaceC1041f).f13463u = AbstractC0558h.f9251l;
                break;
            }
            long andIncrement = C0556f.f9231s.getAndIncrement(c0556f);
            long j8 = AbstractC0558h.f9242b;
            long j9 = andIncrement / j8;
            int i = (int) (andIncrement % j8);
            if (nVar2.f12574s != j9) {
                n nVarM = c0556f.m(j9, nVar2);
                if (nVarM == null) {
                    continue;
                } else {
                    nVar = nVarM;
                }
            } else {
                nVar = nVar2;
            }
            Object objC = c0556f.C(nVar, i, andIncrement, interfaceC1041f);
            n nVar3 = nVar;
            if (objC == AbstractC0558h.f9252m) {
                B0 b02 = interfaceC1041f instanceof B0 ? (B0) interfaceC1041f : null;
                if (b02 != null) {
                    b02.a(nVar3, i);
                }
            } else if (objC == AbstractC0558h.f9254o) {
                if (andIncrement < c0556f.q()) {
                    nVar3.a();
                }
                nVar2 = nVar3;
            } else {
                if (objC == AbstractC0558h.f9253n) {
                    throw new IllegalStateException("unexpected");
                }
                nVar3.a();
                ((C1040e) interfaceC1041f).f13463u = objC;
            }
        }
    }
}
