package kotlin.jvm.internal;

import androidx.compose.runtime.internal.ComposableLambda;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
import w4.InterfaceC3143e;

/* JADX INFO: loaded from: classes3.dex */
public abstract class F {
    public static Collection a(Object obj) {
        if ((obj instanceof K4.a) && !(obj instanceof K4.b)) {
            f(obj, "kotlin.collections.MutableCollection");
            throw null;
        }
        try {
            return (Collection) obj;
        } catch (ClassCastException e6) {
            o.l(e6, F.class.getName());
            throw e6;
        }
    }

    public static Map b(Object obj) {
        if ((obj instanceof K4.a) && !(obj instanceof K4.e)) {
            f(obj, "kotlin.collections.MutableMap");
            throw null;
        }
        try {
            return (Map) obj;
        } catch (ClassCastException e6) {
            o.l(e6, F.class.getName());
            throw e6;
        }
    }

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

    public static boolean d(int i6, Object obj) {
        int arity;
        if (obj instanceof InterfaceC3143e) {
            if (obj instanceof j) {
                arity = ((j) obj).getArity();
            } else if (obj instanceof J4.a) {
                arity = 0;
            } else if (obj instanceof J4.c) {
                arity = 1;
            } else if (obj instanceof J4.e) {
                arity = 2;
            } else if (obj instanceof J4.f) {
                arity = 3;
            } else if (obj instanceof J4.g) {
                arity = 4;
            } else if (obj instanceof J4.h) {
                arity = 5;
            } else if (obj instanceof J4.i) {
                arity = 6;
            } else if (obj instanceof J4.j) {
                arity = 7;
            } else if (obj instanceof J4.k) {
                arity = 8;
            } else {
                boolean z6 = obj instanceof ComposableLambda;
                arity = z6 ? 9 : z6 ? 10 : z6 ? 11 : z6 ? 13 : z6 ? 14 : z6 ? 15 : z6 ? 16 : z6 ? 17 : z6 ? 18 : z6 ? 19 : z6 ? 20 : z6 ? 21 : -1;
            }
            if (arity == i6) {
                return true;
            }
        }
        return false;
    }

    public static boolean e(LinkedHashMap linkedHashMap) {
        if (linkedHashMap != null) {
            return !(linkedHashMap instanceof K4.a) || (linkedHashMap instanceof K4.e);
        }
        return false;
    }

    public static void f(Object obj, String str) {
        ClassCastException classCastException = new ClassCastException(Z0.o.B(obj == null ? "null" : obj.getClass().getName(), " cannot be cast to ", str));
        o.l(classCastException, F.class.getName());
        throw classCastException;
    }
}
