package kotlin.reflect.jvm.internal.impl.renderer;

import com.google.firebase.messaging.Constants;
import hp.e0;
import hp.h1;
import hp.m0;
import hp.p1;
import hp.q0;
import hp.s1;
import hp.t1;
import hp.u1;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import kotlin.reflect.jvm.internal.impl.renderer.c;
import kotlin.text.b0;
import kotlin.text.z;
import qn.j;
import rm.n0;
import rm.o;
import rm.q;
import sm.c0;
import sm.u;
import sm.y0;
import tn.b;
import tn.d0;
import tn.d1;
import tn.e1;
import tn.f1;
import tn.g0;
import tn.i1;
import tn.j0;
import tn.j1;
import tn.k0;
import tn.p;
import tn.p0;
import tn.r0;
import tn.s0;
import tn.t0;
import tn.u0;
import tn.v0;
import tn.w;
import tn.w0;
import tn.y;
import vo.p;

/* loaded from: classes3.dex */
public final class d extends kotlin.reflect.jvm.internal.impl.renderer.c implements kotlin.reflect.jvm.internal.impl.renderer.f {

    /* renamed from: l, reason: collision with root package name */
    private final kotlin.reflect.jvm.internal.impl.renderer.g f26375l;

    /* renamed from: m, reason: collision with root package name */
    private final o f26376m;

    /* loaded from: classes3.dex */
    private final class a implements tn.o {

        /* renamed from: kotlin.reflect.jvm.internal.impl.renderer.d$a$a, reason: collision with other inner class name */
        /* loaded from: classes3.dex */
        public /* synthetic */ class C0569a {

            /* renamed from: a, reason: collision with root package name */
            public static final /* synthetic */ int[] f26378a;

            static {
                int[] iArr = new int[l.values().length];
                try {
                    iArr[l.PRETTY.ordinal()] = 1;
                } catch (NoSuchFieldError unused) {
                }
                try {
                    iArr[l.DEBUG.ordinal()] = 2;
                } catch (NoSuchFieldError unused2) {
                }
                try {
                    iArr[l.NONE.ordinal()] = 3;
                } catch (NoSuchFieldError unused3) {
                }
                f26378a = iArr;
            }
        }

        public a() {
        }

        private final void t(s0 s0Var, StringBuilder sb2, String str) {
            int i10 = C0569a.f26378a[d.this.k0().ordinal()];
            if (i10 != 1) {
                if (i10 != 2) {
                    return;
                }
                p(s0Var, sb2);
                return;
            }
            d.this.Q0(s0Var, sb2);
            sb2.append(str + " for ");
            d dVar = d.this;
            t0 y02 = s0Var.y0();
            t.f(y02, "getCorrespondingProperty(...)");
            dVar.z1(y02, sb2);
        }

        public void A(i1 descriptor, StringBuilder builder) {
            t.g(descriptor, "descriptor");
            t.g(builder, "builder");
            d.this.R1(descriptor, true, builder, true);
        }

        @Override // tn.o
        public /* bridge */ /* synthetic */ Object a(tn.e eVar, Object obj) {
            n(eVar, (StringBuilder) obj);
            return n0.f34904a;
        }

        @Override // tn.o
        public /* bridge */ /* synthetic */ Object b(p0 p0Var, Object obj) {
            s(p0Var, (StringBuilder) obj);
            return n0.f34904a;
        }

        @Override // tn.o
        public /* bridge */ /* synthetic */ Object c(u0 u0Var, Object obj) {
            v(u0Var, (StringBuilder) obj);
            return n0.f34904a;
        }

        @Override // tn.o
        public /* bridge */ /* synthetic */ Object d(w0 w0Var, Object obj) {
            x(w0Var, (StringBuilder) obj);
            return n0.f34904a;
        }

        @Override // tn.o
        public /* bridge */ /* synthetic */ Object e(k0 k0Var, Object obj) {
            r(k0Var, (StringBuilder) obj);
            return n0.f34904a;
        }

        @Override // tn.o
        public /* bridge */ /* synthetic */ Object f(e1 e1Var, Object obj) {
            z(e1Var, (StringBuilder) obj);
            return n0.f34904a;
        }

        @Override // tn.o
        public /* bridge */ /* synthetic */ Object g(v0 v0Var, Object obj) {
            w(v0Var, (StringBuilder) obj);
            return n0.f34904a;
        }

        @Override // tn.o
        public /* bridge */ /* synthetic */ Object h(tn.l lVar, Object obj) {
            o(lVar, (StringBuilder) obj);
            return n0.f34904a;
        }

        @Override // tn.o
        public /* bridge */ /* synthetic */ Object i(i1 i1Var, Object obj) {
            A(i1Var, (StringBuilder) obj);
            return n0.f34904a;
        }

        @Override // tn.o
        public /* bridge */ /* synthetic */ Object j(g0 g0Var, Object obj) {
            q(g0Var, (StringBuilder) obj);
            return n0.f34904a;
        }

        @Override // tn.o
        public /* bridge */ /* synthetic */ Object k(t0 t0Var, Object obj) {
            u(t0Var, (StringBuilder) obj);
            return n0.f34904a;
        }

        @Override // tn.o
        public /* bridge */ /* synthetic */ Object l(d1 d1Var, Object obj) {
            y(d1Var, (StringBuilder) obj);
            return n0.f34904a;
        }

        @Override // tn.o
        public /* bridge */ /* synthetic */ Object m(y yVar, Object obj) {
            p(yVar, (StringBuilder) obj);
            return n0.f34904a;
        }

        public void n(tn.e descriptor, StringBuilder builder) {
            t.g(descriptor, "descriptor");
            t.g(builder, "builder");
            d.this.W0(descriptor, builder);
        }

        public void o(tn.l constructorDescriptor, StringBuilder builder) {
            t.g(constructorDescriptor, "constructorDescriptor");
            t.g(builder, "builder");
            d.this.b1(constructorDescriptor, builder);
        }

        public void p(y descriptor, StringBuilder builder) {
            t.g(descriptor, "descriptor");
            t.g(builder, "builder");
            d.this.h1(descriptor, builder);
        }

        public void q(g0 descriptor, StringBuilder builder) {
            t.g(descriptor, "descriptor");
            t.g(builder, "builder");
            d.this.r1(descriptor, builder, true);
        }

        public void r(k0 descriptor, StringBuilder builder) {
            t.g(descriptor, "descriptor");
            t.g(builder, "builder");
            d.this.v1(descriptor, builder);
        }

        public void s(p0 descriptor, StringBuilder builder) {
            t.g(descriptor, "descriptor");
            t.g(builder, "builder");
            d.this.x1(descriptor, builder);
        }

        public void u(t0 descriptor, StringBuilder builder) {
            t.g(descriptor, "descriptor");
            t.g(builder, "builder");
            d.this.z1(descriptor, builder);
        }

        public void v(u0 descriptor, StringBuilder builder) {
            t.g(descriptor, "descriptor");
            t.g(builder, "builder");
            t(descriptor, builder, "getter");
        }

        public void w(v0 descriptor, StringBuilder builder) {
            t.g(descriptor, "descriptor");
            t.g(builder, "builder");
            t(descriptor, builder, "setter");
        }

        public void x(w0 descriptor, StringBuilder builder) {
            t.g(descriptor, "descriptor");
            t.g(builder, "builder");
            builder.append(descriptor.getName());
        }

        public void y(d1 descriptor, StringBuilder builder) {
            t.g(descriptor, "descriptor");
            t.g(builder, "builder");
            d.this.H1(descriptor, builder);
        }

        public void z(e1 descriptor, StringBuilder builder) {
            t.g(descriptor, "descriptor");
            t.g(builder, "builder");
            d.this.M1(descriptor, builder, true);
        }
    }

