package x4;

/* JADX INFO: renamed from: x4.b, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes3.dex */
public final class C3236b {
    public static void a(int i6, int i7, int i8) {
        if (i6 < 0 || i7 > i8) {
            StringBuilder sbQ = com.google.android.recaptcha.internal.a.q(i6, i7, "startIndex: ", ", endIndex: ", ", size: ");
            sbQ.append(i8);
            throw new IndexOutOfBoundsException(sbQ.toString());
        }
        if (i6 > i7) {
            throw new IllegalArgumentException(com.google.android.recaptcha.internal.a.i(i6, i7, "startIndex: ", " > endIndex: "));
        }
    }

    public static void b(int i6, int i7) {
        if (i6 < 0 || i6 >= i7) {
            throw new IndexOutOfBoundsException(com.google.android.recaptcha.internal.a.i(i6, i7, "index: ", ", size: "));
        }
    }

    public static void c(int i6, int i7) {
        if (i6 < 0 || i6 > i7) {
            throw new IndexOutOfBoundsException(com.google.android.recaptcha.internal.a.i(i6, i7, "index: ", ", size: "));
        }
    }

    public static void d(int i6, int i7, int i8) {
        if (i6 < 0 || i7 > i8) {
            StringBuilder sbQ = com.google.android.recaptcha.internal.a.q(i6, i7, "fromIndex: ", ", toIndex: ", ", size: ");
            sbQ.append(i8);
            throw new IndexOutOfBoundsException(sbQ.toString());
        }
        if (i6 > i7) {
            throw new IllegalArgumentException(com.google.android.recaptcha.internal.a.i(i6, i7, "fromIndex: ", " > toIndex: "));
        }
    }

    public static int e(int i6, int i7) {
        int i8 = i6 + (i6 >> 1);
        if (i8 - i7 < 0) {
            i8 = i7;
        }
        return i8 - 2147483639 > 0 ? i7 > 2147483639 ? Integer.MAX_VALUE : 2147483639 : i8;
    }
}
