package mo;

import java.io.IOException;
import java.io.InputStream;
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 mo.q;
import net.sqlcipher.database.SQLiteDatabase;

/* loaded from: classes3.dex */
public final class r extends i.d {
    private static final r E;
    public static kotlin.reflect.jvm.internal.impl.protobuf.r F = new a();
    private List A;
    private List B;
    private byte C;
    private int D;

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

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

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

    /* renamed from: u, reason: collision with root package name */
    private int f29487u;

    /* renamed from: v, reason: collision with root package name */
    private List f29488v;

    /* renamed from: w, reason: collision with root package name */
    private q f29489w;

    /* renamed from: x, reason: collision with root package name */
    private int f29490x;

    /* renamed from: y, reason: collision with root package name */
    private q f29491y;

    /* renamed from: z, reason: collision with root package name */
    private int f29492z;

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

    /* loaded from: classes3.dex */
    public static final class b extends i.c {

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

        /* renamed from: u, reason: collision with root package name */
        private int f29495u;

        /* renamed from: x, reason: collision with root package name */
        private int f29498x;

        /* renamed from: z, reason: collision with root package name */
        private int f29500z;

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

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

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

        /* renamed from: y, reason: collision with root package name */
        private q f29499y = q.S();
        private List A = Collections.emptyList();
        private List B = Collections.emptyList();

        private b() {
            v();
        }

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

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

        private void s() {
            if ((this.f29493s & 128) != 128) {
                this.A = new ArrayList(this.A);
                this.f29493s |= 128;
            }
        }

        private void t() {
            if ((this.f29493s & 4) != 4) {
                this.f29496v = new ArrayList(this.f29496v);
                this.f29493s |= 4;
            }
        }

        private void u() {
            if ((this.f29493s & 256) != 256) {
                this.B = new ArrayList(this.B);
                this.f29493s |= 256;
            }
        }

        private void v() {
        }

        public b A(int i10) {
            this.f29493s |= 64;
            this.f29500z = i10;
            return this;
        }

        public b B(int i10) {
            this.f29493s |= 1;
            this.f29494t = i10;
            return this;
        }

        public b C(int i10) {
            this.f29493s |= 2;
            this.f29495u = i10;
            return this;
        }

        public b D(int i10) {
            this.f29493s |= 16;
            this.f29498x = i10;
            return this;
        }

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

        public r o() {
            r rVar = new r(this);
            int i10 = this.f29493s;
            int i11 = (i10 & 1) != 1 ? 0 : 1;
            rVar.f29486t = this.f29494t;
            if ((i10 & 2) == 2) {
                i11 |= 2;
            }
            rVar.f29487u = this.f29495u;
            if ((this.f29493s & 4) == 4) {
                this.f29496v = Collections.unmodifiableList(this.f29496v);
                this.f29493s &= -5;
            }
            rVar.f29488v = this.f29496v;
            if ((i10 & 8) == 8) {
                i11 |= 4;
            }
            rVar.f29489w = this.f29497w;
            if ((i10 & 16) == 16) {
                i11 |= 8;
            }
            rVar.f29490x = this.f29498x;
            if ((i10 & 32) == 32) {
                i11 |= 16;
            }
            rVar.f29491y = this.f29499y;
            if ((i10 & 64) == 64) {
                i11 |= 32;
            }
            rVar.f29492z = this.f29500z;
            if ((this.f29493s & 128) == 128) {
                this.A = Collections.unmodifiableList(this.A);
                this.f29493s &= -129;
            }
            rVar.A = this.A;
            if ((this.f29493s & 256) == 256) {
                this.B = Collections.unmodifiableList(this.B);
                this.f29493s &= -257;
            }
            rVar.B = this.B;
            rVar.f29485s = i11;
            return rVar;
        }

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

        public b w(q qVar) {
            if ((this.f29493s & 32) != 32 || this.f29499y == q.S()) {
                this.f29499y = qVar;
            } else {
                this.f29499y = q.t0(this.f29499y).d(qVar).o();
            }
            this.f29493s |= 32;
            return this;
        }

