package j.p0.d;

import java.util.List;

/* JADX INFO: compiled from: TypeIntrinsics.java */
/* JADX INFO: loaded from: classes.dex */
public class h0 {
    public static List a(Object obj) {
        if (!(obj instanceof j.p0.d.i0.a) || (obj instanceof j.p0.d.i0.b)) {
            return c(obj);
        }
        h(obj, "kotlin.collections.MutableList");
        throw null;
    }

    public static Object b(Object obj, int i2) {
        if (obj == null || e(obj, i2)) {
            return obj;
        }
        h(obj, "kotlin.jvm.functions.Function" + i2);
        throw null;
    }

    public static List c(Object obj) {
        try {
            return (List) obj;
        } catch (ClassCastException e) {
            g(e);
            throw null;
        }
    }

    public static int d(Object obj) {
        if (obj instanceof m) {
            return ((m) obj).getArity();
        }
        if (obj instanceof j.p0.c.a) {
            return 0;
        }
        if (obj instanceof j.p0.c.l) {
            return 1;
        }
        if (obj instanceof j.p0.c.p) {
            return 2;
        }
        if (obj instanceof j.p0.c.q) {
            return 3;
        }
        if (obj instanceof j.p0.c.r) {
            return 4;
        }
        if (obj instanceof j.p0.c.s) {
            return 5;
        }
        if (obj instanceof j.p0.c.t) {
            return 6;
        }
        if (obj instanceof j.p0.c.u) {
            return 7;
        }
        if (obj instanceof j.p0.c.v) {
            return 8;
        }
        if (obj instanceof j.p0.c.w) {
            return 9;
        }
        if (obj instanceof j.p0.c.b) {
            return 10;
        }
        if (obj instanceof j.p0.c.c) {
            return 11;
        }
        if (obj instanceof j.p0.c.d) {
            return 12;
        }
        if (obj instanceof j.p0.c.e) {
            return 13;
        }
        if (obj instanceof j.p0.c.f) {
            return 14;
        }
        if (obj instanceof j.p0.c.g) {
            return 15;
        }
        if (obj instanceof j.p0.c.h) {
            return 16;
        }
        if (obj instanceof j.p0.c.i) {
            return 17;
        }
        if (obj instanceof j.p0.c.j) {
            return 18;
        }
        if (obj instanceof j.p0.c.k) {
            return 19;
        }
        if (obj instanceof j.p0.c.m) {
            return 20;
        }
        if (obj instanceof j.p0.c.n) {
            return 21;
        }
        return obj instanceof j.p0.c.o ? 22 : -1;
    }

    public static boolean e(Object obj, int i2) {
        return (obj instanceof j.g) && d(obj) == i2;
    }

    private static <T extends Throwable> T f(T t) {
        r.l(t, h0.class.getName());
        return t;
    }

    public static ClassCastException g(ClassCastException classCastException) {
        f(classCastException);
        throw classCastException;
    }

    public static void h(Object obj, String str) {
        i((obj == null ? "null" : obj.getClass().getName()) + " cannot be cast to " + str);
        throw null;
    }

    public static void i(String str) {
        g(new ClassCastException(str));
        throw null;
    }
}
