package kotlin.reflect.w.internal.y0.g;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import kotlin.reflect.w.internal.y0.i.a;
import kotlin.reflect.w.internal.y0.i.c;
import kotlin.reflect.w.internal.y0.i.d;
import kotlin.reflect.w.internal.y0.i.e;
import kotlin.reflect.w.internal.y0.i.f;
import kotlin.reflect.w.internal.y0.i.h;
import kotlin.reflect.w.internal.y0.i.i;
import kotlin.reflect.w.internal.y0.i.j;
import kotlin.reflect.w.internal.y0.i.p;
import kotlin.reflect.w.internal.y0.i.r;
import kotlin.reflect.w.internal.y0.i.v;

/* JADX INFO: loaded from: classes2.dex */
public final class q extends h.d<q> implements kotlin.reflect.w.internal.y0.i.q {

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public static final q f7965m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public static r<q> f7966n = new a();
    public int A;
    public q B;
    public int C;
    public int D;
    public byte E;
    public int F;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public final kotlin.reflect.w.internal.y0.i.c f7967o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public int f7968p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public List<b> f7969q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public boolean f7970r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public int f7971s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public q f7972t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public int f7973u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public int f7974v;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public int f7975w;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public int f7976x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public int f7977y;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public q f7978z;

    public static class a extends kotlin.reflect.w.internal.y0.i.b<q> {
        @Override // kotlin.reflect.w.internal.y0.i.r
        public Object a(d dVar, f fVar) {
            return new q(dVar, fVar, null);
        }
    }

    public static final class c extends h.c<q, c> implements kotlin.reflect.w.internal.y0.i.q {
        public q A;
        public int B;
        public int C;

        /* JADX INFO: renamed from: o, reason: collision with root package name */
        public int f7998o;

        /* JADX INFO: renamed from: p, reason: collision with root package name */
        public List<b> f7999p = Collections.emptyList();

        /* JADX INFO: renamed from: q, reason: collision with root package name */
        public boolean f8000q;

        /* JADX INFO: renamed from: r, reason: collision with root package name */
        public int f8001r;

        /* JADX INFO: renamed from: s, reason: collision with root package name */
        public q f8002s;

        /* JADX INFO: renamed from: t, reason: collision with root package name */
        public int f8003t;

        /* JADX INFO: renamed from: u, reason: collision with root package name */
        public int f8004u;

        /* JADX INFO: renamed from: v, reason: collision with root package name */
        public int f8005v;

        /* JADX INFO: renamed from: w, reason: collision with root package name */
        public int f8006w;

        /* JADX INFO: renamed from: x, reason: collision with root package name */
        public int f8007x;

        /* JADX INFO: renamed from: y, reason: collision with root package name */
        public q f8008y;

        /* JADX INFO: renamed from: z, reason: collision with root package name */
        public int f8009z;

        public c() {
            q qVar = q.f7965m;
            this.f8002s = qVar;
            this.f8008y = qVar;
            this.A = qVar;
        }

        @Override // r.i0.w.b.y0.i.p.a
        public p a() {
            q qVarN = n();
            if (qVarN.i()) {
                return qVarN;
            }
            throw new v();
        }

        @Override // r.i0.w.b.y0.i.h.b
        public Object clone() {
            c cVar = new c();
            cVar.l(n());
            return cVar;
        }

        @Override // kotlin.reflect.w.internal.y0.i.a.AbstractC0155a, r.i0.w.b.y0.i.p.a
        public /* bridge */ /* synthetic */ p.a h(d dVar, f fVar) throws Throwable {
            p(dVar, fVar);
            return this;
        }

        @Override // kotlin.reflect.w.internal.y0.i.a.AbstractC0155a
        /* JADX INFO: renamed from: j */
        public /* bridge */ /* synthetic */ a.AbstractC0155a h(d dVar, f fVar) throws Throwable {
            p(dVar, fVar);
            return this;
        }

        @Override // r.i0.w.b.y0.i.h.b
        /* JADX INFO: renamed from: k */
        public h.b clone() {
            c cVar = new c();
            cVar.l(n());
            return cVar;
        }