    /* loaded from: classes3.dex */
    public /* synthetic */ class b {

        /* renamed from: a, reason: collision with root package name */
        public static final /* synthetic */ int[] f26379a;

        /* renamed from: b, reason: collision with root package name */
        public static final /* synthetic */ int[] f26380b;

        static {
            int[] iArr = new int[m.values().length];
            try {
                iArr[m.PLAIN.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[m.HTML.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            f26379a = iArr;
            int[] iArr2 = new int[k.values().length];
            try {
                iArr2[k.ALL.ordinal()] = 1;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                iArr2[k.ONLY_NON_SYNTHESIZED.ordinal()] = 2;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                iArr2[k.NONE.ordinal()] = 3;
            } catch (NoSuchFieldError unused5) {
            }
            f26380b = iArr2;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes3.dex */
    public static final class c extends v implements dn.l {
        c() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final CharSequence invoke(h1 it) {
            t.g(it, "it");
            if (it.b()) {
                return "*";
            }
            d dVar = d.this;
            e0 type = it.getType();
            t.f(type, "getType(...)");
            String w10 = dVar.w(type);
            if (it.a() == t1.INVARIANT) {
                return w10;
            }
            return it.a() + ' ' + w10;
        }
    }

    /* renamed from: kotlin.reflect.jvm.internal.impl.renderer.d$d, reason: collision with other inner class name */
    /* loaded from: classes3.dex */
    static final class C0570d extends v implements dn.a {

        /* JADX INFO: Access modifiers changed from: package-private */
        /* renamed from: kotlin.reflect.jvm.internal.impl.renderer.d$d$a */
        /* loaded from: classes3.dex */
        public static final class a extends v implements dn.l {

            /* renamed from: p, reason: collision with root package name */
            public static final a f26383p = new a();

            a() {
                super(1);
            }

            public final void a(kotlin.reflect.jvm.internal.impl.renderer.f withOptions) {
                List n10;
                Set k10;
                t.g(withOptions, "$this$withOptions");
                Set m10 = withOptions.m();
                n10 = u.n(j.a.C, j.a.D);
                k10 = y0.k(m10, n10);
                withOptions.a(k10);
            }

            @Override // dn.l
            public /* bridge */ /* synthetic */ Object invoke(Object obj) {
                a((kotlin.reflect.jvm.internal.impl.renderer.f) obj);
                return n0.f34904a;
            }
        }

        C0570d() {
            super(0);
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final d invoke() {
            kotlin.reflect.jvm.internal.impl.renderer.c y10 = d.this.y(a.f26383p);
            t.e(y10, "null cannot be cast to non-null type org.jetbrains.kotlin.renderer.DescriptorRendererImpl");
            return (d) y10;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes3.dex */
    public static final class e extends v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        public static final e f26384p = new e();

        e() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final CharSequence invoke(i1 i1Var) {
            return "";
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes3.dex */
    public static final class f extends v implements dn.l {
        f() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final CharSequence invoke(e0 e0Var) {
            d dVar = d.this;
            t.d(e0Var);
            return dVar.w(e0Var);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes3.dex */
    public static final class g extends v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        public static final g f26386p = new g();

        g() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final Object invoke(e0 it) {
            t.g(it, "it");
            return it;
        }
    }

    public d(kotlin.reflect.jvm.internal.impl.renderer.g options) {
        o a10;
        t.g(options, "options");
        this.f26375l = options;
        options.l0();
        a10 = q.a(new C0570d());
        this.f26376m = a10;
    }

    private final void A1(t0 t0Var, StringBuilder sb2) {
        Object D0;
        if (d0().contains(kotlin.reflect.jvm.internal.impl.renderer.e.ANNOTATIONS)) {
            U0(this, sb2, t0Var, null, 2, null);
            w l02 = t0Var.l0();
            if (l02 != null) {
                T0(sb2, l02, kotlin.reflect.jvm.internal.impl.descriptors.annotations.e.FIELD);
            }
            w h02 = t0Var.h0();
            if (h02 != null) {
                T0(sb2, h02, kotlin.reflect.jvm.internal.impl.descriptors.annotations.e.PROPERTY_DELEGATE_FIELD);
            }
            if (k0() == l.NONE) {
                u0 getter = t0Var.getGetter();
                if (getter != null) {
                    T0(sb2, getter, kotlin.reflect.jvm.internal.impl.descriptors.annotations.e.PROPERTY_GETTER);
                }
                v0 f10 = t0Var.f();
                if (f10 != null) {
                    T0(sb2, f10, kotlin.reflect.jvm.internal.impl.descriptors.annotations.e.PROPERTY_SETTER);
                    List i10 = f10.i();
                    t.f(i10, "getValueParameters(...)");
                    D0 = c0.D0(i10);
                    i1 i1Var = (i1) D0;
                    t.d(i1Var);
                    T0(sb2, i1Var, kotlin.reflect.jvm.internal.impl.descriptors.annotations.e.SETTER_PARAMETER);
                }
            }
        }
    }

    private final void B1(tn.a aVar, StringBuilder sb2) {
        w0 g02 = aVar.g0();
        if (g02 != null) {
            T0(sb2, g02, kotlin.reflect.jvm.internal.impl.descriptors.annotations.e.RECEIVER);
            e0 type = g02.getType();
            t.f(type, "getType(...)");
            sb2.append(f1(type));
            sb2.append(".");
        }
    }

    private final void C1(tn.a aVar, StringBuilder sb2) {
        w0 g02;
        if (l0() && (g02 = aVar.g0()) != null) {
            sb2.append(" on ");
            e0 type = g02.getType();
            t.f(type, "getType(...)");
            sb2.append(w(type));
        }
    }

    private final void D1(StringBuilder sb2, m0 m0Var) {
        if (t.b(m0Var, p1.f21997b) || p1.k(m0Var)) {
            sb2.append("???");
            return;
        }
        if (kotlin.reflect.jvm.internal.impl.types.error.k.o(m0Var)) {
            if (!A0()) {
                sb2.append("???");
                return;
            }
            hp.d1 K0 = m0Var.K0();
            t.e(K0, "null cannot be cast to non-null type org.jetbrains.kotlin.types.error.ErrorTypeConstructor");
            sb2.append(e1(((kotlin.reflect.jvm.internal.impl.types.error.i) K0).b(0)));
            return;
        }
        if (hp.g0.a(m0Var)) {
            d1(sb2, m0Var);
        } else if (W1(m0Var)) {
            i1(sb2, m0Var);
        } else {
            d1(sb2, m0Var);
        }
    }

    private final void E1(StringBuilder sb2) {
        int length = sb2.length();
        if (length == 0 || sb2.charAt(length - 1) != ' ') {
            sb2.append(' ');
        }
    }

    private final void F1(tn.e eVar, StringBuilder sb2) {
        if (H0() || qn.g.n0(eVar.q())) {
            return;
        }
        Collection n10 = eVar.j().n();
        t.f(n10, "getSupertypes(...)");
        if (n10.isEmpty()) {
            return;
        }
        if (n10.size() == 1 && qn.g.b0((e0) n10.iterator().next())) {
            return;
        }
        E1(sb2);
        sb2.append(": ");
        c0.k0(n10, sb2, ", ", null, null, 0, null, new f(), 60, null);
    }

    private final void G1(y yVar, StringBuilder sb2) {
        q1(sb2, yVar.isSuspend(), "suspend");
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void H1(d1 d1Var, StringBuilder sb2) {
        U0(this, sb2, d1Var, null, 2, null);
        tn.u visibility = d1Var.getVisibility();
        t.f(visibility, "getVisibility(...)");
        U1(visibility, sb2);
        m1(d1Var, sb2);
        sb2.append(k1("typealias"));
        sb2.append(" ");
        r1(d1Var, sb2, true);
        List s10 = d1Var.s();
        t.f(s10, "getDeclaredTypeParameters(...)");
        O1(s10, sb2, false);
        V0(d1Var, sb2);
        sb2.append(" = ");
        sb2.append(w(d1Var.b0()));
    }

    private final String J0() {
        return N(">");
    }

    private final void K(StringBuilder sb2, tn.m mVar) {
        tn.m b10;
        String name;
        if ((mVar instanceof k0) || (mVar instanceof p0) || (b10 = mVar.b()) == null || (b10 instanceof g0)) {
            return;
        }
        sb2.append(" ");
        sb2.append(n1("defined in"));
        sb2.append(" ");
        ro.d m10 = to.f.m(b10);
        t.f(m10, "getFqName(...)");
        sb2.append(m10.e() ? "root package" : u(m10));
        if (F0() && (b10 instanceof k0) && (mVar instanceof p) && (name = ((p) mVar).getSource().a().getName()) != null) {
            sb2.append(" ");
            sb2.append(n1("in file"));
            sb2.append(" ");
            sb2.append(name);
        }
    }

    private final boolean K0(e0 e0Var) {
        return qn.f.r(e0Var) || !e0Var.getAnnotations().isEmpty();
    }

    private final void K1(StringBuilder sb2, e0 e0Var, hp.d1 d1Var) {
        r0 a10 = f1.a(e0Var);
        if (a10 != null) {
            y1(sb2, a10);
        } else {
            sb2.append(J1(d1Var));
            sb2.append(I1(e0Var.I0()));
        }
    }

    private final void L(StringBuilder sb2, List list) {
        c0.k0(list, sb2, ", ", null, null, 0, null, new c(), 60, null);
    }

    private final d0 L0(tn.c0 c0Var) {
        if (c0Var instanceof tn.e) {
            return ((tn.e) c0Var).g() == tn.f.INTERFACE ? d0.ABSTRACT : d0.FINAL;
        }
        tn.m b10 = c0Var.b();
        tn.e eVar = b10 instanceof tn.e ? (tn.e) b10 : null;
        if (eVar != null && (c0Var instanceof tn.b)) {
            tn.b bVar = (tn.b) c0Var;
            t.f(bVar.e(), "getOverriddenDescriptors(...)");
            if ((!r0.isEmpty()) && eVar.k() != d0.FINAL) {
                return d0.OPEN;
            }
            if (eVar.g() != tn.f.INTERFACE || t.b(bVar.getVisibility(), tn.t.f36410a)) {
                return d0.FINAL;
            }
            d0 k10 = bVar.k();
            d0 d0Var = d0.ABSTRACT;
            return k10 == d0Var ? d0Var : d0.OPEN;
        }
        return d0.FINAL;
    }

    static /* synthetic */ void L1(d dVar, StringBuilder sb2, e0 e0Var, hp.d1 d1Var, int i10, Object obj) {
        if ((i10 & 2) != 0) {
            d1Var = e0Var.K0();
        }
        dVar.K1(sb2, e0Var, d1Var);
    }

    private final String M() {
        int i10 = b.f26379a[y0().ordinal()];
        if (i10 == 1) {
            return N("->");
        }
        if (i10 == 2) {
            return "&rarr;";
        }
        throw new rm.t();
    }

    private final boolean M0(kotlin.reflect.jvm.internal.impl.descriptors.annotations.c cVar) {
        return t.b(cVar.d(), j.a.E);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void M1(e1 e1Var, StringBuilder sb2, boolean z10) {
        if (z10) {
            sb2.append(N0());
        }
        if (D0()) {
            sb2.append("/*");
            sb2.append(e1Var.getIndex());
            sb2.append("*/ ");
        }
        q1(sb2, e1Var.B(), "reified");
        String label = e1Var.l().getLabel();
        boolean z11 = true;
        q1(sb2, label.length() > 0, label);
        U0(this, sb2, e1Var, null, 2, null);
        r1(e1Var, sb2, z10);
        int size = e1Var.getUpperBounds().size();
        if ((size > 1 && !z10) || size == 1) {
            e0 e0Var = (e0) e1Var.getUpperBounds().iterator().next();
            if (!qn.g.j0(e0Var)) {
                sb2.append(" : ");
                t.d(e0Var);
                sb2.append(w(e0Var));
            }
        } else if (z10) {
            for (e0 e0Var2 : e1Var.getUpperBounds()) {
                if (!qn.g.j0(e0Var2)) {
                    if (z11) {
                        sb2.append(" : ");
                    } else {
                        sb2.append(" & ");
                    }
                    t.d(e0Var2);
                    sb2.append(w(e0Var2));
                    z11 = false;
                }
            }
        }
        if (z10) {
            sb2.append(J0());
        }
    }

    private final String N(String str) {
        return y0().escape(str);
    }

    private final String N0() {
        return N("<");
    }

    private final void N1(StringBuilder sb2, List list) {
        Iterator it = list.iterator();
        while (it.hasNext()) {
            M1((e1) it.next(), sb2, false);
            if (it.hasNext()) {
                sb2.append(", ");
            }
        }
    }

    private final boolean O0(tn.b bVar) {
        return !bVar.e().isEmpty();
    }

    private final void O1(List list, StringBuilder sb2, boolean z10) {
        if (!I0() && (!list.isEmpty())) {
            sb2.append(N0());
            N1(sb2, list);
            sb2.append(J0());
            if (z10) {
                sb2.append(" ");
            }
        }
    }

    private final void P0(StringBuilder sb2, hp.a aVar) {
        m y02 = y0();
        m mVar = m.HTML;
        if (y02 == mVar) {
            sb2.append("<font color=\"808080\"><i>");
        }
        sb2.append(" /* = ");
        t1(sb2, aVar.S());
        sb2.append(" */");
        if (y0() == mVar) {
            sb2.append("</i></font>");
        }
    }

    private final void P1(j1 j1Var, StringBuilder sb2, boolean z10) {
        if (z10 || !(j1Var instanceof i1)) {
            sb2.append(k1(j1Var.e0() ? "var" : "val"));
            sb2.append(" ");
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void Q0(s0 s0Var, StringBuilder sb2) {
        m1(s0Var, sb2);
    }

    static /* synthetic */ void Q1(d dVar, j1 j1Var, StringBuilder sb2, boolean z10, int i10, Object obj) {
        if ((i10 & 4) != 0) {
            z10 = false;
        }
        dVar.P1(j1Var, sb2, z10);
    }

    /* JADX WARN: Removed duplicated region for block: B:12:0x0046  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    private final void R0(y yVar, StringBuilder sb2) {
        boolean z10;
        boolean z11;
        boolean z12;
        boolean z13 = false;
        if (yVar.isOperator()) {
            Collection e10 = yVar.e();
            t.f(e10, "getOverriddenDescriptors(...)");
            Collection collection = e10;
            if (!collection.isEmpty()) {
                Iterator it = collection.iterator();
                while (it.hasNext()) {
                    if (((y) it.next()).isOperator()) {
                        z12 = false;
                        break;
                    }
                }
            }
            z12 = true;
            if (z12 || P()) {
                z10 = true;
                if (yVar.isInfix()) {
                    Collection e11 = yVar.e();
                    t.f(e11, "getOverriddenDescriptors(...)");
                    Collection collection2 = e11;
                    if (!collection2.isEmpty()) {
                        Iterator it2 = collection2.iterator();
                        while (it2.hasNext()) {
                            if (((y) it2.next()).isInfix()) {
                                z11 = false;
                                break;
                            }
                        }
                    }
                    z11 = true;
                    if (z11 || P()) {
                        z13 = true;
                    }
                }
                q1(sb2, yVar.L(), "tailrec");
                G1(yVar, sb2);
                q1(sb2, yVar.isInline(), "inline");
                q1(sb2, z13, "infix");
                q1(sb2, z10, "operator");
            }
        }
        z10 = false;
        if (yVar.isInfix()) {
        }
        q1(sb2, yVar.L(), "tailrec");
        G1(yVar, sb2);
        q1(sb2, yVar.isInline(), "inline");
        q1(sb2, z13, "infix");
        q1(sb2, z10, "operator");
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX WARN: Code restructure failed: missing block: B:24:0x008e, code lost:
    
        if ((n() ? r10.p0() : xo.c.c(r10)) != false) goto L32;
     */
    /* JADX WARN: Removed duplicated region for block: B:18:0x0068  */
    /* JADX WARN: Removed duplicated region for block: B:21:0x007f  */
    /* JADX WARN: Removed duplicated region for block: B:26:0x0094  */
    /* JADX WARN: Removed duplicated region for block: B:29:? A[RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void R1(i1 i1Var, boolean z10, StringBuilder sb2, boolean z11) {
        boolean z12;
        if (z11) {
            sb2.append(k1("value-parameter"));
            sb2.append(" ");
        }
        if (D0()) {
            sb2.append("/*");
            sb2.append(i1Var.getIndex());
            sb2.append("*/ ");
        }
        U0(this, sb2, i1Var, null, 2, null);
        q1(sb2, i1Var.W(), "crossinline");
        q1(sb2, i1Var.U(), "noinline");
        boolean z13 = true;
        if (s0()) {
            tn.a b10 = i1Var.b();
            tn.d dVar = b10 instanceof tn.d ? (tn.d) b10 : null;
            if (dVar != null && dVar.w()) {
                z12 = true;
                if (z12) {
                    q1(sb2, O(), "actual");
                }
                T1(i1Var, z10, sb2, z11, z12);
                if (U() != null) {
                }
                z13 = false;
                if (z13) {
                    return;
                }
                StringBuilder sb3 = new StringBuilder();
                sb3.append(" = ");
                dn.l U = U();
                t.d(U);
                sb3.append((String) U.invoke(i1Var));
                sb2.append(sb3.toString());
                return;
            }
        }
        z12 = false;
        if (z12) {
        }
        T1(i1Var, z10, sb2, z11, z12);
        if (U() != null) {
        }
        z13 = false;
        if (z13) {
        }
    }

    private final List S0(kotlin.reflect.jvm.internal.impl.descriptors.annotations.c cVar) {
        int v10;
        int v11;
        List z02;
        List H0;
        tn.d N;
        List i10;
        int v12;
        Map a10 = cVar.a();
        List list = null;
        tn.e i11 = p0() ? xo.c.i(cVar) : null;
        if (i11 != null && (N = i11.N()) != null && (i10 = N.i()) != null) {
            ArrayList arrayList = new ArrayList();
            for (Object obj : i10) {
                if (((i1) obj).p0()) {
                    arrayList.add(obj);
                }
            }
            v12 = sm.v.v(arrayList, 10);
            ArrayList arrayList2 = new ArrayList(v12);
            Iterator it = arrayList.iterator();
            while (it.hasNext()) {
                arrayList2.add(((i1) it.next()).getName());
            }
            list = arrayList2;
        }
        if (list == null) {
            list = u.k();
        }
        ArrayList arrayList3 = new ArrayList();
        for (Object obj2 : list) {
            t.d((ro.f) obj2);
            if (!a10.containsKey(r5)) {
                arrayList3.add(obj2);
            }
        }
        v10 = sm.v.v(arrayList3, 10);
        ArrayList arrayList4 = new ArrayList(v10);
        Iterator it2 = arrayList3.iterator();
        while (it2.hasNext()) {
            arrayList4.add(((ro.f) it2.next()).e() + " = ...");
        }
        Set<Map.Entry> entrySet = a10.entrySet();
        v11 = sm.v.v(entrySet, 10);
        ArrayList arrayList5 = new ArrayList(v11);
        for (Map.Entry entry : entrySet) {
            ro.f fVar = (ro.f) entry.getKey();
            vo.g gVar = (vo.g) entry.getValue();
            StringBuilder sb2 = new StringBuilder();
            sb2.append(fVar.e());
            sb2.append(" = ");
            sb2.append(!list.contains(fVar) ? a1(gVar) : "...");
            arrayList5.add(sb2.toString());
        }
        z02 = c0.z0(arrayList4, arrayList5);
        H0 = c0.H0(z02);
        return H0;
    }

    private final void S1(Collection collection, boolean z10, StringBuilder sb2) {
        boolean X1 = X1(z10);
        int size = collection.size();
        C0().b(size, sb2);
        Iterator it = collection.iterator();
        int i10 = 0;
        while (it.hasNext()) {
            i1 i1Var = (i1) it.next();
            C0().c(i1Var, i10, size, sb2);
            R1(i1Var, X1, sb2, false);
            C0().a(i1Var, i10, size, sb2);
            i10++;
        }
        C0().d(size, sb2);
    }

    private final void T0(StringBuilder sb2, kotlin.reflect.jvm.internal.impl.descriptors.annotations.a aVar, kotlin.reflect.jvm.internal.impl.descriptors.annotations.e eVar) {
        boolean U;
        if (d0().contains(kotlin.reflect.jvm.internal.impl.renderer.e.ANNOTATIONS)) {
            Set m10 = aVar instanceof e0 ? m() : W();
            dn.l Q = Q();
            for (kotlin.reflect.jvm.internal.impl.descriptors.annotations.c cVar : aVar.getAnnotations()) {
                U = c0.U(m10, cVar.d());
                if (!U && !M0(cVar) && (Q == null || ((Boolean) Q.invoke(cVar)).booleanValue())) {
                    sb2.append(r(cVar, eVar));
                    if (V()) {
                        sb2.append('\n');
                        t.f(sb2, "append(...)");
                    } else {
                        sb2.append(" ");
                    }
                }
            }
        }
    }

    private final void T1(j1 j1Var, boolean z10, StringBuilder sb2, boolean z11, boolean z12) {
        e0 type = j1Var.getType();
        t.f(type, "getType(...)");
        i1 i1Var = j1Var instanceof i1 ? (i1) j1Var : null;
        e0 f02 = i1Var != null ? i1Var.f0() : null;
        e0 e0Var = f02 == null ? type : f02;
        q1(sb2, f02 != null, "vararg");
        if (z12 || (z11 && !x0())) {
            P1(j1Var, sb2, z12);
        }
        if (z10) {
            r1(j1Var, sb2, z11);
            sb2.append(": ");
        }
        sb2.append(w(e0Var));
        j1(j1Var, sb2);
        if (!D0() || f02 == null) {
            return;
        }
        sb2.append(" /*");
        sb2.append(w(type));
        sb2.append("*/");
    }

    static /* synthetic */ void U0(d dVar, StringBuilder sb2, kotlin.reflect.jvm.internal.impl.descriptors.annotations.a aVar, kotlin.reflect.jvm.internal.impl.descriptors.annotations.e eVar, int i10, Object obj) {
        if ((i10 & 2) != 0) {
            eVar = null;
        }
        dVar.T0(sb2, aVar, eVar);
    }

    private final boolean U1(tn.u uVar, StringBuilder sb2) {
        if (!d0().contains(kotlin.reflect.jvm.internal.impl.renderer.e.VISIBILITY)) {
            return false;
        }
        if (e0()) {
            uVar = uVar.f();
        }
        if (!r0() && t.b(uVar, tn.t.f36421l)) {
            return false;
        }
        sb2.append(k1(uVar.c()));
        sb2.append(" ");
        return true;
    }

    private final void V0(tn.i iVar, StringBuilder sb2) {
        List s10 = iVar.s();
        t.f(s10, "getDeclaredTypeParameters(...)");
        List parameters = iVar.j().getParameters();
        t.f(parameters, "getParameters(...)");
        if (D0() && iVar.I() && parameters.size() > s10.size()) {
            sb2.append(" /*captured type parameters: ");
            N1(sb2, parameters.subList(s10.size(), parameters.size()));
            sb2.append("*/");
        }
    }

    private final void V1(List list, StringBuilder sb2) {
        List<e0> W;
        if (I0()) {
            return;
        }
        ArrayList arrayList = new ArrayList(0);
        Iterator it = list.iterator();
        while (it.hasNext()) {
            e1 e1Var = (e1) it.next();
            List upperBounds = e1Var.getUpperBounds();
            t.f(upperBounds, "getUpperBounds(...)");
            W = c0.W(upperBounds, 1);
            for (e0 e0Var : W) {
                StringBuilder sb3 = new StringBuilder();
                ro.f name = e1Var.getName();
                t.f(name, "getName(...)");
                sb3.append(v(name, false));
                sb3.append(" : ");
                t.d(e0Var);
                sb3.append(w(e0Var));
                arrayList.add(sb3.toString());
            }
        }
        if (!arrayList.isEmpty()) {
            sb2.append(" ");
            sb2.append(k1("where"));
            sb2.append(" ");
            c0.k0(arrayList, sb2, ", ", null, null, 0, null, null, 124, null);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void W0(tn.e eVar, StringBuilder sb2) {
        tn.d N;
        boolean z10 = eVar.g() == tn.f.ENUM_ENTRY;
        if (!x0()) {
            U0(this, sb2, eVar, null, 2, null);
            List E0 = eVar.E0();
            t.f(E0, "getContextReceivers(...)");
            c1(E0, sb2);
            if (!z10) {
                tn.u visibility = eVar.getVisibility();
                t.f(visibility, "getVisibility(...)");
                U1(visibility, sb2);
            }
            if ((eVar.g() != tn.f.INTERFACE || eVar.k() != d0.ABSTRACT) && (!eVar.g().isSingleton() || eVar.k() != d0.FINAL)) {
                d0 k10 = eVar.k();
                t.f(k10, "getModality(...)");
                o1(k10, sb2, L0(eVar));
            }
            m1(eVar, sb2);
            q1(sb2, d0().contains(kotlin.reflect.jvm.internal.impl.renderer.e.INNER) && eVar.I(), "inner");
            q1(sb2, d0().contains(kotlin.reflect.jvm.internal.impl.renderer.e.DATA) && eVar.F0(), Constants.ScionAnalytics.MessageType.DATA_MESSAGE);
            q1(sb2, d0().contains(kotlin.reflect.jvm.internal.impl.renderer.e.INLINE) && eVar.isInline(), "inline");
            q1(sb2, d0().contains(kotlin.reflect.jvm.internal.impl.renderer.e.VALUE) && eVar.G(), "value");
            q1(sb2, d0().contains(kotlin.reflect.jvm.internal.impl.renderer.e.FUN) && eVar.y(), "fun");
            X0(eVar, sb2);
        }
        if (to.f.x(eVar)) {
            Z0(eVar, sb2);
        } else {
            if (!x0()) {
                E1(sb2);
            }
            r1(eVar, sb2, true);
        }
        if (z10) {
            return;
        }
        List s10 = eVar.s();
        t.f(s10, "getDeclaredTypeParameters(...)");
        O1(s10, sb2, false);
        V0(eVar, sb2);
        if (!eVar.g().isSingleton() && S() && (N = eVar.N()) != null) {
            sb2.append(" ");
            U0(this, sb2, N, null, 2, null);
            tn.u visibility2 = N.getVisibility();
            t.f(visibility2, "getVisibility(...)");
            U1(visibility2, sb2);
            sb2.append(k1("constructor"));
            List i10 = N.i();
            t.f(i10, "getValueParameters(...)");
            S1(i10, N.C(), sb2);
        }
        F1(eVar, sb2);
        V1(s10, sb2);
    }

    private final boolean W1(e0 e0Var) {
        boolean z10;
        if (!qn.f.p(e0Var)) {
            return false;
        }
        List I0 = e0Var.I0();
        if (!(I0 instanceof Collection) || !I0.isEmpty()) {
            Iterator it = I0.iterator();
            while (it.hasNext()) {
                if (((h1) it.next()).b()) {
                    z10 = false;
                    break;
                }
            }
        }
        z10 = true;
        return z10;
    }

    private final d X() {
        return (d) this.f26376m.getValue();
    }

    private final void X0(tn.e eVar, StringBuilder sb2) {
        sb2.append(k1(kotlin.reflect.jvm.internal.impl.renderer.c.f26352a.a(eVar)));
    }

    private final boolean X1(boolean z10) {
        int i10 = b.f26380b[h0().ordinal()];
        if (i10 == 1) {
            return true;
        }
        if (i10 != 2) {
            if (i10 != 3) {
                throw new rm.t();
            }
        } else if (!z10) {
            return true;
        }
        return false;
    }

    private final void Z0(tn.m mVar, StringBuilder sb2) {
        if (m0()) {
            if (x0()) {
                sb2.append("companion object");
            }
            E1(sb2);
            tn.m b10 = mVar.b();
            if (b10 != null) {
                sb2.append("of ");
                ro.f name = b10.getName();
                t.f(name, "getName(...)");
                sb2.append(v(name, false));
            }
        }
        if (D0() || !t.b(mVar.getName(), ro.h.f34969d)) {
            if (!x0()) {
                E1(sb2);
            }
            ro.f name2 = mVar.getName();
            t.f(name2, "getName(...)");
            sb2.append(v(name2, true));
        }
    }

    private final String a1(vo.g gVar) {
        String x02;
        String m02;
        dn.l M = this.f26375l.M();
        if (M != null) {
            return (String) M.invoke(gVar);
        }
        if (gVar instanceof vo.b) {
            Iterable iterable = (Iterable) ((vo.b) gVar).b();
            ArrayList arrayList = new ArrayList();
            Iterator it = iterable.iterator();
            while (it.hasNext()) {
                String a12 = a1((vo.g) it.next());
                if (a12 != null) {
                    arrayList.add(a12);
                }
            }
            m02 = c0.m0(arrayList, ", ", "{", "}", 0, null, null, 56, null);
            return m02;
        }
        if (gVar instanceof vo.a) {
            x02 = z.x0(kotlin.reflect.jvm.internal.impl.renderer.c.s(this, (kotlin.reflect.jvm.internal.impl.descriptors.annotations.c) ((vo.a) gVar).b(), null, 2, null), "@");
            return x02;
        }
        if (!(gVar instanceof vo.p)) {
            return gVar.toString();
        }
        p.b bVar = (p.b) ((vo.p) gVar).b();
        if (bVar instanceof p.b.a) {
            return ((p.b.a) bVar).a() + "::class";
        }
        if (!(bVar instanceof p.b.C0952b)) {
            throw new rm.t();
        }
        p.b.C0952b c0952b = (p.b.C0952b) bVar;
        String b10 = c0952b.b().b().b();
        t.f(b10, "asString(...)");
        for (int i10 = 0; i10 < c0952b.a(); i10++) {
            b10 = "kotlin.Array<" + b10 + '>';
        }
        return b10 + "::class";
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX WARN: Removed duplicated region for block: B:13:0x004f  */
    /* JADX WARN: Removed duplicated region for block: B:16:0x0069  */
    /* JADX WARN: Removed duplicated region for block: B:30:0x00bf  */
    /* JADX WARN: Removed duplicated region for block: B:45:0x00e2  */
    /* JADX WARN: Removed duplicated region for block: B:48:0x010b  */
    /* JADX WARN: Removed duplicated region for block: B:51:? A[RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void b1(tn.l lVar, StringBuilder sb2) {
        boolean z10;
        boolean z11;
        tn.d N;
        ArrayList arrayList;
        String m02;
        U0(this, sb2, lVar, null, 2, null);
        if (this.f26375l.T() || lVar.x().k() != d0.SEALED) {
            tn.u visibility = lVar.getVisibility();
            t.f(visibility, "getVisibility(...)");
            if (U1(visibility, sb2)) {
                z10 = true;
                l1(lVar, sb2);
                z11 = (o0() && lVar.w() && !z10) ? false : true;
                if (z11) {
                    sb2.append(k1("constructor"));
                }
                tn.i b10 = lVar.b();
                t.f(b10, "getContainingDeclaration(...)");
                if (v0()) {
                    if (z11) {
                        sb2.append(" ");
                    }
                    r1(b10, sb2, true);
                    List typeParameters = lVar.getTypeParameters();
                    t.f(typeParameters, "getTypeParameters(...)");
                    O1(typeParameters, sb2, false);
                }
                List i10 = lVar.i();
                t.f(i10, "getValueParameters(...)");
                S1(i10, lVar.C(), sb2);
                if (n0() && !lVar.w() && (b10 instanceof tn.e) && (N = ((tn.e) b10).N()) != null) {
                    List i11 = N.i();
                    t.f(i11, "getValueParameters(...)");
                    arrayList = new ArrayList();
                    for (Object obj : i11) {
                        i1 i1Var = (i1) obj;
                        if (!i1Var.p0() && i1Var.f0() == null) {
                            arrayList.add(obj);
                        }
                    }
                    if (!arrayList.isEmpty()) {
                        sb2.append(" : ");
                        sb2.append(k1("this"));
                        m02 = c0.m0(arrayList, ", ", "(", ")", 0, null, e.f26384p, 24, null);
                        sb2.append(m02);
                    }
                }
                if (v0()) {
                    return;
                }
                List typeParameters2 = lVar.getTypeParameters();
                t.f(typeParameters2, "getTypeParameters(...)");
                V1(typeParameters2, sb2);
                return;
            }
        }
        z10 = false;
        l1(lVar, sb2);
        if (o0()) {
        }
        if (z11) {
        }
        tn.i b102 = lVar.b();
        t.f(b102, "getContainingDeclaration(...)");
        if (v0()) {
        }
        List i102 = lVar.i();
        t.f(i102, "getValueParameters(...)");
        S1(i102, lVar.C(), sb2);
        if (n0()) {
            List i112 = N.i();
            t.f(i112, "getValueParameters(...)");
            arrayList = new ArrayList();
            while (r0.hasNext()) {
            }
            if (!arrayList.isEmpty()) {
            }
        }
        if (v0()) {
        }
    }

    private final void c1(List list, StringBuilder sb2) {
        int m10;
        if (!list.isEmpty()) {
            sb2.append("context(");
            Iterator it = list.iterator();
            int i10 = 0;
            while (it.hasNext()) {
                int i11 = i10 + 1;
                w0 w0Var = (w0) it.next();
                T0(sb2, w0Var, kotlin.reflect.jvm.internal.impl.descriptors.annotations.e.RECEIVER);
                e0 type = w0Var.getType();
                t.f(type, "getType(...)");
                sb2.append(f1(type));
                m10 = u.m(list);
                if (i10 == m10) {
                    sb2.append(") ");
                } else {
                    sb2.append(", ");
                }
                i10 = i11;
            }
        }
    }

    private final void d1(StringBuilder sb2, e0 e0Var) {
        U0(this, sb2, e0Var, null, 2, null);
        hp.o oVar = e0Var instanceof hp.o ? (hp.o) e0Var : null;
        if (oVar != null) {
            oVar.W0();
        }
        if (!hp.g0.a(e0Var)) {
            L1(this, sb2, e0Var, null, 2, null);
        } else if (kp.a.u(e0Var) && j0()) {
            sb2.append(e1(kotlin.reflect.jvm.internal.impl.types.error.k.f26475a.p(e0Var)));
        } else {
            if (!(e0Var instanceof kotlin.reflect.jvm.internal.impl.types.error.h) || c0()) {
                sb2.append(e0Var.K0().toString());
            } else {
                sb2.append(((kotlin.reflect.jvm.internal.impl.types.error.h) e0Var).T0());
            }
            sb2.append(I1(e0Var.I0()));
        }
        if (e0Var.L0()) {
            sb2.append("?");
        }
        if (q0.c(e0Var)) {
            sb2.append(" & Any");
        }
    }

    private final String e1(String str) {
        int i10 = b.f26379a[y0().ordinal()];
        if (i10 == 1) {
            return str;
        }
        if (i10 != 2) {
            throw new rm.t();
        }
        return "<font color=red><b>" + str + "</b></font>";
    }

    private final String f1(e0 e0Var) {
        String w10 = w(e0Var);
        if ((!W1(e0Var) || p1.l(e0Var)) && !(e0Var instanceof hp.o)) {
            return w10;
        }
        return '(' + w10 + ')';
    }

    private final String g1(List list) {
        return N(n.c(list));
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void h1(y yVar, StringBuilder sb2) {
        if (!x0()) {
            if (!w0()) {
                U0(this, sb2, yVar, null, 2, null);
                List m02 = yVar.m0();
                t.f(m02, "getContextReceiverParameters(...)");
                c1(m02, sb2);
                tn.u visibility = yVar.getVisibility();
                t.f(visibility, "getVisibility(...)");
                U1(visibility, sb2);
                p1(yVar, sb2);
                if (Y()) {
                    m1(yVar, sb2);
                }
                u1(yVar, sb2);
                if (Y()) {
                    R0(yVar, sb2);
                } else {
                    G1(yVar, sb2);
                }
                l1(yVar, sb2);
                if (D0()) {
                    if (yVar.s0()) {
                        sb2.append("/*isHiddenToOvercomeSignatureClash*/ ");
                    }
                    if (yVar.z0()) {
                        sb2.append("/*isHiddenForResolutionEverywhereBesideSupercalls*/ ");
                    }
                }
            }
            sb2.append(k1("fun"));
            sb2.append(" ");
            List typeParameters = yVar.getTypeParameters();
            t.f(typeParameters, "getTypeParameters(...)");
            O1(typeParameters, sb2, true);
            B1(yVar, sb2);
        }
        r1(yVar, sb2, true);
        List i10 = yVar.i();
        t.f(i10, "getValueParameters(...)");
        S1(i10, yVar.C(), sb2);
        C1(yVar, sb2);
        e0 returnType = yVar.getReturnType();
        if (!G0() && (B0() || returnType == null || !qn.g.C0(returnType))) {
            sb2.append(": ");
            sb2.append(returnType == null ? "[NULL]" : w(returnType));
        }
        List typeParameters2 = yVar.getTypeParameters();
        t.f(typeParameters2, "getTypeParameters(...)");
        V1(typeParameters2, sb2);
    }

    private final void i1(StringBuilder sb2, e0 e0Var) {
        ro.f fVar;
        char m12;
        int b02;
        int b03;
        int m10;
        Object o02;
        int length = sb2.length();
        U0(X(), sb2, e0Var, null, 2, null);
        boolean z10 = sb2.length() != length;
        e0 k10 = qn.f.k(e0Var);
        List e10 = qn.f.e(e0Var);
        if (!e10.isEmpty()) {
            sb2.append("context(");
            m10 = u.m(e10);
            Iterator it = e10.subList(0, m10).iterator();
            while (it.hasNext()) {
                s1(sb2, (e0) it.next());
                sb2.append(", ");
            }
            o02 = c0.o0(e10);
            s1(sb2, (e0) o02);
            sb2.append(") ");
        }
        boolean r10 = qn.f.r(e0Var);
        boolean L0 = e0Var.L0();
        boolean z11 = L0 || (z10 && k10 != null);
        if (z11) {
            if (r10) {
                sb2.insert(length, '(');
            } else {
                if (z10) {
                    m12 = b0.m1(sb2);
                    kotlin.text.b.c(m12);
                    b02 = z.b0(sb2);
                    if (sb2.charAt(b02 - 1) != ')') {
                        b03 = z.b0(sb2);
                        sb2.insert(b03, "()");
                    }
                }
                sb2.append("(");
            }
        }
        q1(sb2, r10, "suspend");
        if (k10 != null) {
            boolean z12 = (W1(k10) && !k10.L0()) || K0(k10) || (k10 instanceof hp.o);
            if (z12) {
                sb2.append("(");
            }
            s1(sb2, k10);
            if (z12) {
                sb2.append(")");
            }
            sb2.append(".");
        }
        sb2.append("(");
        if (!qn.f.n(e0Var) || e0Var.I0().size() > 1) {
            int i10 = 0;
            for (h1 h1Var : qn.f.m(e0Var)) {
                int i11 = i10 + 1;
                if (i10 > 0) {
                    sb2.append(", ");
                }
                if (i0()) {
                    e0 type = h1Var.getType();
                    t.f(type, "getType(...)");
                    fVar = qn.f.d(type);
                } else {
                    fVar = null;
                }
                if (fVar != null) {
                    sb2.append(v(fVar, false));
                    sb2.append(": ");
                }
                sb2.append(x(h1Var));
                i10 = i11;
            }
        } else {
            sb2.append("???");
        }
        sb2.append(") ");
        sb2.append(M());
        sb2.append(" ");
        s1(sb2, qn.f.l(e0Var));
        if (z11) {
            sb2.append(")");
        }
        if (L0) {
            sb2.append("?");
        }
    }

    private final void j1(j1 j1Var, StringBuilder sb2) {
        vo.g T;
        String a12;
        if (!b0() || (T = j1Var.T()) == null || (a12 = a1(T)) == null) {
            return;
        }
        sb2.append(" = ");
        sb2.append(N(a12));
    }

    private final String k1(String str) {
        int i10 = b.f26379a[y0().ordinal()];
        if (i10 == 1) {
            return str;
        }
        if (i10 != 2) {
            throw new rm.t();
        }
        if (R()) {
            return str;
        }
        return "<b>" + str + "</b>";
    }

    private final void l1(tn.b bVar, StringBuilder sb2) {
        if (d0().contains(kotlin.reflect.jvm.internal.impl.renderer.e.MEMBER_KIND) && D0() && bVar.g() != b.a.DECLARATION) {
            sb2.append("/*");
            sb2.append(np.a.f(bVar.g().name()));
            sb2.append("*/ ");
        }
    }

    private final void m1(tn.c0 c0Var, StringBuilder sb2) {
        q1(sb2, c0Var.isExternal(), "external");
        q1(sb2, d0().contains(kotlin.reflect.jvm.internal.impl.renderer.e.EXPECT) && c0Var.H(), "expect");
        q1(sb2, d0().contains(kotlin.reflect.jvm.internal.impl.renderer.e.ACTUAL) && c0Var.C0(), "actual");
    }

    private final void o1(d0 d0Var, StringBuilder sb2, d0 d0Var2) {
        if (q0() || d0Var != d0Var2) {
            q1(sb2, d0().contains(kotlin.reflect.jvm.internal.impl.renderer.e.MODALITY), np.a.f(d0Var.name()));
        }
    }

    private final void p1(tn.b bVar, StringBuilder sb2) {
        if (to.f.J(bVar) && bVar.k() == d0.FINAL) {
            return;
        }
        if (g0() == j.RENDER_OVERRIDE && bVar.k() == d0.OPEN && O0(bVar)) {
            return;
        }
        d0 k10 = bVar.k();
        t.f(k10, "getModality(...)");
        o1(k10, sb2, L0(bVar));
    }

    private final void q1(StringBuilder sb2, boolean z10, String str) {
        if (z10) {
            sb2.append(k1(str));
            sb2.append(" ");
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void r1(tn.m mVar, StringBuilder sb2, boolean z10) {
        ro.f name = mVar.getName();
        t.f(name, "getName(...)");
        sb2.append(v(name, z10));
    }

    private final void s1(StringBuilder sb2, e0 e0Var) {
        s1 N0 = e0Var.N0();
        hp.a aVar = N0 instanceof hp.a ? (hp.a) N0 : null;
        if (aVar == null) {
            t1(sb2, e0Var);
            return;
        }
        if (t0()) {
            t1(sb2, aVar.S());
            return;
        }
        t1(sb2, aVar.W0());
        if (u0()) {
            P0(sb2, aVar);
        }
    }

    private final void t1(StringBuilder sb2, e0 e0Var) {
        if ((e0Var instanceof u1) && n() && !((u1) e0Var).P0()) {
            sb2.append("<Not computed yet>");
            return;
        }
        s1 N0 = e0Var.N0();
        if (N0 instanceof hp.y) {
            sb2.append(((hp.y) N0).U0(this, this));
        } else if (N0 instanceof m0) {
            D1(sb2, (m0) N0);
        }
    }

    private final void u1(tn.b bVar, StringBuilder sb2) {
        if (d0().contains(kotlin.reflect.jvm.internal.impl.renderer.e.OVERRIDE) && O0(bVar) && g0() != j.RENDER_OPEN) {
            q1(sb2, true, "override");
            if (D0()) {
                sb2.append("/*");
                sb2.append(bVar.e().size());
                sb2.append("*/ ");
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void v1(k0 k0Var, StringBuilder sb2) {
        w1(k0Var.d(), "package-fragment", sb2);
        if (n()) {
            sb2.append(" in ");
            r1(k0Var.b(), sb2, false);
        }
    }

    private final void w1(ro.c cVar, String str, StringBuilder sb2) {
        sb2.append(k1(str));
        ro.d j10 = cVar.j();
        t.f(j10, "toUnsafe(...)");
        String u10 = u(j10);
        if (u10.length() > 0) {
            sb2.append(" ");
            sb2.append(u10);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void x1(p0 p0Var, StringBuilder sb2) {
        w1(p0Var.d(), "package", sb2);
        if (n()) {
            sb2.append(" in context of ");
            r1(p0Var.r0(), sb2, false);
        }
    }

    private final void y1(StringBuilder sb2, r0 r0Var) {
        r0 c10 = r0Var.c();
        if (c10 != null) {
            y1(sb2, c10);
            sb2.append('.');
            ro.f name = r0Var.b().getName();
            t.f(name, "getName(...)");
            sb2.append(v(name, false));
        } else {
            hp.d1 j10 = r0Var.b().j();
            t.f(j10, "getTypeConstructor(...)");
            sb2.append(J1(j10));
        }
        sb2.append(I1(r0Var.a()));
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void z1(t0 t0Var, StringBuilder sb2) {
        if (!x0()) {
            if (!w0()) {
                A1(t0Var, sb2);
                List m02 = t0Var.m0();
                t.f(m02, "getContextReceiverParameters(...)");
                c1(m02, sb2);
                tn.u visibility = t0Var.getVisibility();
                t.f(visibility, "getVisibility(...)");
                U1(visibility, sb2);
                boolean z10 = false;
                q1(sb2, d0().contains(kotlin.reflect.jvm.internal.impl.renderer.e.CONST) && t0Var.isConst(), "const");
                m1(t0Var, sb2);
                p1(t0Var, sb2);
                u1(t0Var, sb2);
                if (d0().contains(kotlin.reflect.jvm.internal.impl.renderer.e.LATEINIT) && t0Var.n0()) {
                    z10 = true;
                }
                q1(sb2, z10, "lateinit");
                l1(t0Var, sb2);
            }
            Q1(this, t0Var, sb2, false, 4, null);
            List typeParameters = t0Var.getTypeParameters();
            t.f(typeParameters, "getTypeParameters(...)");
            O1(typeParameters, sb2, true);
            B1(t0Var, sb2);
        }
        r1(t0Var, sb2, true);
        sb2.append(": ");
        e0 type = t0Var.getType();
        t.f(type, "getType(...)");
        sb2.append(w(type));
        C1(t0Var, sb2);
        j1(t0Var, sb2);
        List typeParameters2 = t0Var.getTypeParameters();
        t.f(typeParameters2, "getTypeParameters(...)");
        V1(typeParameters2, sb2);
    }

    public boolean A0() {
        return this.f26375l.c0();
    }

    public boolean B0() {
        return this.f26375l.d0();
    }

    public c.l C0() {
        return this.f26375l.e0();
    }

    public boolean D0() {
        return this.f26375l.f0();
    }

    public boolean E0() {
        return this.f26375l.g0();
    }

    public boolean F0() {
        return this.f26375l.h0();
    }

    public boolean G0() {
        return this.f26375l.i0();
    }

    public boolean H0() {
        return this.f26375l.j0();
    }

    public boolean I0() {
        return this.f26375l.k0();
    }

    public String I1(List typeArguments) {
        t.g(typeArguments, "typeArguments");
        if (typeArguments.isEmpty()) {
            return "";
        }
        StringBuilder sb2 = new StringBuilder();
        sb2.append(N0());
        L(sb2, typeArguments);
        sb2.append(J0());
        String sb3 = sb2.toString();
        t.f(sb3, "toString(...)");
        return sb3;
    }

    public String J1(hp.d1 typeConstructor) {
        t.g(typeConstructor, "typeConstructor");
        tn.h p10 = typeConstructor.p();
        if (p10 instanceof e1 ? true : p10 instanceof tn.e ? true : p10 instanceof d1) {
            return Y0(p10);
        }
        if (p10 == null) {
            return typeConstructor instanceof hp.d0 ? ((hp.d0) typeConstructor).d(g.f26386p) : typeConstructor.toString();
        }
        throw new IllegalStateException(("Unexpected classifier: " + p10.getClass()).toString());
    }

    public boolean O() {
        return this.f26375l.r();
    }

    public boolean P() {
        return this.f26375l.s();
    }

    public dn.l Q() {
        return this.f26375l.t();
    }

    public boolean R() {
        return this.f26375l.u();
    }

    public boolean S() {
        return this.f26375l.v();
    }

    public kotlin.reflect.jvm.internal.impl.renderer.b T() {
        return this.f26375l.w();
    }

    public dn.l U() {
        return this.f26375l.x();
    }

    public boolean V() {
        return this.f26375l.y();
    }

    public Set W() {
        return this.f26375l.z();
    }

    public boolean Y() {
        return this.f26375l.A();
    }

    public String Y0(tn.h klass) {
        t.g(klass, "klass");
        return kotlin.reflect.jvm.internal.impl.types.error.k.m(klass) ? klass.j().toString() : T().a(klass, this);
    }

    public boolean Z() {
        return this.f26375l.B();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.f
    public void a(Set set) {
        t.g(set, "<set-?>");
        this.f26375l.a(set);
    }

    public boolean a0() {
        return this.f26375l.C();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.f
    public void b(boolean z10) {
        this.f26375l.b(z10);
    }

    public boolean b0() {
        return this.f26375l.D();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.f
    public void c(Set set) {
        t.g(set, "<set-?>");
        this.f26375l.c(set);
    }

    public boolean c0() {
        return this.f26375l.E();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.f
    public void d(k kVar) {
        t.g(kVar, "<set-?>");
        this.f26375l.d(kVar);
    }

    public Set d0() {
        return this.f26375l.F();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.f
    public void e(boolean z10) {
        this.f26375l.e(z10);
    }

    public boolean e0() {
        return this.f26375l.G();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.f
    public boolean f() {
        return this.f26375l.f();
    }

    public final kotlin.reflect.jvm.internal.impl.renderer.g f0() {
        return this.f26375l;
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.f
    public void g(kotlin.reflect.jvm.internal.impl.renderer.b bVar) {
        t.g(bVar, "<set-?>");
        this.f26375l.g(bVar);
    }

    public j g0() {
        return this.f26375l.H();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.f
    public void h(boolean z10) {
        this.f26375l.h(z10);
    }

    public k h0() {
        return this.f26375l.I();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.f
    public void i(boolean z10) {
        this.f26375l.i(z10);
    }

    public boolean i0() {
        return this.f26375l.J();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.f
    public void j(boolean z10) {
        this.f26375l.j(z10);
    }

    public boolean j0() {
        return this.f26375l.K();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.f
    public void k(boolean z10) {
        this.f26375l.k(z10);
    }

    public l k0() {
        return this.f26375l.L();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.f
    public void l(m mVar) {
        t.g(mVar, "<set-?>");
        this.f26375l.l(mVar);
    }

    public boolean l0() {
        return this.f26375l.N();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.f
    public Set m() {
        return this.f26375l.m();
    }

    public boolean m0() {
        return this.f26375l.O();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.f
    public boolean n() {
        return this.f26375l.n();
    }

    public boolean n0() {
        return this.f26375l.P();
    }

    public String n1(String message) {
        t.g(message, "message");
        int i10 = b.f26379a[y0().ordinal()];
        if (i10 == 1) {
            return message;
        }
        if (i10 != 2) {
            throw new rm.t();
        }
        return "<i>" + message + "</i>";
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.f
    public kotlin.reflect.jvm.internal.impl.renderer.a o() {
        return this.f26375l.o();
    }

    public boolean o0() {
        return this.f26375l.Q();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.f
    public void p(boolean z10) {
        this.f26375l.p(z10);
    }

    public boolean p0() {
        return this.f26375l.R();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.c
    public String q(tn.m declarationDescriptor) {
        t.g(declarationDescriptor, "declarationDescriptor");
        StringBuilder sb2 = new StringBuilder();
        declarationDescriptor.A0(new a(), sb2);
        if (E0()) {
            K(sb2, declarationDescriptor);
        }
        String sb3 = sb2.toString();
        t.f(sb3, "toString(...)");
        return sb3;
    }

    public boolean q0() {
        return this.f26375l.S();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.c
    public String r(kotlin.reflect.jvm.internal.impl.descriptors.annotations.c annotation, kotlin.reflect.jvm.internal.impl.descriptors.annotations.e eVar) {
        t.g(annotation, "annotation");
        StringBuilder sb2 = new StringBuilder();
        sb2.append('@');
        if (eVar != null) {
            sb2.append(eVar.getRenderName() + ':');
        }
        e0 type = annotation.getType();
        sb2.append(w(type));
        if (Z()) {
            List S0 = S0(annotation);
            if (a0() || (!S0.isEmpty())) {
                c0.k0(S0, sb2, ", ", "(", ")", 0, null, null, 112, null);
            }
        }
        if (D0() && (hp.g0.a(type) || (type.K0().p() instanceof j0.b))) {
            sb2.append(" /* annotation class not found */");
        }
        String sb3 = sb2.toString();
        t.f(sb3, "toString(...)");
        return sb3;
    }

    public boolean r0() {
        return this.f26375l.T();
    }

    public boolean s0() {
        return this.f26375l.U();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.c
    public String t(String lowerRendered, String upperRendered, qn.g builtIns) {
        String b12;
        String b13;
        boolean P;
        t.g(lowerRendered, "lowerRendered");
        t.g(upperRendered, "upperRendered");
        t.g(builtIns, "builtIns");
        if (n.f(lowerRendered, upperRendered)) {
            P = kotlin.text.y.P(upperRendered, "(", false, 2, null);
            if (!P) {
                return lowerRendered + '!';
            }
            return '(' + lowerRendered + ")!";
        }
        kotlin.reflect.jvm.internal.impl.renderer.b T = T();
        tn.e w10 = builtIns.w();
        t.f(w10, "getCollection(...)");
        b12 = z.b1(T.a(w10, this), "Collection", null, 2, null);
        String d10 = n.d(lowerRendered, b12 + "Mutable", upperRendered, b12, b12 + "(Mutable)");
        if (d10 != null) {
            return d10;
        }
        String d11 = n.d(lowerRendered, b12 + "MutableMap.MutableEntry", upperRendered, b12 + "Map.Entry", b12 + "(Mutable)Map.(Mutable)Entry");
        if (d11 != null) {
            return d11;
        }
        kotlin.reflect.jvm.internal.impl.renderer.b T2 = T();
        tn.e j10 = builtIns.j();
        t.f(j10, "getArray(...)");
        b13 = z.b1(T2.a(j10, this), "Array", null, 2, null);
        String d12 = n.d(lowerRendered, b13 + N("Array<"), upperRendered, b13 + N("Array<out "), b13 + N("Array<(out) "));
        if (d12 != null) {
            return d12;
        }
        return '(' + lowerRendered + ".." + upperRendered + ')';
    }

    public boolean t0() {
        return this.f26375l.V();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.c
    public String u(ro.d fqName) {
        t.g(fqName, "fqName");
        List h10 = fqName.h();
        t.f(h10, "pathSegments(...)");
        return g1(h10);
    }

    public boolean u0() {
        return this.f26375l.W();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.c
    public String v(ro.f name, boolean z10) {
        t.g(name, "name");
        String N = N(n.b(name));
        if (!R() || y0() != m.HTML || !z10) {
            return N;
        }
        return "<b>" + N + "</b>";
    }

    public boolean v0() {
        return this.f26375l.X();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.c
    public String w(e0 type) {
        t.g(type, "type");
        StringBuilder sb2 = new StringBuilder();
        s1(sb2, (e0) z0().invoke(type));
        String sb3 = sb2.toString();
        t.f(sb3, "toString(...)");
        return sb3;
    }

    public boolean w0() {
        return this.f26375l.Y();
    }

    @Override // kotlin.reflect.jvm.internal.impl.renderer.c
    public String x(h1 typeProjection) {
        List e10;
        t.g(typeProjection, "typeProjection");
        StringBuilder sb2 = new StringBuilder();
        e10 = sm.t.e(typeProjection);
        L(sb2, e10);
        String sb3 = sb2.toString();
        t.f(sb3, "toString(...)");
        return sb3;
    }

    public boolean x0() {
        return this.f26375l.Z();
    }

    public m y0() {
        return this.f26375l.a0();
    }

    public dn.l z0() {
        return this.f26375l.b0();
    }
}
