package defpackage;

import com.google.android.gms.internal.measurement.zzaeh;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;

/* JADX INFO: renamed from: ˋʛᵿˏ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C1442 extends AbstractC5456 {

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public int f5881 = Integer.MAX_VALUE;

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public int f5882;

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public int f5883;

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public int f5884;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public final InputStream f5885;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public final byte[] f5886;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public int f5887;

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public int f5888;

    public /* synthetic */ C1442(InputStream inputStream, int i) {
        this.f5885 = inputStream;
        this.f5886 = new byte[i < 8 ? 8 : i];
        this.f5887 = 0;
        this.f5883 = 0;
        this.f5884 = 0;
    }

    /* JADX INFO: renamed from: ʽᵡᵢᵾ, reason: contains not printable characters */
    public final void m4118() {
        int i = this.f5887 + this.f5882;
        this.f5887 = i;
        int i2 = this.f5884 + i;
        int i3 = this.f5881;
        if (i2 <= i3) {
            this.f5882 = 0;
            return;
        }
        int i4 = i2 - i3;
        this.f5882 = i4;
        this.f5887 = i - i4;
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public final C0347 mo4119() throws IOException {
        int iMo4152 = mo4152();
        int i = this.f5887;
        int i2 = this.f5883;
        int i3 = i - i2;
        byte[] bArr = this.f5886;
        if (iMo4152 <= i3 && iMo4152 > 0) {
            C0347 c0347M9795 = AbstractC4667.m9795(bArr, i2, iMo4152);
            this.f5883 += iMo4152;
            return c0347M9795;
        }
        if (iMo4152 == 0) {
            return AbstractC4667.f17732;
        }
        if (iMo4152 < 0) {
            C1974.m5334("CodedInputStream encountered an embedded string or message which claimed to have negative size.");
            return null;
        }
        byte[] bArrM4128 = m4128(iMo4152);
        if (bArrM4128 != null) {
            return AbstractC4667.m9795(bArrM4128, 0, bArrM4128.length);
        }
        int i4 = this.f5883;
        int i5 = this.f5887;
        int i6 = i5 - i4;
        this.f5884 += i5;
        this.f5883 = 0;
        this.f5887 = 0;
        ArrayList arrayListM4122 = m4122(iMo4152 - i6);
        byte[] bArr2 = new byte[iMo4152];
        System.arraycopy(bArr, i4, bArr2, 0, i6);
        int size = arrayListM4122.size();
        int i7 = 0;
        while (i7 < size) {
            Object obj = arrayListM4122.get(i7);
            i7++;
            byte[] bArr3 = (byte[]) obj;
            int length = bArr3.length;
            System.arraycopy(bArr3, 0, bArr2, i6, length);
            i6 += length;
        }
        try {
            C0347 c0347 = AbstractC4667.f17732;
            return iMo4152 == 0 ? AbstractC4667.f17732 : new C0347(bArr2);
        } catch (zzaeh e) {
            throw new AssertionError("Expected no InvalidProtocolBufferException as data UTF8 validity is not checked.", e);
        }
    }

    /* JADX INFO: renamed from: ˀᵗ, reason: contains not printable characters */
    public final long m4120() throws zzaeh {
        long j = 0;
        for (int i = 0; i < 64; i += 7) {
            if (this.f5883 == this.f5887) {
                m4125(1);
            }
            int i2 = this.f5883;
            this.f5883 = i2 + 1;
            byte b = this.f5886[i2];
            j |= ((long) (b & 127)) << i;
            if ((b & 128) == 0) {
                return j;
            }
        }
        C1974.m5334("CodedInputStream encountered a malformed varint.");
        return 0L;
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ˀᵭ, reason: contains not printable characters */
    public final int mo4121() {
        return m4137();
    }

    /* JADX INFO: renamed from: ˁʢᵛ, reason: contains not printable characters */
    public final ArrayList m4122(int i) throws IOException {
        ArrayList arrayList = new ArrayList();
        while (i > 0) {
            int iMin = Math.min(i, 4096);
            byte[] bArr = new byte[iMin];
            int i2 = 0;
            while (i2 < iMin) {
                try {
                    int i3 = this.f5885.read(bArr, i2, iMin - i2);
                    if (i3 == -1) {
                        C1974.m5334("While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either that the input has been truncated or that an embedded message misreported its own length.");
                        return null;
                    }
                    this.f5884 += i3;
                    i2 += i3;
                } catch (zzaeh e) {
                    e.f1025 = true;
                    throw e;
                }
            }
            i -= iMin;
            arrayList.add(bArr);
        }
        return arrayList;
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ˁˌᵩ, reason: contains not printable characters */
    public final int mo4123() {
        return mo4152();
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public final int mo4124() {
        return m4137();
    }

    /* JADX INFO: renamed from: ˈⁱᵡ, reason: contains not printable characters */
    public final void m4125(int i) throws zzaeh {
        if (m4147(i)) {
            return;
        }
        if (i > (Integer.MAX_VALUE - this.f5884) - this.f5883) {
            C1974.m5334("Protocol message was too large.  May be malicious.  Use CodedInputStream.setSizeLimit() to increase the size limit. If reading multiple messages, consider resetting the counter between each message using CodedInputStream.resetSizeCounter().");
        } else {
            C1974.m5334("While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either that the input has been truncated or that an embedded message misreported its own length.");
        }
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ˉᵲ, reason: contains not printable characters */
    public final int mo4126() throws zzaeh {
        if (mo4151()) {
            this.f5888 = 0;
            return 0;
        }
        int iMo4152 = mo4152();
        this.f5888 = iMo4152;
        if ((iMo4152 >>> 3) != 0) {
            return iMo4152;
        }
        C1974.m5334("Protocol message contained an invalid tag (zero).");
        return 0;
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ˉᵵᵜ, reason: contains not printable characters */
    public final int mo4127() {
        return mo4152();
    }

    /* JADX INFO: renamed from: ˊˌˊ, reason: contains not printable characters */
    public final byte[] m4128(int i) throws IOException {
        if (i == 0) {
            return AbstractC5240.f19754;
        }
        int i2 = this.f5884;
        int i3 = this.f5883;
        int i4 = i2 + i3 + i;
        if ((-2147483647) + i4 > 0) {
            C1974.m5334("Protocol message was too large.  May be malicious.  Use CodedInputStream.setSizeLimit() to increase the size limit. If reading multiple messages, consider resetting the counter between each message using CodedInputStream.resetSizeCounter().");
            return null;
        }
        int i5 = this.f5881;
        if (i4 > i5) {
            mo4133((i5 - i2) - i3);
            C1974.m5334("While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either that the input has been truncated or that an embedded message misreported its own length.");
            return null;
        }
        int i6 = this.f5887 - i3;
        int i7 = i - i6;
        InputStream inputStream = this.f5885;
        if (i7 >= 4096) {
            try {
                if (i7 > inputStream.available()) {
                    return null;
                }
            } catch (zzaeh e) {
                e.f1025 = true;
                throw e;
            }
        }
        byte[] bArr = new byte[i];
        System.arraycopy(this.f5886, this.f5883, bArr, 0, i6);
        this.f5884 += this.f5887;
        this.f5883 = 0;
        this.f5887 = 0;
        while (i6 < i) {
            try {
                int i8 = inputStream.read(bArr, i6, i - i6);
                if (i8 == -1) {
                    C1974.m5334("While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either that the input has been truncated or that an embedded message misreported its own length.");
                    return null;
                }
                this.f5884 += i8;
                i6 += i8;
            } catch (zzaeh e2) {
                e2.f1025 = true;
                throw e2;
            }
        }
        return bArr;
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ˊᵡᵗʨ, reason: contains not printable characters */
    public final int mo4129() {
        return AbstractC5456.m11074(mo4152());
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ˊᵨᵧ, reason: contains not printable characters */
    public final boolean mo4130(int i) throws zzaeh {
        int i2 = i & 7;
        if (i2 != 0) {
            if (i2 == 1) {
                mo4133(8);
                return true;
            }
            if (i2 == 2) {
                mo4133(mo4152());
                return true;
            }
            if (i2 == 3) {
                m11076();
                mo4136(((i >>> 3) << 3) | 4);
                return true;
            }
            if (i2 == 4) {
                if (this.f20659 == 0) {
                    mo4136(0);
                }
                return false;
            }
            if (i2 == 5) {
                mo4133(4);
                return true;
            }
            C1974.m5335();
            return false;
        }
        int i3 = this.f5887 - this.f5883;
        byte[] bArr = this.f5886;
        if (i3 >= 10) {
            for (int i4 = 0; i4 < 10; i4++) {
                int i5 = this.f5883;
                this.f5883 = i5 + 1;
                if (bArr[i5] < 0) {
                }
            }
            C1974.m5334("CodedInputStream encountered a malformed varint.");
            return false;
        }
        for (int i6 = 0; i6 < 10; i6++) {
            if (this.f5883 == this.f5887) {
                m4125(1);
            }
            int i7 = this.f5883;
            this.f5883 = i7 + 1;
            if (bArr[i7] < 0) {
            }
        }
        C1974.m5334("CodedInputStream encountered a malformed varint.");
        return false;
        return true;
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public final void mo4131(int i) {
        this.f5881 = i;
        m4118();
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ˊᵾʽʼ, reason: contains not printable characters */
    public final long mo4132() {
        return m4141();
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ˋˈ, reason: contains not printable characters */
    public final void mo4133(int i) throws zzaeh {
        InputStream inputStream = this.f5885;
        int i2 = this.f5887;
        int i3 = this.f5883;
        int i4 = i2 - i3;
        if (i <= i4 && i >= 0) {
            this.f5883 = i3 + i;
            return;
        }
        if (i < 0) {
            C1974.m5334("CodedInputStream encountered an embedded string or message which claimed to have negative size.");
            return;
        }
        int i5 = this.f5884;
        int i6 = i5 + i3;
        int i7 = this.f5881;
        if (i6 + i > i7) {
            mo4133((i7 - i5) - i3);
            C1974.m5334("While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either that the input has been truncated or that an embedded message misreported its own length.");
            return;
        }
        this.f5884 = i6;
        this.f5887 = 0;
        this.f5883 = 0;
        while (i4 < i) {
            long j = i - i4;
            try {
                try {
                    long jSkip = inputStream.skip(j);
                    if (jSkip < 0 || jSkip > j) {
                        String strValueOf = String.valueOf(inputStream.getClass());
                        StringBuilder sb = new StringBuilder(strValueOf.length() + 31 + String.valueOf(jSkip).length() + 41);
                        sb.append(strValueOf);
                        sb.append("#skip returned invalid result: ");
                        sb.append(jSkip);
                        sb.append("\nThe InputStream implementation is buggy.");
                        throw new IllegalStateException(sb.toString());
                    }
                    if (jSkip == 0) {
                        break;
                    } else {
                        i4 += (int) jSkip;
                    }
                } catch (zzaeh e) {
                    e.f1025 = true;
                    throw e;
                }
            } catch (Throwable th) {
                this.f5884 += i4;
                m4118();
                throw th;
            }
        }
        this.f5884 += i4;
        m4118();
        if (i4 >= i) {
            return;
        }
        int i8 = this.f5887;
        int i9 = i8 - this.f5883;
        this.f5883 = i8;
        m4125(1);
        while (true) {
            int i10 = i - i9;
            int i11 = this.f5887;
            if (i10 <= i11) {
                this.f5883 = i10;
                return;
            } else {
                i9 += i11;
                this.f5883 = i11;
                m4125(1);
            }
        }
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final double mo4134() {
        return Double.longBitsToDouble(m4141());
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public final boolean mo4135() {
        return mo4138() != 0;
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ˏːˆ, reason: contains not printable characters */
    public final void mo4136(int i) throws zzaeh {
        if (this.f5888 == i) {
            return;
        }
        C1974.m5334("Protocol message end-group tag did not match expected tag.");
    }

    /* JADX INFO: renamed from: ˏᵩʨ, reason: contains not printable characters */
    public final int m4137() throws zzaeh {
        int i = this.f5883;
        if (this.f5887 - i < 4) {
            m4125(4);
            i = this.f5883;
        }
        this.f5883 = i + 4;
        byte[] bArr = this.f5886;
        int i2 = bArr[i] & 255;
        int i3 = bArr[i + 1] & 255;
        int i4 = bArr[i + 2] & 255;
        return ((bArr[i + 3] & 255) << 24) | (i3 << 8) | i2 | (i4 << 16);
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ˑʢ, reason: contains not printable characters */
    public final long mo4138() {
        long j;
        long j2;
        long j3;
        int i = this.f5883;
        int i2 = this.f5887;
        if (i2 != i) {
            int i3 = i + 1;
            byte[] bArr = this.f5886;
            byte b = bArr[i];
            if (b >= 0) {
                this.f5883 = i3;
                return b;
            }
            if (i2 - i3 >= 9) {
                int i4 = i + 2;
                int i5 = (bArr[i3] << 7) ^ b;
                if (i5 < 0) {
                    j = i5 ^ (-128);
                } else {
                    int i6 = i + 3;
                    int i7 = (bArr[i4] << 14) ^ i5;
                    if (i7 >= 0) {
                        j = i7 ^ 16256;
                    } else {
                        int i8 = i + 4;
                        int i9 = i7 ^ (bArr[i6] << 21);
                        if (i9 < 0) {
                            long j4 = (-2080896) ^ i9;
                            i4 = i8;
                            j = j4;
                        } else {
                            i6 = i + 5;
                            long j5 = ((long) i9) ^ (((long) bArr[i8]) << 28);
                            if (j5 >= 0) {
                                j2 = 266354560;
                            } else {
                                int i10 = i + 6;
                                long j6 = j5 ^ (((long) bArr[i6]) << 35);
                                if (j6 < 0) {
                                    j3 = -34093383808L;
                                } else {
                                    i6 = i + 7;
                                    j5 = j6 ^ (((long) bArr[i10]) << 42);
                                    if (j5 >= 0) {
                                        j2 = 4363953127296L;
                                    } else {
                                        i10 = i + 8;
                                        j6 = j5 ^ (((long) bArr[i6]) << 49);
                                        if (j6 < 0) {
                                            j3 = -558586000294016L;
                                        } else {
                                            i6 = i + 9;
                                            j5 = j6 ^ (((long) bArr[i10]) << 56);
                                            if (j5 >= 0) {
                                                j2 = 71499008037633920L;
                                            } else {
                                                int i11 = i + 10;
                                                long j7 = j5 ^ (((long) bArr[i6]) << 63);
                                                if (j7 >= 0) {
                                                    j = j7 ^ (-9151873028817141888L);
                                                    i4 = i11;
                                                }
                                            }
                                        }
                                    }
                                }
                                j = j6 ^ j3;
                                i4 = i10;
                            }
                            j = j5 ^ j2;
                        }
                    }
                    i4 = i6;
                }
                this.f5883 = i4;
                return j;
            }
        }
        return m4120();
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public final String mo4139() throws IOException {
        int iMo4152 = mo4152();
        int i = this.f5883;
        int i2 = this.f5887;
        int i3 = i2 - i;
        byte[] bArrM4145 = this.f5886;
        if (iMo4152 <= i3 && iMo4152 > 0) {
            this.f5883 = i + iMo4152;
        } else {
            if (iMo4152 == 0) {
                return "";
            }
            if (iMo4152 < 0) {
                C1974.m5334("CodedInputStream encountered an embedded string or message which claimed to have negative size.");
                return null;
            }
            i = 0;
            if (iMo4152 <= i2) {
                m4125(iMo4152);
                this.f5883 = iMo4152;
            } else {
                bArrM4145 = m4145(iMo4152);
            }
        }
        return AbstractC5355.m10945(bArrM4145, i, iMo4152);
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public final long mo4140() {
        return mo4138();
    }

    /* JADX INFO: renamed from: ᵛˀˊ, reason: contains not printable characters */
    public final long m4141() throws zzaeh {
        int i = this.f5883;
        if (this.f5887 - i < 8) {
            m4125(8);
            i = this.f5883;
        }
        this.f5883 = i + 8;
        byte[] bArr = this.f5886;
        long j = bArr[i];
        long j2 = (((long) bArr[i + 1]) & 255) << 8;
        long j3 = bArr[i + 2];
        long j4 = bArr[i + 3];
        long j5 = bArr[i + 4];
        return ((((long) bArr[i + 7]) & 255) << 56) | j2 | (j & 255) | ((j3 & 255) << 16) | ((j4 & 255) << 24) | ((j5 & 255) << 32) | ((bArr[i + 5] & 255) << 40) | ((bArr[i + 6] & 255) << 48);
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ᵛˑﹳ, reason: contains not printable characters */
    public final long mo4142() {
        return AbstractC5456.m11072(mo4138());
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final float mo4143() {
        return Float.intBitsToFloat(m4137());
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public final int mo4144(byte[] bArr, int i, int i2) throws IOException {
        if ((bArr.length - i) - i2 < 0 || (i | i2) < 0) {
            C4468.m9514();
            return 0;
        }
        if (i2 == 0) {
            return 0;
        }
        int i3 = this.f5887;
        int i4 = this.f5883;
        int i5 = i3 - i4;
        if (i5 > 0) {
            int iMin = Math.min(i2, i5);
            System.arraycopy(this.f5886, this.f5883, bArr, i, iMin);
            this.f5883 += iMin;
            return iMin;
        }
        int iMin2 = Math.min(i2, (this.f5881 - this.f5884) - i4);
        if (iMin2 <= 0) {
            return -1;
        }
        try {
            int i6 = this.f5885.read(bArr, i, iMin2);
            if (i6 != -1) {
                this.f5884 += i6;
            }
            return i6;
        } catch (zzaeh e) {
            e.f1025 = true;
            throw e;
        }
    }

    /* JADX INFO: renamed from: ᵞᵛᵘ, reason: contains not printable characters */
    public final byte[] m4145(int i) throws IOException {
        byte[] bArrM4128 = m4128(i);
        if (bArrM4128 != null) {
            return bArrM4128;
        }
        int i2 = this.f5883;
        int i3 = this.f5887;
        int i4 = i3 - i2;
        this.f5884 += i3;
        this.f5883 = 0;
        this.f5887 = 0;
        ArrayList arrayListM4122 = m4122(i - i4);
        byte[] bArr = new byte[i];
        System.arraycopy(this.f5886, i2, bArr, 0, i4);
        int size = arrayListM4122.size();
        int i5 = 0;
        while (i5 < size) {
            Object obj = arrayListM4122.get(i5);
            i5++;
            byte[] bArr2 = (byte[]) obj;
            int length = bArr2.length;
            System.arraycopy(bArr2, 0, bArr, i4, length);
            i4 += length;
        }
        return bArr;
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public final byte[] mo4146() throws zzaeh {
        int iMo4152 = mo4152();
        int i = this.f5887;
        int i2 = this.f5883;
        if (iMo4152 <= i - i2 && iMo4152 > 0) {
            byte[] bArrCopyOfRange = Arrays.copyOfRange(this.f5886, i2, i2 + iMo4152);
            this.f5883 += iMo4152;
            return bArrCopyOfRange;
        }
        if (iMo4152 >= 0) {
            return m4145(iMo4152);
        }
        C1974.m5334("CodedInputStream encountered an embedded string or message which claimed to have negative size.");
        return null;
    }

    /* JADX INFO: renamed from: ᵨˈʼﹶ, reason: contains not printable characters */
    public final boolean m4147(int i) throws IOException {
        InputStream inputStream = this.f5885;
        int i2 = this.f5883;
        int i3 = i2 + i;
        int i4 = this.f5887;
        if (i3 <= i4) {
            StringBuilder sb = new StringBuilder(String.valueOf(i).length() + 66);
            sb.append("refillBuffer() called when ");
            sb.append(i);
            sb.append(" bytes were already available in buffer");
            throw new IllegalStateException(sb.toString());
        }
        int i5 = this.f5884;
        if (i <= (Integer.MAX_VALUE - i5) - i2 && i5 + i2 + i <= this.f5881) {
            byte[] bArr = this.f5886;
            if (i2 > 0) {
                if (i4 > i2) {
                    System.arraycopy(bArr, i2, bArr, 0, i4 - i2);
                }
                i5 = this.f5884 + i2;
                this.f5884 = i5;
                i4 = this.f5887 - i2;
                this.f5887 = i4;
                this.f5883 = 0;
            }
            try {
                int i6 = inputStream.read(bArr, i4, Math.min(bArr.length - i4, (Integer.MAX_VALUE - i5) - i4));
                if (i6 == 0 || i6 < -1 || i6 > bArr.length) {
                    String strValueOf = String.valueOf(inputStream.getClass());
                    StringBuilder sb2 = new StringBuilder(String.valueOf(i6).length() + strValueOf.length() + 39 + 41);
                    sb2.append(strValueOf);
                    sb2.append("#read(byte[]) returned invalid result: ");
                    sb2.append(i6);
                    sb2.append("\nThe InputStream implementation is buggy.");
                    throw new IllegalStateException(sb2.toString());
                }
                if (i6 > 0) {
                    this.f5887 += i6;
                    m4118();
                    if (this.f5887 >= i || m4147(i)) {
                        return true;
                    }
                }
            } catch (zzaeh e) {
                e.f1025 = true;
                throw e;
            }
        }
        return false;
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public final long mo4148() {
        return mo4138();
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public final int mo4149() {
        return this.f5884 + this.f5883;
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public final int mo4150() {
        return mo4152();
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public final boolean mo4151() {
        return this.f5883 == this.f5887 && !m4147(1);
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ᵵᵬᵽ, reason: contains not printable characters */
    public final int mo4152() {
        int i;
        int i2 = this.f5883;
        int i3 = this.f5887;
        if (i3 != i2) {
            int i4 = i2 + 1;
            byte[] bArr = this.f5886;
            byte b = bArr[i2];
            if (b >= 0) {
                this.f5883 = i4;
                return b;
            }
            if (i3 - i4 >= 9) {
                int i5 = i2 + 2;
                int i6 = (bArr[i4] << 7) ^ b;
                if (i6 < 0) {
                    i = i6 ^ (-128);
                } else {
                    int i7 = i2 + 3;
                    int i8 = (bArr[i5] << 14) ^ i6;
                    if (i8 >= 0) {
                        i = i8 ^ 16256;
                    } else {
                        int i9 = i2 + 4;
                        int i10 = i8 ^ (bArr[i7] << 21);
                        if (i10 < 0) {
                            i = (-2080896) ^ i10;
                        } else {
                            i7 = i2 + 5;
                            byte b2 = bArr[i9];
                            int i11 = (i10 ^ (b2 << 28)) ^ 266354560;
                            if (b2 < 0) {
                                i9 = i2 + 6;
                                if (bArr[i7] < 0) {
                                    i7 = i2 + 7;
                                    if (bArr[i9] < 0) {
                                        i9 = i2 + 8;
                                        if (bArr[i7] < 0) {
                                            i7 = i2 + 9;
                                            if (bArr[i9] < 0) {
                                                int i12 = i2 + 10;
                                                if (bArr[i7] >= 0) {
                                                    i5 = i12;
                                                    i = i11;
                                                }
                                            }
                                        }
                                    }
                                }
                                i = i11;
                            }
                            i = i11;
                        }
                        i5 = i9;
                    }
                    i5 = i7;
                }
                this.f5883 = i5;
                return i;
            }
        }
        return (int) m4120();
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final int mo4153(int i) throws zzaeh {
        if (i < 0) {
            C1974.m5334("CodedInputStream encountered an embedded string or message which claimed to have negative size.");
            return 0;
        }
        int i2 = this.f5884 + this.f5883 + i;
        if (i2 < 0) {
            C1974.m5334("Protocol message was too large.  May be malicious.  Use CodedInputStream.setSizeLimit() to increase the size limit. If reading multiple messages, consider resetting the counter between each message using CodedInputStream.resetSizeCounter().");
            return 0;
        }
        int i3 = this.f5881;
        if (i2 > i3) {
            C1974.m5334("While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either that the input has been truncated or that an embedded message misreported its own length.");
            return 0;
        }
        this.f5881 = i2;
        m4118();
        return i3;
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public final long mo4154() {
        return m4141();
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public final String mo4155() throws zzaeh {
        int iMo4152 = mo4152();
        byte[] bArr = this.f5886;
        if (iMo4152 > 0) {
            int i = this.f5887;
            int i2 = this.f5883;
            if (iMo4152 <= i - i2) {
                String str = new String(bArr, i2, iMo4152, StandardCharsets.UTF_8);
                this.f5883 += iMo4152;
                return str;
            }
        }
        if (iMo4152 == 0) {
            return "";
        }
        if (iMo4152 < 0) {
            C1974.m5334("CodedInputStream encountered an embedded string or message which claimed to have negative size.");
            return null;
        }
        if (iMo4152 > this.f5887) {
            return new String(m4145(iMo4152), StandardCharsets.UTF_8);
        }
        m4125(iMo4152);
        String str2 = new String(bArr, this.f5883, iMo4152, StandardCharsets.UTF_8);
        this.f5883 += iMo4152;
        return str2;
    }

    @Override // defpackage.AbstractC5456
    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public final int mo4156() {
        int i = this.f5881;
        if (i == Integer.MAX_VALUE) {
            return -1;
        }
        return i - (this.f5884 + this.f5883);
    }
}
