package wp;

import rm.n0;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public final class b extends c {

    /* renamed from: t, reason: collision with root package name */
    private final dn.p f49560t;

    /* 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 f49561p;

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

        /* renamed from: s, reason: collision with root package name */
        int f49564s;

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

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

    public /* synthetic */ b(dn.p pVar, vm.g gVar, int i10, vp.a aVar, int i11, kotlin.jvm.internal.k kVar) {
        this(pVar, (i11 & 2) != 0 ? vm.h.f40193p : gVar, (i11 & 4) != 0 ? -2 : i10, (i11 & 8) != 0 ? vp.a.SUSPEND : aVar);
    }

    /* JADX INFO: Access modifiers changed from: protected */
    /* JADX WARN: Removed duplicated region for block: B:12:0x004a  */
    /* JADX WARN: Removed duplicated region for block: B:15:0x004d  */
    /* JADX WARN: Removed duplicated region for block: B:19:0x0036  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0023  */
    @Override // wp.c, xp.e
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object h(vp.s sVar, vm.d dVar) {
        a aVar;
        Object f10;
        int i10;
        if (dVar instanceof a) {
            aVar = (a) dVar;
            int i11 = aVar.f49564s;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                aVar.f49564s = i11 - Integer.MIN_VALUE;
                Object obj = aVar.f49562q;
                f10 = wm.d.f();
                i10 = aVar.f49564s;
                if (i10 != 0) {
                    rm.y.b(obj);
                    aVar.f49561p = sVar;
                    aVar.f49564s = 1;
                    if (super.h(sVar, aVar) == f10) {
                        return f10;
                    }
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    sVar = (vp.s) aVar.f49561p;
                    rm.y.b(obj);
                }
                if (sVar.o()) {
                    throw new IllegalStateException("'awaitClose { yourCallbackOrListener.cancel() }' should be used in the end of callbackFlow block.\nOtherwise, a callback/listener may leak in case of external cancellation.\nSee callbackFlow API documentation for the details.");
                }
                return n0.f34904a;
            }
        }
        aVar = new a(dVar);
        Object obj2 = aVar.f49562q;
        f10 = wm.d.f();
        i10 = aVar.f49564s;
        if (i10 != 0) {
        }
        if (sVar.o()) {
        }
    }

    @Override // xp.e
    protected xp.e i(vm.g gVar, int i10, vp.a aVar) {
        return new b(this.f49560t, gVar, i10, aVar);
    }

    public b(dn.p pVar, vm.g gVar, int i10, vp.a aVar) {
        super(pVar, gVar, i10, aVar);
        this.f49560t = pVar;
    }
}