        public q n() {
            q qVar = new q(this, null);
            int i2 = this.f7998o;
            if ((i2 & 1) == 1) {
                this.f7999p = Collections.unmodifiableList(this.f7999p);
                this.f7998o &= -2;
            }
            qVar.f7969q = this.f7999p;
            int i3 = (i2 & 2) != 2 ? 0 : 1;
            qVar.f7970r = this.f8000q;
            if ((i2 & 4) == 4) {
                i3 |= 2;
            }
            qVar.f7971s = this.f8001r;
            if ((i2 & 8) == 8) {
                i3 |= 4;
            }
            qVar.f7972t = this.f8002s;
            if ((i2 & 16) == 16) {
                i3 |= 8;
            }
            qVar.f7973u = this.f8003t;
            if ((i2 & 32) == 32) {
                i3 |= 16;
            }
            qVar.f7974v = this.f8004u;
            if ((i2 & 64) == 64) {
                i3 |= 32;
            }
            qVar.f7975w = this.f8005v;
            if ((i2 & 128) == 128) {
                i3 |= 64;
            }
            qVar.f7976x = this.f8006w;
            if ((i2 & 256) == 256) {
                i3 |= 128;
            }
            qVar.f7977y = this.f8007x;
            if ((i2 & 512) == 512) {
                i3 |= 256;
            }
            qVar.f7978z = this.f8008y;
            if ((i2 & 1024) == 1024) {
                i3 |= 512;
            }
            qVar.A = this.f8009z;
            if ((i2 & 2048) == 2048) {
                i3 |= 1024;
            }
            qVar.B = this.A;
            if ((i2 & 4096) == 4096) {
                i3 |= 2048;
            }
            qVar.C = this.B;
            if ((i2 & 8192) == 8192) {
                i3 |= 4096;
            }
            qVar.D = this.C;
            qVar.f7968p = i3;
            return qVar;
        }

        @Override // r.i0.w.b.y0.i.h.b
        /* JADX INFO: renamed from: o, reason: merged with bridge method [inline-methods] */
        public c l(q qVar) {
            q qVar2;
            q qVar3;
            q qVar4;
            q qVar5 = q.f7965m;
            if (qVar == qVar5) {
                return this;
            }
            if (!qVar.f7969q.isEmpty()) {
                if (this.f7999p.isEmpty()) {
                    this.f7999p = qVar.f7969q;
                    this.f7998o &= -2;
                } else {
                    if ((this.f7998o & 1) != 1) {
                        this.f7999p = new ArrayList(this.f7999p);
                        this.f7998o |= 1;
                    }
                    this.f7999p.addAll(qVar.f7969q);
                }
            }
            int i2 = qVar.f7968p;
            if ((i2 & 1) == 1) {
                boolean z2 = qVar.f7970r;
                this.f7998o |= 2;
                this.f8000q = z2;
            }
            if ((i2 & 2) == 2) {
                int i3 = qVar.f7971s;
                this.f7998o |= 4;
                this.f8001r = i3;
            }
            if (qVar.u()) {
                q qVarN = qVar.f7972t;
                if ((this.f7998o & 8) == 8 && (qVar4 = this.f8002s) != qVar5) {
                    c cVarY = q.y(qVar4);
                    cVarY.l(qVarN);
                    qVarN = cVarY.n();
                }
                this.f8002s = qVarN;
                this.f7998o |= 8;
            }
            if ((qVar.f7968p & 8) == 8) {
                int i4 = qVar.f7973u;
                this.f7998o |= 16;
                this.f8003t = i4;
            }
            if (qVar.t()) {
                int i5 = qVar.f7974v;
                this.f7998o |= 32;
                this.f8004u = i5;
            }
            int i6 = qVar.f7968p;
            if ((i6 & 32) == 32) {
                int i7 = qVar.f7975w;
                this.f7998o |= 64;
                this.f8005v = i7;
            }
            if ((i6 & 64) == 64) {
                int i8 = qVar.f7976x;
                this.f7998o |= 128;
                this.f8006w = i8;
            }
            if (qVar.w()) {
                int i9 = qVar.f7977y;
                this.f7998o |= 256;
                this.f8007x = i9;
            }
            if (qVar.v()) {
                q qVarN2 = qVar.f7978z;
                if ((this.f7998o & 512) == 512 && (qVar3 = this.f8008y) != qVar5) {
                    c cVarY2 = q.y(qVar3);
                    cVarY2.l(qVarN2);
                    qVarN2 = cVarY2.n();
                }
                this.f8008y = qVarN2;
                this.f7998o |= 512;
            }
            if ((qVar.f7968p & 512) == 512) {
                int i10 = qVar.A;
                this.f7998o |= 1024;
                this.f8009z = i10;
            }
            if (qVar.s()) {
                q qVarN3 = qVar.B;
                if ((this.f7998o & 2048) == 2048 && (qVar2 = this.A) != qVar5) {
                    c cVarY3 = q.y(qVar2);
                    cVarY3.l(qVarN3);
                    qVarN3 = cVarY3.n();
                }
                this.A = qVarN3;
                this.f7998o |= 2048;
            }
            int i11 = qVar.f7968p;
            if ((i11 & 2048) == 2048) {
                int i12 = qVar.C;
                this.f7998o |= 4096;
                this.B = i12;
            }
            if ((i11 & 4096) == 4096) {
                int i13 = qVar.D;
                this.f7998o |= 8192;
                this.C = i13;
            }
            m(qVar);
            this.f8259f = this.f8259f.b(qVar.f7967o);
            return this;
        }