        /* JADX WARN: Removed duplicated region for block: B:17:0x001d  */
        @Override // kotlin.reflect.jvm.internal.impl.protobuf.p.a
        /* renamed from: x, 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) {
            r rVar = null;
            try {
                try {
                    r rVar2 = (r) r.F.b(eVar, gVar);
                    if (rVar2 != null) {
                        d(rVar2);
                    }
                    return this;
                } catch (kotlin.reflect.jvm.internal.impl.protobuf.k e10) {
                    r rVar3 = (r) e10.a();
                    try {
                        throw e10;
                    } catch (Throwable th2) {
                        th = th2;
                        rVar = rVar3;
                        if (rVar != null) {
                            d(rVar);
                        }
                        throw th;
                    }
                }
            } catch (Throwable th3) {
                th = th3;
                if (rVar != null) {
                }
                throw th;
            }
        }

        @Override // kotlin.reflect.jvm.internal.impl.protobuf.i.b
        /* renamed from: y, reason: merged with bridge method [inline-methods] */
        public b d(r rVar) {
            if (rVar == r.M()) {
                return this;
            }
            if (rVar.a0()) {
                B(rVar.Q());
            }
            if (rVar.b0()) {
                C(rVar.R());
            }
            if (!rVar.f29488v.isEmpty()) {
                if (this.f29496v.isEmpty()) {
                    this.f29496v = rVar.f29488v;
                    this.f29493s &= -5;
                } else {
                    t();
                    this.f29496v.addAll(rVar.f29488v);
                }
            }
            if (rVar.c0()) {
                z(rVar.V());
            }
            if (rVar.d0()) {
                D(rVar.W());
            }
            if (rVar.Y()) {
                w(rVar.O());
            }
            if (rVar.Z()) {
                A(rVar.P());
            }
            if (!rVar.A.isEmpty()) {
                if (this.A.isEmpty()) {
                    this.A = rVar.A;
                    this.f29493s &= -129;
                } else {
                    s();
                    this.A.addAll(rVar.A);
                }
            }
            if (!rVar.B.isEmpty()) {
                if (this.B.isEmpty()) {
                    this.B = rVar.B;
                    this.f29493s &= -257;
                } else {
                    u();
                    this.B.addAll(rVar.B);
                }
            }
            k(rVar);
            f(c().g(rVar.f29484r));
            return this;
        }

        public b z(q qVar) {
            if ((this.f29493s & 8) != 8 || this.f29497w == q.S()) {
                this.f29497w = qVar;
            } else {
                this.f29497w = q.t0(this.f29497w).d(qVar).o();
            }
            this.f29493s |= 8;
            return this;
        }
    }

    static {
        r rVar = new r(true);
        E = rVar;
        rVar.e0();
    }

    public static r M() {
        return E;
    }

    private void e0() {
        this.f29486t = 6;
        this.f29487u = 0;
        this.f29488v = Collections.emptyList();
        this.f29489w = q.S();
        this.f29490x = 0;
        this.f29491y = q.S();
        this.f29492z = 0;
        this.A = Collections.emptyList();
        this.B = Collections.emptyList();
    }

    public static b f0() {
        return b.l();
    }

    public static b g0(r rVar) {
        return f0().d(rVar);
    }

    public static r i0(InputStream inputStream, kotlin.reflect.jvm.internal.impl.protobuf.g gVar) {
        return (r) F.c(inputStream, gVar);
    }

    public mo.b J(int i10) {
        return (mo.b) this.A.get(i10);
    }

    public int K() {
        return this.A.size();
    }

    public List L() {
        return this.A;
    }

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

    public q O() {
        return this.f29491y;
    }

    public int P() {
        return this.f29492z;
    }

    public int Q() {
        return this.f29486t;
    }

    public int R() {
        return this.f29487u;
    }

    public s S(int i10) {
        return (s) this.f29488v.get(i10);
    }

    public int T() {
        return this.f29488v.size();
    }

    public List U() {
        return this.f29488v;
    }

    public q V() {
        return this.f29489w;
    }

    public int W() {
        return this.f29490x;
    }

    public List X() {
        return this.B;
    }

    public boolean Y() {
        return (this.f29485s & 16) == 16;
    }

    public boolean Z() {
        return (this.f29485s & 32) == 32;
    }

