package N5;

import Z6.InterfaceC0382w;
import c7.K;
import com.google.android.gms.internal.measurement.C1;
import com.martsnew.domain.type.MediaType;
import y5.C1763h;

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

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

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public final /* synthetic */ String f4787v;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public final /* synthetic */ MediaType f4788w;

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

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public t(String str, MediaType mediaType, u uVar, int i, E6.d dVar) {
        super(2, dVar);
        this.f4787v = str;
        this.f4788w = mediaType;
        this.f4789x = uVar;
        this.f4790y = i;
    }

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

    @Override // G6.a
    public final E6.d m(E6.d dVar, Object obj) {
        return new t(this.f4787v, this.f4788w, this.f4789x, this.f4790y, dVar);
    }

    /* JADX WARN: Removed duplicated region for block: B:18:0x004a A[RETURN] */
    /* JADX WARN: Type inference failed for: r11v13, types: [java.lang.Object, java.util.List] */
    @Override // G6.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object p(Object obj) throws Throwable {
        String str;
        String str2;
        Object objA;
        F6.a aVar = F6.a.f2580q;
        int i = this.f4786u;
        u uVar = this.f4789x;
        if (i == 0) {
            C1.N(obj);
            String str3 = this.f4787v;
            if (str3.equals("trending")) {
                str2 = "day";
            } else if (str3.equals("popular")) {
                str2 = this.f4788w.f11108q;
            } else {
                str = null;
                this.f4786u = 1;
                objA = uVar.f4791d.a(str3, str, this.f4790y, 30, this);
                if (objA == aVar) {
                    return aVar;
                }
            }
            str = str2;
            this.f4786u = 1;
            objA = uVar.f4791d.a(str3, str, this.f4790y, 30, this);
            if (objA == aVar) {
            }
        } else {
            if (i != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            C1.N(obj);
            objA = ((A6.j) obj).f449q;
        }
        if (!(objA instanceof A6.i)) {
            C1763h c1763h = new C1763h(new q(((k5.m) objA).f13982c));
            K k8 = uVar.f4792e;
            k8.getClass();
            k8.g(null, c1763h);
        }
        return A6.n.f457a;
    }
}
