package o1;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import p1.AbstractC0692a;

/* JADX INFO: Access modifiers changed from: package-private */
/* JADX INFO: renamed from: o1.n, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractC0678n extends AbstractC0677m {
    public static final Collection c(Object[] objArr) {
        kotlin.jvm.internal.l.e(objArr, "<this>");
        return new C0667c(objArr, false);
    }

    public static final int d(List list, Comparable comparable, int i2, int i3) {
        kotlin.jvm.internal.l.e(list, "<this>");
        l(list.size(), i2, i3);
        int i4 = i3 - 1;
        while (i2 <= i4) {
            int i5 = (i2 + i4) >>> 1;
            int iA = AbstractC0692a.a((Comparable) list.get(i5), comparable);
            if (iA < 0) {
                i2 = i5 + 1;
            } else {
                if (iA <= 0) {
                    return i5;
                }
                i4 = i5 - 1;
            }
        }
        return -(i2 + 1);
    }

    public static /* synthetic */ int e(List list, Comparable comparable, int i2, int i3, int i4, Object obj) {
        if ((i4 & 2) != 0) {
            i2 = 0;
        }
        if ((i4 & 4) != 0) {
            i3 = list.size();
        }
        return d(list, comparable, i2, i3);
    }

    public static List f() {
        return x.f6004b;
    }

    public static int g(List list) {
        kotlin.jvm.internal.l.e(list, "<this>");
        return list.size() - 1;
    }

    public static List h(Object... elements) {
        kotlin.jvm.internal.l.e(elements, "elements");
        return elements.length > 0 ? AbstractC0668d.b(elements) : AbstractC0676l.f();
    }

    public static List i(Object... elements) {
        kotlin.jvm.internal.l.e(elements, "elements");
        return AbstractC0672h.o(elements);
    }

    public static List j(Object... elements) {
        kotlin.jvm.internal.l.e(elements, "elements");
        return elements.length == 0 ? new ArrayList() : new ArrayList(new C0667c(elements, true));
    }

    public static final List k(List list) {
        kotlin.jvm.internal.l.e(list, "<this>");
        int size = list.size();
        return size != 0 ? size != 1 ? list : AbstractC0676l.b(list.get(0)) : AbstractC0676l.f();
    }

    private static final void l(int i2, int i3, int i4) {
        if (i3 > i4) {
            throw new IllegalArgumentException("fromIndex (" + i3 + ") is greater than toIndex (" + i4 + ").");
        }
        if (i3 < 0) {
            throw new IndexOutOfBoundsException("fromIndex (" + i3 + ") is less than zero.");
        }
        if (i4 <= i2) {
            return;
        }
        throw new IndexOutOfBoundsException("toIndex (" + i4 + ") is greater than size (" + i2 + ").");
    }

    public static void m() {
        throw new ArithmeticException("Count overflow has happened.");
    }

    public static void n() {
        throw new ArithmeticException("Index overflow has happened.");
    }
}
