package kotlinx.coroutines;

import kotlin.coroutines.EmptyCoroutineContext;

/* JADX INFO: loaded from: classes.dex */
public abstract class t extends kotlin.coroutines.a implements kotlin.coroutines.d {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final s f29561b = new s(kotlin.coroutines.c.f29225a, new sd.l() { // from class: kotlinx.coroutines.CoroutineDispatcher$Key$1
        @Override // sd.l
        public final Object invoke(Object obj) {
            kotlin.coroutines.f fVar = (kotlin.coroutines.f) obj;
            if (fVar instanceof t) {
                return (t) fVar;
            }
            return null;
        }
    });

    public t() {
        super(kotlin.coroutines.c.f29225a);
    }

    public abstract void L(kotlin.coroutines.h hVar, Runnable runnable);

    public boolean M(kotlin.coroutines.h hVar) {
        return !(this instanceof s1);
    }

    public t N(int i10) {
        y.e(i10);
        return new kotlinx.coroutines.internal.h(this, i10);
    }

    @Override // kotlin.coroutines.a, kotlin.coroutines.h
    public final kotlin.coroutines.f m(kotlin.coroutines.g gVar) {
        nb.g.i(gVar, "key");
        if (!(gVar instanceof kotlin.coroutines.b)) {
            if (kotlin.coroutines.c.f29225a == gVar) {
                return this;
            }
            return null;
        }
        kotlin.coroutines.b bVar = (kotlin.coroutines.b) gVar;
        kotlin.coroutines.g gVar2 = this.f29222a;
        nb.g.i(gVar2, "key");
        if (gVar2 != bVar && bVar.f29224b != gVar2) {
            return null;
        }
        kotlin.coroutines.f fVar = (kotlin.coroutines.f) bVar.f29223a.invoke(this);
        if (fVar instanceof kotlin.coroutines.f) {
            return fVar;
        }
        return null;
    }

    public String toString() {
        return getClass().getSimpleName() + '@' + y.z(this);
    }

    @Override // kotlin.coroutines.a, kotlin.coroutines.h
    public final kotlin.coroutines.h x(kotlin.coroutines.g gVar) {
        nb.g.i(gVar, "key");
        if (gVar instanceof kotlin.coroutines.b) {
            kotlin.coroutines.b bVar = (kotlin.coroutines.b) gVar;
            kotlin.coroutines.g gVar2 = this.f29222a;
            nb.g.i(gVar2, "key");
            if ((gVar2 == bVar || bVar.f29224b == gVar2) && ((kotlin.coroutines.f) bVar.f29223a.invoke(this)) != null) {
                return EmptyCoroutineContext.f29221a;
            }
        } else if (kotlin.coroutines.c.f29225a == gVar) {
            return EmptyCoroutineContext.f29221a;
        }
        return this;
    }
}
