package vp;

import rm.n0;
import rm.x;
import rm.y;
import tp.m0;
import vp.h;

/* loaded from: classes3.dex */
abstract /* synthetic */ class l {

    /* loaded from: classes3.dex */
    static final class a extends kotlin.coroutines.jvm.internal.l implements dn.p {

        /* renamed from: p, reason: collision with root package name */
        int f40446p;

        /* renamed from: q, reason: collision with root package name */
        private /* synthetic */ Object f40447q;

        /* renamed from: r, reason: collision with root package name */
        final /* synthetic */ u f40448r;

        /* renamed from: s, reason: collision with root package name */
        final /* synthetic */ Object f40449s;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        a(u uVar, Object obj, vm.d dVar) {
            super(2, dVar);
            this.f40448r = uVar;
            this.f40449s = obj;
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final vm.d create(Object obj, vm.d dVar) {
            a aVar = new a(this.f40448r, this.f40449s, dVar);
            aVar.f40447q = obj;
            return aVar;
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            Object f10;
            Object a10;
            f10 = wm.d.f();
            int i10 = this.f40446p;
            try {
                if (i10 == 0) {
                    y.b(obj);
                    u uVar = this.f40448r;
                    Object obj2 = this.f40449s;
                    x.a aVar = x.f34910p;
                    this.f40446p = 1;
                    if (uVar.k(obj2, this) == f10) {
                        return f10;
                    }
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    y.b(obj);
                }
                a10 = x.a(n0.f34904a);
            } catch (Throwable th2) {
                x.a aVar2 = x.f34910p;
                a10 = x.a(y.a(th2));
            }
            return h.b(x.e(a10) ? h.f40440b.c(n0.f34904a) : h.f40440b.a(x.c(a10)));
        }

        @Override // dn.p
        public final Object invoke(m0 m0Var, vm.d dVar) {
            return ((a) create(m0Var, dVar)).invokeSuspend(n0.f34904a);
        }
    }

    public static final Object a(u uVar, Object obj) {
        Object b10;
        Object n10 = uVar.n(obj);
        if (n10 instanceof h.c) {
            b10 = tp.j.b(null, new a(uVar, obj, null), 1, null);
            return ((h) b10).k();
        }
        return h.f40440b.c(n0.f34904a);
    }
}
