package androidx.collection.internal; import androidx.media3.exoplayer.upstream.CmcdHeadersFactory; import kotlin.Metadata; import kotlin.jvm.internal.Intrinsics; /* compiled from: ContainerHelpers.kt */ @Metadata(d1 = {"\u00000\n\u0000\n\u0002\u0010\u0015\n\u0000\n\u0002\u0010\u0016\n\u0000\n\u0002\u0010\u0011\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0007\u001a \u0010\b\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\u00012\u0006\u0010\u000b\u001a\u00020\t2\u0006\u0010\f\u001a\u00020\tH\u0000\u001a \u0010\b\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\u00032\u0006\u0010\u000b\u001a\u00020\t2\u0006\u0010\f\u001a\u00020\rH\u0000\u001a\u001c\u0010\u000e\u001a\u00020\u000f2\b\u0010\u0010\u001a\u0004\u0018\u00010\u00062\b\u0010\u0011\u001a\u0004\u0018\u00010\u0006H\u0000\u001a\u0010\u0010\u0012\u001a\u00020\t2\u0006\u0010\u0013\u001a\u00020\tH\u0000\u001a\u0010\u0010\u0014\u001a\u00020\t2\u0006\u0010\u0013\u001a\u00020\tH\u0000\u001a\u0010\u0010\u0015\u001a\u00020\t2\u0006\u0010\u0013\u001a\u00020\tH\u0000\"\u0010\u0010\u0000\u001a\u00020\u00018\u0000X\u0081\u0004¢\u0006\u0002\n\u0000\"\u0010\u0010\u0002\u001a\u00020\u00038\u0000X\u0081\u0004¢\u0006\u0002\n\u0000\"\u001a\u0010\u0004\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00060\u00058\u0000X\u0081\u0004¢\u0006\u0004\n\u0002\u0010\u0007¨\u0006\u0016"}, d2 = {"EMPTY_INTS", "", "EMPTY_LONGS", "", "EMPTY_OBJECTS", "", "", "[Ljava/lang/Object;", "binarySearch", "", "array", "size", "value", "", "equal", "", CmcdHeadersFactory.OBJECT_TYPE_AUDIO_ONLY, "b", "idealByteArraySize", "need", "idealIntArraySize", "idealLongArraySize", "collection"}, k = 2, mv = {1, 8, 0}, xi = 48) /* loaded from: classes.dex */ public final class ContainerHelpersKt { public static final int[] EMPTY_INTS = new int[0]; public static final long[] EMPTY_LONGS = new long[0]; public static final Object[] EMPTY_OBJECTS = new Object[0]; public static final int idealByteArraySize(int i) { for (int i2 = 4; i2 < 32; i2++) { int i3 = (1 << i2) - 12; if (i <= i3) { return i3; } } return i; } public static final int idealIntArraySize(int i) { return idealByteArraySize(i * 4) / 4; } public static final int idealLongArraySize(int i) { return idealByteArraySize(i * 8) / 8; } public static final boolean equal(Object obj, Object obj2) { return Intrinsics.areEqual(obj, obj2); } public static final int binarySearch(int[] array, int i, int i2) { Intrinsics.checkNotNullParameter(array, "array"); int i3 = i - 1; int i4 = 0; while (i4 <= i3) { int i5 = (i4 + i3) >>> 1; int i6 = array[i5]; if (i6 < i2) { i4 = i5 + 1; } else { if (i6 <= i2) { return i5; } i3 = i5 - 1; } } return ~i4; } public static final int binarySearch(long[] array, int i, long j) { Intrinsics.checkNotNullParameter(array, "array"); int i2 = i - 1; int i3 = 0; while (i3 <= i2) { int i4 = (i3 + i2) >>> 1; long j2 = array[i4]; if (j2 < j) { i3 = i4 + 1; } else { if (j2 <= j) { return i4; } i2 = i4 - 1; } } return ~i3; } }