package defpackage;

import java.util.AbstractCollection;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

/* JADX INFO: loaded from: classes3.dex */
public class hz9 {
    public static Collection a(AbstractCollection abstractCollection) {
        if (!(abstractCollection instanceof f25) || (abstractCollection instanceof g25)) {
            return abstractCollection;
        }
        g(abstractCollection, "kotlin.collections.MutableCollection");
        throw null;
    }

    public static List b(Object obj) {
        if ((obj instanceof f25) && !(obj instanceof j25)) {
            g(obj, "kotlin.collections.MutableList");
            throw null;
        }
        try {
            return (List) obj;
        } catch (ClassCastException e) {
            cr4.k(e, hz9.class.getName());
            throw e;
        }
    }

    public static Map c(Map map) {
        if ((map instanceof f25) && !(map instanceof l25)) {
            g(map, "kotlin.collections.MutableMap");
            throw null;
        }
        try {
            return map;
        } catch (ClassCastException e) {
            cr4.k(e, hz9.class.getName());
            throw e;
        }
    }

    public static Set d(Object obj) {
        if ((obj instanceof f25) && !(obj instanceof m25)) {
            g(obj, "kotlin.collections.MutableSet");
            throw null;
        }
        try {
            return (Set) obj;
        } catch (ClassCastException e) {
            cr4.k(e, hz9.class.getName());
            throw e;
        }
    }

    public static void e(int i, Object obj) {
        if (obj == null || f(i, obj)) {
            return;
        }
        g(obj, "kotlin.jvm.functions.Function" + i);
        throw null;
    }

    public static boolean f(int i, Object obj) {
        if (obj instanceof lr3) {
            if ((obj instanceof tr3 ? ((tr3) obj).getArity() : obj instanceof qq3 ? 0 : obj instanceof sq3 ? 1 : obj instanceof gr3 ? 2 : obj instanceof ir3 ? 3 : obj instanceof kr3 ? 4 : obj instanceof mr3 ? 5 : obj instanceof nr3 ? 6 : obj instanceof or3 ? 7 : obj instanceof pr3 ? 8 : obj instanceof qr3 ? 9 : obj instanceof rq3 ? 10 : obj instanceof tq3 ? 11 : obj instanceof uq3 ? 12 : obj instanceof vq3 ? 13 : obj instanceof wq3 ? 14 : obj instanceof xq3 ? 15 : obj instanceof yq3 ? 16 : obj instanceof zq3 ? 17 : obj instanceof ar3 ? 18 : obj instanceof br3 ? 19 : obj instanceof dr3 ? 20 : obj instanceof er3 ? 21 : obj instanceof fr3 ? 22 : -1) == i) {
                return true;
            }
        }
        return false;
    }

    public static void g(Object obj, String str) {
        ClassCastException classCastException = new ClassCastException(vw2.l(obj == null ? "null" : obj.getClass().getName(), " cannot be cast to ", str));
        cr4.k(classCastException, hz9.class.getName());
        throw classCastException;
    }
}