    @Override // kotlin.reflect.jvm.internal.impl.protobuf.p
    public void a(kotlin.reflect.jvm.internal.impl.protobuf.f fVar) {
        getSerializedSize();
        i.d.a s10 = s();
        if ((this.f29485s & 1) == 1) {
            fVar.Z(1, this.f29486t);
        }
        if ((this.f29485s & 2) == 2) {
            fVar.Z(2, this.f29487u);
        }
        for (int i10 = 0; i10 < this.f29488v.size(); i10++) {
            fVar.c0(3, (kotlin.reflect.jvm.internal.impl.protobuf.p) this.f29488v.get(i10));
        }
        if ((this.f29485s & 4) == 4) {
            fVar.c0(4, this.f29489w);
        }
        if ((this.f29485s & 8) == 8) {
            fVar.Z(5, this.f29490x);
        }
        if ((this.f29485s & 16) == 16) {
            fVar.c0(6, this.f29491y);
        }
        if ((this.f29485s & 32) == 32) {
            fVar.Z(7, this.f29492z);
        }
        for (int i11 = 0; i11 < this.A.size(); i11++) {
            fVar.c0(8, (kotlin.reflect.jvm.internal.impl.protobuf.p) this.A.get(i11));
        }
        for (int i12 = 0; i12 < this.B.size(); i12++) {
            fVar.Z(31, ((Integer) this.B.get(i12)).intValue());
        }
        s10.a(200, fVar);
        fVar.h0(this.f29484r);
    }

    public boolean a0() {
        return (this.f29485s & 1) == 1;
    }

    public boolean b0() {
        return (this.f29485s & 2) == 2;
    }

    public boolean c0() {
        return (this.f29485s & 4) == 4;
    }

    public boolean d0() {
        return (this.f29485s & 8) == 8;
    }

    @Override // kotlin.reflect.jvm.internal.impl.protobuf.p
    public int getSerializedSize() {
        int i10 = this.D;
        if (i10 != -1) {
            return i10;
        }
        int o10 = (this.f29485s & 1) == 1 ? kotlin.reflect.jvm.internal.impl.protobuf.f.o(1, this.f29486t) + 0 : 0;
        if ((this.f29485s & 2) == 2) {
            o10 += kotlin.reflect.jvm.internal.impl.protobuf.f.o(2, this.f29487u);
        }
        for (int i11 = 0; i11 < this.f29488v.size(); i11++) {
            o10 += kotlin.reflect.jvm.internal.impl.protobuf.f.r(3, (kotlin.reflect.jvm.internal.impl.protobuf.p) this.f29488v.get(i11));
        }
        if ((this.f29485s & 4) == 4) {
            o10 += kotlin.reflect.jvm.internal.impl.protobuf.f.r(4, this.f29489w);
        }
        if ((this.f29485s & 8) == 8) {
            o10 += kotlin.reflect.jvm.internal.impl.protobuf.f.o(5, this.f29490x);
        }
        if ((this.f29485s & 16) == 16) {
            o10 += kotlin.reflect.jvm.internal.impl.protobuf.f.r(6, this.f29491y);
        }
        if ((this.f29485s & 32) == 32) {
            o10 += kotlin.reflect.jvm.internal.impl.protobuf.f.o(7, this.f29492z);
        }
        for (int i12 = 0; i12 < this.A.size(); i12++) {
            o10 += kotlin.reflect.jvm.internal.impl.protobuf.f.r(8, (kotlin.reflect.jvm.internal.impl.protobuf.p) this.A.get(i12));
        }
        int i13 = 0;
        for (int i14 = 0; i14 < this.B.size(); i14++) {
            i13 += kotlin.reflect.jvm.internal.impl.protobuf.f.p(((Integer) this.B.get(i14)).intValue());
        }
        int size = o10 + i13 + (X().size() * 2) + n() + this.f29484r.size();
        this.D = size;
        return size;
    }

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

    @Override // kotlin.reflect.jvm.internal.impl.protobuf.q
    public final boolean isInitialized() {
        byte b10 = this.C;
        if (b10 == 1) {
            return true;
        }
        if (b10 == 0) {
            return false;
        }
        if (!b0()) {
            this.C = (byte) 0;
            return false;
        }
        for (int i10 = 0; i10 < T(); i10++) {
            if (!S(i10).isInitialized()) {
                this.C = (byte) 0;
                return false;
            }
        }
        if (c0() && !V().isInitialized()) {
            this.C = (byte) 0;
            return false;
        }
        if (Y() && !O().isInitialized()) {
            this.C = (byte) 0;
            return false;
        }
        for (int i11 = 0; i11 < K(); i11++) {
            if (!J(i11).isInitialized()) {
                this.C = (byte) 0;
                return false;
            }
        }
        if (m()) {
            this.C = (byte) 1;
            return true;
        }
        this.C = (byte) 0;
        return false;
    }

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

    private r(i.c cVar) {
        super(cVar);
        this.C = (byte) -1;
        this.D = -1;
        this.f29484r = cVar.c();
    }