        /* JADX WARN: Removed duplicated region for block: B:15:0x001b  */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
            To view partially-correct add '--show-bad-code' argument
        */
        public r.i0.w.b.y0.g.q.c p(kotlin.reflect.w.internal.y0.i.d r3, kotlin.reflect.w.internal.y0.i.f r4) throws java.lang.Throwable {
            /*
                r2 = this;
                r0 = 0
                r.i0.w.b.y0.i.r<r.i0.w.b.y0.g.q> r1 = kotlin.reflect.w.internal.y0.g.q.f7966n     // Catch: java.lang.Throwable -> Lf kotlin.reflect.w.internal.y0.i.j -> L11
                java.lang.Object r3 = r1.a(r3, r4)     // Catch: java.lang.Throwable -> Lf kotlin.reflect.w.internal.y0.i.j -> L11
                r.i0.w.b.y0.g.q r3 = (kotlin.reflect.w.internal.y0.g.q) r3     // Catch: java.lang.Throwable -> Lf kotlin.reflect.w.internal.y0.i.j -> L11
                if (r3 == 0) goto Le
                r2.l(r3)
            Le:
                return r2
            Lf:
                r3 = move-exception
                goto L19
            L11:
                r3 = move-exception
                r.i0.w.b.y0.i.p r4 = r3.f8275f     // Catch: java.lang.Throwable -> Lf
                r.i0.w.b.y0.g.q r4 = (kotlin.reflect.w.internal.y0.g.q) r4     // Catch: java.lang.Throwable -> Lf
                throw r3     // Catch: java.lang.Throwable -> L17
            L17:
                r3 = move-exception
                r0 = r4
            L19:
                if (r0 == 0) goto L1e
                r2.l(r0)
            L1e:
                throw r3
            */
            throw new UnsupportedOperationException("Method not decompiled: r.i0.w.b.y0.g.q.c.p(r.i0.w.b.y0.i.d, r.i0.w.b.y0.i.f):r.i0.w.b.y0.g.q$c");
        }
    }

    static {
        q qVar = new q();
        f7965m = qVar;
        qVar.x();
    }

    public q() {
        this.E = (byte) -1;
        this.F = -1;
        this.f7967o = kotlin.reflect.w.internal.y0.i.c.f8234f;
    }

