package kotlin.reflect.w.internal;

import io.netty.handler.codec.dns.DefaultDnsRecordDecoder;
import java.io.IOException;
import java.util.List;
import kotlin.Metadata;
import kotlin.collections.j;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Lambda;
import kotlin.jvm.internal.o;
import kotlin.reflect.w.internal.y0.d.h1;
import kotlin.reflect.w.internal.y0.d.p0;
import kotlin.reflect.w.internal.y0.d.s0;
import kotlin.reflect.w.internal.y0.d.w;
import kotlin.reflect.w.internal.y0.h.e;
import kotlin.reflect.w.internal.y0.j.c;
import kotlin.reflect.w.internal.y0.n.h0;

/* JADX INFO: renamed from: r.i0.w.b.r0, reason: from Kotlin metadata */
/* JADX INFO: loaded from: classes.dex */
@Metadata(d1 = {"\u0000P\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\bÀ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0002J\u000e\u0010\t\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\nJ\u000e\u0010\u000b\u001a\u00020\u00062\u0006\u0010\f\u001a\u00020\nJ\u000e\u0010\r\u001a\u00020\u00062\u0006\u0010\u000e\u001a\u00020\u000fJ\u000e\u0010\u0010\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\u0011J\u000e\u0010\u0012\u001a\u00020\u00062\u0006\u0010\u0013\u001a\u00020\u0014J\u001a\u0010\u0015\u001a\u00020\u0016*\u00060\u0017j\u0002`\u00182\b\u0010\u0019\u001a\u0004\u0018\u00010\u001aH\u0002J\u0018\u0010\u001b\u001a\u00020\u0016*\u00060\u0017j\u0002`\u00182\u0006\u0010\u001c\u001a\u00020\bH\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u001d"}, d2 = {"Lkotlin/reflect/jvm/internal/ReflectionObjectRenderer;", "", "()V", "renderer", "Lkotlin/reflect/jvm/internal/impl/renderer/DescriptorRenderer;", "renderCallable", "", "descriptor", "Lkotlin/reflect/jvm/internal/impl/descriptors/CallableDescriptor;", "renderFunction", "Lkotlin/reflect/jvm/internal/impl/descriptors/FunctionDescriptor;", "renderLambda", "invoke", "renderParameter", "parameter", "Lkotlin/reflect/jvm/internal/KParameterImpl;", "renderProperty", "Lkotlin/reflect/jvm/internal/impl/descriptors/PropertyDescriptor;", "renderType", "type", "Lkotlin/reflect/jvm/internal/impl/types/KotlinType;", "appendReceiverType", "", "Ljava/lang/StringBuilder;", "Lkotlin/text/StringBuilder;", "receiver", "Lkotlin/reflect/jvm/internal/impl/descriptors/ReceiverParameterDescriptor;", "appendReceivers", "callable", "kotlin-reflection"}, k = 1, mv = {1, 7, 1}, xi = 48)
public final class ReflectionObjectRenderer {
    public static final ReflectionObjectRenderer a = null;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final c f6378b = c.a;

    /* JADX INFO: renamed from: r.i0.w.b.r0$a */
    @Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\r\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n \u0004*\u0004\u0018\u00010\u00030\u0003H\n¢\u0006\u0002\b\u0005"}, d2 = {"<anonymous>", "", "it", "Lkotlin/reflect/jvm/internal/impl/descriptors/ValueParameterDescriptor;", "kotlin.jvm.PlatformType", "invoke"}, k = 3, mv = {1, 7, 1}, xi = 48)
    public static final class a extends Lambda implements Function1<h1, CharSequence> {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        public static final a f6379f = new a();

        public a() {
            super(1);
        }

        @Override // kotlin.jvm.functions.Function1
        public CharSequence invoke(h1 h1Var) {
            ReflectionObjectRenderer reflectionObjectRenderer = ReflectionObjectRenderer.a;
            h0 type = h1Var.getType();
            o.e(type, "it.type");
            return ReflectionObjectRenderer.e(type);
        }
    }

    public static final void a(StringBuilder sb, s0 s0Var) {
        if (s0Var != null) {
            h0 type = s0Var.getType();
            o.e(type, "receiver.type");
            sb.append(e(type));
            sb.append(DefaultDnsRecordDecoder.ROOT);
        }
    }

    public static final void b(StringBuilder sb, kotlin.reflect.w.internal.y0.d.a aVar) {
        s0 s0VarG = v0.g(aVar);
        s0 s0VarL0 = aVar.l0();
        a(sb, s0VarG);
        boolean z2 = (s0VarG == null || s0VarL0 == null) ? false : true;
        if (z2) {
            sb.append("(");
        }
        a(sb, s0VarL0);
        if (z2) {
            sb.append(")");
        }
    }

    public static final String c(w wVar) throws IOException {
        o.f(wVar, "descriptor");
        StringBuilder sb = new StringBuilder();
        sb.append("fun ");
        b(sb, wVar);
        c cVar = f6378b;
        e name = wVar.getName();
        o.e(name, "descriptor.name");
        sb.append(cVar.u(name, true));
        List<h1> listH = wVar.h();
        o.e(listH, "descriptor.valueParameters");
        j.B(listH, sb, ", ", "(", ")", 0, null, a.f6379f, 48);
        sb.append(": ");
        h0 returnType = wVar.getReturnType();
        o.c(returnType);
        sb.append(e(returnType));
        String string = sb.toString();
        o.e(string, "StringBuilder().apply(builderAction).toString()");
        return string;
    }

    public static final String d(p0 p0Var) {
        o.f(p0Var, "descriptor");
        StringBuilder sb = new StringBuilder();
        sb.append(p0Var.i0() ? "var " : "val ");
        b(sb, p0Var);
        c cVar = f6378b;
        e name = p0Var.getName();
        o.e(name, "descriptor.name");
        sb.append(cVar.u(name, true));
        sb.append(": ");
        h0 type = p0Var.getType();
        o.e(type, "descriptor.type");
        sb.append(e(type));
        String string = sb.toString();
        o.e(string, "StringBuilder().apply(builderAction).toString()");
        return string;
    }

    public static final String e(h0 h0Var) {
        o.f(h0Var, "type");
        return f6378b.v(h0Var);
    }
}
