package W;

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

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

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

    /* JADX INFO: renamed from: B, reason: collision with root package name */
    public final /* synthetic */ K f7011B;

    /* JADX INFO: renamed from: C, reason: collision with root package name */
    public final /* synthetic */ C2.a f7012C;

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

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

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

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

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

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0345l(K k8, C2.a aVar, E6.d dVar) {
        super(1, dVar);
        this.f7011B = k8;
        this.f7012C = aVar;
    }

    @Override // O6.l
    public final Object b(Object obj) {
        return new C0345l(this.f7011B, this.f7012C, (E6.d) obj).p(A6.n.f457a);
    }

    /* JADX WARN: Removed duplicated region for block: B:23:0x00a6  */
    /* JADX WARN: Removed duplicated region for block: B:31:0x00d9  */
    /* JADX WARN: Removed duplicated region for block: B:35:0x00e4  */
    /* JADX WARN: Removed duplicated region for block: B:36:0x00e9  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x00ff  */
    @Override // G6.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object p(Object obj) throws Throwable {
        i7.a aVarA;
        P6.j jVar;
        P6.m mVar;
        P6.m mVar2;
        i7.a aVar;
        Iterator it;
        i7.a aVar2;
        P6.j jVar2;
        P6.m mVar3;
        C0344k c0344k;
        P6.m mVar4;
        P6.j jVar3;
        Object obj2;
        Integer numA;
        int i;
        F6.a aVar3 = F6.a.f2580q;
        int i5 = this.f7010A;
        C2.a aVar4 = this.f7012C;
        K k8 = this.f7011B;
        if (i5 == 0) {
            C1.N(obj);
            aVarA = i7.e.a();
            jVar = new P6.j();
            mVar = new P6.m();
            this.f7013u = aVarA;
            this.f7014v = jVar;
            this.f7015w = mVar;
            this.f7016x = mVar;
            this.f7010A = 1;
            obj = K.g(k8, true, this);
            if (obj != aVar3) {
                mVar2 = mVar;
            }
            return aVar3;
        }
        if (i5 != 1) {
            if (i5 != 2) {
                if (i5 != 3) {
                    if (i5 != 4) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    i = this.f7018z;
                    obj2 = this.f7013u;
                    C1.N(obj);
                    return new C0336c(i, ((Number) obj).intValue(), obj2);
                }
                aVar = (i7.a) this.f7015w;
                mVar4 = (P6.m) this.f7014v;
                jVar3 = (P6.j) this.f7013u;
                C1.N(obj);
                try {
                    jVar3.f5532q = true;
                    aVar.a(null);
                    obj2 = mVar4.f5535q;
                    int iHashCode = obj2 == null ? obj2.hashCode() : 0;
                    U uH = k8.h();
                    this.f7013u = obj2;
                    this.f7014v = null;
                    this.f7015w = null;
                    this.f7018z = iHashCode;
                    this.f7010A = 4;
                    numA = uH.a();
                    if (numA != aVar3) {
                        i = iHashCode;
                        obj = numA;
                        return new C0336c(i, ((Number) obj).intValue(), obj2);
                    }
                    return aVar3;
                } catch (Throwable th) {
                    aVar.a(null);
                    throw th;
                }
            }
            it = this.f7017y;
            c0344k = (C0344k) this.f7016x;
            mVar3 = (P6.m) this.f7015w;
            jVar2 = (P6.j) this.f7014v;
            aVar2 = (i7.a) this.f7013u;
            C1.N(obj);
            while (it.hasNext()) {
                O6.p pVar = (O6.p) it.next();
                this.f7013u = aVar2;
                this.f7014v = jVar2;
                this.f7015w = mVar3;
                this.f7016x = c0344k;
                this.f7017y = it;
                this.f7010A = 2;
                if (pVar.k(c0344k, this) == aVar3) {
                    break;
                }
            }
            mVar2 = mVar3;
            jVar = jVar2;
            aVar = aVar2;
            aVar4.f1159t = null;
            this.f7013u = jVar;
            this.f7014v = mVar2;
            this.f7015w = aVar;
            this.f7016x = null;
            this.f7017y = null;
            this.f7010A = 3;
            if (aVar.b(this) != aVar3) {
                mVar4 = mVar2;
                jVar3 = jVar;
                jVar3.f5532q = true;
                aVar.a(null);
                obj2 = mVar4.f5535q;
                if (obj2 == null) {
                }
                U uH2 = k8.h();
                this.f7013u = obj2;
                this.f7014v = null;
                this.f7015w = null;
                this.f7018z = iHashCode;
                this.f7010A = 4;
                numA = uH2.a();
                if (numA != aVar3) {
                }
            }
            return aVar3;
        }
        mVar = (P6.m) this.f7016x;
        mVar2 = (P6.m) this.f7015w;
        jVar = (P6.j) this.f7014v;
        aVarA = (i7.a) this.f7013u;
        C1.N(obj);
        mVar.f5535q = ((C0336c) obj).f6978b;
        C0344k c0344k2 = new C0344k(aVarA, jVar, mVar2, k8);
        List list = (List) aVar4.f1159t;
        if (list == null) {
            aVar = aVarA;
            aVar4.f1159t = null;
            this.f7013u = jVar;
            this.f7014v = mVar2;
            this.f7015w = aVar;
            this.f7016x = null;
            this.f7017y = null;
            this.f7010A = 3;
            if (aVar.b(this) != aVar3) {
            }
            return aVar3;
        }
        it = list.iterator();
        aVar2 = aVarA;
        jVar2 = jVar;
        mVar3 = mVar2;
        c0344k = c0344k2;
        while (it.hasNext()) {
        }
        mVar2 = mVar3;
        jVar = jVar2;
        aVar = aVar2;
        aVar4.f1159t = null;
        this.f7013u = jVar;
        this.f7014v = mVar2;
        this.f7015w = aVar;
        this.f7016x = null;
        this.f7017y = null;
        this.f7010A = 3;
        if (aVar.b(this) != aVar3) {
        }
        return aVar3;
    }
}
