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

import defpackage.AbstractC2202;
import defpackage.C0321;
import defpackage.C1260;
import defpackage.C2585;
import defpackage.C2707;
import defpackage.C2931;
import defpackage.C5500;
import java.util.Arrays;

/* renamed from: com.google.crypto.tink.shaded.protobuf.ᵸˑ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C0027 {

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public static final C0027 f1105 = new C0027(0, new int[0], new Object[0], false);

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

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public Object[] f1107;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public int f1108;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public int[] f1109;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public int f1110 = -1;

    public C0027(int i, int[] iArr, Object[] objArr, boolean z) {
        this.f1108 = i;
        this.f1109 = iArr;
        this.f1107 = objArr;
        this.f1106 = z;
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public static C0027 m962() {
        return new C0027(0, new int[8], new Object[8], true);
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || !(obj instanceof C0027)) {
            return false;
        }
        C0027 c0027 = (C0027) obj;
        int i = this.f1108;
        if (i == c0027.f1108) {
            int[] iArr = this.f1109;
            int[] iArr2 = c0027.f1109;
            int i2 = 0;
            while (true) {
                if (i2 >= i) {
                    Object[] objArr = this.f1107;
                    Object[] objArr2 = c0027.f1107;
                    int i3 = this.f1108;
                    for (int i4 = 0; i4 < i3; i4++) {
                        if (objArr[i4].equals(objArr2[i4])) {
                        }
                    }
                    return true;
                }
                if (iArr[i2] != iArr2[i2]) {
                    break;
                }
                i2++;
            }
        }
        return false;
    }

    public final int hashCode() {
        int i = this.f1108;
        int i2 = (527 + i) * 31;
        int[] iArr = this.f1109;
        int iHashCode = 17;
        int i3 = 17;
        for (int i4 = 0; i4 < i; i4++) {
            i3 = (i3 * 31) + iArr[i4];
        }
        int i5 = (i2 + i3) * 31;
        Object[] objArr = this.f1107;
        int i6 = this.f1108;
        for (int i7 = 0; i7 < i6; i7++) {
            iHashCode = (iHashCode * 31) + objArr[i7].hashCode();
        }
        return i5 + iHashCode;
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final void m963(C2931 c2931) {
        if (this.f1108 == 0) {
            return;
        }
        c2931.getClass();
        C0321 c0321 = (C0321) c2931.f11366;
        for (int i = 0; i < this.f1108; i++) {
            int i2 = this.f1109[i];
            Object obj = this.f1107[i];
            int i3 = i2 >>> 3;
            int i4 = i2 & 7;
            if (i4 == 0) {
                c0321.m1714(((Long) obj).longValue(), i3);
            } else if (i4 == 1) {
                c0321.m1712(((Long) obj).longValue(), i3);
            } else if (i4 == 2) {
                AbstractC2202 abstractC2202 = (AbstractC2202) obj;
                c0321.m1711(i3, 2);
                c0321.m1721(abstractC2202.size());
                C5500 c5500 = (C5500) abstractC2202;
                c0321.m1713(c5500.f20630, c5500.mo3599(), c5500.size());
            } else if (i4 == 3) {
                c0321.m1711(i3, 3);
                ((C0027) obj).m963(c2931);
                c0321.m1711(i3, 4);
            } else {
                if (i4 != 5) {
                    C1260.m3814(InvalidProtocolBufferException.m837());
                    return;
                }
                c0321.m1720(i3, ((Integer) obj).intValue());
            }
        }
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final void m964(int i) {
        int[] iArr = this.f1109;
        if (i > iArr.length) {
            int i2 = this.f1108;
            int i3 = (i2 / 2) + i2;
            if (i3 >= i) {
                i = i3;
            }
            if (i < 8) {
                i = 8;
            }
            this.f1109 = Arrays.copyOf(iArr, i);
            this.f1107 = Arrays.copyOf(this.f1107, i);
        }
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final int m965() {
        int iM1704;
        int iM1705;
        int iM17042;
        int i = this.f1110;
        if (i != -1) {
            return i;
        }
        int i2 = 0;
        for (int i3 = 0; i3 < this.f1108; i3++) {
            int i4 = this.f1109[i3];
            int i5 = i4 >>> 3;
            int i6 = i4 & 7;
            if (i6 != 0) {
                if (i6 == 1) {
                    ((Long) this.f1107[i3]).getClass();
                    iM17042 = C0321.m1704(i5) + 8;
                } else if (i6 == 2) {
                    iM17042 = C0321.m1708(i5, (AbstractC2202) this.f1107[i3]);
                } else if (i6 == 3) {
                    iM1704 = C0321.m1704(i5) * 2;
                    iM1705 = ((C0027) this.f1107[i3]).m965();
                } else {
                    if (i6 != 5) {
                        C2707.m6713(InvalidProtocolBufferException.m837());
                        return 0;
                    }
                    ((Integer) this.f1107[i3]).getClass();
                    iM17042 = C0321.m1704(i5) + 4;
                }
                i2 = iM17042 + i2;
            } else {
                long jLongValue = ((Long) this.f1107[i3]).longValue();
                iM1704 = C0321.m1704(i5);
                iM1705 = C0321.m1705(jLongValue);
            }
            i2 = iM1705 + iM1704 + i2;
        }
        this.f1110 = i2;
        return i2;
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final void m966(int i, Object obj) {
        if (!this.f1106) {
            C2585.m6504();
            return;
        }
        m964(this.f1108 + 1);
        int[] iArr = this.f1109;
        int i2 = this.f1108;
        iArr[i2] = i;
        this.f1107[i2] = obj;
        this.f1108 = i2 + 1;
    }
}
