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

import java.io.IOException;
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.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.q;
import kotlin.reflect.w.internal.y0.i.r;

/* JADX INFO: loaded from: classes2.dex */
public final class v extends h implements q {

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

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

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

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

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

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

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

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

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

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

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

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

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

    public static final class b extends h.b<v, b> implements q {

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

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

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

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

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

        /* JADX INFO: renamed from: p, reason: collision with root package name */
        public c f8104p = c.ERROR;

        /* JADX INFO: renamed from: s, reason: collision with root package name */
        public d f8107s = d.LANGUAGE_VERSION;

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

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

        @Override // kotlin.reflect.w.internal.y0.i.a.AbstractC0155a, r.i0.w.b.y0.i.p.a
        public /* bridge */ /* synthetic */ p.a h(kotlin.reflect.w.internal.y0.i.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(kotlin.reflect.w.internal.y0.i.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() {
            b bVar = new b();
            bVar.n(m());
            return bVar;
        }

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

        public v m() {
            v vVar = new v(this, null);
            int i2 = this.f8101m;
            int i3 = (i2 & 1) != 1 ? 0 : 1;
            vVar.f8093p = this.f8102n;
            if ((i2 & 2) == 2) {
                i3 |= 2;
            }
            vVar.f8094q = this.f8103o;
            if ((i2 & 4) == 4) {
                i3 |= 4;
            }
            vVar.f8095r = this.f8104p;
            if ((i2 & 8) == 8) {
                i3 |= 8;
            }
            vVar.f8096s = this.f8105q;
            if ((i2 & 16) == 16) {
                i3 |= 16;
            }
            vVar.f8097t = this.f8106r;
            if ((i2 & 32) == 32) {
                i3 |= 32;
            }
            vVar.f8098u = this.f8107s;
            vVar.f8092o = i3;
            return vVar;
        }

        public b n(v vVar) {
            if (vVar == v.f8089f) {
                return this;
            }
            int i2 = vVar.f8092o;
            if ((i2 & 1) == 1) {
                int i3 = vVar.f8093p;
                this.f8101m |= 1;
                this.f8102n = i3;
            }
            if ((i2 & 2) == 2) {
                int i4 = vVar.f8094q;
                this.f8101m = 2 | this.f8101m;
                this.f8103o = i4;
            }
            if ((i2 & 4) == 4) {
                c cVar = vVar.f8095r;
                Objects.requireNonNull(cVar);
                this.f8101m = 4 | this.f8101m;
                this.f8104p = cVar;
            }
            int i5 = vVar.f8092o;
            if ((i5 & 8) == 8) {
                int i6 = vVar.f8096s;
                this.f8101m = 8 | this.f8101m;
                this.f8105q = i6;
            }
            if ((i5 & 16) == 16) {
                int i7 = vVar.f8097t;
                this.f8101m = 16 | this.f8101m;
                this.f8106r = i7;
            }
            if ((i5 & 32) == 32) {
                d dVar = vVar.f8098u;
                Objects.requireNonNull(dVar);
                this.f8101m = 32 | this.f8101m;
                this.f8107s = dVar;
            }
            this.f8259f = this.f8259f.b(vVar.f8091n);
            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.v.b 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.v> r1 = kotlin.reflect.w.internal.y0.g.v.f8090m     // 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.v r3 = (kotlin.reflect.w.internal.y0.g.v) 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.v r4 = (kotlin.reflect.w.internal.y0.g.v) 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.v.b.o(r.i0.w.b.y0.i.d, r.i0.w.b.y0.i.f):r.i0.w.b.y0.g.v$b");
        }
    }

    public enum c implements i.a {
        WARNING(0),
        ERROR(1),
        HIDDEN(2);


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

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

        public static c b(int i2) {
            if (i2 == 0) {
                return WARNING;
            }
            if (i2 == 1) {
                return ERROR;
            }
            if (i2 != 2) {
                return null;
            }
            return HIDDEN;
        }

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

    public enum d implements i.a {
        LANGUAGE_VERSION(0),
        COMPILER_VERSION(1),
        API_VERSION(2);


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

        d(int i2) {
            this.f8117p = i2;
        }

        public static d b(int i2) {
            if (i2 == 0) {
                return LANGUAGE_VERSION;
            }
            if (i2 == 1) {
                return COMPILER_VERSION;
            }
            if (i2 != 2) {
                return null;
            }
            return API_VERSION;
        }

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

    static {
        v vVar = new v();
        f8089f = vVar;
        vVar.f8093p = 0;
        vVar.f8094q = 0;
        vVar.f8095r = c.ERROR;
        vVar.f8096s = 0;
        vVar.f8097t = 0;
        vVar.f8098u = d.LANGUAGE_VERSION;
    }

    public v() {
        this.f8099v = (byte) -1;
        this.f8100w = -1;
        this.f8091n = kotlin.reflect.w.internal.y0.i.c.f8234f;
    }

    public v(kotlin.reflect.w.internal.y0.i.d dVar, f fVar, kotlin.reflect.w.internal.y0.g.a aVar) {
        int iL;
        this.f8099v = (byte) -1;
        this.f8100w = -1;
        boolean z2 = false;
        this.f8093p = 0;
        this.f8094q = 0;
        this.f8095r = c.ERROR;
        this.f8096s = 0;
        this.f8097t = 0;
        this.f8098u = d.LANGUAGE_VERSION;
        c.b bVarN = kotlin.reflect.w.internal.y0.i.c.n();
        e eVarK = e.k(bVarN, 1);
        while (!z2) {
            try {
                try {
                    int iO = dVar.o();
                    if (iO != 0) {
                        if (iO == 8) {
                            this.f8092o |= 1;
                            this.f8093p = dVar.l();
                        } else if (iO == 16) {
                            this.f8092o |= 2;
                            this.f8094q = dVar.l();
                        } else if (iO == 24) {
                            iL = dVar.l();
                            c cVarB = c.b(iL);
                            if (cVarB == null) {
                                eVarK.y(iO);
                                eVarK.y(iL);
                            } else {
                                this.f8092o |= 4;
                                this.f8095r = cVarB;
                            }
                        } else if (iO == 32) {
                            this.f8092o |= 8;
                            this.f8096s = dVar.l();
                        } else if (iO == 40) {
                            this.f8092o |= 16;
                            this.f8097t = dVar.l();
                        } else if (iO == 48) {
                            iL = dVar.l();
                            d dVarB = d.b(iL);
                            if (dVarB == null) {
                                eVarK.y(iO);
                                eVarK.y(iL);
                            } else {
                                this.f8092o |= 32;
                                this.f8098u = dVarB;
                            }
                        } 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.f8091n = bVarN.d();
                    throw th2;
                }
                this.f8091n = bVarN.d();
                throw th;
            }
        }
        try {
            eVarK.j();
        } catch (IOException unused2) {
        } catch (Throwable th3) {
            this.f8091n = bVarN.d();
            throw th3;
        }
        this.f8091n = bVarN.d();
    }

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

    @Override // kotlin.reflect.w.internal.y0.i.p
    public void d(e eVar) throws IOException {
        f();
        if ((this.f8092o & 1) == 1) {
            eVar.p(1, this.f8093p);
        }
        if ((this.f8092o & 2) == 2) {
            eVar.p(2, this.f8094q);
        }
        if ((this.f8092o & 4) == 4) {
            eVar.n(3, this.f8095r.f8112p);
        }
        if ((this.f8092o & 8) == 8) {
            eVar.p(4, this.f8096s);
        }
        if ((this.f8092o & 16) == 16) {
            eVar.p(5, this.f8097t);
        }
        if ((this.f8092o & 32) == 32) {
            eVar.n(6, this.f8098u.f8117p);
        }
        eVar.u(this.f8091n);
    }

    @Override // kotlin.reflect.w.internal.y0.i.p
    public int f() {
        int i2 = this.f8100w;
        if (i2 != -1) {
            return i2;
        }
        int iC = (this.f8092o & 1) == 1 ? 0 + e.c(1, this.f8093p) : 0;
        if ((this.f8092o & 2) == 2) {
            iC += e.c(2, this.f8094q);
        }
        if ((this.f8092o & 4) == 4) {
            iC += e.b(3, this.f8095r.f8112p);
        }
        if ((this.f8092o & 8) == 8) {
            iC += e.c(4, this.f8096s);
        }
        if ((this.f8092o & 16) == 16) {
            iC += e.c(5, this.f8097t);
        }
        if ((this.f8092o & 32) == 32) {
            iC += e.b(6, this.f8098u.f8117p);
        }
        int size = this.f8091n.size() + iC;
        this.f8100w = size;
        return size;
    }

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

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

    public v(h.b bVar, kotlin.reflect.w.internal.y0.g.a aVar) {
        super(bVar);
        this.f8099v = (byte) -1;
        this.f8100w = -1;
        this.f8091n = bVar.f8259f;
    }
}
