package g.h0.c;

import java.util.List;
import java.util.Set;

/* JADX INFO: compiled from: TypeIntrinsics.java */
/* JADX INFO: loaded from: classes.dex */
public class f0 {
    public static List a(Object obj) {
        if ((obj instanceof g.h0.c.g0.a) && !(obj instanceof g.h0.c.g0.b)) {
            e(obj, "kotlin.collections.MutableList");
            throw null;
        }
        try {
            return (List) obj;
        } catch (ClassCastException e2) {
            l.j(e2, f0.class.getName());
            throw e2;
        }
    }

    public static Set b(Object obj) {
        if (obj instanceof g.h0.c.g0.a) {
            e(obj, "kotlin.collections.MutableSet");
            throw null;
        }
        try {
            return (Set) obj;
        } catch (ClassCastException e2) {
            l.j(e2, f0.class.getName());
            throw e2;
        }
    }

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

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

    public static void e(Object obj, String str) {
        ClassCastException classCastException = new ClassCastException(d.b.a.a.a.q(obj == null ? "null" : obj.getClass().getName(), " cannot be cast to ", str));
        l.j(classCastException, f0.class.getName());
        throw classCastException;
    }
}
