package com.google.android.gms.internal.fido;

import Z0.o;

/* JADX INFO: loaded from: classes3.dex */
public final class zzap {
    public static int zza(int i6, int i7, String str) {
        String strZza;
        if (i6 >= 0 && i6 < i7) {
            return i6;
        }
        if (i6 < 0) {
            strZza = zzaq.zza("%s (%s) must not be negative", "index", Integer.valueOf(i6));
        } else {
            if (i7 < 0) {
                throw new IllegalArgumentException(o.l("negative size: ", i7));
            }
            strZza = zzaq.zza("%s (%s) must be less than size (%s)", "index", Integer.valueOf(i6), Integer.valueOf(i7));
        }
        throw new IndexOutOfBoundsException(strZza);
    }

    public static int zzb(int i6, int i7, String str) {
        if (i6 < 0 || i6 > i7) {
            throw new IndexOutOfBoundsException(zzf(i6, i7, "index"));
        }
        return i6;
    }

    public static void zzc(boolean z6) {
        if (!z6) {
            throw new IllegalArgumentException();
        }
    }

    public static void zzd(boolean z6, String str, char c6) {
        if (!z6) {
            throw new IllegalArgumentException(zzaq.zza(str, Character.valueOf(c6)));
        }
    }

    public static void zze(int i6, int i7, int i8) {
        if (i6 < 0 || i7 < i6 || i7 > i8) {
            throw new IndexOutOfBoundsException((i6 < 0 || i6 > i8) ? zzf(i6, i8, "start index") : (i7 < 0 || i7 > i8) ? zzf(i7, i8, "end index") : zzaq.zza("end index (%s) must not be less than start index (%s)", Integer.valueOf(i7), Integer.valueOf(i6)));
        }
    }

    private static String zzf(int i6, int i7, String str) {
        if (i6 < 0) {
            return zzaq.zza("%s (%s) must not be negative", str, Integer.valueOf(i6));
        }
        if (i7 >= 0) {
            return zzaq.zza("%s (%s) must not be greater than size (%s)", str, Integer.valueOf(i6), Integer.valueOf(i7));
        }
        throw new IllegalArgumentException(o.l("negative size: ", i7));
    }
}
