package o5;

import com.google.android.gms.internal.measurement.AbstractC0707u1;
import com.google.android.gms.internal.measurement.C1;
import f5.C0926C;
import f5.C0952m;
import h5.AbstractC1033b;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import l5.EnumC1134c;
import n4.u0;

/* JADX INFO: renamed from: o5.o, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1376o {

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

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

    public C1376o(C0926C c0926c, j5.m mVar) {
        P6.g.e(c0926c, "movieRepository");
        P6.g.e(mVar, "historyMapper");
        this.f15787a = c0926c;
        this.f15788b = mVar;
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Serializable a(EnumC1134c enumC1134c, G6.c cVar) {
        C1375n c1375n;
        String strN;
        C1376o c1376o;
        if (cVar instanceof C1375n) {
            c1375n = (C1375n) cVar;
            int i = c1375n.f15786w;
            if ((i & Integer.MIN_VALUE) != 0) {
                c1375n.f15786w = i - Integer.MIN_VALUE;
            } else {
                c1375n = new C1375n(this, cVar);
            }
        }
        Object objA = c1375n.f15784u;
        F6.a aVar = F6.a.f2580q;
        int i5 = c1375n.f15786w;
        if (i5 == 0) {
            C1.N(objA);
            int iOrdinal = enumC1134c.ordinal();
            if (iOrdinal == 0) {
                strN = null;
            } else if (iOrdinal == 1) {
                strN = AbstractC0707u1.n(new Date());
            } else {
                if (iOrdinal != 2) {
                    throw new A6.b();
                }
                strN = AbstractC0707u1.n(new Date(System.currentTimeMillis() - 86400000));
            }
            c1375n.f15783t = this;
            c1375n.f15786w = 1;
            C0926C c0926c = this.f15787a;
            c0926c.getClass();
            o6.x xVar = AbstractC1033b.f13423a;
            objA = AbstractC1033b.a(new C0952m(strN, c0926c, null), c1375n);
            if (objA == aVar) {
                return aVar;
            }
            c1376o = this;
        } else {
            if (i5 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            c1376o = c1375n.f15783t;
            C1.N(objA);
        }
        X4.c cVar2 = (X4.c) objA;
        if (!(cVar2 instanceof X4.b)) {
            if (cVar2 instanceof X4.a) {
                return C1.j(((X4.a) cVar2).f7227a);
            }
            throw new A6.b();
        }
        j5.m mVar = c1376o.f15788b;
        List list = (List) ((X4.b) cVar2).f7228a;
        mVar.getClass();
        return (Serializable) u0.u(mVar, list);
    }
}
