package hp;

import java.util.List;

/* loaded from: classes3.dex */
public abstract class l1 {
    public static final m0 a(e0 e0Var) {
        kotlin.jvm.internal.t.g(e0Var, "<this>");
        s1 N0 = e0Var.N0();
        m0 m0Var = N0 instanceof m0 ? (m0) N0 : null;
        if (m0Var != null) {
            return m0Var;
        }
        throw new IllegalStateException(("This is should be simple type: " + e0Var).toString());
    }

    public static final e0 b(e0 e0Var, List newArguments, kotlin.reflect.jvm.internal.impl.descriptors.annotations.g newAnnotations) {
        kotlin.jvm.internal.t.g(e0Var, "<this>");
        kotlin.jvm.internal.t.g(newArguments, "newArguments");
        kotlin.jvm.internal.t.g(newAnnotations, "newAnnotations");
        return e(e0Var, newArguments, newAnnotations, null, 4, null);
    }

    public static final e0 c(e0 e0Var, List newArguments, kotlin.reflect.jvm.internal.impl.descriptors.annotations.g newAnnotations, List newArgumentsForUpperBound) {
        kotlin.jvm.internal.t.g(e0Var, "<this>");
        kotlin.jvm.internal.t.g(newArguments, "newArguments");
        kotlin.jvm.internal.t.g(newAnnotations, "newAnnotations");
        kotlin.jvm.internal.t.g(newArgumentsForUpperBound, "newArgumentsForUpperBound");
        if ((newArguments.isEmpty() || newArguments == e0Var.I0()) && newAnnotations == e0Var.getAnnotations()) {
            return e0Var;
        }
        z0 J0 = e0Var.J0();
        if ((newAnnotations instanceof kotlin.reflect.jvm.internal.impl.descriptors.annotations.l) && newAnnotations.isEmpty()) {
            newAnnotations = kotlin.reflect.jvm.internal.impl.descriptors.annotations.g.f26219f.b();
        }
        z0 a10 = a1.a(J0, newAnnotations);
        s1 N0 = e0Var.N0();
        if (N0 instanceof y) {
            y yVar = (y) N0;
            return f0.d(d(yVar.S0(), newArguments, a10), d(yVar.T0(), newArgumentsForUpperBound, a10));
        }
        if (N0 instanceof m0) {
            return d((m0) N0, newArguments, a10);
        }
        throw new rm.t();
    }

    public static final m0 d(m0 m0Var, List newArguments, z0 newAttributes) {
        kotlin.jvm.internal.t.g(m0Var, "<this>");
        kotlin.jvm.internal.t.g(newArguments, "newArguments");
        kotlin.jvm.internal.t.g(newAttributes, "newAttributes");
        return (newArguments.isEmpty() && newAttributes == m0Var.J0()) ? m0Var : newArguments.isEmpty() ? m0Var.Q0(newAttributes) : m0Var instanceof kotlin.reflect.jvm.internal.impl.types.error.h ? ((kotlin.reflect.jvm.internal.impl.types.error.h) m0Var).W0(newArguments) : f0.j(newAttributes, m0Var.K0(), newArguments, m0Var.L0(), null, 16, null);
    }

    public static /* synthetic */ e0 e(e0 e0Var, List list, kotlin.reflect.jvm.internal.impl.descriptors.annotations.g gVar, List list2, int i10, Object obj) {
        if ((i10 & 1) != 0) {
            list = e0Var.I0();
        }
        if ((i10 & 2) != 0) {
            gVar = e0Var.getAnnotations();
        }
        if ((i10 & 4) != 0) {
            list2 = list;
        }
        return c(e0Var, list, gVar, list2);
    }

    public static /* synthetic */ m0 f(m0 m0Var, List list, z0 z0Var, int i10, Object obj) {
        if ((i10 & 1) != 0) {
            list = m0Var.I0();
        }
        if ((i10 & 2) != 0) {
            z0Var = m0Var.J0();
        }
        return d(m0Var, list, z0Var);
    }
}
