package com.google.android.gms.internal.location; import org.checkerframework.checker.nullness.compatqual.NullableDecl; /* loaded from: classes.dex */ public final class zzbm { public static int zza(int i10, int i11, @NullableDecl String str) { String zza; if (i10 >= 0 && i10 < i11) { return i10; } if (i10 < 0) { zza = zzbn.zza("%s (%s) must not be negative", "index", Integer.valueOf(i10)); } else { if (i11 < 0) { StringBuilder sb = new StringBuilder(26); sb.append("negative size: "); sb.append(i11); throw new IllegalArgumentException(sb.toString()); } zza = zzbn.zza("%s (%s) must be less than size (%s)", "index", Integer.valueOf(i10), Integer.valueOf(i11)); } throw new IndexOutOfBoundsException(zza); } public static int zzb(int i10, int i11, @NullableDecl String str) { if (i10 < 0 || i10 > i11) { throw new IndexOutOfBoundsException(zzd(i10, i11, "index")); } return i10; } public static void zzc(int i10, int i11, int i12) { if (i10 < 0 || i11 < i10 || i11 > i12) { throw new IndexOutOfBoundsException((i10 < 0 || i10 > i12) ? zzd(i10, i12, "start index") : (i11 < 0 || i11 > i12) ? zzd(i11, i12, "end index") : zzbn.zza("end index (%s) must not be less than start index (%s)", Integer.valueOf(i11), Integer.valueOf(i10))); } } private static String zzd(int i10, int i11, @NullableDecl String str) { if (i10 < 0) { return zzbn.zza("%s (%s) must not be negative", str, Integer.valueOf(i10)); } if (i11 >= 0) { return zzbn.zza("%s (%s) must not be greater than size (%s)", str, Integer.valueOf(i10), Integer.valueOf(i11)); } StringBuilder sb = new StringBuilder(26); sb.append("negative size: "); sb.append(i11); throw new IllegalArgumentException(sb.toString()); } }