package V2;

import com.debridstream.tv.HomeViewModel;
import m3.AbstractC2467b;
import w4.C3137A;

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

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

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

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

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

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

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        T1 t12 = new T1(this.f7542d, dVar);
        t12.f7541c = obj;
        return t12;
    }

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

    /* JADX WARN: Removed duplicated region for block: B:23:0x006f  */
    @Override // C4.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        V4.C c6;
        HomeViewModel homeViewModel;
        V4.C c7;
        V4.C c8;
        B4.a aVar = B4.a.f492a;
        int i6 = this.f7540b;
        HomeViewModel homeViewModel2 = this.f7542d;
        if (i6 == 0) {
            AbstractC2467b.l(obj);
            V4.C c9 = (V4.C) this.f7541c;
            this.f7541c = c9;
            this.f7539a = homeViewModel2;
            this.f7540b = 1;
            c5.e eVar = V4.N.f8259a;
            Object objH = V4.E.H(c5.d.f13466b, new C2(2, null), this);
            if (objH != aVar) {
                c6 = c9;
                obj = objH;
                homeViewModel = homeViewModel2;
            }
            return aVar;
        }
        if (i6 != 1) {
            if (i6 != 2) {
                if (i6 != 3) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                c8 = (V4.C) this.f7541c;
                AbstractC2467b.l(obj);
                V4.E.y(c8, null, null, new P1(2, null), 3);
                V4.E.y(c8, null, null, new S1(homeViewModel2, null), 3);
                homeViewModel2.loadHome();
                homeViewModel2.refreshHeroes();
                return C3137A.f25453a;
            }
            c7 = (V4.C) this.f7541c;
            AbstractC2467b.l(obj);
            this.f7541c = c7;
            this.f7540b = 3;
            if (homeViewModel2.refreshCatalogConfigsFromRemote(this) != aVar) {
                c8 = c7;
                V4.E.y(c8, null, null, new P1(2, null), 3);
                V4.E.y(c8, null, null, new S1(homeViewModel2, null), 3);
                homeViewModel2.loadHome();
                homeViewModel2.refreshHeroes();
                return C3137A.f25453a;
            }
            return aVar;
        }
        homeViewModel = this.f7539a;
        c6 = (V4.C) this.f7541c;
        AbstractC2467b.l(obj);
        this.f7541c = c6;
        this.f7539a = null;
        this.f7540b = 2;
        if (homeViewModel.applyCatalogConfigs((C0739x2) obj, this) != aVar) {
            c7 = c6;
            this.f7541c = c7;
            this.f7540b = 3;
            if (homeViewModel2.refreshCatalogConfigsFromRemote(this) != aVar) {
            }
        }
        return aVar;
    }
}
