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

import com.google.crypto.tink.shaded.protobuf.h0;
import com.google.crypto.tink.shaded.protobuf.p1;
import com.google.crypto.tink.shaded.protobuf.q1;
import java.util.List;
import java.util.Map;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public final class l implements q1 {

    /* renamed from: a, reason: collision with root package name */
    private final k f14392a;

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes3.dex */
    public static /* synthetic */ class a {

        /* renamed from: a, reason: collision with root package name */
        static final /* synthetic */ int[] f14393a;

        static {
            int[] iArr = new int[p1.b.values().length];
            f14393a = iArr;
            try {
                iArr[p1.b.BOOL.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                f14393a[p1.b.FIXED32.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                f14393a[p1.b.INT32.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                f14393a[p1.b.SFIXED32.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                f14393a[p1.b.SINT32.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                f14393a[p1.b.UINT32.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                f14393a[p1.b.FIXED64.ordinal()] = 7;
            } catch (NoSuchFieldError unused7) {
            }
            try {
                f14393a[p1.b.INT64.ordinal()] = 8;
            } catch (NoSuchFieldError unused8) {
            }
            try {
                f14393a[p1.b.SFIXED64.ordinal()] = 9;
            } catch (NoSuchFieldError unused9) {
            }
            try {
                f14393a[p1.b.SINT64.ordinal()] = 10;
            } catch (NoSuchFieldError unused10) {
            }
            try {
                f14393a[p1.b.UINT64.ordinal()] = 11;
            } catch (NoSuchFieldError unused11) {
            }
            try {
                f14393a[p1.b.STRING.ordinal()] = 12;
            } catch (NoSuchFieldError unused12) {
            }
        }
    }

    private l(k kVar) {
        k kVar2 = (k) z.b(kVar, "output");
        this.f14392a = kVar2;
        kVar2.f14380a = this;
    }

    public static l P(k kVar) {
        l lVar = kVar.f14380a;
        return lVar != null ? lVar : new l(kVar);
    }

    private void Q(int i10, h0.a aVar, Map map) {
        int[] iArr = a.f14393a;
        throw null;
    }

    private void R(int i10, Object obj) {
        if (obj instanceof String) {
            this.f14392a.C0(i10, (String) obj);
        } else {
            this.f14392a.a0(i10, (h) obj);
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void A(int i10, float f10) {
        this.f14392a.j0(i10, f10);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void B(int i10) {
        this.f14392a.D0(i10, 4);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void C(int i10, List list, boolean z10) {
        int i11 = 0;
        if (!z10) {
            while (i11 < list.size()) {
                this.f14392a.y0(i10, ((Integer) list.get(i11)).intValue());
                i11++;
            }
            return;
        }
        this.f14392a.D0(i10, 2);
        int i12 = 0;
        for (int i13 = 0; i13 < list.size(); i13++) {
            i12 += k.G(((Integer) list.get(i13)).intValue());
        }
        this.f14392a.F0(i12);
        while (i11 < list.size()) {
            this.f14392a.z0(((Integer) list.get(i11)).intValue());
            i11++;
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void D(int i10, int i11) {
        this.f14392a.d0(i10, i11);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void E(int i10, List list, boolean z10) {
        int i11 = 0;
        if (!z10) {
            while (i11 < list.size()) {
                this.f14392a.p0(i10, ((Long) list.get(i11)).longValue());
                i11++;
            }
            return;
        }
        this.f14392a.D0(i10, 2);
        int i12 = 0;
        for (int i13 = 0; i13 < list.size(); i13++) {
            i12 += k.w(((Long) list.get(i13)).longValue());
        }
        this.f14392a.F0(i12);
        while (i11 < list.size()) {
            this.f14392a.q0(((Long) list.get(i11)).longValue());
            i11++;
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void F(int i10, List list, boolean z10) {
        int i11 = 0;
        if (!z10) {
            while (i11 < list.size()) {
                this.f14392a.d0(i10, ((Integer) list.get(i11)).intValue());
                i11++;
            }
            return;
        }
        this.f14392a.D0(i10, 2);
        int i12 = 0;
        for (int i13 = 0; i13 < list.size(); i13++) {
            i12 += k.k(((Integer) list.get(i13)).intValue());
        }
        this.f14392a.F0(i12);
        while (i11 < list.size()) {
            this.f14392a.e0(((Integer) list.get(i11)).intValue());
            i11++;
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void G(int i10, List list, boolean z10) {
        int i11 = 0;
        if (!z10) {
            while (i11 < list.size()) {
                this.f14392a.b0(i10, ((Double) list.get(i11)).doubleValue());
                i11++;
            }
            return;
        }
        this.f14392a.D0(i10, 2);
        int i12 = 0;
        for (int i13 = 0; i13 < list.size(); i13++) {
            i12 += k.i(((Double) list.get(i13)).doubleValue());
        }
        this.f14392a.F0(i12);
        while (i11 < list.size()) {
            this.f14392a.c0(((Double) list.get(i11)).doubleValue());
            i11++;
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void H(int i10, int i11) {
        this.f14392a.y0(i10, i11);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void I(int i10, List list) {
        for (int i11 = 0; i11 < list.size(); i11++) {
            this.f14392a.a0(i10, (h) list.get(i11));
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void J(int i10, Object obj, d1 d1Var) {
        this.f14392a.r0(i10, (o0) obj, d1Var);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void K(int i10, h0.a aVar, Map map) {
        if (this.f14392a.T()) {
            Q(i10, aVar, map);
            return;
        }
        for (Map.Entry entry : map.entrySet()) {
            this.f14392a.D0(i10, 2);
            this.f14392a.F0(h0.a(aVar, entry.getKey(), entry.getValue()));
            h0.b(this.f14392a, aVar, entry.getKey(), entry.getValue());
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void L(int i10, Object obj, d1 d1Var) {
        this.f14392a.l0(i10, (o0) obj, d1Var);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void M(int i10, List list, d1 d1Var) {
        for (int i11 = 0; i11 < list.size(); i11++) {
            L(i10, list.get(i11), d1Var);
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void N(int i10, List list, d1 d1Var) {
        for (int i11 = 0; i11 < list.size(); i11++) {
            J(i10, list.get(i11), d1Var);
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void O(int i10, h hVar) {
        this.f14392a.a0(i10, hVar);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void a(int i10, List list, boolean z10) {
        int i11 = 0;
        if (!z10) {
            while (i11 < list.size()) {
                this.f14392a.j0(i10, ((Float) list.get(i11)).floatValue());
                i11++;
            }
            return;
        }
        this.f14392a.D0(i10, 2);
        int i12 = 0;
        for (int i13 = 0; i13 < list.size(); i13++) {
            i12 += k.q(((Float) list.get(i13)).floatValue());
        }
        this.f14392a.F0(i12);
        while (i11 < list.size()) {
            this.f14392a.k0(((Float) list.get(i11)).floatValue());
            i11++;
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void b(int i10, int i11) {
        this.f14392a.E0(i10, i11);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public final void c(int i10, Object obj) {
        if (obj instanceof h) {
            this.f14392a.t0(i10, (h) obj);
        } else {
            this.f14392a.s0(i10, (o0) obj);
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void d(int i10, int i11) {
        this.f14392a.f0(i10, i11);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void e(int i10, double d10) {
        this.f14392a.b0(i10, d10);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void f(int i10, List list, boolean z10) {
        int i11 = 0;
        if (!z10) {
            while (i11 < list.size()) {
                this.f14392a.w0(i10, ((Long) list.get(i11)).longValue());
                i11++;
            }
            return;
        }
        this.f14392a.D0(i10, 2);
        int i12 = 0;
        for (int i13 = 0; i13 < list.size(); i13++) {
            i12 += k.E(((Long) list.get(i13)).longValue());
        }
        this.f14392a.F0(i12);
        while (i11 < list.size()) {
            this.f14392a.x0(((Long) list.get(i11)).longValue());
            i11++;
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void g(int i10, List list, boolean z10) {
        int i11 = 0;
        if (!z10) {
            while (i11 < list.size()) {
                this.f14392a.G0(i10, ((Long) list.get(i11)).longValue());
                i11++;
            }
            return;
        }
        this.f14392a.D0(i10, 2);
        int i12 = 0;
        for (int i13 = 0; i13 < list.size(); i13++) {
            i12 += k.P(((Long) list.get(i13)).longValue());
        }
        this.f14392a.F0(i12);
        while (i11 < list.size()) {
            this.f14392a.H0(((Long) list.get(i11)).longValue());
            i11++;
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void h(int i10, long j10) {
        this.f14392a.h0(i10, j10);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public q1.a i() {
        return q1.a.ASCENDING;
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void j(int i10, List list) {
        int i11 = 0;
        if (!(list instanceof d0)) {
            while (i11 < list.size()) {
                this.f14392a.C0(i10, (String) list.get(i11));
                i11++;
            }
        } else {
            d0 d0Var = (d0) list;
            while (i11 < list.size()) {
                R(i10, d0Var.f(i11));
                i11++;
            }
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void k(int i10, String str) {
        this.f14392a.C0(i10, str);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void l(int i10, long j10) {
        this.f14392a.G0(i10, j10);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void m(int i10, List list, boolean z10) {
        int i11 = 0;
        if (!z10) {
            while (i11 < list.size()) {
                this.f14392a.n0(i10, ((Integer) list.get(i11)).intValue());
                i11++;
            }
            return;
        }
        this.f14392a.D0(i10, 2);
        int i12 = 0;
        for (int i13 = 0; i13 < list.size(); i13++) {
            i12 += k.u(((Integer) list.get(i13)).intValue());
        }
        this.f14392a.F0(i12);
        while (i11 < list.size()) {
            this.f14392a.o0(((Integer) list.get(i11)).intValue());
            i11++;
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void n(int i10, long j10) {
        this.f14392a.p0(i10, j10);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void o(int i10, boolean z10) {
        this.f14392a.Y(i10, z10);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void p(int i10, int i11) {
        this.f14392a.u0(i10, i11);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void q(int i10) {
        this.f14392a.D0(i10, 3);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void r(int i10, int i11) {
        this.f14392a.n0(i10, i11);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void s(int i10, List list, boolean z10) {
        int i11 = 0;
        if (!z10) {
            while (i11 < list.size()) {
                this.f14392a.h0(i10, ((Long) list.get(i11)).longValue());
                i11++;
            }
            return;
        }
        this.f14392a.D0(i10, 2);
        int i12 = 0;
        for (int i13 = 0; i13 < list.size(); i13++) {
            i12 += k.o(((Long) list.get(i13)).longValue());
        }
        this.f14392a.F0(i12);
        while (i11 < list.size()) {
            this.f14392a.i0(((Long) list.get(i11)).longValue());
            i11++;
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void t(int i10, List list, boolean z10) {
        int i11 = 0;
        if (!z10) {
            while (i11 < list.size()) {
                this.f14392a.u0(i10, ((Integer) list.get(i11)).intValue());
                i11++;
            }
            return;
        }
        this.f14392a.D0(i10, 2);
        int i12 = 0;
        for (int i13 = 0; i13 < list.size(); i13++) {
            i12 += k.C(((Integer) list.get(i13)).intValue());
        }
        this.f14392a.F0(i12);
        while (i11 < list.size()) {
            this.f14392a.v0(((Integer) list.get(i11)).intValue());
            i11++;
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void u(int i10, long j10) {
        this.f14392a.w0(i10, j10);
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void v(int i10, List list, boolean z10) {
        int i11 = 0;
        if (!z10) {
            while (i11 < list.size()) {
                this.f14392a.f0(i10, ((Integer) list.get(i11)).intValue());
                i11++;
            }
            return;
        }
        this.f14392a.D0(i10, 2);
        int i12 = 0;
        for (int i13 = 0; i13 < list.size(); i13++) {
            i12 += k.m(((Integer) list.get(i13)).intValue());
        }
        this.f14392a.F0(i12);
        while (i11 < list.size()) {
            this.f14392a.g0(((Integer) list.get(i11)).intValue());
            i11++;
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void w(int i10, List list, boolean z10) {
        int i11 = 0;
        if (!z10) {
            while (i11 < list.size()) {
                this.f14392a.Y(i10, ((Boolean) list.get(i11)).booleanValue());
                i11++;
            }
            return;
        }
        this.f14392a.D0(i10, 2);
        int i12 = 0;
        for (int i13 = 0; i13 < list.size(); i13++) {
            i12 += k.e(((Boolean) list.get(i13)).booleanValue());
        }
        this.f14392a.F0(i12);
        while (i11 < list.size()) {
            this.f14392a.Z(((Boolean) list.get(i11)).booleanValue());
            i11++;
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void x(int i10, List list, boolean z10) {
        int i11 = 0;
        if (!z10) {
            while (i11 < list.size()) {
                this.f14392a.E0(i10, ((Integer) list.get(i11)).intValue());
                i11++;
            }
            return;
        }
        this.f14392a.D0(i10, 2);
        int i12 = 0;
        for (int i13 = 0; i13 < list.size(); i13++) {
            i12 += k.N(((Integer) list.get(i13)).intValue());
        }
        this.f14392a.F0(i12);
        while (i11 < list.size()) {
            this.f14392a.F0(((Integer) list.get(i11)).intValue());
            i11++;
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void y(int i10, List list, boolean z10) {
        int i11 = 0;
        if (!z10) {
            while (i11 < list.size()) {
                this.f14392a.A0(i10, ((Long) list.get(i11)).longValue());
                i11++;
            }
            return;
        }
        this.f14392a.D0(i10, 2);
        int i12 = 0;
        for (int i13 = 0; i13 < list.size(); i13++) {
            i12 += k.I(((Long) list.get(i13)).longValue());
        }
        this.f14392a.F0(i12);
        while (i11 < list.size()) {
            this.f14392a.B0(((Long) list.get(i11)).longValue());
            i11++;
        }
    }

    @Override // com.google.crypto.tink.shaded.protobuf.q1
    public void z(int i10, long j10) {
        this.f14392a.A0(i10, j10);
    }
}
