package o5;

import com.google.android.gms.internal.measurement.C1;
import com.martsnew.data.model.response.PageDataResponse;
import com.martsnew.domain.type.MediaType;
import f5.C0926C;
import f5.C0959t;
import f5.C0960u;
import f5.C0962w;
import h5.AbstractC1033b;
import java.util.List;
import l5.EnumC1135d;
import n4.u0;

/* JADX INFO: loaded from: classes.dex */
public final class y {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final C0926C f15823a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final j5.q f15824b;

    public y(C0926C c0926c, j5.q qVar) {
        P6.g.e(c0926c, "movieRepository");
        P6.g.e(qVar, "movieMapper");
        this.f15823a = c0926c;
        this.f15824b = qVar;
    }

    /* JADX WARN: Removed duplicated region for block: B:8:0x0015  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object a(MediaType mediaType, EnumC1135d enumC1135d, int i, int i5, G6.c cVar) {
        x xVar;
        y yVar;
        int i8;
        int i9;
        X4.c cVar2;
        if (cVar instanceof x) {
            xVar = (x) cVar;
            int i10 = xVar.f15822y;
            if ((i10 & Integer.MIN_VALUE) != 0) {
                xVar.f15822y = i10 - Integer.MIN_VALUE;
            } else {
                xVar = new x(this, cVar);
            }
        }
        x xVar2 = xVar;
        Object objA = xVar2.f15820w;
        F6.a aVar = F6.a.f2580q;
        int i11 = xVar2.f15822y;
        if (i11 == 0) {
            C1.N(objA);
            int iOrdinal = enumC1135d.ordinal();
            C0926C c0926c = this.f15823a;
            if (iOrdinal == 0) {
                String str = mediaType.f11108q;
                xVar2.f15817t = this;
                xVar2.f15818u = i;
                xVar2.f15819v = i5;
                xVar2.f15822y = 1;
                c0926c.getClass();
                o6.x xVar3 = AbstractC1033b.f13423a;
                objA = AbstractC1033b.a(new C0959t(i, i5, null, c0926c, str), xVar2);
                if (objA != aVar) {
                    yVar = this;
                    i8 = i;
                    i9 = i5;
                    cVar2 = (X4.c) objA;
                }
            } else if (iOrdinal == 1) {
                String str2 = mediaType.f11108q;
                xVar2.f15817t = this;
                xVar2.f15818u = i;
                xVar2.f15819v = i5;
                xVar2.f15822y = 3;
                c0926c.getClass();
                o6.x xVar4 = AbstractC1033b.f13423a;
                objA = AbstractC1033b.a(new C0962w(i, i5, null, c0926c, str2), xVar2);
                if (objA != aVar) {
                    yVar = this;
                    i8 = i;
                    i9 = i5;
                    cVar2 = (X4.c) objA;
                }
            } else {
                if (iOrdinal != 2) {
                    throw new A6.b();
                }
                String str3 = mediaType.f11108q;
                xVar2.f15817t = this;
                xVar2.f15818u = i;
                xVar2.f15819v = i5;
                xVar2.f15822y = 2;
                c0926c.getClass();
                o6.x xVar5 = AbstractC1033b.f13423a;
                objA = AbstractC1033b.a(new C0960u(i, i5, null, c0926c, str3), xVar2);
                if (objA != aVar) {
                    yVar = this;
                    i8 = i;
                    i9 = i5;
                    cVar2 = (X4.c) objA;
                }
            }
            return aVar;
        }
        if (i11 == 1) {
            i9 = xVar2.f15819v;
            i8 = xVar2.f15818u;
            yVar = xVar2.f15817t;
            C1.N(objA);
            cVar2 = (X4.c) objA;
        } else if (i11 == 2) {
            i9 = xVar2.f15819v;
            i8 = xVar2.f15818u;
            yVar = xVar2.f15817t;
            C1.N(objA);
            cVar2 = (X4.c) objA;
        } else {
            if (i11 != 3) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            i9 = xVar2.f15819v;
            i8 = xVar2.f15818u;
            yVar = xVar2.f15817t;
            C1.N(objA);
            cVar2 = (X4.c) objA;
        }
        if (cVar2 instanceof X4.a) {
            return C1.j(((X4.a) cVar2).f7227a);
        }
        if (!(cVar2 instanceof X4.b)) {
            throw new A6.b();
        }
        j5.q qVar = yVar.f15824b;
        List list = ((PageDataResponse) ((X4.b) cVar2).f7228a).f10896e;
        qVar.getClass();
        return new k5.m(i8, i9, u0.u(qVar, list));
    }
}
