package mo;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import kotlin.reflect.jvm.internal.impl.protobuf.a;
import kotlin.reflect.jvm.internal.impl.protobuf.d;
import kotlin.reflect.jvm.internal.impl.protobuf.i;
import kotlin.reflect.jvm.internal.impl.protobuf.j;
import mo.q;

/* loaded from: classes3.dex */
public final class h extends kotlin.reflect.jvm.internal.impl.protobuf.i implements kotlin.reflect.jvm.internal.impl.protobuf.q {
    private static final h B;
    public static kotlin.reflect.jvm.internal.impl.protobuf.r C = new a();
    private int A;

    /* renamed from: q, reason: collision with root package name */
    private final kotlin.reflect.jvm.internal.impl.protobuf.d f29344q;

    /* renamed from: r, reason: collision with root package name */
    private int f29345r;

    /* renamed from: s, reason: collision with root package name */
    private int f29346s;

    /* renamed from: t, reason: collision with root package name */
    private int f29347t;

    /* renamed from: u, reason: collision with root package name */
    private c f29348u;

    /* renamed from: v, reason: collision with root package name */
    private q f29349v;

    /* renamed from: w, reason: collision with root package name */
    private int f29350w;

    /* renamed from: x, reason: collision with root package name */
    private List f29351x;

    /* renamed from: y, reason: collision with root package name */
    private List f29352y;

    /* renamed from: z, reason: collision with root package name */
    private byte f29353z;

    /* loaded from: classes3.dex */
    static class a extends kotlin.reflect.jvm.internal.impl.protobuf.b {
        a() {
        }

        @Override // kotlin.reflect.jvm.internal.impl.protobuf.r
        /* renamed from: j, reason: merged with bridge method [inline-methods] */
        public h b(kotlin.reflect.jvm.internal.impl.protobuf.e eVar, kotlin.reflect.jvm.internal.impl.protobuf.g gVar) {
            return new h(eVar, gVar);
        }
    }

    /* loaded from: classes3.dex */
    public static final class b extends i.b implements kotlin.reflect.jvm.internal.impl.protobuf.q {

        /* renamed from: q, reason: collision with root package name */
        private int f29354q;

        /* renamed from: r, reason: collision with root package name */
        private int f29355r;

        /* renamed from: s, reason: collision with root package name */
        private int f29356s;

        /* renamed from: v, reason: collision with root package name */
        private int f29359v;

        /* renamed from: t, reason: collision with root package name */
        private c f29357t = c.TRUE;

        /* renamed from: u, reason: collision with root package name */
        private q f29358u = q.S();

        /* renamed from: w, reason: collision with root package name */
        private List f29360w = Collections.emptyList();

        /* renamed from: x, reason: collision with root package name */
        private List f29361x = Collections.emptyList();

        private b() {
            p();
        }

        static /* synthetic */ b h() {
            return l();
        }

        private static b l() {
            return new b();
        }

        private void n() {
            if ((this.f29354q & 32) != 32) {
                this.f29360w = new ArrayList(this.f29360w);
                this.f29354q |= 32;
            }
        }

        private void o() {
            if ((this.f29354q & 64) != 64) {
                this.f29361x = new ArrayList(this.f29361x);
                this.f29354q |= 64;
            }
        }

        private void p() {
        }

        @Override // kotlin.reflect.jvm.internal.impl.protobuf.p.a
        /* renamed from: i, reason: merged with bridge method [inline-methods] */
        public h build() {
            h j10 = j();
            if (j10.isInitialized()) {
                return j10;
            }
            throw a.AbstractC0563a.b(j10);
        }

        public h j() {
            h hVar = new h(this);
            int i10 = this.f29354q;
            int i11 = (i10 & 1) != 1 ? 0 : 1;
            hVar.f29346s = this.f29355r;
            if ((i10 & 2) == 2) {
                i11 |= 2;
            }
            hVar.f29347t = this.f29356s;
            if ((i10 & 4) == 4) {
                i11 |= 4;
            }
            hVar.f29348u = this.f29357t;
            if ((i10 & 8) == 8) {
                i11 |= 8;
            }
            hVar.f29349v = this.f29358u;
            if ((i10 & 16) == 16) {
                i11 |= 16;
            }
            hVar.f29350w = this.f29359v;
            if ((this.f29354q & 32) == 32) {
                this.f29360w = Collections.unmodifiableList(this.f29360w);
                this.f29354q &= -33;
            }
            hVar.f29351x = this.f29360w;
            if ((this.f29354q & 64) == 64) {
                this.f29361x = Collections.unmodifiableList(this.f29361x);
                this.f29354q &= -65;
            }
            hVar.f29352y = this.f29361x;
            hVar.f29345r = i11;
            return hVar;
        }

