package Y5;

import A6.n;
import O6.p;
import Z6.AbstractC0385z;
import Z6.InterfaceC0382w;
import Z6.J;
import c6.C0585a;
import c7.K;
import com.google.android.gms.internal.measurement.C1;
import com.martsnew.domain.model.LatestVersion;
import com.martsnew.tv.R;
import f4.C0922b;
import n4.u0;
import y5.C1763h;

/* JADX INFO: loaded from: classes.dex */
public final class h extends G6.i implements p {

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

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

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

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public final /* synthetic */ j f7337x;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public h(j jVar, E6.d dVar) {
        super(2, dVar);
        this.f7337x = jVar;
    }

    @Override // O6.p
    public final Object k(Object obj, Object obj2) {
        return ((h) m((E6.d) obj2, (InterfaceC0382w) obj)).p(n.f457a);
    }

    @Override // G6.a
    public final E6.d m(E6.d dVar, Object obj) {
        return new h(this.f7337x, dVar);
    }

    /* JADX WARN: Code restructure failed: missing block: B:40:0x00e3, code lost:
    
        if (r3.f7341f.a(r11) == r0) goto L49;
     */
    /* JADX WARN: Code restructure failed: missing block: B:48:0x0107, code lost:
    
        if (r12 != r0) goto L50;
     */
    /* JADX WARN: Removed duplicated region for block: B:17:0x0060  */
    /* JADX WARN: Removed duplicated region for block: B:23:0x007d  */
    /* JADX WARN: Removed duplicated region for block: B:29:0x00a0  */
    /* JADX WARN: Removed duplicated region for block: B:30:0x00b0  */
    /* JADX WARN: Removed duplicated region for block: B:37:0x00d0  */
    @Override // G6.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object p(Object obj) throws Throwable {
        Object objA;
        Throwable thA;
        Throwable th;
        Throwable th2;
        Object objA2;
        F6.a aVar = F6.a.f2580q;
        int i = this.f7336w;
        n nVar = n.f457a;
        j jVar = this.f7337x;
        g gVar = g.f7330s;
        K k8 = jVar.i;
        switch (i) {
            case u0.f15495q /* 0 */:
                C1.N(obj);
                this.f7336w = 1;
                objA = jVar.f7342g.a(false, this);
                if (objA != aVar) {
                    if (!(objA instanceof A6.i)) {
                        LatestVersion latestVersion = (LatestVersion) objA;
                        if (latestVersion.f11052r > 1) {
                            jVar.f7344j = latestVersion;
                            C1763h c1763h = new C1763h(g.f7331t);
                            k8.getClass();
                            k8.g(null, c1763h);
                            return nVar;
                        }
                    }
                    thA = A6.j.a(objA);
                    if (thA == null) {
                        this.f7334u = jVar;
                        this.f7335v = thA;
                        this.f7336w = 2;
                        g7.e eVar = J.f7474a;
                        Object objC = AbstractC0385z.C(g7.d.f12985s, new C0585a(2, null), this);
                        if (objC != aVar) {
                            th = thA;
                            obj = objC;
                            if (!((Boolean) obj).booleanValue()) {
                                K k9 = jVar.i;
                                C1763h c1763h2 = new C1763h(g.f7332u);
                                k9.getClass();
                                k9.g(null, c1763h2);
                                C0922b.a().b(th);
                                return nVar;
                            }
                            y5.n nVar2 = new y5.n(R.string.message_no_internet);
                            this.f7334u = th;
                            this.f7335v = null;
                            this.f7336w = 3;
                            if (jVar.g(nVar2, this) != aVar) {
                                th2 = th;
                                th = th2;
                                C0922b.a().b(th);
                                return nVar;
                            }
                        }
                    } else if (!jVar.f7340e.f16277a.b()) {
                        this.f7336w = 5;
                        if (AbstractC0385z.h(1000L, this) != aVar) {
                            this.f7336w = 6;
                            objA2 = jVar.f7339d.a(this);
                        }
                    } else {
                        this.f7336w = 4;
                    }
                    break;
                }
                return aVar;
            case 1:
                C1.N(obj);
                objA = ((A6.j) obj).f449q;
                if (!(objA instanceof A6.i)) {
                }
                thA = A6.j.a(objA);
                if (thA == null) {
                }
                return aVar;
            case 2:
                th = this.f7335v;
                jVar = (j) this.f7334u;
                C1.N(obj);
                if (!((Boolean) obj).booleanValue()) {
                }
                break;
            case 3:
                th2 = (Throwable) this.f7334u;
                C1.N(obj);
                th = th2;
                C0922b.a().b(th);
                return nVar;
            case 4:
                C1.N(obj);
                ((A6.j) obj).getClass();
                C1763h c1763h3 = new C1763h(gVar);
                k8.getClass();
                k8.g(null, c1763h3);
                return nVar;
            case 5:
                C1.N(obj);
                this.f7336w = 6;
                objA2 = jVar.f7339d.a(this);
                break;
            case Z.g.STRING_SET_FIELD_NUMBER /* 6 */:
                C1.N(obj);
                objA2 = ((A6.j) obj).f449q;
                if (objA2 instanceof A6.i) {
                    objA2 = null;
                }
                if (P6.g.a(objA2, Boolean.TRUE)) {
                    C1763h c1763h4 = new C1763h(g.f7329r);
                    k8.getClass();
                    k8.g(null, c1763h4);
                    return nVar;
                }
                C1763h c1763h5 = new C1763h(gVar);
                k8.getClass();
                k8.g(null, c1763h5);
                return nVar;
            default:
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
        }
    }
}