    public q(d dVar, f fVar, kotlin.reflect.w.internal.y0.g.a aVar) {
        int i2;
        this.E = (byte) -1;
        this.F = -1;
        x();
        c.b bVarN = kotlin.reflect.w.internal.y0.i.c.n();
        e eVarK = e.k(bVarN, 1);
        boolean z2 = false;
        boolean z3 = false;
        while (!z2) {
            try {
                try {
                    int iO = dVar.o();
                    c cVarY = null;
                    switch (iO) {
                        case 0:
                            z2 = true;
                            break;
                        case 8:
                            this.f7968p |= 4096;
                            this.D = dVar.l();
                            break;
                        case 18:
                            if (!(z3 & true)) {
                                this.f7969q = new ArrayList();
                                z3 |= true;
                            }
                            this.f7969q.add((b) dVar.h(b.f7980m, fVar));
                            break;
                        case 24:
                            this.f7968p |= 1;
                            this.f7970r = dVar.e();
                            break;
                        case 32:
                            this.f7968p |= 2;
                            this.f7971s = dVar.l();
                            break;
                        case 42:
                            i2 = 4;
                            if ((this.f7968p & 4) == 4) {
                                q qVar = this.f7972t;
                                Objects.requireNonNull(qVar);
                                cVarY = y(qVar);
                            }
                            q qVar2 = (q) dVar.h(f7966n, fVar);
                            this.f7972t = qVar2;
                            if (cVarY != null) {
                                cVarY.l(qVar2);
                                this.f7972t = cVarY.n();
                            }
                            this.f7968p |= i2;
                            break;
                        case 48:
                            this.f7968p |= 16;
                            this.f7974v = dVar.l();
                            break;
                        case 56:
                            this.f7968p |= 32;
                            this.f7975w = dVar.l();
                            break;
                        case 64:
                            this.f7968p |= 8;
                            this.f7973u = dVar.l();
                            break;
                        case 72:
                            this.f7968p |= 64;
                            this.f7976x = dVar.l();
                            break;
                        case 82:
                            i2 = 256;
                            if ((this.f7968p & 256) == 256) {
                                q qVar3 = this.f7978z;
                                Objects.requireNonNull(qVar3);
                                cVarY = y(qVar3);
                            }
                            q qVar4 = (q) dVar.h(f7966n, fVar);
                            this.f7978z = qVar4;
                            if (cVarY != null) {
                                cVarY.l(qVar4);
                                this.f7978z = cVarY.n();
                            }
                            this.f7968p |= i2;
                            break;
                        case 88:
                            this.f7968p |= 512;
                            this.A = dVar.l();
                            break;
                        case 96:
                            this.f7968p |= 128;
                            this.f7977y = dVar.l();
                            break;
                        case 106:
                            i2 = 1024;
                            if ((this.f7968p & 1024) == 1024) {
                                q qVar5 = this.B;
                                Objects.requireNonNull(qVar5);
                                cVarY = y(qVar5);
                            }
                            q qVar6 = (q) dVar.h(f7966n, fVar);
                            this.B = qVar6;
                            if (cVarY != null) {
                                cVarY.l(qVar6);
                                this.B = cVarY.n();
                            }
                            this.f7968p |= i2;
                            break;
                        case 112:
                            this.f7968p |= 2048;
                            this.C = dVar.l();
                            break;
                        default:
                            if (!q(dVar, eVarK, fVar, iO)) {
                                z2 = true;
                            }
                            break;
                    }
                } catch (j e2) {
                    e2.f8275f = this;
                    throw e2;
                } catch (IOException e3) {
                    j jVar = new j(e3.getMessage());
                    jVar.f8275f = this;
                    throw jVar;
                }
            } catch (Throwable th) {
                if (z3 & true) {
                    this.f7969q = Collections.unmodifiableList(this.f7969q);
                }
                try {
                    eVarK.j();
                } catch (IOException unused) {
                } catch (Throwable th2) {
                    this.f7967o = bVarN.d();
                    throw th2;
                }
                this.f7967o = bVarN.d();
                this.f8262f.i();
                throw th;
            }
        }
        if (z3 & true) {
            this.f7969q = Collections.unmodifiableList(this.f7969q);
        }
        try {
            eVarK.j();
        } catch (IOException unused2) {
        } catch (Throwable th3) {
            this.f7967o = bVarN.d();
            throw th3;
        }
        this.f7967o = bVarN.d();
        this.f8262f.i();
    }

    public static c y(q qVar) {
        c cVar = new c();
        cVar.l(qVar);
        return cVar;
    }

    @Override // kotlin.reflect.w.internal.y0.i.q
    public p b() {
        return f7965m;
    }

    @Override // kotlin.reflect.w.internal.y0.i.p
    public p.a c() {
        return y(this);
    }