        /* renamed from: k, reason: merged with bridge method [inline-methods] */
        public b clone() {
            return l().d(j());
        }

        /* JADX WARN: Removed duplicated region for block: B:17:0x001d  */
        @Override // kotlin.reflect.jvm.internal.impl.protobuf.p.a
        /* renamed from: q, reason: merged with bridge method [inline-methods] */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public b I(kotlin.reflect.jvm.internal.impl.protobuf.e eVar, kotlin.reflect.jvm.internal.impl.protobuf.g gVar) {
            h hVar = null;
            try {
                try {
                    h hVar2 = (h) h.C.b(eVar, gVar);
                    if (hVar2 != null) {
                        d(hVar2);
                    }
                    return this;
                } catch (kotlin.reflect.jvm.internal.impl.protobuf.k e10) {
                    h hVar3 = (h) e10.a();
                    try {
                        throw e10;
                    } catch (Throwable th2) {
                        th = th2;
                        hVar = hVar3;
                        if (hVar != null) {
                            d(hVar);
                        }
                        throw th;
                    }
                }
            } catch (Throwable th3) {
                th = th3;
                if (hVar != null) {
                }
                throw th;
            }
        }

        @Override // kotlin.reflect.jvm.internal.impl.protobuf.i.b
        /* renamed from: s, reason: merged with bridge method [inline-methods] */
        public b d(h hVar) {
            if (hVar == h.z()) {
                return this;
            }
            if (hVar.H()) {
                v(hVar.A());
            }
            if (hVar.L()) {
                x(hVar.F());
            }
            if (hVar.G()) {
                u(hVar.y());
            }
            if (hVar.J()) {
                t(hVar.B());
            }
            if (hVar.K()) {
                w(hVar.C());
            }
            if (!hVar.f29351x.isEmpty()) {
                if (this.f29360w.isEmpty()) {
                    this.f29360w = hVar.f29351x;
                    this.f29354q &= -33;
                } else {
                    n();
                    this.f29360w.addAll(hVar.f29351x);
                }
            }
            if (!hVar.f29352y.isEmpty()) {
                if (this.f29361x.isEmpty()) {
                    this.f29361x = hVar.f29352y;
                    this.f29354q &= -65;
                } else {
                    o();
                    this.f29361x.addAll(hVar.f29352y);
                }
            }
            f(c().g(hVar.f29344q));
            return this;
        }

        public b t(q qVar) {
            if ((this.f29354q & 8) != 8 || this.f29358u == q.S()) {
                this.f29358u = qVar;
            } else {
                this.f29358u = q.t0(this.f29358u).d(qVar).o();
            }
            this.f29354q |= 8;
            return this;
        }

        public b u(c cVar) {
            cVar.getClass();
            this.f29354q |= 4;
            this.f29357t = cVar;
            return this;
        }

        public b v(int i10) {
            this.f29354q |= 1;
            this.f29355r = i10;
            return this;
        }

        public b w(int i10) {
            this.f29354q |= 16;
            this.f29359v = i10;
            return this;
        }

        public b x(int i10) {
            this.f29354q |= 2;
            this.f29356s = i10;
            return this;
        }
    }

    /* loaded from: classes3.dex */
    public enum c implements j.a {
        TRUE(0, 0),
        FALSE(1, 1),
        NULL(2, 2);

        private static j.b internalValueMap = new a();
        private final int value;

        /* loaded from: classes3.dex */
        static class a implements j.b {
            a() {
            }

            @Override // kotlin.reflect.jvm.internal.impl.protobuf.j.b
            /* renamed from: a, reason: merged with bridge method [inline-methods] */
            public c findValueByNumber(int i10) {
                return c.valueOf(i10);
            }
        }

        c(int i10, int i11) {
            this.value = i11;
        }

        @Override // kotlin.reflect.jvm.internal.impl.protobuf.j.a
        public final int getNumber() {
            return this.value;
        }

        public static c valueOf(int i10) {
            if (i10 == 0) {
                return TRUE;
            }
            if (i10 == 1) {
                return FALSE;
            }
            if (i10 != 2) {
                return null;
            }
            return NULL;
        }
    }

    static {
        h hVar = new h(true);
        B = hVar;
        hVar.M();
    }

