package f.z.d;

/* JADX INFO: compiled from: TypeIntrinsics.java */
/* JADX INFO: loaded from: classes.dex */
public class y {
    public static Iterable a(Object obj) {
        if (!(obj instanceof f.z.d.z.a)) {
            return c(obj);
        }
        h(obj, "kotlin.collections.MutableIterable");
        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 Iterable c(Object obj) {
        try {
            return (Iterable) obj;
        } catch (ClassCastException e2) {
            g(e2);
            throw null;
        }
    }

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

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

    private static <T extends Throwable> T f(T t) {
        k.j(t, y.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;
    }
}
