package h3;

import androidx.compose.runtime.State;
import java.util.Iterator;
import m3.AbstractC2467b;
import w4.C3137A;

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

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

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

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

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public n0.x f16809e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public n0.x f16810f;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public D.H f16811j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public int f16812k;
    public final /* synthetic */ n0.x l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final /* synthetic */ n0.x f16813m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final /* synthetic */ D.H f16814n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public final /* synthetic */ State f16815o;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public F2(n0.x xVar, n0.x xVar2, D.H h5, State state, A4.d dVar) {
        super(2, dVar);
        this.l = xVar;
        this.f16813m = xVar2;
        this.f16814n = h5;
        this.f16815o = state;
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /* JADX WARN: Type inference failed for: r7v3, types: [java.lang.Iterable, java.lang.Object, java.util.Collection] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final Object d(int i6, C4.c cVar, D.H h5) {
        E2 e22;
        if (cVar instanceof E2) {
            e22 = (E2) cVar;
            int i7 = e22.f16778b;
            if ((i7 & Integer.MIN_VALUE) != 0) {
                e22.f16778b = i7 - Integer.MIN_VALUE;
            } else {
                e22 = new E2(cVar);
            }
        }
        Object obj = e22.f16777a;
        B4.a aVar = B4.a.f492a;
        int i8 = e22.f16778b;
        C3137A c3137a = C3137A.f25453a;
        if (i8 == 0) {
            AbstractC2467b.l(obj);
            if (i6 >= 0) {
                ?? r7 = h5.i().f901k;
                if (!r7.isEmpty()) {
                    Iterator it = r7.iterator();
                    while (it.hasNext()) {
                        if (((D.x) it.next()).f907a == i6) {
                            break;
                        }
                    }
                }
                e22.f16778b = 1;
                if (D.H.k(h5, i6, e22) != aVar) {
                }
            }
        }
        if (i8 != 1) {
            if (i8 != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            AbstractC2467b.l(obj);
            return c3137a;
        }
        AbstractC2467b.l(obj);
        e22.f16778b = 2;
        return V4.E.l(48L, e22) == aVar ? aVar : c3137a;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        return new F2(this.l, this.f16813m, this.f16814n, this.f16815o, dVar);
    }

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

    /* JADX WARN: Code restructure failed: missing block: B:51:0x011d, code lost:
    
        if (V4.E.l(48, r19) != r2) goto L53;
     */
    /* JADX WARN: Removed duplicated region for block: B:33:0x00a9  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x00ce  */
    /* JADX WARN: Removed duplicated region for block: B:45:0x00ff  */
    /* JADX WARN: Removed duplicated region for block: B:49:0x0111  */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:43:0x00f3 -> B:44:0x00f8). Please report as a decompilation issue!!! */
    @Override // C4.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        n0.x xVar;
        n0.x xVar2;
        D.H h5;
        int i6;
        int i7;
        n0.x xVar3;
        n0.x xVar4;
        int i8;
        n0.x xVar5;
        n0.x xVar6;
        int i9;
        int i10;
        int i11;
        n0.x xVar7;
        int i12 = 1;
        B4.a aVar = B4.a.f492a;
        int i13 = this.f16812k;
        C3137A c3137a = C3137A.f25453a;
        D.H h6 = this.f16814n;
        if (i13 == 0) {
            AbstractC2467b.l(obj);
            float f6 = T2.f17380a;
            State state = this.f16815o;
            C2099d2 c2099d2 = ((C2105e2) state.getValue()).f17892b;
            String str = c2099d2 != null ? c2099d2.f17848a : null;
            int i14 = -1;
            if (str != null) {
                Iterator it = ((C2105e2) state.getValue()).f17891a.iterator();
                int i15 = 0;
                while (true) {
                    if (!it.hasNext()) {
                        break;
                    }
                    if (((C2099d2) it.next()).f17848a.equals(str)) {
                        i14 = i15;
                        break;
                    }
                    i15++;
                }
            }
            xVar = this.f16813m;
            if (i14 >= 0 && (xVar2 = this.l) != null) {
                h5 = h6;
                i6 = 10;
                i7 = i14;
                xVar3 = xVar2;
                xVar4 = xVar;
                i8 = 0;
                if (i8 < i6) {
                }
            }
            this.f16809e = xVar;
            this.f16810f = null;
            this.f16811j = null;
            this.f16812k = 3;
            if (D.H.k(h6, 0, this) != aVar) {
            }
            return aVar;
        }
        if (i13 == 1) {
            i8 = this.f16808d;
            i11 = this.f16807c;
            i10 = this.f16806b;
            i9 = this.f16805a;
            h5 = this.f16811j;
            xVar6 = this.f16810f;
            xVar7 = this.f16809e;
            AbstractC2467b.l(obj);
            if (!n0.x.a(xVar7)) {
            }
            return c3137a;
        }
        if (i13 == 2) {
            int i16 = this.f16807c;
            int i17 = this.f16806b;
            i7 = this.f16805a;
            D.H h7 = this.f16811j;
            n0.x xVar8 = this.f16810f;
            n0.x xVar9 = this.f16809e;
            AbstractC2467b.l(obj);
            int i18 = 1;
            char c6 = 2;
            xVar4 = xVar8;
            h5 = h7;
            i6 = i17;
            xVar3 = xVar9;
            i8 = i16 + 1;
            i12 = i18;
            if (i8 < i6) {
                this.f16809e = xVar3;
                this.f16810f = xVar4;
                this.f16811j = h5;
                this.f16805a = i7;
                this.f16806b = i6;
                this.f16807c = i8;
                this.f16808d = i8;
                this.f16812k = i12;
                if (d(i7, this, h5) != aVar) {
                    int i19 = i6;
                    i9 = i7;
                    i10 = i19;
                    xVar6 = xVar4;
                    xVar7 = xVar3;
                    i11 = i8;
                    if (!n0.x.a(xVar7)) {
                        i18 = i12;
                        long j4 = (((long) i8) * 32) + ((long) 32);
                        this.f16809e = xVar7;
                        this.f16810f = xVar6;
                        this.f16811j = h5;
                        this.f16805a = i9;
                        this.f16806b = i10;
                        i16 = i11;
                        this.f16807c = i16;
                        c6 = 2;
                        this.f16812k = 2;
                        if (V4.E.l(j4, this) != aVar) {
                            int i20 = i9;
                            i6 = i10;
                            i7 = i20;
                            xVar3 = xVar7;
                            xVar4 = xVar6;
                            i8 = i16 + 1;
                            i12 = i18;
                            if (i8 < i6) {
                                xVar = xVar4;
                                this.f16809e = xVar;
                                this.f16810f = null;
                                this.f16811j = null;
                                this.f16812k = 3;
                                if (D.H.k(h6, 0, this) != aVar) {
                                    xVar5 = xVar;
                                    this.f16809e = xVar5;
                                    this.f16812k = 4;
                                }
                            }
                        }
                    }
                    return c3137a;
                }
                return aVar;
            }
        } else {
            if (i13 != 3) {
                if (i13 != 4) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                xVar5 = this.f16809e;
                AbstractC2467b.l(obj);
                if (xVar5 != null) {
                    n0.x.a(xVar5);
                }
                return c3137a;
            }
            xVar5 = this.f16809e;
            AbstractC2467b.l(obj);
            this.f16809e = xVar5;
            this.f16812k = 4;
        }
    }
}
