package wp;

import rm.n0;

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

    /* loaded from: classes3.dex */
    public static final class a implements e {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ e f49639p;

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

        public a(e eVar, dn.p pVar) {
            this.f49639p = eVar;
            this.f49640q = pVar;
        }

        @Override // wp.e
        public Object collect(f fVar, vm.d dVar) {
            Object f10;
            Object collect = this.f49639p.collect(new b(new kotlin.jvm.internal.k0(), fVar, this.f49640q), dVar);
            f10 = wm.d.f();
            return collect == f10 ? collect : n0.f34904a;
        }
    }

    /* loaded from: classes3.dex */
    static final class b implements f {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ kotlin.jvm.internal.k0 f49641p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ f f49642q;

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

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

            /* renamed from: p, reason: collision with root package name */
            Object f49644p;

            /* renamed from: q, reason: collision with root package name */
            Object f49645q;

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

            /* renamed from: t, reason: collision with root package name */
            int f49648t;

            a(vm.d dVar) {
                super(dVar);
            }

            @Override // kotlin.coroutines.jvm.internal.a
            public final Object invokeSuspend(Object obj) {
                this.f49646r = obj;
                this.f49648t |= Integer.MIN_VALUE;
                return b.this.emit(null, this);
            }
        }

        b(kotlin.jvm.internal.k0 k0Var, f fVar, dn.p pVar) {
            this.f49641p = k0Var;
            this.f49642q = fVar;
            this.f49643r = pVar;
        }

        /* JADX WARN: Removed duplicated region for block: B:20:0x0073  */
        /* JADX WARN: Removed duplicated region for block: B:23:0x008a  */
        /* JADX WARN: Removed duplicated region for block: B:28:0x0045  */
        /* JADX WARN: Removed duplicated region for block: B:8:0x0025  */
        @Override // wp.f
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object emit(Object obj, vm.d dVar) {
            a aVar;
            Object f10;
            int i10;
            if (dVar instanceof a) {
                aVar = (a) dVar;
                int i11 = aVar.f49648t;
                if ((i11 & Integer.MIN_VALUE) != 0) {
                    aVar.f49648t = i11 - Integer.MIN_VALUE;
                    Object obj2 = aVar.f49646r;
                    f10 = wm.d.f();
                    i10 = aVar.f49648t;
                    if (i10 != 0) {
                        rm.y.b(obj2);
                        if (this.f49641p.f26193p) {
                            f fVar = this.f49642q;
                            aVar.f49648t = 1;
                            if (fVar.emit(obj, aVar) == f10) {
                                return f10;
                            }
                            return n0.f34904a;
                        }
                        dn.p pVar = this.f49643r;
                        aVar.f49644p = this;
                        aVar.f49645q = obj;
                        aVar.f49648t = 2;
                        obj2 = pVar.invoke(obj, aVar);
                        if (obj2 == f10) {
                            return f10;
                        }
                        if (!((Boolean) obj2).booleanValue()) {
                        }
                    } else {
                        if (i10 == 1) {
                            rm.y.b(obj2);
                            return n0.f34904a;
                        }
                        if (i10 == 2) {
                            obj = aVar.f49645q;
                            this = (b) aVar.f49644p;
                            rm.y.b(obj2);
                            if (!((Boolean) obj2).booleanValue()) {
                                return n0.f34904a;
                            }
                            this.f49641p.f26193p = true;
                            f fVar2 = this.f49642q;
                            aVar.f49644p = null;
                            aVar.f49645q = null;
                            aVar.f49648t = 3;
                            if (fVar2.emit(obj, aVar) == f10) {
                                return f10;
                            }
                        } else {
                            if (i10 != 3) {
                                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                            }
                            rm.y.b(obj2);
                        }
                    }
                    return n0.f34904a;
                }
            }
            aVar = new a(dVar);
            Object obj22 = aVar.f49646r;
            f10 = wm.d.f();
            i10 = aVar.f49648t;
            if (i10 != 0) {
            }
            return n0.f34904a;
        }
    }

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