package F5;

import Z6.InterfaceC0382w;
import c7.K;
import com.google.android.gms.internal.measurement.C1;
import com.martsnew.domain.model.Genre;
import java.util.List;

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

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

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

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

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public A(C c3, Genre genre, E6.d dVar) {
        super(2, dVar);
        this.f2513w = c3;
        this.f2514x = genre;
    }

    @Override // O6.p
    public final Object k(Object obj, Object obj2) {
        return ((A) 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 A(this.f2513w, this.f2514x, dVar);
    }

    /* JADX WARN: Code restructure failed: missing block: B:25:0x00a6, code lost:
    
        if (r6.f(r1, r10) == r0) goto L26;
     */
    /* JADX WARN: Removed duplicated region for block: B:21:0x007d  */
    /* JADX WARN: Removed duplicated region for block: B:24:0x009e  */
    @Override // G6.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object p(Object obj) throws Throwable {
        Object objA;
        Throwable thA;
        F6.a aVar = F6.a.f2580q;
        int i = this.f2512v;
        Genre genre = this.f2514x;
        C c3 = this.f2513w;
        if (i != 0) {
            if (i != 1) {
                if (i != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                C1.N(obj);
                return A6.n.f457a;
            }
            C1.N(obj);
            objA = ((A6.j) obj).f449q;
            if (!(objA instanceof A6.i)) {
                k5.m mVar = (k5.m) objA;
                K k8 = c3.f2523g;
                Object obj2 = mVar.f13982c;
                k8.getClass();
                k8.g(null, obj2);
                c3.f2524h.put(new Long(genre.f11046q), mVar.f13982c);
            }
            thA = A6.j.a(objA);
            if (thA != null) {
                this.f2511u = objA;
                this.f2512v = 2;
            }
            return A6.n.f457a;
        }
        C1.N(obj);
        boolean zContainsKey = c3.f2524h.containsKey(new Long(genre.f11046q));
        long j8 = genre.f11046q;
        if (zContainsKey) {
            Object obj3 = (List) c3.f2524h.get(new Long(j8));
            if (obj3 == null) {
                obj3 = B6.t.f1032q;
            }
            K k9 = c3.f2523g;
            k9.getClass();
            k9.g(null, obj3);
            return A6.n.f457a;
        }
        c3.i.put(new Long(j8), new Integer(1));
        List listC = C1.C(new Long(j8));
        this.f2512v = 1;
        objA = c3.f2521e.a(listC, 1, 30, this);
        if (objA != aVar) {
            if (!(objA instanceof A6.i)) {
            }
            thA = A6.j.a(objA);
            if (thA != null) {
            }
            return A6.n.f457a;
        }
        return aVar;
    }
}