    private void M() {
        this.f29346s = 0;
        this.f29347t = 0;
        this.f29348u = c.TRUE;
        this.f29349v = q.S();
        this.f29350w = 0;
        this.f29351x = Collections.emptyList();
        this.f29352y = Collections.emptyList();
    }

    public static b N() {
        return b.h();
    }

    public static b O(h hVar) {
        return N().d(hVar);
    }

    public static h z() {
        return B;
    }

    public int A() {
        return this.f29346s;
    }

    public q B() {
        return this.f29349v;
    }

    public int C() {
        return this.f29350w;
    }

    public h D(int i10) {
        return (h) this.f29352y.get(i10);
    }

    public int E() {
        return this.f29352y.size();
    }

    public int F() {
        return this.f29347t;
    }

    public boolean G() {
        return (this.f29345r & 4) == 4;
    }

    public boolean H() {
        return (this.f29345r & 1) == 1;
    }

    public boolean J() {
        return (this.f29345r & 8) == 8;
    }

    public boolean K() {
        return (this.f29345r & 16) == 16;
    }

    public boolean L() {
        return (this.f29345r & 2) == 2;
    }

    @Override // kotlin.reflect.jvm.internal.impl.protobuf.p
    /* renamed from: P, reason: merged with bridge method [inline-methods] */
    public b newBuilderForType() {
        return N();
    }

    @Override // kotlin.reflect.jvm.internal.impl.protobuf.p
    /* renamed from: Q, reason: merged with bridge method [inline-methods] */
    public b toBuilder() {
        return O(this);
    }

    @Override // kotlin.reflect.jvm.internal.impl.protobuf.p
    public void a(kotlin.reflect.jvm.internal.impl.protobuf.f fVar) {
        getSerializedSize();
        if ((this.f29345r & 1) == 1) {
            fVar.Z(1, this.f29346s);
        }
        if ((this.f29345r & 2) == 2) {
            fVar.Z(2, this.f29347t);
        }
        if ((this.f29345r & 4) == 4) {
            fVar.R(3, this.f29348u.getNumber());
        }
        if ((this.f29345r & 8) == 8) {
            fVar.c0(4, this.f29349v);
        }
        if ((this.f29345r & 16) == 16) {
            fVar.Z(5, this.f29350w);
        }
        for (int i10 = 0; i10 < this.f29351x.size(); i10++) {
            fVar.c0(6, (kotlin.reflect.jvm.internal.impl.protobuf.p) this.f29351x.get(i10));
        }
        for (int i11 = 0; i11 < this.f29352y.size(); i11++) {
            fVar.c0(7, (kotlin.reflect.jvm.internal.impl.protobuf.p) this.f29352y.get(i11));
        }
        fVar.h0(this.f29344q);
    }

    @Override // kotlin.reflect.jvm.internal.impl.protobuf.p
    public int getSerializedSize() {
        int i10 = this.A;
        if (i10 != -1) {
            return i10;
        }
        int o10 = (this.f29345r & 1) == 1 ? kotlin.reflect.jvm.internal.impl.protobuf.f.o(1, this.f29346s) + 0 : 0;
        if ((this.f29345r & 2) == 2) {
            o10 += kotlin.reflect.jvm.internal.impl.protobuf.f.o(2, this.f29347t);
        }
        if ((this.f29345r & 4) == 4) {
            o10 += kotlin.reflect.jvm.internal.impl.protobuf.f.h(3, this.f29348u.getNumber());
        }
        if ((this.f29345r & 8) == 8) {
            o10 += kotlin.reflect.jvm.internal.impl.protobuf.f.r(4, this.f29349v);
        }
        if ((this.f29345r & 16) == 16) {
            o10 += kotlin.reflect.jvm.internal.impl.protobuf.f.o(5, this.f29350w);
        }
        for (int i11 = 0; i11 < this.f29351x.size(); i11++) {
            o10 += kotlin.reflect.jvm.internal.impl.protobuf.f.r(6, (kotlin.reflect.jvm.internal.impl.protobuf.p) this.f29351x.get(i11));
        }
        for (int i12 = 0; i12 < this.f29352y.size(); i12++) {
            o10 += kotlin.reflect.jvm.internal.impl.protobuf.f.r(7, (kotlin.reflect.jvm.internal.impl.protobuf.p) this.f29352y.get(i12));
        }
        int size = o10 + this.f29344q.size();
        this.A = size;
        return size;
    }