    @Override // kotlin.reflect.w.internal.y0.i.p
    public void d(e eVar) throws IOException {
        f();
        h.d<MessageType>.a aVarP = p();
        if ((this.f7968p & 4096) == 4096) {
            eVar.p(1, this.D);
        }
        for (int i2 = 0; i2 < this.f7969q.size(); i2++) {
            eVar.r(2, this.f7969q.get(i2));
        }
        if ((this.f7968p & 1) == 1) {
            boolean z2 = this.f7970r;
            eVar.y(24);
            eVar.t(z2 ? 1 : 0);
        }
        if ((this.f7968p & 2) == 2) {
            eVar.p(4, this.f7971s);
        }
        if ((this.f7968p & 4) == 4) {
            eVar.r(5, this.f7972t);
        }
        if ((this.f7968p & 16) == 16) {
            eVar.p(6, this.f7974v);
        }
        if ((this.f7968p & 32) == 32) {
            eVar.p(7, this.f7975w);
        }
        if ((this.f7968p & 8) == 8) {
            eVar.p(8, this.f7973u);
        }
        if ((this.f7968p & 64) == 64) {
            eVar.p(9, this.f7976x);
        }
        if ((this.f7968p & 256) == 256) {
            eVar.r(10, this.f7978z);
        }
        if ((this.f7968p & 512) == 512) {
            eVar.p(11, this.A);
        }
        if ((this.f7968p & 128) == 128) {
            eVar.p(12, this.f7977y);
        }
        if ((this.f7968p & 1024) == 1024) {
            eVar.r(13, this.B);
        }
        if ((this.f7968p & 2048) == 2048) {
            eVar.p(14, this.C);
        }
        aVarP.a(200, eVar);
        eVar.u(this.f7967o);
    }

    @Override // kotlin.reflect.w.internal.y0.i.p
    public int f() {
        int i2 = this.F;
        if (i2 != -1) {
            return i2;
        }
        int iC = (this.f7968p & 4096) == 4096 ? e.c(1, this.D) + 0 : 0;
        for (int i3 = 0; i3 < this.f7969q.size(); i3++) {
            iC += e.e(2, this.f7969q.get(i3));
        }
        if ((this.f7968p & 1) == 1) {
            iC += e.i(3) + 1;
        }
        if ((this.f7968p & 2) == 2) {
            iC += e.c(4, this.f7971s);
        }
        if ((this.f7968p & 4) == 4) {
            iC += e.e(5, this.f7972t);
        }
        if ((this.f7968p & 16) == 16) {
            iC += e.c(6, this.f7974v);
        }
        if ((this.f7968p & 32) == 32) {
            iC += e.c(7, this.f7975w);
        }
        if ((this.f7968p & 8) == 8) {
            iC += e.c(8, this.f7973u);
        }
        if ((this.f7968p & 64) == 64) {
            iC += e.c(9, this.f7976x);
        }
        if ((this.f7968p & 256) == 256) {
            iC += e.e(10, this.f7978z);
        }
        if ((this.f7968p & 512) == 512) {
            iC += e.c(11, this.A);
        }
        if ((this.f7968p & 128) == 128) {
            iC += e.c(12, this.f7977y);
        }
        if ((this.f7968p & 1024) == 1024) {
            iC += e.e(13, this.B);
        }
        if ((this.f7968p & 2048) == 2048) {
            iC += e.c(14, this.C);
        }
        int size = this.f7967o.size() + l() + iC;
        this.F = size;
        return size;
    }

    @Override // kotlin.reflect.w.internal.y0.i.p
    public p.a g() {
        return new c();
    }

    @Override // kotlin.reflect.w.internal.y0.i.q
    public final boolean i() {
        byte b2 = this.E;
        if (b2 == 1) {
            return true;
        }
        if (b2 == 0) {
            return false;
        }
        for (int i2 = 0; i2 < this.f7969q.size(); i2++) {
            if (!this.f7969q.get(i2).i()) {
                this.E = (byte) 0;
                return false;
            }
        }
        if (u() && !this.f7972t.i()) {
            this.E = (byte) 0;
            return false;
        }
        if (v() && !this.f7978z.i()) {
            this.E = (byte) 0;
            return false;
        }
        if (s() && !this.B.i()) {
            this.E = (byte) 0;
            return false;
        }
        if (k()) {
            this.E = (byte) 1;
            return true;
        }
        this.E = (byte) 0;
        return false;
    }

    public boolean s() {
        return (this.f7968p & 1024) == 1024;
    }

    public boolean t() {
        return (this.f7968p & 16) == 16;
    }

    public boolean u() {
        return (this.f7968p & 4) == 4;
    }

    public boolean v() {
        return (this.f7968p & 256) == 256;
    }

    public boolean w() {
        return (this.f7968p & 128) == 128;
    }

