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;

/* renamed from: ˑʾᵤ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C2023 extends AbstractC3415 {

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public int f8117;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public int f8118;

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public int f8119;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public int f8120;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public int f8121;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final byte[] f8122;

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public int f8123 = Integer.MAX_VALUE;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final InputStream f8124;

    public /* synthetic */ C2023(InputStream inputStream, int i) {
        this.f8124 = inputStream;
        this.f8122 = new byte[i < 8 ? 8 : i];
        this.f8121 = 0;
        this.f8120 = 0;
        this.f8118 = 0;
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public final int mo5558() {
        return m5562();
    }

    /* renamed from: ˀᵗᵩ, reason: contains not printable characters */
    public final void m5559(int i) throws zzaeh {
        if (m5561(i)) {
            return;
        }
        if (i > (Integer.MAX_VALUE - this.f8118) - this.f8120) {
            C1499.m4426("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 {
            C1499.m4426("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.AbstractC3415
    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    public final long mo5560() {
        return m5568();
    }

    /* renamed from: ˆᵼᵷˊ, reason: contains not printable characters */
    public final boolean m5561(int i) throws IOException {
        InputStream inputStream = this.f8124;
        int i2 = this.f8120;
        int i3 = i2 + i;
        int i4 = this.f8121;
        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.f8118;
        if (i <= (Integer.MAX_VALUE - i5) - i2 && i5 + i2 + i <= this.f8123) {
            byte[] bArr = this.f8122;
            if (i2 > 0) {
                if (i4 > i2) {
                    System.arraycopy(bArr, i2, bArr, 0, i4 - i2);
                }
                i5 = this.f8118 + i2;
                this.f8118 = i5;
                i4 = this.f8121 - i2;
                this.f8121 = i4;
                this.f8120 = 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.f8121 += i6;
                    m5563();
                    if (this.f8121 >= i || m5561(i)) {
                        return true;
                    }
                }
            } catch (zzaeh e) {
                e.f1025 = true;
                throw e;
            }
        }
        return false;
    }

    /* renamed from: ˊʽˎ, reason: contains not printable characters */
    public final int m5562() throws zzaeh {
        int i = this.f8120;
        if (this.f8121 - i < 4) {
            m5559(4);
            i = this.f8120;
        }
        this.f8120 = i + 4;
        byte[] bArr = this.f8122;
        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);
    }

    /* renamed from: ˊᵸˊ, reason: contains not printable characters */
    public final void m5563() {
        int i = this.f8121 + this.f8117;
        this.f8121 = i;
        int i2 = this.f8118 + i;
        int i3 = this.f8123;
        if (i2 <= i3) {
            this.f8117 = 0;
            return;
        }
        int i4 = i2 - i3;
        this.f8117 = i4;
        this.f8121 = i - i4;
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public final int mo5564() {
        return this.f8118 + this.f8120;
    }

    /* renamed from: ˌᵪ, reason: contains not printable characters */
    public final byte[] m5565(int i) throws IOException {
        if (i == 0) {
            return AbstractC0357.f2110;
        }
        int i2 = this.f8118;
        int i3 = this.f8120;
        int i4 = i2 + i3 + i;
        if ((-2147483647) + i4 > 0) {
            C1499.m4426("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.f8123;
        if (i4 > i5) {
            mo5586((i5 - i2) - i3);
            C1499.m4426("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.f8121 - i3;
        int i7 = i - i6;
        InputStream inputStream = this.f8124;
        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.f8122, this.f8120, bArr, 0, i6);
        this.f8118 += this.f8121;
        this.f8120 = 0;
        this.f8121 = 0;
        while (i6 < i) {
            try {
                int i8 = inputStream.read(bArr, i6, i - i6);
                if (i8 == -1) {
                    C1499.m4426("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.f8118 += i8;
                i6 += i8;
            } catch (zzaeh e2) {
                e2.f1025 = true;
                throw e2;
            }
        }
        return bArr;
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final int mo5566(int i) throws zzaeh {
        if (i < 0) {
            C1499.m4426("CodedInputStream encountered an embedded string or message which claimed to have negative size.");
            return 0;
        }
        int i2 = this.f8118 + this.f8120 + i;
        if (i2 < 0) {
            C1499.m4426("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.f8123;
        if (i2 > i3) {
            C1499.m4426("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.f8123 = i2;
        m5563();
        return i3;
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ˎˑː, reason: contains not printable characters */
    public final String mo5567() throws IOException {
        int iMo5578 = mo5578();
        int i = this.f8120;
        int i2 = this.f8121;
        int i3 = i2 - i;
        byte[] bArrM5574 = this.f8122;
        if (iMo5578 <= i3 && iMo5578 > 0) {
            this.f8120 = i + iMo5578;
        } else {
            if (iMo5578 == 0) {
                return "";
            }
            if (iMo5578 < 0) {
                C1499.m4426("CodedInputStream encountered an embedded string or message which claimed to have negative size.");
                return null;
            }
            i = 0;
            if (iMo5578 <= i2) {
                m5559(iMo5578);
                this.f8120 = iMo5578;
            } else {
                bArrM5574 = m5574(iMo5578);
            }
        }
        return AbstractC1440.m4345(bArrM5574, i, iMo5578);
    }

    /* renamed from: ˎᵬˀ, reason: contains not printable characters */
    public final long m5568() throws zzaeh {
        int i = this.f8120;
        if (this.f8121 - i < 8) {
            m5559(8);
            i = this.f8120;
        }
        this.f8120 = i + 8;
        byte[] bArr = this.f8122;
        long j = bArr[i];
        long j2 = bArr[i + 2];
        long j3 = bArr[i + 3];
        long j4 = bArr[i + 4];
        return ((bArr[i + 7] & 255) << 56) | ((bArr[i + 1] & 255) << 8) | (j & 255) | ((j2 & 255) << 16) | ((j3 & 255) << 24) | ((j4 & 255) << 32) | ((bArr[i + 5] & 255) << 40) | ((bArr[i + 6] & 255) << 48);
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ˑᵝﹳᵜ, reason: contains not printable characters */
    public final long mo5569() {
        long j;
        long j2;
        long j3;
        int i = this.f8120;
        int i2 = this.f8121;
        if (i2 != i) {
            int i3 = i + 1;
            byte[] bArr = this.f8122;
            byte b = bArr[i];
            if (b >= 0) {
                this.f8120 = 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 = i9 ^ (bArr[i8] << 28);
                            if (j5 >= 0) {
                                j2 = 266354560;
                            } else {
                                int i10 = i + 6;
                                long j6 = j5 ^ (bArr[i6] << 35);
                                if (j6 < 0) {
                                    j3 = -34093383808L;
                                } else {
                                    i6 = i + 7;
                                    j5 = j6 ^ (bArr[i10] << 42);
                                    if (j5 >= 0) {
                                        j2 = 4363953127296L;
                                    } else {
                                        i10 = i + 8;
                                        j6 = j5 ^ (bArr[i6] << 49);
                                        if (j6 < 0) {
                                            j3 = -558586000294016L;
                                        } else {
                                            i6 = i + 9;
                                            j5 = j6 ^ (bArr[i10] << 56);
                                            if (j5 >= 0) {
                                                j2 = 71499008037633920L;
                                            } else {
                                                int i11 = i + 10;
                                                long j7 = j5 ^ (bArr[i6] << 63);
                                                if (j7 >= 0) {
                                                    j = j7 ^ (-9151873028817141888L);
                                                    i4 = i11;
                                                }
                                            }
                                        }
                                    }
                                }
                                j = j6 ^ j3;
                                i4 = i10;
                            }
                            j = j5 ^ j2;
                        }
                    }
                    i4 = i6;
                }
                this.f8120 = i4;
                return j;
            }
        }
        return m5579();
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public final String mo5570() throws zzaeh {
        int iMo5578 = mo5578();
        byte[] bArr = this.f8122;
        if (iMo5578 > 0) {
            int i = this.f8121;
            int i2 = this.f8120;
            if (iMo5578 <= i - i2) {
                String str = new String(bArr, i2, iMo5578, StandardCharsets.UTF_8);
                this.f8120 += iMo5578;
                return str;
            }
        }
        if (iMo5578 == 0) {
            return "";
        }
        if (iMo5578 < 0) {
            C1499.m4426("CodedInputStream encountered an embedded string or message which claimed to have negative size.");
            return null;
        }
        if (iMo5578 > this.f8121) {
            return new String(m5574(iMo5578), StandardCharsets.UTF_8);
        }
        m5559(iMo5578);
        String str2 = new String(bArr, this.f8120, iMo5578, StandardCharsets.UTF_8);
        this.f8120 += iMo5578;
        return str2;
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ˑᵱ, reason: contains not printable characters */
    public final boolean mo5571(int i) throws zzaeh {
        int i2 = i & 7;
        if (i2 != 0) {
            if (i2 == 1) {
                mo5586(8);
                return true;
            }
            if (i2 == 2) {
                mo5586(mo5578());
                return true;
            }
            if (i2 == 3) {
                m7777();
                mo5585(((i >>> 3) << 3) | 4);
                return true;
            }
            if (i2 == 4) {
                if (this.f12707 == 0) {
                    mo5585(0);
                }
                return false;
            }
            if (i2 == 5) {
                mo5586(4);
                return true;
            }
            C1499.m4428();
            return false;
        }
        int i3 = this.f8121 - this.f8120;
        byte[] bArr = this.f8122;
        if (i3 >= 10) {
            for (int i4 = 0; i4 < 10; i4++) {
                int i5 = this.f8120;
                this.f8120 = i5 + 1;
                if (bArr[i5] < 0) {
                }
            }
            C1499.m4426("CodedInputStream encountered a malformed varint.");
            return false;
        }
        for (int i6 = 0; i6 < 10; i6++) {
            if (this.f8120 == this.f8121) {
                m5559(1);
            }
            int i7 = this.f8120;
            this.f8120 = i7 + 1;
            if (bArr[i7] < 0) {
            }
        }
        C1499.m4426("CodedInputStream encountered a malformed varint.");
        return false;
        return true;
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public final int mo5572() {
        return mo5578();
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    public final long mo5573() {
        return AbstractC3415.m7776(mo5569());
    }

    /* renamed from: ᵛˈᵤ, reason: contains not printable characters */
    public final byte[] m5574(int i) throws IOException {
        byte[] bArrM5565 = m5565(i);
        if (bArrM5565 != null) {
            return bArrM5565;
        }
        int i2 = this.f8120;
        int i3 = this.f8121;
        int i4 = i3 - i2;
        this.f8118 += i3;
        this.f8120 = 0;
        this.f8121 = 0;
        ArrayList arrayListM5589 = m5589(i - i4);
        byte[] bArr = new byte[i];
        System.arraycopy(this.f8122, i2, bArr, 0, i4);
        int size = arrayListM5589.size();
        int i5 = 0;
        while (i5 < size) {
            Object obj = arrayListM5589.get(i5);
            i5++;
            byte[] bArr2 = (byte[]) obj;
            int length = bArr2.length;
            System.arraycopy(bArr2, 0, bArr, i4, length);
            i4 += length;
        }
        return bArr;
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final int mo5575() {
        int i = this.f8123;
        if (i == Integer.MAX_VALUE) {
            return -1;
        }
        return i - (this.f8118 + this.f8120);
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵞʡ, reason: contains not printable characters */
    public final int mo5576() throws zzaeh {
        if (mo5591()) {
            this.f8119 = 0;
            return 0;
        }
        int iMo5578 = mo5578();
        this.f8119 = iMo5578;
        if ((iMo5578 >>> 3) != 0) {
            return iMo5578;
        }
        C1499.m4426("Protocol message contained an invalid tag (zero).");
        return 0;
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public final boolean mo5577() {
        return mo5569() != 0;
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵡᵘˎʽ, reason: contains not printable characters */
    public final int mo5578() {
        int i;
        int i2 = this.f8120;
        int i3 = this.f8121;
        if (i3 != i2) {
            int i4 = i2 + 1;
            byte[] bArr = this.f8122;
            byte b = bArr[i2];
            if (b >= 0) {
                this.f8120 = 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.f8120 = i5;
                return i;
            }
        }
        return (int) m5579();
    }

    /* renamed from: ᵡᵶᵡ, reason: contains not printable characters */
    public final long m5579() throws zzaeh {
        long j = 0;
        for (int i = 0; i < 64; i += 7) {
            if (this.f8120 == this.f8121) {
                m5559(1);
            }
            int i2 = this.f8120;
            this.f8120 = i2 + 1;
            j |= (r5 & Byte.MAX_VALUE) << i;
            if ((this.f8122[i2] & 128) == 0) {
                return j;
            }
        }
        C1499.m4426("CodedInputStream encountered a malformed varint.");
        return 0L;
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public final long mo5580() {
        return m5568();
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final float mo5581() {
        return Float.intBitsToFloat(m5562());
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final int mo5582() {
        return mo5578();
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public final byte[] mo5583() throws zzaeh {
        int iMo5578 = mo5578();
        int i = this.f8121;
        int i2 = this.f8120;
        if (iMo5578 <= i - i2 && iMo5578 > 0) {
            byte[] bArrCopyOfRange = Arrays.copyOfRange(this.f8122, i2, i2 + iMo5578);
            this.f8120 += iMo5578;
            return bArrCopyOfRange;
        }
        if (iMo5578 >= 0) {
            return m5574(iMo5578);
        }
        C1499.m4426("CodedInputStream encountered an embedded string or message which claimed to have negative size.");
        return null;
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final double mo5584() {
        return Double.longBitsToDouble(m5568());
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵨᵳʝ, reason: contains not printable characters */
    public final void mo5585(int i) throws zzaeh {
        if (this.f8119 == i) {
            return;
        }
        C1499.m4426("Protocol message end-group tag did not match expected tag.");
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public final void mo5586(int i) throws zzaeh {
        InputStream inputStream = this.f8124;
        int i2 = this.f8121;
        int i3 = this.f8120;
        int i4 = i2 - i3;
        if (i <= i4 && i >= 0) {
            this.f8120 = i3 + i;
            return;
        }
        if (i < 0) {
            C1499.m4426("CodedInputStream encountered an embedded string or message which claimed to have negative size.");
            return;
        }
        int i5 = this.f8118;
        int i6 = i5 + i3;
        int i7 = this.f8123;
        if (i6 + i > i7) {
            mo5586((i7 - i5) - i3);
            C1499.m4426("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.f8118 = i6;
        this.f8121 = 0;
        this.f8120 = 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.f8118 += i4;
                m5563();
                throw th;
            }
        }
        this.f8118 += i4;
        m5563();
        if (i4 >= i) {
            return;
        }
        int i8 = this.f8121;
        int i9 = i8 - this.f8120;
        this.f8120 = i8;
        m5559(1);
        while (true) {
            int i10 = i - i9;
            int i11 = this.f8121;
            if (i10 <= i11) {
                this.f8120 = i10;
                return;
            } else {
                i9 += i11;
                this.f8120 = i11;
                m5559(1);
            }
        }
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public final C2492 mo5587() throws IOException {
        int iMo5578 = mo5578();
        int i = this.f8121;
        int i2 = this.f8120;
        int i3 = i - i2;
        byte[] bArr = this.f8122;
        if (iMo5578 <= i3 && iMo5578 > 0) {
            C2492 c2492M6634 = AbstractC2646.m6634(bArr, i2, iMo5578);
            this.f8120 += iMo5578;
            return c2492M6634;
        }
        if (iMo5578 == 0) {
            return AbstractC2646.f10247;
        }
        if (iMo5578 < 0) {
            C1499.m4426("CodedInputStream encountered an embedded string or message which claimed to have negative size.");
            return null;
        }
        byte[] bArrM5565 = m5565(iMo5578);
        if (bArrM5565 != null) {
            return AbstractC2646.m6634(bArrM5565, 0, bArrM5565.length);
        }
        int i4 = this.f8120;
        int i5 = this.f8121;
        int i6 = i5 - i4;
        this.f8118 += i5;
        this.f8120 = 0;
        this.f8121 = 0;
        ArrayList arrayListM5589 = m5589(iMo5578 - i6);
        byte[] bArr2 = new byte[iMo5578];
        System.arraycopy(bArr, i4, bArr2, 0, i6);
        int size = arrayListM5589.size();
        int i7 = 0;
        while (i7 < size) {
            Object obj = arrayListM5589.get(i7);
            i7++;
            byte[] bArr3 = (byte[]) obj;
            int length = bArr3.length;
            System.arraycopy(bArr3, 0, bArr2, i6, length);
            i6 += length;
        }
        try {
            C2492 c2492 = AbstractC2646.f10247;
            return iMo5578 == 0 ? AbstractC2646.f10247 : new C2492(bArr2);
        } catch (zzaeh e) {
            throw new AssertionError("Expected no InvalidProtocolBufferException as data UTF8 validity is not checked.", e);
        }
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public final int mo5588(byte[] bArr, int i, int i2) throws IOException {
        if ((bArr.length - i) - i2 < 0 || (i | i2) < 0) {
            C0190.m1431();
            return 0;
        }
        if (i2 == 0) {
            return 0;
        }
        int i3 = this.f8121;
        int i4 = this.f8120;
        int i5 = i3 - i4;
        if (i5 > 0) {
            int iMin = Math.min(i2, i5);
            System.arraycopy(this.f8122, this.f8120, bArr, i, iMin);
            this.f8120 += iMin;
            return iMin;
        }
        int iMin2 = Math.min(i2, (this.f8123 - this.f8118) - i4);
        if (iMin2 <= 0) {
            return -1;
        }
        try {
            int i6 = this.f8124.read(bArr, i, iMin2);
            if (i6 != -1) {
                this.f8118 += i6;
            }
            return i6;
        } catch (zzaeh e) {
            e.f1025 = true;
            throw e;
        }
    }

    /* renamed from: ᵳᵹᵺˋ, reason: contains not printable characters */
    public final ArrayList m5589(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.f8124.read(bArr, i2, iMin - i2);
                    if (i3 == -1) {
                        C1499.m4426("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.f8118 += i3;
                    i2 += i3;
                } catch (zzaeh e) {
                    e.f1025 = true;
                    throw e;
                }
            }
            i -= iMin;
            arrayList.add(bArr);
        }
        return arrayList;
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public final int mo5590() {
        return m5562();
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public final boolean mo5591() {
        return this.f8120 == this.f8121 && !m5561(1);
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final void mo5592(int i) {
        this.f8123 = i;
        m5563();
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public final int mo5593() {
        return mo5578();
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final long mo5594() {
        return mo5569();
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final long mo5595() {
        return mo5569();
    }

    @Override // defpackage.AbstractC3415
    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public final int mo5596() {
        return AbstractC3415.m7774(mo5578());
    }
}
