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

import com.google.android.recaptcha.internal.a;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;

/* JADX INFO: loaded from: classes3.dex */
public abstract class zzajo extends zzaix {
    private static final Logger zzb = Logger.getLogger(zzajo.class.getName());
    private static final boolean zzc = zzana.zzc();
    zzajq zza;

    public static class zza extends zzajo {
        private final byte[] zzb;
        private final int zzc;
        private int zzd;

        public zza(byte[] bArr, int i6, int i7) {
            super();
            if (bArr == null) {
                throw new NullPointerException("buffer");
            }
            if (((bArr.length - i7) | i7) < 0) {
                Locale locale = Locale.US;
                throw new IllegalArgumentException(a.i(bArr.length, i7, "Array range is invalid. Buffer.length=", ", offset=0, length="));
            }
            this.zzb = bArr;
            this.zzd = 0;
            this.zzc = i7;
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final int zza() {
            return this.zzc - this.zzd;
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzb(int i6, boolean z6) throws zzd {
            zzj(i6, 0);
            zza(z6 ? (byte) 1 : (byte) 0);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzc() {
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzd(int i6, zzaiw zzaiwVar) throws zzd {
            zzj(1, 3);
            zzk(2, i6);
            zzc(3, zzaiwVar);
            zzj(1, 4);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzf(int i6, long j4) throws zzd {
            zzj(i6, 1);
            zzf(j4);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzg(int i6, int i7) throws zzd {
            zzj(i6, 5);
            zzi(i7);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzh(int i6, int i7) throws zzd {
            zzj(i6, 0);
            zzj(i7);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzi(int i6) throws zzd {
            int i7 = this.zzd;
            try {
                byte[] bArr = this.zzb;
                bArr[i7] = (byte) i6;
                bArr[i7 + 1] = (byte) (i6 >> 8);
                bArr[i7 + 2] = (byte) (i6 >> 16);
                bArr[i7 + 3] = i6 >> 24;
                this.zzd = i7 + 4;
            } catch (IndexOutOfBoundsException e6) {
                throw new zzd(i7, this.zzc, 4, (Throwable) e6);
            }
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzj(int i6) throws zzd {
            if (i6 >= 0) {
                zzl(i6);
            } else {
                zzh(i6);
            }
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzk(int i6, int i7) throws zzd {
            zzj(i6, 0);
            zzl(i7);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzl(int i6) throws zzd {
            int i7;
            int i8 = this.zzd;
            while ((i6 & (-128)) != 0) {
                try {
                    i7 = i8 + 1;
                    try {
                        this.zzb[i8] = (byte) (i6 | 128);
                        i6 >>>= 7;
                        i8 = i7;
                    } catch (IndexOutOfBoundsException e6) {
                        e = e6;
                        i8 = i7;
                        throw new zzd(i8, this.zzc, 1, (Throwable) e);
                    }
                } catch (IndexOutOfBoundsException e7) {
                    e = e7;
                    throw new zzd(i8, this.zzc, 1, (Throwable) e);
                }
            }
            i7 = i8 + 1;
            this.zzb[i8] = (byte) i6;
            this.zzd = i7;
        }

        private final void zzc(byte[] bArr, int i6, int i7) throws zzd {
            try {
                System.arraycopy(bArr, i6, this.zzb, this.zzd, i7);
                this.zzd += i7;
            } catch (IndexOutOfBoundsException e6) {
                throw new zzd(this.zzd, this.zzc, i7, (Throwable) e6);
            }
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zza(byte b5) throws zzd {
            int i6 = this.zzd;
            try {
                int i7 = i6 + 1;
                try {
                    this.zzb[i6] = b5;
                    this.zzd = i7;
                } catch (IndexOutOfBoundsException e6) {
                    e = e6;
                    i6 = i7;
                    throw new zzd(i6, this.zzc, 1, (Throwable) e);
                }
            } catch (IndexOutOfBoundsException e7) {
                e = e7;
            }
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzb(byte[] bArr, int i6, int i7) throws zzd {
            zzl(i7);
            zzc(bArr, 0, i7);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzf(long j4) throws zzd {
            int i6 = this.zzd;
            try {
                byte[] bArr = this.zzb;
                bArr[i6] = (byte) j4;
                bArr[i6 + 1] = (byte) (j4 >> 8);
                bArr[i6 + 2] = (byte) (j4 >> 16);
                bArr[i6 + 3] = (byte) (j4 >> 24);
                bArr[i6 + 4] = (byte) (j4 >> 32);
                bArr[i6 + 5] = (byte) (j4 >> 40);
                bArr[i6 + 6] = (byte) (j4 >> 48);
                bArr[i6 + 7] = (byte) (j4 >> 56);
                this.zzd = i6 + 8;
            } catch (IndexOutOfBoundsException e6) {
                throw new zzd(i6, this.zzc, 8, (Throwable) e6);
            }
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzh(int i6, long j4) throws zzd {
            zzj(i6, 0);
            zzh(j4);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzj(int i6, int i7) throws zzd {
            zzl((i6 << 3) | i7);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzb(zzaiw zzaiwVar) throws zzd {
            zzl(zzaiwVar.zzb());
            zzaiwVar.zza(this);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzc(int i6, zzaiw zzaiwVar) throws zzd {
            zzj(i6, 2);
            zzb(zzaiwVar);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzh(long j4) throws zzd {
            int i6;
            int i7;
            int i8 = this.zzd;
            if (zzajo.zzc && zza() >= 10) {
                while ((j4 & (-128)) != 0) {
                    zzana.zza(this.zzb, i8, (byte) (((int) j4) | 128));
                    j4 >>>= 7;
                    i8++;
                }
                i6 = i8 + 1;
                zzana.zza(this.zzb, i8, (byte) j4);
            } else {
                while ((j4 & (-128)) != 0) {
                    try {
                        i7 = i8 + 1;
                    } catch (IndexOutOfBoundsException e6) {
                        e = e6;
                    }
                    try {
                        this.zzb[i8] = (byte) (((int) j4) | 128);
                        j4 >>>= 7;
                        i8 = i7;
                    } catch (IndexOutOfBoundsException e7) {
                        e = e7;
                        i8 = i7;
                        throw new zzd(i8, this.zzc, 1, (Throwable) e);
                    }
                }
                i6 = i8 + 1;
                try {
                    this.zzb[i8] = (byte) j4;
                } catch (IndexOutOfBoundsException e8) {
                    e = e8;
                    i8 = i6;
                    throw new zzd(i8, this.zzc, 1, (Throwable) e);
                }
            }
            this.zzd = i6;
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzaix
        public final void zza(byte[] bArr, int i6, int i7) throws zzd {
            zzc(bArr, i6, i7);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzb(zzaln zzalnVar, zzamc zzamcVar) throws zzd {
            zzl(((zzain) zzalnVar).zza(zzamcVar));
            zzamcVar.zza(zzalnVar, this.zza);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzc(int i6, zzaln zzalnVar, zzamc zzamcVar) throws zzd {
            zzj(i6, 2);
            zzl(((zzain) zzalnVar).zza(zzamcVar));
            zzamcVar.zza(zzalnVar, this.zza);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzb(int i6, zzaln zzalnVar) throws zzd {
            zzj(1, 3);
            zzk(2, i6);
            zzj(3, 2);
            zzc(zzalnVar);
            zzj(1, 4);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzc(zzaln zzalnVar) throws zzd {
            zzl(zzalnVar.zzl());
            zzalnVar.zza(this);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzb(int i6, String str) throws zzd {
            zzj(i6, 2);
            zzb(str);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzb(String str) throws zzd {
            int i6 = this.zzd;
            try {
                int iZzh = zzajo.zzh(str.length() * 3);
                int iZzh2 = zzajo.zzh(str.length());
                if (iZzh2 == iZzh) {
                    int i7 = i6 + iZzh2;
                    this.zzd = i7;
                    int iZza = zzanb.zza(str, this.zzb, i7, zza());
                    this.zzd = i6;
                    zzl((iZza - i6) - iZzh2);
                    this.zzd = iZza;
                    return;
                }
                zzl(zzanb.zza(str));
                this.zzd = zzanb.zza(str, this.zzb, this.zzd, zza());
            } catch (zzane e6) {
                this.zzd = i6;
                zza(str, e6);
            } catch (IndexOutOfBoundsException e7) {
                throw new zzd(e7);
            }
        }
    }

    public static abstract class zzb extends zzajo {
        final byte[] zzb;
        final int zzc;
        int zzd;
        int zze;

        public zzb(int i6) {
            super();
            if (i6 < 0) {
                throw new IllegalArgumentException("bufferSize must be >= 0");
            }
            byte[] bArr = new byte[Math.max(i6, 20)];
            this.zzb = bArr;
            this.zzc = bArr.length;
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final int zza() {
            throw new UnsupportedOperationException("spaceLeft() can only be called on CodedOutputStreams that are writing to a flat array or ByteBuffer.");
        }

        public final void zzb(byte b5) {
            int i6 = this.zzd;
            this.zzb[i6] = b5;
            this.zzd = i6 + 1;
            this.zze++;
        }

        public final void zzi(long j4) {
            int i6 = this.zzd;
            byte[] bArr = this.zzb;
            bArr[i6] = (byte) j4;
            bArr[i6 + 1] = (byte) (j4 >> 8);
            bArr[i6 + 2] = (byte) (j4 >> 16);
            bArr[i6 + 3] = (byte) (j4 >> 24);
            bArr[i6 + 4] = (byte) (j4 >> 32);
            bArr[i6 + 5] = (byte) (j4 >> 40);
            bArr[i6 + 6] = (byte) (j4 >> 48);
            bArr[i6 + 7] = (byte) (j4 >> 56);
            this.zzd = i6 + 8;
            this.zze += 8;
        }

        public final void zzj(long j4) {
            if (!zzajo.zzc) {
                while ((j4 & (-128)) != 0) {
                    byte[] bArr = this.zzb;
                    int i6 = this.zzd;
                    this.zzd = i6 + 1;
                    bArr[i6] = (byte) (((int) j4) | 128);
                    this.zze++;
                    j4 >>>= 7;
                }
                byte[] bArr2 = this.zzb;
                int i7 = this.zzd;
                this.zzd = i7 + 1;
                bArr2[i7] = (byte) j4;
                this.zze++;
                return;
            }
            long j6 = this.zzd;
            while ((j4 & (-128)) != 0) {
                byte[] bArr3 = this.zzb;
                int i8 = this.zzd;
                this.zzd = i8 + 1;
                zzana.zza(bArr3, i8, (byte) (((int) j4) | 128));
                j4 >>>= 7;
            }
            byte[] bArr4 = this.zzb;
            int i9 = this.zzd;
            this.zzd = i9 + 1;
            zzana.zza(bArr4, i9, (byte) j4);
            this.zze += (int) (((long) this.zzd) - j6);
        }

        public final void zzl(int i6, int i7) {
            zzn((i6 << 3) | i7);
        }

        public final void zzm(int i6) {
            int i7 = this.zzd;
            byte[] bArr = this.zzb;
            bArr[i7] = (byte) i6;
            bArr[i7 + 1] = (byte) (i6 >> 8);
            bArr[i7 + 2] = (byte) (i6 >> 16);
            bArr[i7 + 3] = i6 >> 24;
            this.zzd = i7 + 4;
            this.zze += 4;
        }

        public final void zzn(int i6) {
            if (!zzajo.zzc) {
                while ((i6 & (-128)) != 0) {
                    byte[] bArr = this.zzb;
                    int i7 = this.zzd;
                    this.zzd = i7 + 1;
                    bArr[i7] = (byte) (i6 | 128);
                    this.zze++;
                    i6 >>>= 7;
                }
                byte[] bArr2 = this.zzb;
                int i8 = this.zzd;
                this.zzd = i8 + 1;
                bArr2[i8] = (byte) i6;
                this.zze++;
                return;
            }
            long j4 = this.zzd;
            while ((i6 & (-128)) != 0) {
                byte[] bArr3 = this.zzb;
                int i9 = this.zzd;
                this.zzd = i9 + 1;
                zzana.zza(bArr3, i9, (byte) (i6 | 128));
                i6 >>>= 7;
            }
            byte[] bArr4 = this.zzb;
            int i10 = this.zzd;
            this.zzd = i10 + 1;
            zzana.zza(bArr4, i10, (byte) i6);
            this.zze += (int) (((long) this.zzd) - j4);
        }
    }

    public static class zzd extends IOException {
        public zzd() {
            super("CodedOutputStream was writing to a flat byte array and ran out of space.");
        }

        public zzd(Throwable th) {
            super("CodedOutputStream was writing to a flat byte array and ran out of space.", th);
        }

        private zzd(String str, Throwable th) {
            super(A0.a.n("CodedOutputStream was writing to a flat byte array and ran out of space.: ", str), th);
        }

        public zzd(int i6, int i7, int i8, Throwable th) {
            this(i6, i7, i8, th);
        }

        /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
        private zzd(long j4, long j6, int i6, Throwable th) {
            this("Pos: " + j4 + ", limit: " + j6 + ", len: " + i6, th);
            Locale locale = Locale.US;
        }
    }

    public static int zza(double d6) {
        return 8;
    }

    public static int zzb(int i6) {
        return 4;
    }

    public static int zzc(long j4) {
        return 8;
    }

    public static int zzd(int i6) {
        if (i6 > 4096) {
            return 4096;
        }
        return i6;
    }

    public static int zze(int i6) {
        return 4;
    }

    public static int zzf(int i6) {
        return zzh(zzm(i6));
    }

    public static int zzg(int i6) {
        return zzh(i6 << 3);
    }

    public static int zzh(int i6) {
        return (352 - (Integer.numberOfLeadingZeros(i6) * 9)) >>> 6;
    }

    private static long zzi(long j4) {
        return (j4 >> 63) ^ (j4 << 1);
    }

    private static int zzm(int i6) {
        return (i6 >> 31) ^ (i6 << 1);
    }

    public abstract int zza();

    public abstract void zza(byte b5);

    public abstract void zzb(int i6, zzaln zzalnVar);

    public abstract void zzb(int i6, String str);

    public abstract void zzb(int i6, boolean z6);

    public abstract void zzb(zzaiw zzaiwVar);

    public abstract void zzb(zzaln zzalnVar, zzamc zzamcVar);

    public abstract void zzb(String str);

    public abstract void zzb(byte[] bArr, int i6, int i7);

    public abstract void zzc();

    public abstract void zzc(int i6, zzaiw zzaiwVar);

    public abstract void zzc(int i6, zzaln zzalnVar, zzamc zzamcVar);

    public abstract void zzc(zzaln zzalnVar);

    public abstract void zzd(int i6, zzaiw zzaiwVar);

    public abstract void zzf(int i6, long j4);

    public abstract void zzf(long j4);

    public abstract void zzg(int i6, int i7);

    public abstract void zzh(int i6, int i7);

    public abstract void zzh(int i6, long j4);

    public abstract void zzh(long j4);

    public abstract void zzi(int i6);

    public abstract void zzj(int i6);

    public abstract void zzj(int i6, int i7);

    public final void zzk(int i6) {
        zzl(zzm(i6));
    }

    public abstract void zzk(int i6, int i7);

    public abstract void zzl(int i6);

    public static final class zzc extends zzb {
        private final OutputStream zzf;

        public zzc(OutputStream outputStream, int i6) {
            super(i6);
            if (outputStream == null) {
                throw new NullPointerException("out");
            }
            this.zzf = outputStream;
        }

        private final void zze() throws IOException {
            this.zzf.write(this.zzb, 0, this.zzd);
            this.zzd = 0;
        }

        private final void zzo(int i6) throws IOException {
            if (this.zzc - this.zzd < i6) {
                zze();
            }
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zza(byte b5) throws IOException {
            if (this.zzd == this.zzc) {
                zze();
            }
            zzb(b5);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzb(int i6, boolean z6) throws IOException {
            zzo(11);
            zzl(i6, 0);
            zzb(z6 ? (byte) 1 : (byte) 0);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzc() throws IOException {
            if (this.zzd > 0) {
                zze();
            }
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzd(int i6, zzaiw zzaiwVar) throws IOException {
            zzj(1, 3);
            zzk(2, i6);
            zzc(3, zzaiwVar);
            zzj(1, 4);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzf(int i6, long j4) throws IOException {
            zzo(18);
            zzl(i6, 1);
            zzi(j4);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzg(int i6, int i7) throws IOException {
            zzo(14);
            zzl(i6, 5);
            zzm(i7);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzh(int i6, int i7) throws IOException {
            zzo(20);
            zzl(i6, 0);
            if (i7 >= 0) {
                zzn(i7);
            } else {
                zzj(i7);
            }
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzi(int i6) throws IOException {
            zzo(4);
            zzm(i6);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzj(int i6) throws IOException {
            if (i6 >= 0) {
                zzl(i6);
            } else {
                zzh(i6);
            }
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzk(int i6, int i7) throws IOException {
            zzo(20);
            zzl(i6, 0);
            zzn(i7);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzl(int i6) throws IOException {
            zzo(5);
            zzn(i6);
        }

        private final void zzc(byte[] bArr, int i6, int i7) throws IOException {
            int i8 = this.zzc;
            int i9 = this.zzd;
            if (i8 - i9 >= i7) {
                System.arraycopy(bArr, i6, this.zzb, i9, i7);
                this.zzd += i7;
            } else {
                int i10 = i8 - i9;
                System.arraycopy(bArr, i6, this.zzb, i9, i10);
                int i11 = i6 + i10;
                i7 -= i10;
                this.zzd = this.zzc;
                this.zze += i10;
                zze();
                if (i7 <= this.zzc) {
                    System.arraycopy(bArr, i11, this.zzb, 0, i7);
                    this.zzd = i7;
                } else {
                    this.zzf.write(bArr, i11, i7);
                }
            }
            this.zze += i7;
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzj(int i6, int i7) throws IOException {
            zzl((i6 << 3) | i7);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzaix
        public final void zza(byte[] bArr, int i6, int i7) throws IOException {
            zzc(bArr, i6, i7);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzb(byte[] bArr, int i6, int i7) throws IOException {
            zzl(i7);
            zzc(bArr, 0, i7);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzf(long j4) throws IOException {
            zzo(8);
            zzi(j4);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzh(int i6, long j4) throws IOException {
            zzo(20);
            zzl(i6, 0);
            zzj(j4);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzb(zzaiw zzaiwVar) throws IOException {
            zzl(zzaiwVar.zzb());
            zzaiwVar.zza(this);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzb(zzaln zzalnVar, zzamc zzamcVar) throws IOException {
            zzl(((zzain) zzalnVar).zza(zzamcVar));
            zzamcVar.zza(zzalnVar, this.zza);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzh(long j4) throws IOException {
            zzo(10);
            zzj(j4);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzb(int i6, zzaln zzalnVar) throws IOException {
            zzj(1, 3);
            zzk(2, i6);
            zzj(3, 2);
            zzc(zzalnVar);
            zzj(1, 4);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzb(int i6, String str) throws IOException {
            zzj(i6, 2);
            zzb(str);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzc(int i6, zzaiw zzaiwVar) throws IOException {
            zzj(i6, 2);
            zzb(zzaiwVar);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzb(String str) throws IOException {
            int iZza;
            try {
                int length = str.length() * 3;
                int iZzh = zzajo.zzh(length);
                int i6 = iZzh + length;
                int i7 = this.zzc;
                if (i6 > i7) {
                    byte[] bArr = new byte[length];
                    int iZza2 = zzanb.zza(str, bArr, 0, length);
                    zzl(iZza2);
                    zza(bArr, 0, iZza2);
                    return;
                }
                if (i6 > i7 - this.zzd) {
                    zze();
                }
                int iZzh2 = zzajo.zzh(str.length());
                int i8 = this.zzd;
                try {
                    if (iZzh2 == iZzh) {
                        int i9 = i8 + iZzh2;
                        this.zzd = i9;
                        int iZza3 = zzanb.zza(str, this.zzb, i9, this.zzc - i9);
                        this.zzd = i8;
                        iZza = (iZza3 - i8) - iZzh2;
                        zzn(iZza);
                        this.zzd = iZza3;
                    } else {
                        iZza = zzanb.zza(str);
                        zzn(iZza);
                        this.zzd = zzanb.zza(str, this.zzb, this.zzd, iZza);
                    }
                    this.zze += iZza;
                } catch (zzane e6) {
                    this.zze -= this.zzd - i8;
                    this.zzd = i8;
                    throw e6;
                } catch (ArrayIndexOutOfBoundsException e7) {
                    throw new zzd(e7);
                }
            } catch (zzane e8) {
                zza(str, e8);
            }
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzc(int i6, zzaln zzalnVar, zzamc zzamcVar) throws IOException {
            zzj(i6, 2);
            zzb(zzalnVar, zzamcVar);
        }

        @Override // com.google.android.gms.internal.p002firebaseauthapi.zzajo
        public final void zzc(zzaln zzalnVar) throws IOException {
            zzl(zzalnVar.zzl());
            zzalnVar.zza(this);
        }
    }

    private zzajo() {
    }

    public static int zza(float f6) {
        return 4;
    }

    public static int zzb(int i6, int i7) {
        return zzh(i6 << 3) + 4;
    }

    public static int zzc(int i6, int i7) {
        return zze(i7) + zzh(i6 << 3);
    }

    public static int zze(int i6, int i7) {
        return zzh(zzm(i7)) + zzh(i6 << 3);
    }

    public static int zzf(int i6, int i7) {
        return zzh(i7) + zzh(i6 << 3);
    }

    public final void zzg(int i6, long j4) {
        zzh(i6, zzi(j4));
    }

    public final void zzi(int i6, int i7) {
        zzk(i6, zzm(i7));
    }

    public static int zza(long j4) {
        return 8;
    }

    public static int zzb(int i6, long j4) {
        return zze(j4) + zzh(i6 << 3);
    }

    public static int zzd(int i6, int i7) {
        return zzh(i6 << 3) + 4;
    }

    public final void zzg(long j4) {
        zzh(zzi(j4));
    }

    public static int zza(boolean z6) {
        return 1;
    }

    public static int zzc(int i6) {
        return zze(i6);
    }

    public static int zzd(int i6, long j4) {
        return zze(zzi(j4)) + zzh(i6 << 3);
    }

    public static int zze(int i6, long j4) {
        return zze(j4) + zzh(i6 << 3);
    }

    public static int zza(int i6, boolean z6) {
        return zzh(i6 << 3) + 1;
    }

    public static int zzb(long j4) {
        return zze(j4);
    }

    public static int zzc(int i6, long j4) {
        return zzh(i6 << 3) + 8;
    }

    public static int zza(byte[] bArr) {
        int length = bArr.length;
        return zzh(length) + length;
    }

    public static int zzb(int i6, zzakv zzakvVar) {
        int iZzh = zzh(i6 << 3);
        int iZza = zzakvVar.zza();
        return zzh(iZza) + iZza + iZzh;
    }

    public static int zzd(long j4) {
        return zze(zzi(j4));
    }

    public static int zze(long j4) {
        return (640 - (Long.numberOfLeadingZeros(j4) * 9)) >>> 6;
    }

    public static int zza(int i6, zzaiw zzaiwVar) {
        int iZzh = zzh(i6 << 3);
        int iZzb = zzaiwVar.zzb();
        return zzh(iZzb) + iZzb + iZzh;
    }

    public static int zzb(int i6, zzaln zzalnVar, zzamc zzamcVar) {
        return zza(zzalnVar, zzamcVar) + zzh(i6 << 3);
    }

    public static int zza(zzaiw zzaiwVar) {
        int iZzb = zzaiwVar.zzb();
        return zzh(iZzb) + iZzb;
    }

    public static int zzb(zzaln zzalnVar) {
        int iZzl = zzalnVar.zzl();
        return zzh(iZzl) + iZzl;
    }

    public static int zza(int i6, double d6) {
        return zzh(i6 << 3) + 8;
    }

    public static int zzb(int i6, zzaiw zzaiwVar) {
        return zza(3, zzaiwVar) + zzf(2, i6) + (zzh(8) << 1);
    }

    public static int zza(int i6, int i7) {
        return zze(i7) + zzh(i6 << 3);
    }

    public static int zza(int i6) {
        return zze(i6);
    }

    public static zzajo zzb(byte[] bArr) {
        return new zza(bArr, 0, bArr.length);
    }

    public static int zza(int i6, long j4) {
        return zzh(i6 << 3) + 8;
    }

    public static int zza(int i6, float f6) {
        return zzh(i6 << 3) + 4;
    }

    public final void zzb() {
        if (zza() != 0) {
            throw new IllegalStateException("Did not write as much data as expected.");
        }
    }

    @Deprecated
    public static int zza(int i6, zzaln zzalnVar, zzamc zzamcVar) {
        return ((zzain) zzalnVar).zza(zzamcVar) + (zzh(i6 << 3) << 1);
    }

    public final void zzb(boolean z6) {
        zza(z6 ? (byte) 1 : (byte) 0);
    }

    @Deprecated
    public static int zza(zzaln zzalnVar) {
        return zzalnVar.zzl();
    }

    public final void zzb(int i6, double d6) {
        zzf(i6, Double.doubleToRawLongBits(d6));
    }

    public static int zza(int i6, zzakv zzakvVar) {
        return zzb(3, zzakvVar) + zzf(2, i6) + (zzh(8) << 1);
    }

    public final void zzb(double d6) {
        zzf(Double.doubleToRawLongBits(d6));
    }

    public final void zzb(int i6, float f6) {
        zzg(i6, Float.floatToRawIntBits(f6));
    }

    public final void zzb(float f6) {
        zzi(Float.floatToRawIntBits(f6));
    }

    public static int zza(zzakv zzakvVar) {
        int iZza = zzakvVar.zza();
        return zzh(iZza) + iZza;
    }

    public static int zza(int i6, zzaln zzalnVar) {
        return zzb(zzalnVar) + zzh(24) + zzf(2, i6) + (zzh(8) << 1);
    }

    public static int zza(zzaln zzalnVar, zzamc zzamcVar) {
        int iZza = ((zzain) zzalnVar).zza(zzamcVar);
        return zzh(iZza) + iZza;
    }

    public static int zza(int i6, String str) {
        return zza(str) + zzh(i6 << 3);
    }

    public static int zza(String str) {
        int length;
        try {
            length = zzanb.zza(str);
        } catch (zzane unused) {
            length = str.getBytes(zzaki.zza).length;
        }
        return zzh(length) + length;
    }

    public static zzajo zza(OutputStream outputStream, int i6) {
        return new zzc(outputStream, i6);
    }

    public final void zza(String str, zzane zzaneVar) throws zzd {
        zzb.logp(Level.WARNING, "com.google.protobuf.CodedOutputStream", "inefficientWriteStringNoTag", "Converting ill-formed UTF-16. Your Protocol Buffer will not round trip correctly!", (Throwable) zzaneVar);
        byte[] bytes = str.getBytes(zzaki.zza);
        try {
            zzl(bytes.length);
            zza(bytes, 0, bytes.length);
        } catch (IndexOutOfBoundsException e6) {
            throw new zzd(e6);
        }
    }
}