    public final void x() {
        this.f7969q = Collections.emptyList();
        this.f7970r = false;
        this.f7971s = 0;
        q qVar = f7965m;
        this.f7972t = qVar;
        this.f7973u = 0;
        this.f7974v = 0;
        this.f7975w = 0;
        this.f7976x = 0;
        this.f7977y = 0;
        this.f7978z = qVar;
        this.A = 0;
        this.B = qVar;
        this.C = 0;
        this.D = 0;
    }

    public c z() {
        return y(this);
    }

    public static final class b extends h implements kotlin.reflect.w.internal.y0.i.q {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        public static final b f7979f;

        /* JADX INFO: renamed from: m, reason: collision with root package name */
        public static r<b> f7980m = new a();

        /* JADX INFO: renamed from: n, reason: collision with root package name */
        public final kotlin.reflect.w.internal.y0.i.c f7981n;

        /* JADX INFO: renamed from: o, reason: collision with root package name */
        public int f7982o;

        /* JADX INFO: renamed from: p, reason: collision with root package name */
        public c f7983p;

        /* JADX INFO: renamed from: q, reason: collision with root package name */
        public q f7984q;

        /* JADX INFO: renamed from: r, reason: collision with root package name */
        public int f7985r;

        /* JADX INFO: renamed from: s, reason: collision with root package name */
        public byte f7986s;

        /* JADX INFO: renamed from: t, reason: collision with root package name */
        public int f7987t;

        public static class a extends kotlin.reflect.w.internal.y0.i.b<b> {
            @Override // kotlin.reflect.w.internal.y0.i.r
            public Object a(d dVar, f fVar) {
                return new b(dVar, fVar, null);
            }
        }

        /* JADX INFO: renamed from: r.i0.w.b.y0.g.q$b$b, reason: collision with other inner class name */
        public static final class C0152b extends h.b<b, C0152b> implements kotlin.reflect.w.internal.y0.i.q {

            /* JADX INFO: renamed from: m, reason: collision with root package name */
            public int f7988m;

            /* JADX INFO: renamed from: n, reason: collision with root package name */
            public c f7989n = c.INV;

            /* JADX INFO: renamed from: o, reason: collision with root package name */
            public q f7990o = q.f7965m;

            /* JADX INFO: renamed from: p, reason: collision with root package name */
            public int f7991p;

            @Override // r.i0.w.b.y0.i.p.a
            public p a() {
                b bVarM = m();
                if (bVarM.i()) {
                    return bVarM;
                }
                throw new v();
            }

            @Override // r.i0.w.b.y0.i.h.b
            public Object clone() {
                C0152b c0152b = new C0152b();
                c0152b.n(m());
                return c0152b;
            }

            @Override // kotlin.reflect.w.internal.y0.i.a.AbstractC0155a, r.i0.w.b.y0.i.p.a
            public /* bridge */ /* synthetic */ p.a h(d dVar, f fVar) throws Throwable {
                o(dVar, fVar);
                return this;
            }

            @Override // kotlin.reflect.w.internal.y0.i.a.AbstractC0155a
            /* JADX INFO: renamed from: j */
            public /* bridge */ /* synthetic */ a.AbstractC0155a h(d dVar, f fVar) throws Throwable {
                o(dVar, fVar);
                return this;
            }

            @Override // r.i0.w.b.y0.i.h.b
            /* JADX INFO: renamed from: k */
            public h.b clone() {
                C0152b c0152b = new C0152b();
                c0152b.n(m());
                return c0152b;
            }

            @Override // r.i0.w.b.y0.i.h.b
            public /* bridge */ /* synthetic */ h.b l(h hVar) {
                n((b) hVar);
                return this;
            }

            public b m() {
                b bVar = new b(this, null);
                int i2 = this.f7988m;
                int i3 = (i2 & 1) != 1 ? 0 : 1;
                bVar.f7983p = this.f7989n;
                if ((i2 & 2) == 2) {
                    i3 |= 2;
                }
                bVar.f7984q = this.f7990o;
                if ((i2 & 4) == 4) {
                    i3 |= 4;
                }
                bVar.f7985r = this.f7991p;
                bVar.f7982o = i3;
                return bVar;
            }

