package F1;

/* JADX INFO: loaded from: classes.dex */
public final class I0 extends kotlinx.coroutines.internal.q {

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    private q1.g f582x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    private Object f583y;

    /* JADX WARN: Illegal instructions before constructor call */
    public I0(q1.g gVar, q1.d dVar) {
        J0 j02 = J0.f585b;
        super(gVar.get(j02) == null ? gVar.plus(j02) : gVar, dVar);
    }

    @Override // kotlinx.coroutines.internal.q, F1.AbstractC0109a
    protected void s0(Object obj) {
        q1.g gVar = this.f582x;
        if (gVar != null) {
            kotlinx.coroutines.internal.v.a(gVar, this.f583y);
            this.f582x = null;
            this.f583y = null;
        }
        Object objA = C.a(obj, this.f5173r);
        q1.d dVar = this.f5173r;
        q1.g context = dVar.getContext();
        Object objC = kotlinx.coroutines.internal.v.c(context, null);
        I0 i0E = objC != kotlinx.coroutines.internal.v.f5176a ? D.e(dVar, context, objC) : null;
        try {
            this.f5173r.resumeWith(objA);
            n1.s sVar = n1.s.f5871a;
        } finally {
            if (i0E == null || i0E.w0()) {
                kotlinx.coroutines.internal.v.a(context, objC);
            }
        }
    }

    public final boolean w0() {
        if (this.f582x == null) {
            return false;
        }
        this.f582x = null;
        this.f583y = null;
        return true;
    }

    public final void x0(q1.g gVar, Object obj) {
        this.f582x = gVar;
        this.f583y = obj;
    }
}
