package com.google.crypto.tink.shaded.protobuf;

import defpackage.AbstractC0715;
import defpackage.AbstractC3026;
import defpackage.AbstractC3306;

/* renamed from: com.google.crypto.tink.shaded.protobuf.ᵴᵳ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C0025 extends AbstractC0715 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public int f1098;

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final int f1099;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public int f1100;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final byte[] f1101;

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public int f1102 = Integer.MAX_VALUE;

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public int f1103;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public int f1104;

    public C0025(byte[] bArr, int i, int i2, boolean z) {
        this.f1101 = bArr;
        this.f1104 = i2 + i;
        this.f1100 = i;
        this.f1099 = i;
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ˀᵗᵝᵭ */
    public final String mo153() throws InvalidProtocolBufferException {
        int iM955 = m955();
        if (iM955 > 0) {
            int i = this.f1104;
            int i2 = this.f1100;
            if (iM955 <= i - i2) {
                String str = AbstractC3026.f11662.ᵨᵳʝ(this.f1101, i2, iM955);
                this.f1100 += iM955;
                return str;
            }
        }
        if (iM955 == 0) {
            return "";
        }
        if (iM955 <= 0) {
            throw InvalidProtocolBufferException.m834();
        }
        throw InvalidProtocolBufferException.m835();
    }

    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    public final int m955() {
        int i;
        int i2 = this.f1100;
        int i3 = this.f1104;
        if (i3 != i2) {
            int i4 = i2 + 1;
            byte[] bArr = this.f1101;
            byte b = bArr[i2];
            if (b >= 0) {
                this.f1100 = 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.f1100 = i5;
                return i;
            }
        }
        return (int) m957();
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ˌʾˀ */
    public final double mo158() {
        return Double.longBitsToDouble(m959());
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ˌᵜᵹᵩ */
    public final int mo159(int i) throws InvalidProtocolBufferException {
        if (i < 0) {
            throw InvalidProtocolBufferException.m834();
        }
        int iMo163 = mo163() + i;
        if (iMo163 < 0) {
            throw new InvalidProtocolBufferException("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().");
        }
        int i2 = this.f1102;
        if (iMo163 > i2) {
            throw InvalidProtocolBufferException.m835();
        }
        this.f1102 = iMo163;
        m958();
        return i2;
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ˎˏʜʾ */
    public final boolean mo161() {
        return this.f1100 == this.f1104;
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ˎˑː */
    public final long mo162() {
        return m960();
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ˏˋٴ */
    public final int mo163() {
        return this.f1100 - this.f1099;
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ˑᵥˁ */
    public final int mo165() {
        return m955();
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ˑᵱ */
    public final int mo166() {
        return m955();
    }

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public final int m956() throws InvalidProtocolBufferException {
        int i = this.f1100;
        if (this.f1104 - i < 4) {
            throw InvalidProtocolBufferException.m835();
        }
        this.f1100 = i + 4;
        byte[] bArr = this.f1101;
        return ((bArr[i + 3] & 255) << 24) | (bArr[i] & 255) | ((bArr[i + 1] & 255) << 8) | ((bArr[i + 2] & 255) << 16);
    }

    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    public final long m957() throws InvalidProtocolBufferException {
        long j = 0;
        for (int i = 0; i < 64; i += 7) {
            int i2 = this.f1100;
            if (i2 == this.f1104) {
                throw InvalidProtocolBufferException.m835();
            }
            this.f1100 = i2 + 1;
            j |= (r3 & Byte.MAX_VALUE) << i;
            if ((this.f1101[i2] & 128) == 0) {
                return j;
            }
        }
        throw InvalidProtocolBufferException.m840();
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ᵞʡ */
    public final long mo170() {
        return m959();
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ᵡʠ */
    public final int mo171() {
        return m955();
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ᵡˎ */
    public final int mo172() throws InvalidProtocolBufferException {
        if (mo161()) {
            this.f1103 = 0;
            return 0;
        }
        int iM955 = m955();
        this.f1103 = iM955;
        if ((iM955 >>> 3) != 0) {
            return iM955;
        }
        throw InvalidProtocolBufferException.m838();
    }

    /* renamed from: ᵡᵘˎʽ, reason: contains not printable characters */
    public final void m958() {
        int i = this.f1104 + this.f1098;
        this.f1104 = i;
        int i2 = i - this.f1099;
        int i3 = this.f1102;
        if (i2 <= i3) {
            this.f1098 = 0;
            return;
        }
        int i4 = i2 - i3;
        this.f1098 = i4;
        this.f1104 = i - i4;
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ᵡⁱᵥ */
    public final String mo174() throws InvalidProtocolBufferException {
        int iM955 = m955();
        if (iM955 > 0) {
            int i = this.f1104;
            int i2 = this.f1100;
            if (iM955 <= i - i2) {
                String str = new String(this.f1101, i2, iM955, AbstractC3306.f12387);
                this.f1100 += iM955;
                return str;
            }
        }
        if (iM955 == 0) {
            return "";
        }
        if (iM955 < 0) {
            throw InvalidProtocolBufferException.m834();
        }
        throw InvalidProtocolBufferException.m835();
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ᵢˇᵭ */
    public final int mo175() {
        return m956();
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ᵤᵙᵷ */
    public final long mo176() {
        return AbstractC0715.m2711(m960());
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ᵧᵾˀˈ */
    public final long mo177() {
        return m960();
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ᵨᵳʝ */
    public final float mo178() {
        return Float.intBitsToFloat(m956());
    }

    /* JADX WARN: Removed duplicated region for block: B:15:0x002f  */
    @Override // defpackage.AbstractC0715
    /* renamed from: ᵪʩ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final defpackage.C5500 mo923() throws com.google.crypto.tink.shaded.protobuf.InvalidProtocolBufferException {
        /*
            r4 = this;
            int r0 = r4.m955()
            byte[] r1 = r4.f1101
            if (r0 <= 0) goto L19
            int r2 = r4.f1104
            int r3 = r4.f1100
            int r2 = r2 - r3
            if (r0 > r2) goto L19
            ᵿˎᵠ r1 = defpackage.AbstractC2202.m5862(r1, r3, r0)
            int r2 = r4.f1100
            int r2 = r2 + r0
            r4.f1100 = r2
            return r1
        L19:
            if (r0 != 0) goto L1e
            ᵿˎᵠ r4 = defpackage.AbstractC2202.f8641
            return r4
        L1e:
            if (r0 <= 0) goto L2f
            int r2 = r4.f1104
            int r3 = r4.f1100
            int r2 = r2 - r3
            if (r0 > r2) goto L2f
            int r0 = r0 + r3
            r4.f1100 = r0
            byte[] r4 = java.util.Arrays.copyOfRange(r1, r3, r0)
            goto L35
        L2f:
            if (r0 > 0) goto L42
            if (r0 != 0) goto L3d
            byte[] r4 = defpackage.AbstractC3306.f12388
        L35:
            ᵿˎᵠ r0 = defpackage.AbstractC2202.f8641
            ᵿˎᵠ r0 = new ᵿˎᵠ
            r0.<init>(r4)
            return r0
        L3d:
            com.google.crypto.tink.shaded.protobuf.InvalidProtocolBufferException r4 = com.google.crypto.tink.shaded.protobuf.InvalidProtocolBufferException.m834()
            throw r4
        L42:
            com.google.crypto.tink.shaded.protobuf.InvalidProtocolBufferException r4 = com.google.crypto.tink.shaded.protobuf.InvalidProtocolBufferException.m835()
            throw r4
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.crypto.tink.shaded.protobuf.C0025.mo923():ᵿˎᵠ");
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ᵯٴᵦ */
    public final boolean mo180() {
        return m960() != 0;
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ᵴᵳ */
    public final void mo182(int i) throws InvalidProtocolBufferException {
        if (this.f1103 != i) {
            throw new InvalidProtocolBufferException("Protocol message end-group tag did not match expected tag.");
        }
    }

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public final long m959() throws InvalidProtocolBufferException {
        int i = this.f1100;
        if (this.f1104 - i < 8) {
            throw InvalidProtocolBufferException.m835();
        }
        this.f1100 = i + 8;
        byte[] bArr = this.f1101;
        return ((bArr[i + 1] & 255) << 8) | (bArr[i] & 255) | ((bArr[i + 2] & 255) << 16) | ((bArr[i + 3] & 255) << 24) | ((bArr[i + 4] & 255) << 32) | ((bArr[i + 5] & 255) << 40) | ((bArr[i + 6] & 255) << 48) | ((bArr[i + 7] & 255) << 56);
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ᵶᵷᵕ */
    public final void mo184(int i) {
        this.f1102 = i;
        m958();
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ᵸʓᵠ */
    public final int mo185() {
        return m956();
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ᵾᵬ */
    public final int mo186() {
        return AbstractC0715.m2713(m955());
    }

    @Override // defpackage.AbstractC0715
    /* renamed from: ᵿʗᵝʽ */
    public final long mo187() {
        return m959();
    }

    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public final long m960() {
        long j;
        long j2;
        long j3;
        long j4;
        int i = this.f1100;
        int i2 = this.f1104;
        if (i2 != i) {
            int i3 = i + 1;
            byte[] bArr = this.f1101;
            byte b = bArr[i];
            if (b >= 0) {
                this.f1100 = 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;
                        i4 = i6;
                    } else {
                        int i8 = i + 4;
                        int i9 = i7 ^ (bArr[i6] << 21);
                        if (i9 < 0) {
                            j4 = (-2080896) ^ i9;
                        } else {
                            long j5 = i9;
                            i4 = i + 5;
                            long j6 = j5 ^ (bArr[i8] << 28);
                            if (j6 >= 0) {
                                j3 = 266354560;
                            } else {
                                i8 = i + 6;
                                long j7 = j6 ^ (bArr[i4] << 35);
                                if (j7 < 0) {
                                    j2 = -34093383808L;
                                } else {
                                    i4 = i + 7;
                                    j6 = j7 ^ (bArr[i8] << 42);
                                    if (j6 >= 0) {
                                        j3 = 4363953127296L;
                                    } else {
                                        i8 = i + 8;
                                        j7 = j6 ^ (bArr[i4] << 49);
                                        if (j7 < 0) {
                                            j2 = -558586000294016L;
                                        } else {
                                            i4 = i + 9;
                                            long j8 = (j7 ^ (bArr[i8] << 56)) ^ 71499008037633920L;
                                            if (j8 < 0) {
                                                int i10 = i + 10;
                                                if (bArr[i4] >= 0) {
                                                    i4 = i10;
                                                }
                                            }
                                            j = j8;
                                        }
                                    }
                                }
                                j4 = j2 ^ j7;
                            }
                            j = j3 ^ j6;
                        }
                        i4 = i8;
                        j = j4;
                    }
                }
                this.f1100 = i4;
                return j;
            }
        }
        return m957();
    }
}
