package W;

import com.google.android.gms.internal.measurement.C1;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/* JADX INFO: renamed from: W.g, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0340g extends G6.i implements O6.p {

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

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

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

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

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

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

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

    @Override // O6.p
    public final Object k(Object obj, Object obj2) {
        return ((C0340g) m((E6.d) obj2, obj)).p(A6.n.f457a);
    }

    @Override // G6.a
    public final E6.d m(E6.d dVar, Object obj) {
        C0340g c0340g = new C0340g(this.f6992y, this.f6993z, dVar);
        c0340g.f6991x = obj;
        return c0340g;
    }

    @Override // G6.a
    public final Object p(Object obj) throws Throwable {
        Iterator it;
        List list;
        int i = this.f6990w;
        if (i == 0) {
            C1.N(obj);
            obj = this.f6991x;
            it = this.f6992y.iterator();
            list = this.f6993z;
        } else if (i == 1) {
            Object obj2 = this.f6989v;
            Iterator it2 = this.f6988u;
            List list2 = (List) this.f6991x;
            C1.N(obj);
            if (((Boolean) obj).booleanValue()) {
                list2.add(new C0339f(1, null));
                this.f6991x = list2;
                this.f6988u = it2;
                this.f6989v = null;
                this.f6990w = 2;
                throw null;
            }
            obj = obj2;
            it = it2;
            list = list2;
        } else {
            if (i != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            it = this.f6988u;
            list = (List) this.f6991x;
            C1.N(obj);
        }
        if (!it.hasNext()) {
            return obj;
        }
        if (it.next() != null) {
            throw new ClassCastException();
        }
        this.f6991x = list;
        this.f6988u = it;
        this.f6989v = obj;
        this.f6990w = 1;
        throw null;
    }
}
