package V2;

import java.util.ArrayList;
import java.util.List;
import m3.AbstractC2467b;
import w4.C3137A;

/* JADX INFO: loaded from: classes.dex */
public final class H2 extends C4.j implements J4.e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public Object f7348a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public Object f7349b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f7350c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public /* synthetic */ Object f7351d;

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        H2 h22 = new H2(2, dVar);
        h22.f7351d = obj;
        return h22;
    }

    @Override // J4.e
    public final Object invoke(Object obj, Object obj2) {
        return ((H2) create((V4.C) obj, (A4.d) obj2)).invokeSuspend(C3137A.f25453a);
    }

    /* JADX WARN: Removed duplicated region for block: B:25:0x00c5  */
    /* JADX WARN: Removed duplicated region for block: B:29:0x00da  */
    /* JADX WARN: Removed duplicated region for block: B:35:0x00f8  */
    @Override // C4.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) throws Throwable {
        V4.H h5;
        V4.H h6;
        V4.H h7;
        List list;
        V4.H h8;
        V4.H h9;
        Object objAwait;
        List list2;
        List list3;
        List list4;
        B4.a aVar = B4.a.f492a;
        int i6 = this.f7350c;
        if (i6 == 0) {
            AbstractC2467b.l(obj);
            V4.C c6 = (V4.C) this.f7351d;
            V4.I iE = V4.E.e(c6, null, new F2(2, null), 3);
            V4.I iE2 = V4.E.e(c6, null, new G2(2, null), 3);
            V4.I iE3 = V4.E.e(c6, null, new E2(2, null), 3);
            V4.I iE4 = V4.E.e(c6, null, new D2(2, null), 3);
            this.f7351d = iE2;
            this.f7348a = iE3;
            this.f7349b = iE4;
            this.f7350c = 1;
            Object objM = iE.m(this);
            if (objM != aVar) {
                h5 = iE4;
                obj = objM;
                h6 = iE2;
                h7 = iE3;
            }
            return aVar;
        }
        if (i6 != 1) {
            if (i6 == 2) {
                list = (List) this.f7349b;
                h9 = (V4.H) this.f7348a;
                h8 = (V4.H) this.f7351d;
                AbstractC2467b.l(obj);
                List list5 = (List) obj;
                this.f7351d = h9;
                this.f7348a = list;
                this.f7349b = list5;
                this.f7350c = 3;
                objAwait = h8.await(this);
                if (objAwait != aVar) {
                    List list6 = list;
                    list2 = list5;
                    obj = objAwait;
                    list3 = list6;
                    ArrayList arrayList = new ArrayList();
                    while (r12.hasNext()) {
                    }
                    this.f7351d = list3;
                    this.f7348a = list2;
                    this.f7349b = arrayList;
                    this.f7350c = 4;
                    obj = h9.await(this);
                    if (obj != aVar) {
                    }
                }
                return aVar;
            }
            if (i6 != 3) {
                if (i6 != 4) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                list4 = (List) this.f7349b;
                list2 = (List) this.f7348a;
                list3 = (List) this.f7351d;
                AbstractC2467b.l(obj);
                return new C0739x2(list4, list3, list2, (List) obj);
            }
            list2 = (List) this.f7349b;
            list3 = (List) this.f7348a;
            h9 = (V4.H) this.f7351d;
            AbstractC2467b.l(obj);
            ArrayList arrayList2 = new ArrayList();
            for (Object obj2 : (Iterable) obj) {
                if (!(((AbstractC0742y1) obj2) instanceof C0726u1)) {
                    arrayList2.add(obj2);
                }
            }
            this.f7351d = list3;
            this.f7348a = list2;
            this.f7349b = arrayList2;
            this.f7350c = 4;
            obj = h9.await(this);
            if (obj != aVar) {
                list4 = arrayList2;
                return new C0739x2(list4, list3, list2, (List) obj);
            }
            return aVar;
        }
        h5 = (V4.H) this.f7349b;
        h7 = (V4.H) this.f7348a;
        h6 = (V4.H) this.f7351d;
        AbstractC2467b.l(obj);
        List list7 = (List) obj;
        this.f7351d = h7;
        this.f7348a = h5;
        this.f7349b = list7;
        this.f7350c = 2;
        Object objAwait2 = h6.await(this);
        if (objAwait2 != aVar) {
            V4.H h10 = h5;
            list = list7;
            obj = objAwait2;
            h8 = h7;
            h9 = h10;
            List list52 = (List) obj;
            this.f7351d = h9;
            this.f7348a = list;
            this.f7349b = list52;
            this.f7350c = 3;
            objAwait = h8.await(this);
            if (objAwait != aVar) {
            }
        }
        return aVar;
    }
}
