package kotlin.coroutines; import d0.w.c; import d0.w.d; import d0.w.f; import d0.z.d.m; import d0.z.d.o; import kotlin.jvm.functions.Function2; /* compiled from: CoroutineContext.kt */ public interface CoroutineContext { /* compiled from: CoroutineContext.kt */ public interface Element extends CoroutineContext { /* compiled from: CoroutineContext.kt */ public static final class a { public static R fold(Element element, R r, Function2 function2) { m.checkNotNullParameter(function2, "operation"); return (R) function2.invoke(r, element); } /* JADX DEBUG: Multi-variable search result rejected for r1v0, resolved type: kotlin.coroutines.CoroutineContext$Element */ /* JADX WARN: Multi-variable type inference failed */ public static E get(Element element, Key key) { m.checkNotNullParameter(key, "key"); if (m.areEqual(element.getKey(), key)) { return element; } return null; } public static CoroutineContext minusKey(Element element, Key key) { m.checkNotNullParameter(key, "key"); return m.areEqual(element.getKey(), key) ? f.i : element; } public static CoroutineContext plus(Element element, CoroutineContext coroutineContext) { m.checkNotNullParameter(coroutineContext, "context"); return a.plus(element, coroutineContext); } } @Override // kotlin.coroutines.CoroutineContext E get(Key key); Key getKey(); } /* compiled from: CoroutineContext.kt */ public interface Key { } /* compiled from: CoroutineContext.kt */ public static final class a { /* compiled from: CoroutineContext.kt */ /* renamed from: kotlin.coroutines.CoroutineContext$a$a reason: collision with other inner class name */ public static final class C0338a extends o implements Function2 { public static final C0338a i = new C0338a(); public C0338a() { super(2); } public final CoroutineContext invoke(CoroutineContext coroutineContext, Element element) { c cVar; m.checkNotNullParameter(coroutineContext, "acc"); m.checkNotNullParameter(element, "element"); CoroutineContext minusKey = coroutineContext.minusKey(element.getKey()); f fVar = f.i; if (minusKey == fVar) { return element; } int i2 = d.e; d.b bVar = d.b.a; d dVar = (d) minusKey.get(bVar); if (dVar == null) { cVar = new c(minusKey, element); } else { CoroutineContext minusKey2 = minusKey.minusKey(bVar); if (minusKey2 == fVar) { return new c(element, dVar); } cVar = new c(new c(minusKey2, element), dVar); } return cVar; } } public static CoroutineContext plus(CoroutineContext coroutineContext, CoroutineContext coroutineContext2) { m.checkNotNullParameter(coroutineContext2, "context"); return coroutineContext2 == f.i ? coroutineContext : (CoroutineContext) coroutineContext2.fold(coroutineContext, C0338a.i); } } R fold(R r, Function2 function2); E get(Key key); CoroutineContext minusKey(Key key); CoroutineContext plus(CoroutineContext coroutineContext); }