    private r(boolean z10) {
        this.C = (byte) -1;
        this.D = -1;
        this.f29484r = kotlin.reflect.jvm.internal.impl.protobuf.d.f26243p;
    }

    /* JADX WARN: Failed to find 'out' block for switch in B:6:0x0022. Please report as an issue. */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r5v0 */
    /* JADX WARN: Type inference failed for: r5v1 */
    /* JADX WARN: Type inference failed for: r5v2, types: [boolean] */
    private r(kotlin.reflect.jvm.internal.impl.protobuf.e eVar, kotlin.reflect.jvm.internal.impl.protobuf.g gVar) {
        q.c builder;
        this.C = (byte) -1;
        this.D = -1;
        e0();
        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 (true) {
            ?? r52 = 128;
            if (!z10) {
                try {
                    try {
                        int J = eVar.J();
                        switch (J) {
                            case 0:
                                z10 = true;
                            case 8:
                                this.f29485s |= 1;
                                this.f29486t = eVar.r();
                            case 16:
                                this.f29485s |= 2;
                                this.f29487u = eVar.r();
                            case 26:
                                if ((i10 & 4) != 4) {
                                    this.f29488v = new ArrayList();
                                    i10 |= 4;
                                }
                                this.f29488v.add(eVar.t(s.D, gVar));
                            case 34:
                                builder = (this.f29485s & 4) == 4 ? this.f29489w.toBuilder() : null;
                                q qVar = (q) eVar.t(q.K, gVar);
                                this.f29489w = qVar;
                                if (builder != null) {
                                    builder.d(qVar);
                                    this.f29489w = builder.o();
                                }
                                this.f29485s |= 4;
                            case 40:
                                this.f29485s |= 8;
                                this.f29490x = eVar.r();
                            case 50:
                                builder = (this.f29485s & 16) == 16 ? this.f29491y.toBuilder() : null;
                                q qVar2 = (q) eVar.t(q.K, gVar);
                                this.f29491y = qVar2;
                                if (builder != null) {
                                    builder.d(qVar2);
                                    this.f29491y = builder.o();
                                }
                                this.f29485s |= 16;
                            case 56:
                                this.f29485s |= 32;
                                this.f29492z = eVar.r();
                            case 66:
                                if ((i10 & 128) != 128) {
                                    this.A = new ArrayList();
                                    i10 |= 128;
                                }
                                this.A.add(eVar.t(mo.b.f29240x, gVar));
                            case 248:
                                if ((i10 & 256) != 256) {
                                    this.B = new ArrayList();
                                    i10 |= 256;
                                }
                                this.B.add(Integer.valueOf(eVar.r()));
                            case SQLiteDatabase.MAX_SQL_CACHE_SIZE /* 250 */:
                                int i11 = eVar.i(eVar.z());
                                if ((i10 & 256) != 256 && eVar.e() > 0) {
                                    this.B = new ArrayList();
                                    i10 |= 256;
                                }
                                while (eVar.e() > 0) {
                                    this.B.add(Integer.valueOf(eVar.r()));
                                }
                                eVar.h(i11);
                                break;
                            default:
                                r52 = j(eVar, I, gVar, J);
                                if (r52 == 0) {
                                    z10 = true;
                                }
                        }
                    } 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);
                    }
                } catch (Throwable th2) {
                    if ((i10 & 4) == 4) {
                        this.f29488v = Collections.unmodifiableList(this.f29488v);
                    }
                    if ((i10 & 128) == r52) {
                        this.A = Collections.unmodifiableList(this.A);
                    }
                    if ((i10 & 256) == 256) {
                        this.B = Collections.unmodifiableList(this.B);
                    }
                    try {
                        I.H();
                    } catch (IOException unused) {
                    } catch (Throwable th3) {
                        this.f29484r = u10.e();
                        throw th3;
                    }
                    this.f29484r = u10.e();
                    g();
                    throw th2;
                }
            } else {
                if ((i10 & 4) == 4) {
                    this.f29488v = Collections.unmodifiableList(this.f29488v);
                }
                if ((i10 & 128) == 128) {
                    this.A = Collections.unmodifiableList(this.A);
                }
                if ((i10 & 256) == 256) {
                    this.B = Collections.unmodifiableList(this.B);
                }
                try {
                    I.H();
                } catch (IOException unused2) {
                } catch (Throwable th4) {
                    this.f29484r = u10.e();
                    throw th4;
                }
                this.f29484r = u10.e();
                g();
                return;
            }
        }
    }
}