            public C0152b n(b bVar) {
                q qVar;
                if (bVar == b.f7979f) {
                    return this;
                }
                if ((bVar.f7982o & 1) == 1) {
                    c cVar = bVar.f7983p;
                    Objects.requireNonNull(cVar);
                    this.f7988m |= 1;
                    this.f7989n = cVar;
                }
                if (bVar.k()) {
                    q qVarN = bVar.f7984q;
                    if ((this.f7988m & 2) == 2 && (qVar = this.f7990o) != q.f7965m) {
                        c cVarY = q.y(qVar);
                        cVarY.l(qVarN);
                        qVarN = cVarY.n();
                    }
                    this.f7990o = qVarN;
                    this.f7988m |= 2;
                }
                if ((bVar.f7982o & 4) == 4) {
                    int i2 = bVar.f7985r;
                    this.f7988m |= 4;
                    this.f7991p = i2;
                }
                this.f8259f = this.f8259f.b(bVar.f7981n);
                return this;
            }

            /* JADX WARN: Removed duplicated region for block: B:15:0x001b  */
            /*
                Code decompiled incorrectly, please refer to instructions dump.
                To view partially-correct add '--show-bad-code' argument
            */
            public r.i0.w.b.y0.g.q.b.C0152b o(kotlin.reflect.w.internal.y0.i.d r3, kotlin.reflect.w.internal.y0.i.f r4) throws java.lang.Throwable {
                /*
                    r2 = this;
                    r0 = 0
                    r.i0.w.b.y0.i.r<r.i0.w.b.y0.g.q$b> r1 = r.i0.w.b.y0.g.q.b.f7980m     // Catch: java.lang.Throwable -> Lf kotlin.reflect.w.internal.y0.i.j -> L11
                    java.lang.Object r3 = r1.a(r3, r4)     // Catch: java.lang.Throwable -> Lf kotlin.reflect.w.internal.y0.i.j -> L11
                    r.i0.w.b.y0.g.q$b r3 = (r.i0.w.b.y0.g.q.b) r3     // Catch: java.lang.Throwable -> Lf kotlin.reflect.w.internal.y0.i.j -> L11
                    if (r3 == 0) goto Le
                    r2.n(r3)
                Le:
                    return r2
                Lf:
                    r3 = move-exception
                    goto L19
                L11:
                    r3 = move-exception
                    r.i0.w.b.y0.i.p r4 = r3.f8275f     // Catch: java.lang.Throwable -> Lf
                    r.i0.w.b.y0.g.q$b r4 = (r.i0.w.b.y0.g.q.b) r4     // Catch: java.lang.Throwable -> Lf
                    throw r3     // Catch: java.lang.Throwable -> L17
                L17:
                    r3 = move-exception
                    r0 = r4
                L19:
                    if (r0 == 0) goto L1e
                    r2.n(r0)
                L1e:
                    throw r3
                */
                throw new UnsupportedOperationException("Method not decompiled: r.i0.w.b.y0.g.q.b.C0152b.o(r.i0.w.b.y0.i.d, r.i0.w.b.y0.i.f):r.i0.w.b.y0.g.q$b$b");
            }
        }

        public enum c implements i.a {
            IN(0),
            OUT(1),
            INV(2),
            STAR(3);


            /* JADX INFO: renamed from: q, reason: collision with root package name */
            public final int f7997q;

            c(int i2) {
                this.f7997q = i2;
            }

            public static c b(int i2) {
                if (i2 == 0) {
                    return IN;
                }
                if (i2 == 1) {
                    return OUT;
                }
                if (i2 == 2) {
                    return INV;
                }
                if (i2 != 3) {
                    return null;
                }
                return STAR;
            }

            @Override // r.i0.w.b.y0.i.i.a
            public final int a() {
                return this.f7997q;
            }
        }

        static {
            b bVar = new b();
            f7979f = bVar;
            bVar.f7983p = c.INV;
            bVar.f7984q = q.f7965m;
            bVar.f7985r = 0;
        }

        public b() {
            this.f7986s = (byte) -1;
            this.f7987t = -1;
            this.f7981n = kotlin.reflect.w.internal.y0.i.c.f8234f;
        }

