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

/* JADX INFO: loaded from: classes3.dex */
abstract class zzac extends zzd<String> {
    final CharSequence zza;
    private final zzf zzb;
    private int zze;
    private int zzd = 0;
    private final boolean zzc = false;

    public zzac(zzv zzvVar, CharSequence charSequence) {
        this.zzb = zzvVar.zza;
        this.zze = zzvVar.zzc;
        this.zza = charSequence;
    }

    public abstract int zza(int i6);

    @Override // com.google.android.gms.internal.p002firebaseauthapi.zzd
    public final /* synthetic */ String zza() {
        int i6 = this.zzd;
        while (true) {
            int i7 = this.zzd;
            if (i7 == -1) {
                zzb();
                return null;
            }
            int iZzb = zzb(i7);
            if (iZzb == -1) {
                iZzb = this.zza.length();
                this.zzd = -1;
            } else {
                this.zzd = zza(iZzb);
            }
            int i8 = this.zzd;
            if (i8 != i6) {
                while (i6 < iZzb && this.zzb.zza(this.zza.charAt(i6))) {
                    i6++;
                }
                while (iZzb > i6 && this.zzb.zza(this.zza.charAt(iZzb - 1))) {
                    iZzb--;
                }
                int i9 = this.zze;
                if (i9 == 1) {
                    iZzb = this.zza.length();
                    this.zzd = -1;
                    while (iZzb > i6 && this.zzb.zza(this.zza.charAt(iZzb - 1))) {
                        iZzb--;
                    }
                } else {
                    this.zze = i9 - 1;
                }
                return this.zza.subSequence(i6, iZzb).toString();
            }
            int i10 = i8 + 1;
            this.zzd = i10;
            if (i10 > this.zza.length()) {
                this.zzd = -1;
            }
        }
    }

    public abstract int zzb(int i6);
}
