package wp;

import com.google.android.gms.common.api.Api;
import rm.n0;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public abstract /* synthetic */ class p {

    /* renamed from: a, reason: collision with root package name */
    private static final int f49649a = zp.i0.b("kotlinx.coroutines.flow.defaultConcurrency", 16, 1, Api.BaseClientBuilder.API_PRIORITY_OTHER);

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes3.dex */
    public static final class a extends kotlin.coroutines.jvm.internal.l implements dn.q {

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

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

        /* renamed from: r, reason: collision with root package name */
        /* synthetic */ Object f49652r;

        /* renamed from: s, reason: collision with root package name */
        final /* synthetic */ dn.p f49653s;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        a(dn.p pVar, vm.d dVar) {
            super(3, dVar);
            this.f49653s = pVar;
        }

        @Override // dn.q
        /* renamed from: b, reason: merged with bridge method [inline-methods] */
        public final Object invoke(f fVar, Object obj, vm.d dVar) {
            a aVar = new a(this.f49653s, dVar);
            aVar.f49651q = fVar;
            aVar.f49652r = obj;
            return aVar.invokeSuspend(n0.f34904a);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            Object f10;
            f fVar;
            f10 = wm.d.f();
            int i10 = this.f49650p;
            if (i10 == 0) {
                rm.y.b(obj);
                fVar = (f) this.f49651q;
                Object obj2 = this.f49652r;
                dn.p pVar = this.f49653s;
                this.f49651q = fVar;
                this.f49650p = 1;
                obj = pVar.invoke(obj2, this);
                if (obj == f10) {
                    return f10;
                }
            } else {
                if (i10 != 1) {
                    if (i10 != 2) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    rm.y.b(obj);
                    return n0.f34904a;
                }
                fVar = (f) this.f49651q;
                rm.y.b(obj);
            }
            this.f49651q = null;
            this.f49650p = 2;
            if (fVar.emit(obj, this) == f10) {
                return f10;
            }
            return n0.f34904a;
        }
    }

    public static final e a(e eVar, dn.p pVar) {
        return g.u(eVar, new a(pVar, null));
    }

    public static final e b(e eVar, dn.q qVar) {
        return new xp.i(qVar, eVar, null, 0, null, 28, null);
    }
}
