package y;

/* loaded from: classes.dex */
public abstract class p0 {
    public static final int a(androidx.collection.j jVar, int i10, int i11, int i12) {
        if (!(i11 <= i12)) {
            z0.a("fromIndex(" + i11 + ") > toIndex(" + i12 + ')');
        }
        if (i11 < 0) {
            throw new IndexOutOfBoundsException("Index out of range: " + i11);
        }
        if (i12 > jVar.b()) {
            throw new IndexOutOfBoundsException("Index out of range: " + i12);
        }
        int i13 = i12 - 1;
        while (i11 <= i13) {
            int i14 = (i11 + i13) >>> 1;
            int a10 = jVar.a(i14);
            if (a10 < i10) {
                i11 = i14 + 1;
            } else {
                if (a10 <= i10) {
                    return i14;
                }
                i13 = i14 - 1;
            }
        }
        return -(i11 + 1);
    }

    public static /* synthetic */ int b(androidx.collection.j jVar, int i10, int i11, int i12, int i13, Object obj) {
        if ((i13 & 2) != 0) {
            i11 = 0;
        }
        if ((i13 & 4) != 0) {
            i12 = jVar.b();
        }
        return a(jVar, i10, i11, i12);
    }
}
