package O1;

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

/* JADX INFO: renamed from: O1.h, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0568h extends C4.j implements J4.e {

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

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

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

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ List f5413e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final /* synthetic */ ArrayList f5414f;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0568h(List list, ArrayList arrayList, A4.d dVar) {
        super(2, dVar);
        this.f5413e = list;
        this.f5414f = arrayList;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        C0568h c0568h = new C0568h(this.f5413e, this.f5414f, dVar);
        c0568h.f5412d = obj;
        return c0568h;
    }

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

    @Override // C4.a
    public final Object invokeSuspend(Object obj) {
        Iterator it;
        List list;
        B4.a aVar = B4.a.f492a;
        int i6 = this.f5411c;
        if (i6 == 0) {
            AbstractC2467b.l(obj);
            obj = this.f5412d;
            it = this.f5413e.iterator();
            list = this.f5414f;
        } else if (i6 == 1) {
            Object obj2 = this.f5410b;
            Iterator it2 = this.f5409a;
            List list2 = (List) this.f5412d;
            AbstractC2467b.l(obj);
            if (((Boolean) obj).booleanValue()) {
                list2.add(new C0567g(1, null));
                this.f5412d = list2;
                this.f5409a = it2;
                this.f5410b = null;
                this.f5411c = 2;
                throw null;
            }
            obj = obj2;
            it = it2;
            list = list2;
        } else {
            if (i6 != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            it = this.f5409a;
            list = (List) this.f5412d;
            AbstractC2467b.l(obj);
        }
        if (!it.hasNext()) {
            return obj;
        }
        if (it.next() != null) {
            throw new ClassCastException();
        }
        this.f5412d = list;
        this.f5409a = it;
        this.f5410b = obj;
        this.f5411c = 1;
        throw null;
    }
}
