package mo;

import java.io.IOException;
import kotlin.reflect.jvm.internal.impl.protobuf.a;
import kotlin.reflect.jvm.internal.impl.protobuf.d;
import kotlin.reflect.jvm.internal.impl.protobuf.i;

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

    /* renamed from: u, reason: collision with root package name */
    private static final p f29446u;

    /* renamed from: v, reason: collision with root package name */
    public static kotlin.reflect.jvm.internal.impl.protobuf.r f29447v = new a();

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

    /* renamed from: r, reason: collision with root package name */
    private kotlin.reflect.jvm.internal.impl.protobuf.n f29449r;

    /* renamed from: s, reason: collision with root package name */
    private byte f29450s;

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

    /* 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 p b(kotlin.reflect.jvm.internal.impl.protobuf.e eVar, kotlin.reflect.jvm.internal.impl.protobuf.g gVar) {
            return new p(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 f29452q;

        /* renamed from: r, reason: collision with root package name */
        private kotlin.reflect.jvm.internal.impl.protobuf.n f29453r = kotlin.reflect.jvm.internal.impl.protobuf.m.f26302q;

        private b() {
            o();
        }

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

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

        private void n() {
            if ((this.f29452q & 1) != 1) {
                this.f29453r = new kotlin.reflect.jvm.internal.impl.protobuf.m(this.f29453r);
                this.f29452q |= 1;
            }
        }

        private void o() {
        }

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

        public p j() {
            p pVar = new p(this);
            if ((this.f29452q & 1) == 1) {
                this.f29453r = this.f29453r.c();
                this.f29452q &= -2;
            }
            pVar.f29449r = this.f29453r;
            return pVar;
        }

        /* 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: p, 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) {
            p pVar = null;
            try {
                try {
                    p pVar2 = (p) p.f29447v.b(eVar, gVar);
                    if (pVar2 != null) {
                        d(pVar2);
                    }
                    return this;
                } catch (kotlin.reflect.jvm.internal.impl.protobuf.k e10) {
                    p pVar3 = (p) e10.a();
                    try {
                        throw e10;
                    } catch (Throwable th2) {
                        th = th2;
                        pVar = pVar3;
                        if (pVar != null) {
                            d(pVar);
                        }
                        throw th;
                    }
                }
            } catch (Throwable th3) {
                th = th3;
                if (pVar != null) {
                }
                throw th;
            }
        }

        @Override // kotlin.reflect.jvm.internal.impl.protobuf.i.b
        /* renamed from: q, reason: merged with bridge method [inline-methods] */
        public b d(p pVar) {
            if (pVar == p.o()) {
                return this;
            }
            if (!pVar.f29449r.isEmpty()) {
                if (this.f29453r.isEmpty()) {
                    this.f29453r = pVar.f29449r;
                    this.f29452q &= -2;
                } else {
                    n();
                    this.f29453r.addAll(pVar.f29449r);
                }
            }
            f(c().g(pVar.f29448q));
            return this;
        }
    }

    static {
        p pVar = new p(true);
        f29446u = pVar;
        pVar.r();
    }

    public static p o() {
        return f29446u;
    }

    private void r() {
        this.f29449r = kotlin.reflect.jvm.internal.impl.protobuf.m.f26302q;
    }

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

    public static b t(p pVar) {
        return s().d(pVar);
    }

    @Override // kotlin.reflect.jvm.internal.impl.protobuf.p
    public void a(kotlin.reflect.jvm.internal.impl.protobuf.f fVar) {
        getSerializedSize();
        for (int i10 = 0; i10 < this.f29449r.size(); i10++) {
            fVar.N(1, this.f29449r.t0(i10));
        }
        fVar.h0(this.f29448q);
    }

    @Override // kotlin.reflect.jvm.internal.impl.protobuf.p
    public int getSerializedSize() {
        int i10 = this.f29451t;
        if (i10 != -1) {
            return i10;
        }
        int i11 = 0;
        for (int i12 = 0; i12 < this.f29449r.size(); i12++) {
            i11 += kotlin.reflect.jvm.internal.impl.protobuf.f.e(this.f29449r.t0(i12));
        }
        int size = 0 + i11 + (q().size() * 1) + this.f29448q.size();
        this.f29451t = size;
        return size;
    }

    @Override // kotlin.reflect.jvm.internal.impl.protobuf.q
    public final boolean isInitialized() {
        byte b10 = this.f29450s;
        if (b10 == 1) {
            return true;
        }
        if (b10 == 0) {
            return false;
        }
        this.f29450s = (byte) 1;
        return true;
    }

    public String p(int i10) {
        return (String) this.f29449r.get(i10);
    }

    public kotlin.reflect.jvm.internal.impl.protobuf.s q() {
        return this.f29449r;
    }

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

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

    private p(i.b bVar) {
        super(bVar);
        this.f29450s = (byte) -1;
        this.f29451t = -1;
        this.f29448q = bVar.c();
    }

    private p(boolean z10) {
        this.f29450s = (byte) -1;
        this.f29451t = -1;
        this.f29448q = kotlin.reflect.jvm.internal.impl.protobuf.d.f26243p;
    }

    private p(kotlin.reflect.jvm.internal.impl.protobuf.e eVar, kotlin.reflect.jvm.internal.impl.protobuf.g gVar) {
        this.f29450s = (byte) -1;
        this.f29451t = -1;
        r();
        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;
        boolean z11 = false;
        while (!z10) {
            try {
                try {
                    try {
                        int J = eVar.J();
                        if (J != 0) {
                            if (J != 10) {
                                if (!j(eVar, I, gVar, J)) {
                                }
                            } else {
                                kotlin.reflect.jvm.internal.impl.protobuf.d k10 = eVar.k();
                                if (!(z11 & true)) {
                                    this.f29449r = new kotlin.reflect.jvm.internal.impl.protobuf.m();
                                    z11 |= true;
                                }
                                this.f29449r.N0(k10);
                            }
                        }
                        z10 = true;
                    } catch (IOException e10) {
                        throw new kotlin.reflect.jvm.internal.impl.protobuf.k(e10.getMessage()).i(this);
                    }
                } catch (kotlin.reflect.jvm.internal.impl.protobuf.k e11) {
                    throw e11.i(this);
                }
            } catch (Throwable th2) {
                if (z11 & true) {
                    this.f29449r = this.f29449r.c();
                }
                try {
                    I.H();
                } catch (IOException unused) {
                } catch (Throwable th3) {
                    this.f29448q = u10.e();
                    throw th3;
                }
                this.f29448q = u10.e();
                g();
                throw th2;
            }
        }
        if (z11 & true) {
            this.f29449r = this.f29449r.c();
        }
        try {
            I.H();
        } catch (IOException unused2) {
        } catch (Throwable th4) {
            this.f29448q = u10.e();
            throw th4;
        }
        this.f29448q = u10.e();
        g();
    }
}
