package V2;

import com.debridstream.tv.HomeViewModel;
import java.util.ArrayList;
import m3.AbstractC2467b;
import w4.C3137A;

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

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public e5.a f7716a;

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ HomeViewModel f7719d;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0645c2(HomeViewModel homeViewModel, A4.d dVar) {
        super(2, dVar);
        this.f7719d = homeViewModel;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        return new C0645c2(this.f7719d, dVar);
    }

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

    /* JADX WARN: Code restructure failed: missing block: B:28:0x0099, code lost:
    
        if (V4.E.k(r1, r10) == r0) goto L29;
     */
    @Override // C4.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        HomeViewModel homeViewModel;
        e5.a aVar;
        B4.a aVar2 = B4.a.f492a;
        int i6 = this.f7718c;
        HomeViewModel homeViewModel2 = this.f7719d;
        try {
            if (i6 == 0) {
                AbstractC2467b.l(obj);
                e5.a aVar3 = homeViewModel2.sectionLoadMutex;
                this.f7716a = aVar3;
                this.f7717b = homeViewModel2;
                this.f7718c = 1;
                e5.c cVar = (e5.c) aVar3;
                if (cVar.e(this) != aVar2) {
                    homeViewModel = homeViewModel2;
                    aVar = cVar;
                }
                return aVar2;
            }
            if (i6 != 1) {
                if (i6 != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                AbstractC2467b.l(obj);
                return C3137A.f25453a;
            }
            homeViewModel = this.f7717b;
            e5.a aVar4 = this.f7716a;
            AbstractC2467b.l(obj);
            aVar = aVar4;
            ArrayList arrayList = new ArrayList();
            for (AbstractC0742y1 abstractC0742y1 : homeViewModel.configsKidsMain) {
                if (!homeViewModel.loadedKidsMain.contains(abstractC0742y1.a()) && !homeViewModel.loadingKidsMain.contains(abstractC0742y1.a())) {
                    homeViewModel.loadingKidsMain.add(abstractC0742y1.a());
                    arrayList.add(abstractC0742y1);
                }
            }
            ((e5.c) aVar).g(null);
            C0640b2 c0640b2 = new C0640b2(arrayList, homeViewModel2, null);
            this.f7716a = null;
            this.f7717b = null;
            this.f7718c = 2;
        } catch (Throwable th) {
            ((e5.c) aVar).g(null);
            throw th;
        }
    }
}