        public b(d dVar, f fVar, kotlin.reflect.w.internal.y0.g.a aVar) {
            this.f7986s = (byte) -1;
            this.f7987t = -1;
            this.f7983p = c.INV;
            this.f7984q = q.f7965m;
            boolean z2 = false;
            this.f7985r = 0;
            c.b bVarN = kotlin.reflect.w.internal.y0.i.c.n();
            e eVarK = e.k(bVarN, 1);
            while (!z2) {
                try {
                    try {
                        try {
                            int iO = dVar.o();
                            if (iO != 0) {
                                if (iO == 8) {
                                    int iL = dVar.l();
                                    c cVarB = c.b(iL);
                                    if (cVarB == null) {
                                        eVarK.y(iO);
                                        eVarK.y(iL);
                                    } else {
                                        this.f7982o |= 1;
                                        this.f7983p = cVarB;
                                    }
                                } else if (iO == 18) {
                                    c cVarY = null;
                                    if ((this.f7982o & 2) == 2) {
                                        q qVar = this.f7984q;
                                        Objects.requireNonNull(qVar);
                                        cVarY = q.y(qVar);
                                    }
                                    q qVar2 = (q) dVar.h(q.f7966n, fVar);
                                    this.f7984q = qVar2;
                                    if (cVarY != null) {
                                        cVarY.l(qVar2);
                                        this.f7984q = cVarY.n();
                                    }
                                    this.f7982o |= 2;
                                } else if (iO == 24) {
                                    this.f7982o |= 4;
                                    this.f7985r = dVar.l();
                                } else if (!dVar.r(iO, eVarK)) {
                                }
                            }
                            z2 = true;
                        } catch (j e2) {
                            e2.f8275f = this;
                            throw e2;
                        }
                    } catch (IOException e3) {
                        j jVar = new j(e3.getMessage());
                        jVar.f8275f = this;
                        throw jVar;
                    }
                } catch (Throwable th) {
                    try {
                        eVarK.j();
                    } catch (IOException unused) {
                    } catch (Throwable th2) {
                        this.f7981n = bVarN.d();
                        throw th2;
                    }
                    this.f7981n = bVarN.d();
                    throw th;
                }
            }
            try {
                eVarK.j();
            } catch (IOException unused2) {
            } catch (Throwable th3) {
                this.f7981n = bVarN.d();
                throw th3;
            }
            this.f7981n = bVarN.d();
        }

        @Override // kotlin.reflect.w.internal.y0.i.p
        public p.a c() {
            C0152b c0152b = new C0152b();
            c0152b.n(this);
            return c0152b;
        }

        @Override // kotlin.reflect.w.internal.y0.i.p
        public void d(e eVar) throws IOException {
            f();
            if ((this.f7982o & 1) == 1) {
                eVar.n(1, this.f7983p.f7997q);
            }
            if ((this.f7982o & 2) == 2) {
                eVar.r(2, this.f7984q);
            }
            if ((this.f7982o & 4) == 4) {
                eVar.p(3, this.f7985r);
            }
            eVar.u(this.f7981n);
        }

        @Override // kotlin.reflect.w.internal.y0.i.p
        public int f() {
            int i2 = this.f7987t;
            if (i2 != -1) {
                return i2;
            }
            int iB = (this.f7982o & 1) == 1 ? 0 + e.b(1, this.f7983p.f7997q) : 0;
            if ((this.f7982o & 2) == 2) {
                iB += e.e(2, this.f7984q);
            }
            if ((this.f7982o & 4) == 4) {
                iB += e.c(3, this.f7985r);
            }
            int size = this.f7981n.size() + iB;
            this.f7987t = size;
            return size;
        }

        @Override // kotlin.reflect.w.internal.y0.i.p
        public p.a g() {
            return new C0152b();
        }

        @Override // kotlin.reflect.w.internal.y0.i.q
        public final boolean i() {
            byte b2 = this.f7986s;
            if (b2 == 1) {
                return true;
            }
            if (b2 == 0) {
                return false;
            }
            if (!k() || this.f7984q.i()) {
                this.f7986s = (byte) 1;
                return true;
            }
            this.f7986s = (byte) 0;
            return false;
        }

        public boolean k() {
            return (this.f7982o & 2) == 2;
        }

        public b(h.b bVar, kotlin.reflect.w.internal.y0.g.a aVar) {
            super(bVar);
            this.f7986s = (byte) -1;
            this.f7987t = -1;
            this.f7981n = bVar.f8259f;
        }
    }

    public q(h.c cVar, kotlin.reflect.w.internal.y0.g.a aVar) {
        super(cVar);
        this.E = (byte) -1;
        this.F = -1;
        this.f7967o = cVar.f8259f;
    }
}