    @Override // kotlin.reflect.jvm.internal.impl.protobuf.q
    public final boolean isInitialized() {
        byte b10 = this.f29353z;
        if (b10 == 1) {
            return true;
        }
        if (b10 == 0) {
            return false;
        }
        if (J() && !B().isInitialized()) {
            this.f29353z = (byte) 0;
            return false;
        }
        for (int i10 = 0; i10 < x(); i10++) {
            if (!w(i10).isInitialized()) {
                this.f29353z = (byte) 0;
                return false;
            }
        }
        for (int i11 = 0; i11 < E(); i11++) {
            if (!D(i11).isInitialized()) {
                this.f29353z = (byte) 0;
                return false;
            }
        }
        this.f29353z = (byte) 1;
        return true;
    }

    public h w(int i10) {
        return (h) this.f29351x.get(i10);
    }

    public int x() {
        return this.f29351x.size();
    }

    public c y() {
        return this.f29348u;
    }

    private h(i.b bVar) {
        super(bVar);
        this.f29353z = (byte) -1;
        this.A = -1;
        this.f29344q = bVar.c();
    }

    private h(boolean z10) {
        this.f29353z = (byte) -1;
        this.A = -1;
        this.f29344q = kotlin.reflect.jvm.internal.impl.protobuf.d.f26243p;
    }

    private h(kotlin.reflect.jvm.internal.impl.protobuf.e eVar, kotlin.reflect.jvm.internal.impl.protobuf.g gVar) {
        this.f29353z = (byte) -1;
        this.A = -1;
        M();
        d.b u10 = kotlin.reflect.jvm.internal.impl.protobuf.d.u();
        kotlin.reflect.jvm.internal.impl.protobuf.f I = kotlin.reflect.jvm.internal.impl.protobuf.f.I(u10, 1);
        boolean z10 = false;
        int i10 = 0;
        while (!z10) {
            try {
                try {
                    int J = eVar.J();
                    if (J != 0) {
                        if (J == 8) {
                            this.f29345r |= 1;
                            this.f29346s = eVar.r();
                        } else if (J == 16) {
                            this.f29345r |= 2;
                            this.f29347t = eVar.r();
                        } else if (J == 24) {
                            int m10 = eVar.m();
                            c valueOf = c.valueOf(m10);
                            if (valueOf == null) {
                                I.n0(J);
                                I.n0(m10);
                            } else {
                                this.f29345r |= 4;
                                this.f29348u = valueOf;
                            }
                        } else if (J == 34) {
                            q.c builder = (this.f29345r & 8) == 8 ? this.f29349v.toBuilder() : null;
                            q qVar = (q) eVar.t(q.K, gVar);
                            this.f29349v = qVar;
                            if (builder != null) {
                                builder.d(qVar);
                                this.f29349v = builder.o();
                            }
                            this.f29345r |= 8;
                        } else if (J == 40) {
                            this.f29345r |= 16;
                            this.f29350w = eVar.r();
                        } else if (J == 50) {
                            if ((i10 & 32) != 32) {
                                this.f29351x = new ArrayList();
                                i10 |= 32;
                            }
                            this.f29351x.add(eVar.t(C, gVar));
                        } else if (J != 58) {
                            if (!j(eVar, I, gVar, J)) {
                            }
                        } else {
                            if ((i10 & 64) != 64) {
                                this.f29352y = new ArrayList();
                                i10 |= 64;
                            }
                            this.f29352y.add(eVar.t(C, gVar));
                        }
                    }
                    z10 = true;
                } catch (Throwable th2) {
                    if ((i10 & 32) == 32) {
                        this.f29351x = Collections.unmodifiableList(this.f29351x);
                    }
                    if ((i10 & 64) == 64) {
                        this.f29352y = Collections.unmodifiableList(this.f29352y);
                    }
                    try {
                        I.H();
                    } catch (IOException unused) {
                    } catch (Throwable th3) {
                        this.f29344q = u10.e();
                        throw th3;
                    }
                    this.f29344q = u10.e();
                    g();
                    throw th2;
                }
            } catch (kotlin.reflect.jvm.internal.impl.protobuf.k e10) {
                throw e10.i(this);
            } catch (IOException e11) {
                throw new kotlin.reflect.jvm.internal.impl.protobuf.k(e11.getMessage()).i(this);
            }
        }
        if ((i10 & 32) == 32) {
            this.f29351x = Collections.unmodifiableList(this.f29351x);
        }
        if ((i10 & 64) == 64) {
            this.f29352y = Collections.unmodifiableList(this.f29352y);
        }
        try {
            I.H();
        } catch (IOException unused2) {
        } catch (Throwable th4) {
            this.f29344q = u10.e();
            throw th4;
        }
        this.f29344q = u10.e();
        g();
    }
}
