package H1;

import kotlinx.coroutines.internal.f;
import n1.l;
import n1.m;
import n1.s;
import q1.d;
import r1.AbstractC0707b;
import y1.p;

/* JADX INFO: loaded from: classes.dex */
public abstract class a {
    /* JADX INFO: Access modifiers changed from: private */
    public static final void b(d dVar, Throwable th) throws Throwable {
        l.a aVar = l.f5861g;
        dVar.resumeWith(l.b(m.a(th)));
        throw th;
    }

    public static final void c(d dVar, d dVar2) throws Throwable {
        try {
            d dVarC = AbstractC0707b.c(dVar);
            l.a aVar = l.f5861g;
            f.c(dVarC, l.b(s.f5871a), null, 2, null);
        } catch (Throwable th) {
            b(dVar2, th);
        }
    }

    public static final void d(y1.l lVar, d dVar) throws Throwable {
        try {
            d dVarC = AbstractC0707b.c(AbstractC0707b.a(lVar, dVar));
            l.a aVar = l.f5861g;
            f.c(dVarC, l.b(s.f5871a), null, 2, null);
        } catch (Throwable th) {
            b(dVar, th);
        }
    }

    public static final void e(p pVar, Object obj, d dVar, y1.l lVar) throws Throwable {
        try {
            d dVarC = AbstractC0707b.c(AbstractC0707b.b(pVar, obj, dVar));
            l.a aVar = l.f5861g;
            f.b(dVarC, l.b(s.f5871a), lVar);
        } catch (Throwable th) {
            b(dVar, th);
        }
    }

    public static /* synthetic */ void f(p pVar, Object obj, d dVar, y1.l lVar, int i2, Object obj2) throws Throwable {
        if ((i2 & 4) != 0) {
            lVar = null;
        }
        e(pVar, obj, dVar, lVar);
    }
}
