package wp;

import rm.n0;

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

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

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

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

        /* renamed from: s, reason: collision with root package name */
        boolean f49603s;

        /* renamed from: t, reason: collision with root package name */
        /* synthetic */ Object f49604t;

        /* renamed from: u, reason: collision with root package name */
        int f49605u;

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

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f49604t = obj;
            this.f49605u |= Integer.MIN_VALUE;
            return i.c(null, null, false, this);
        }
    }

    public static final Object b(f fVar, vp.t tVar, vm.d dVar) {
        Object f10;
        Object c10 = c(fVar, tVar, true, dVar);
        f10 = wm.d.f();
        return c10 == f10 ? c10 : n0.f34904a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX WARN: Removed duplicated region for block: B:16:0x0070 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:18:0x0071  */
    /* JADX WARN: Removed duplicated region for block: B:21:0x007d A[Catch: all -> 0x009b, TRY_LEAVE, TryCatch #0 {all -> 0x009b, blocks: (B:12:0x0036, B:14:0x0060, B:19:0x0075, B:21:0x007d, B:32:0x0052, B:34:0x005c), top: B:7:0x0022 }] */
    /* JADX WARN: Removed duplicated region for block: B:24:0x0092  */
    /* JADX WARN: Removed duplicated region for block: B:33:0x0056  */
    /* JADX WARN: Removed duplicated region for block: B:9:0x0024  */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:22:0x008f -> B:13:0x0039). Please report as a decompilation issue!!! */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final Object c(f fVar, vp.t tVar, boolean z10, vm.d dVar) {
        a aVar;
        Object f10;
        int i10;
        vp.f it;
        vp.f fVar2;
        f fVar3;
        Object b10;
        try {
            if (dVar instanceof a) {
                aVar = (a) dVar;
                int i11 = aVar.f49605u;
                if ((i11 & Integer.MIN_VALUE) != 0) {
                    aVar.f49605u = i11 - Integer.MIN_VALUE;
                    Object obj = aVar.f49604t;
                    f10 = wm.d.f();
                    i10 = aVar.f49605u;
                    if (i10 != 0) {
                        rm.y.b(obj);
                        g.n(fVar);
                        it = tVar.iterator();
                        aVar.f49600p = fVar;
                        aVar.f49601q = tVar;
                        aVar.f49602r = it;
                        aVar.f49603s = z10;
                        aVar.f49605u = 1;
                        b10 = it.b(aVar);
                        if (b10 == f10) {
                        }
                    } else if (i10 == 1) {
                        z10 = aVar.f49603s;
                        fVar2 = (vp.f) aVar.f49602r;
                        tVar = (vp.t) aVar.f49601q;
                        fVar3 = (f) aVar.f49600p;
                        rm.y.b(obj);
                        if (((Boolean) obj).booleanValue()) {
                        }
                    } else {
                        if (i10 != 2) {
                            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                        }
                        z10 = aVar.f49603s;
                        fVar2 = (vp.f) aVar.f49602r;
                        tVar = (vp.t) aVar.f49601q;
                        fVar3 = (f) aVar.f49600p;
                        rm.y.b(obj);
                        it = fVar2;
                        fVar = fVar3;
                        aVar.f49600p = fVar;
                        aVar.f49601q = tVar;
                        aVar.f49602r = it;
                        aVar.f49603s = z10;
                        aVar.f49605u = 1;
                        b10 = it.b(aVar);
                        if (b10 == f10) {
                            return f10;
                        }
                        fVar3 = fVar;
                        fVar2 = it;
                        obj = b10;
                        if (((Boolean) obj).booleanValue()) {
                            if (z10) {
                                vp.k.a(tVar, null);
                            }
                            return n0.f34904a;
                        }
                        Object next = fVar2.next();
                        aVar.f49600p = fVar3;
                        aVar.f49601q = tVar;
                        aVar.f49602r = fVar2;
                        aVar.f49603s = z10;
                        aVar.f49605u = 2;
                        if (fVar3.emit(next, aVar) == f10) {
                            return f10;
                        }
                        it = fVar2;
                        fVar = fVar3;
                        aVar.f49600p = fVar;
                        aVar.f49601q = tVar;
                        aVar.f49602r = it;
                        aVar.f49603s = z10;
                        aVar.f49605u = 1;
                        b10 = it.b(aVar);
                        if (b10 == f10) {
                        }
                    }
                }
            }
            if (i10 != 0) {
            }
        } finally {
        }
        aVar = new a(dVar);
        Object obj2 = aVar.f49604t;
        f10 = wm.d.f();
        i10 = aVar.f49605u;
    }
}
