package V2;

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

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

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

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

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

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

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

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

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

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final /* synthetic */ HomeViewModel f8089k;
    public final /* synthetic */ F1 l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final /* synthetic */ int f8090m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final /* synthetic */ int f8091n;

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

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public final /* synthetic */ Set f8093p;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0723t2(HomeViewModel homeViewModel, F1 f12, int i6, int i7, List list, Set set, A4.d dVar) {
        super(2, dVar);
        this.f8089k = homeViewModel;
        this.l = f12;
        this.f8090m = i6;
        this.f8091n = i7;
        this.f8092o = list;
        this.f8093p = set;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        return new C0723t2(this.f8089k, this.l, this.f8090m, this.f8091n, this.f8092o, this.f8093p, dVar);
    }

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

    /* JADX WARN: Code restructure failed: missing block: B:27:0x00b9, code lost:
    
        if (V4.E.k(r2, r14) == r0) goto L28;
     */
    @Override // C4.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        Set setLoadingSetFor;
        List list;
        Set set;
        int i6;
        int i7;
        e5.a aVar;
        int i8;
        B4.a aVar2 = B4.a.f492a;
        int i9 = this.f8088j;
        HomeViewModel homeViewModel = this.f8089k;
        F1 f12 = this.l;
        try {
            if (i9 == 0) {
                AbstractC2467b.l(obj);
                setLoadingSetFor = homeViewModel.loadingSetFor(f12);
                e5.a aVar3 = homeViewModel.sectionLoadMutex;
                this.f8082a = setLoadingSetFor;
                this.f8083b = aVar3;
                list = this.f8092o;
                this.f8084c = list;
                set = this.f8093p;
                this.f8085d = set;
                i6 = this.f8090m;
                this.f8086e = i6;
                i7 = this.f8091n;
                this.f8087f = i7;
                this.f8088j = 1;
                e5.c cVar = (e5.c) aVar3;
                Object objE = cVar.e(this);
                aVar = cVar;
                if (objE != aVar2) {
                }
                return aVar2;
            }
            if (i9 != 1) {
                if (i9 != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                AbstractC2467b.l(obj);
                return C3137A.f25453a;
            }
            i7 = this.f8087f;
            i6 = this.f8086e;
            set = this.f8085d;
            list = this.f8084c;
            e5.a aVar4 = this.f8083b;
            setLoadingSetFor = this.f8082a;
            AbstractC2467b.l(obj);
            aVar = aVar4;
            ArrayList arrayList = new ArrayList((i8 - i7) + 1);
            if (i7 <= i8) {
                while (true) {
                    AbstractC0742y1 abstractC0742y1 = (AbstractC0742y1) list.get(i7);
                    if (!set.contains(abstractC0742y1.a()) && !setLoadingSetFor.contains(abstractC0742y1.a())) {
                        setLoadingSetFor.add(abstractC0742y1.a());
                        arrayList.add(abstractC0742y1);
                    }
                    if (i7 == i8) {
                        break;
                    }
                    i7++;
                }
            }
            ((e5.c) aVar).g(null);
            C0719s2 c0719s2 = new C0719s2(arrayList, homeViewModel, f12, this.f8093p, setLoadingSetFor, null);
            this.f8082a = null;
            this.f8083b = null;
            this.f8084c = null;
            this.f8085d = null;
            this.f8088j = 2;
        } catch (Throwable th) {
            ((e5.c) aVar).g(null);
            throw th;
        }
        i8 = i6;
    }
}
