package kotlin.reflect.w.internal;

import g.h.a.i;
import java.lang.annotation.Annotation;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
import kotlin.Metadata;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Lambda;
import kotlin.jvm.internal.o;
import kotlin.reflect.KCallable;
import kotlin.reflect.KParameter;
import kotlin.reflect.KType;
import kotlin.reflect.KTypeParameter;
import kotlin.reflect.KVisibility;
import kotlin.reflect.full.IllegalCallableAccessException;
import kotlin.reflect.w.internal.calls.Caller;
import kotlin.reflect.w.internal.y0.d.b1;
import kotlin.reflect.w.internal.y0.d.c0;
import kotlin.reflect.w.internal.y0.d.q;
import kotlin.reflect.w.internal.y0.d.r;
import kotlin.reflect.w.internal.y0.d.s0;
import kotlin.reflect.w.internal.y0.n.h0;

/* JADX INFO: renamed from: r.i0.w.b.e, reason: from Kotlin metadata */
/* JADX INFO: loaded from: classes.dex */
@Metadata(d1 = {"\u0000\u0094\u0001\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0010\u001b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0011\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010$\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\b \u0018\u0000*\u0006\b\u0000\u0010\u0001 \u00012\b\u0012\u0004\u0012\u0002H\u00010\u00022\u00020\u0003B\u0005¢\u0006\u0002\u0010\u0004J%\u00106\u001a\u00028\u00002\u0016\u00107\u001a\f\u0012\b\b\u0001\u0012\u0004\u0018\u00010908\"\u0004\u0018\u000109H\u0016¢\u0006\u0002\u0010:J#\u0010;\u001a\u00028\u00002\u0014\u00107\u001a\u0010\u0012\u0004\u0012\u00020\f\u0012\u0006\u0012\u0004\u0018\u0001090<H\u0002¢\u0006\u0002\u0010=J#\u0010>\u001a\u00028\u00002\u0014\u00107\u001a\u0010\u0012\u0004\u0012\u00020\f\u0012\u0006\u0012\u0004\u0018\u0001090<H\u0016¢\u0006\u0002\u0010=J3\u0010?\u001a\u00028\u00002\u0014\u00107\u001a\u0010\u0012\u0004\u0012\u00020\f\u0012\u0006\u0012\u0004\u0018\u0001090<2\f\u0010@\u001a\b\u0012\u0002\b\u0003\u0018\u00010AH\u0000¢\u0006\u0004\bB\u0010CJ\u0010\u0010D\u001a\u0002092\u0006\u0010E\u001a\u00020,H\u0002J\n\u0010F\u001a\u0004\u0018\u00010GH\u0002R(\u0010\u0005\u001a\u001c\u0012\u0018\u0012\u0016\u0012\u0004\u0012\u00020\b \t*\n\u0012\u0004\u0012\u00020\b\u0018\u00010\u00070\u00070\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R(\u0010\n\u001a\u001c\u0012\u0018\u0012\u0016\u0012\u0004\u0012\u00020\f \t*\n\u0012\u0004\u0012\u00020\f\u0018\u00010\u000b0\u000b0\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u001c\u0010\r\u001a\u0010\u0012\f\u0012\n \t*\u0004\u0018\u00010\u000e0\u000e0\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R(\u0010\u000f\u001a\u001c\u0012\u0018\u0012\u0016\u0012\u0004\u0012\u00020\u0010 \t*\n\u0012\u0004\u0012\u00020\u0010\u0018\u00010\u00070\u00070\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u001a\u0010\u0011\u001a\b\u0012\u0004\u0012\u00020\b0\u00078VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0012\u0010\u0013R\u0016\u0010\u0014\u001a\u0006\u0012\u0002\b\u00030\u0015X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0016\u0010\u0017R\u0012\u0010\u0018\u001a\u00020\u0019X¦\u0004¢\u0006\u0006\u001a\u0004\b\u001a\u0010\u001bR\u0018\u0010\u001c\u001a\b\u0012\u0002\b\u0003\u0018\u00010\u0015X¦\u0004¢\u0006\u0006\u001a\u0004\b\u001d\u0010\u0017R\u0012\u0010\u001e\u001a\u00020\u001fX¦\u0004¢\u0006\u0006\u001a\u0004\b \u0010!R\u0014\u0010\"\u001a\u00020#8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\"\u0010$R\u0014\u0010%\u001a\u00020#8DX\u0084\u0004¢\u0006\u0006\u001a\u0004\b%\u0010$R\u0012\u0010&\u001a\u00020#X¦\u0004¢\u0006\u0006\u001a\u0004\b&\u0010$R\u0014\u0010'\u001a\u00020#8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b'\u0010$R\u0014\u0010(\u001a\u00020#8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b(\u0010$R\u001a\u0010)\u001a\b\u0012\u0004\u0012\u00020\f0\u00078VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b*\u0010\u0013R\u0014\u0010+\u001a\u00020,8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b-\u0010.R\u001a\u0010/\u001a\b\u0012\u0004\u0012\u0002000\u00078VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b1\u0010\u0013R\u0016\u00102\u001a\u0004\u0018\u0001038VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b4\u00105¨\u0006H"}, d2 = {"Lkotlin/reflect/jvm/internal/KCallableImpl;", "R", "Lkotlin/reflect/KCallable;", "Lkotlin/reflect/jvm/internal/KTypeParameterOwnerImpl;", "()V", "_annotations", "Lkotlin/reflect/jvm/internal/ReflectProperties$LazySoftVal;", "", "", "kotlin.jvm.PlatformType", "_parameters", "Ljava/util/ArrayList;", "Lkotlin/reflect/KParameter;", "_returnType", "Lkotlin/reflect/jvm/internal/KTypeImpl;", "_typeParameters", "Lkotlin/reflect/jvm/internal/KTypeParameterImpl;", "annotations", "getAnnotations", "()Ljava/util/List;", "caller", "Lkotlin/reflect/jvm/internal/calls/Caller;", "getCaller", "()Lkotlin/reflect/jvm/internal/calls/Caller;", "container", "Lkotlin/reflect/jvm/internal/KDeclarationContainerImpl;", "getContainer", "()Lkotlin/reflect/jvm/internal/KDeclarationContainerImpl;", "defaultCaller", "getDefaultCaller", "descriptor", "Lkotlin/reflect/jvm/internal/impl/descriptors/CallableMemberDescriptor;", "getDescriptor", "()Lorg/jetbrains/kotlin/descriptors/CallableMemberDescriptor;", "isAbstract", "", "()Z", "isAnnotationConstructor", "isBound", "isFinal", "isOpen", "parameters", "getParameters", "returnType", "Lkotlin/reflect/KType;", "getReturnType", "()Lkotlin/reflect/KType;", "typeParameters", "Lkotlin/reflect/KTypeParameter;", "getTypeParameters", "visibility", "Lkotlin/reflect/KVisibility;", "getVisibility", "()Lkotlin/reflect/KVisibility;", "call", "args", "", "", "([Ljava/lang/Object;)Ljava/lang/Object;", "callAnnotationConstructor", "", "(Ljava/util/Map;)Ljava/lang/Object;", "callBy", "callDefaultMethod", "continuationArgument", "Lkotlin/coroutines/Continuation;", "callDefaultMethod$kotlin_reflection", "(Ljava/util/Map;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "defaultEmptyArray", "type", "extractContinuationArgument", "Ljava/lang/reflect/Type;", "kotlin-reflection"}, k = 1, mv = {1, 7, 1}, xi = 48)
public abstract class KCallableImpl<R> implements KCallable<R>, KTypeParameterOwnerImpl {

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final n0<List<Annotation>> f6270f;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final n0<ArrayList<KParameter>> f6271m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final n0<KTypeImpl> f6272n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public final n0<List<KTypeParameterImpl>> f6273o;

    /* JADX INFO: renamed from: r.i0.w.b.e$a */
    @Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0010 \n\u0002\u0010\u001b\n\u0002\b\u0003\u0010\u0000\u001a\u0016\u0012\u0004\u0012\u00020\u0002 \u0003*\n\u0012\u0004\u0012\u00020\u0002\u0018\u00010\u00010\u0001\"\u0006\b\u0000\u0010\u0004 \u0001H\n¢\u0006\u0002\b\u0005"}, d2 = {"<anonymous>", "", "", "kotlin.jvm.PlatformType", "R", "invoke"}, k = 3, mv = {1, 7, 1}, xi = 48)
    public static final class a extends Lambda implements Function0<List<? extends Annotation>> {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        public final /* synthetic */ KCallableImpl<R> f6274f;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        /* JADX WARN: Multi-variable type inference failed */
        public a(KCallableImpl<? extends R> kCallableImpl) {
            super(0);
            this.f6274f = kCallableImpl;
        }

        @Override // kotlin.jvm.functions.Function0
        public List<? extends Annotation> invoke() {
            return v0.d(this.f6274f.o());
        }
    }

    /* JADX INFO: renamed from: r.i0.w.b.e$b */
    @Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\u0010\u0000\u001a\u0016\u0012\u0004\u0012\u00020\u0002 \u0003*\n\u0012\u0004\u0012\u00020\u0002\u0018\u00010\u00010\u0001\"\u0006\b\u0000\u0010\u0004 \u0001H\n¢\u0006\u0002\b\u0005"}, d2 = {"<anonymous>", "Ljava/util/ArrayList;", "Lkotlin/reflect/KParameter;", "kotlin.jvm.PlatformType", "R", "invoke"}, k = 3, mv = {1, 7, 1}, xi = 48)
    public static final class b extends Lambda implements Function0<ArrayList<KParameter>> {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        public final /* synthetic */ KCallableImpl<R> f6275f;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        /* JADX WARN: Multi-variable type inference failed */
        public b(KCallableImpl<? extends R> kCallableImpl) {
            super(0);
            this.f6275f = kCallableImpl;
        }

        @Override // kotlin.jvm.functions.Function0
        public ArrayList<KParameter> invoke() {
            int i2;
            kotlin.reflect.w.internal.y0.d.b bVarO = this.f6275f.o();
            ArrayList<KParameter> arrayList = new ArrayList<>();
            int i3 = 0;
            if (this.f6275f.q()) {
                i2 = 0;
            } else {
                s0 s0VarG = v0.g(bVarO);
                if (s0VarG != null) {
                    arrayList.add(new KParameterImpl(this.f6275f, 0, KParameter.a.INSTANCE, new f(s0VarG)));
                    i2 = 1;
                } else {
                    i2 = 0;
                }
                s0 s0VarL0 = bVarO.l0();
                if (s0VarL0 != null) {
                    arrayList.add(new KParameterImpl(this.f6275f, i2, KParameter.a.EXTENSION_RECEIVER, new g(s0VarL0)));
                    i2++;
                }
            }
            int size = bVarO.h().size();
            while (i3 < size) {
                arrayList.add(new KParameterImpl(this.f6275f, i2, KParameter.a.VALUE, new h(bVarO, i3)));
                i3++;
                i2++;
            }
            if (this.f6275f.p() && (bVarO instanceof kotlin.reflect.w.internal.y0.f.a.o0.a) && arrayList.size() > 1) {
                i.x3(arrayList, new i());
            }
            arrayList.trimToSize();
            return arrayList;
        }
    }

    /* JADX INFO: renamed from: r.i0.w.b.e$c */
    @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u0010\u0000\u001a\n \u0002*\u0004\u0018\u00010\u00010\u0001\"\u0006\b\u0000\u0010\u0003 \u0001H\n¢\u0006\u0002\b\u0004"}, d2 = {"<anonymous>", "Lkotlin/reflect/jvm/internal/KTypeImpl;", "kotlin.jvm.PlatformType", "R", "invoke"}, k = 3, mv = {1, 7, 1}, xi = 48)
    public static final class c extends Lambda implements Function0<KTypeImpl> {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        public final /* synthetic */ KCallableImpl<R> f6276f;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        /* JADX WARN: Multi-variable type inference failed */
        public c(KCallableImpl<? extends R> kCallableImpl) {
            super(0);
            this.f6276f = kCallableImpl;
        }

        @Override // kotlin.jvm.functions.Function0
        public KTypeImpl invoke() {
            h0 returnType = this.f6276f.o().getReturnType();
            o.c(returnType);
            return new KTypeImpl(returnType, new j(this.f6276f));
        }
    }

    /* JADX INFO: renamed from: r.i0.w.b.e$d */
    @Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0003\u0010\u0000\u001a\u0016\u0012\u0004\u0012\u00020\u0002 \u0003*\n\u0012\u0004\u0012\u00020\u0002\u0018\u00010\u00010\u0001\"\u0006\b\u0000\u0010\u0004 \u0001H\n¢\u0006\u0002\b\u0005"}, d2 = {"<anonymous>", "", "Lkotlin/reflect/jvm/internal/KTypeParameterImpl;", "kotlin.jvm.PlatformType", "R", "invoke"}, k = 3, mv = {1, 7, 1}, xi = 48)
    public static final class d extends Lambda implements Function0<List<? extends KTypeParameterImpl>> {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        public final /* synthetic */ KCallableImpl<R> f6277f;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        /* JADX WARN: Multi-variable type inference failed */
        public d(KCallableImpl<? extends R> kCallableImpl) {
            super(0);
            this.f6277f = kCallableImpl;
        }

        @Override // kotlin.jvm.functions.Function0
        public List<? extends KTypeParameterImpl> invoke() {
            List<b1> typeParameters = this.f6277f.o().getTypeParameters();
            o.e(typeParameters, "descriptor.typeParameters");
            KCallableImpl<R> kCallableImpl = this.f6277f;
            ArrayList arrayList = new ArrayList(i.H(typeParameters, 10));
            for (b1 b1Var : typeParameters) {
                o.e(b1Var, "descriptor");
                arrayList.add(new KTypeParameterImpl(kCallableImpl, b1Var));
            }
            return arrayList;
        }
    }

    public KCallableImpl() {
        n0<List<Annotation>> n0VarG2 = i.G2(new a(this));
        o.e(n0VarG2, "lazySoft { descriptor.computeAnnotations() }");
        this.f6270f = n0VarG2;
        n0<ArrayList<KParameter>> n0VarG22 = i.G2(new b(this));
        o.e(n0VarG22, "lazySoft {\n        val d…ze()\n        result\n    }");
        this.f6271m = n0VarG22;
        n0<KTypeImpl> n0VarG23 = i.G2(new c(this));
        o.e(n0VarG23, "lazySoft {\n        KType…eturnType\n        }\n    }");
        this.f6272n = n0VarG23;
        n0<List<KTypeParameterImpl>> n0VarG24 = i.G2(new d(this));
        o.e(n0VarG24, "lazySoft {\n        descr…this, descriptor) }\n    }");
        this.f6273o = n0VarG24;
    }

    @Override // kotlin.reflect.KCallable
    public R call(Object... args) throws IllegalCallableAccessException {
        o.f(args, "args");
        try {
            return (R) l().call(args);
        } catch (IllegalAccessException e2) {
            throw new IllegalCallableAccessException(e2);
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:100:0x0176 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:103:0x00d7 A[SYNTHETIC] */
    @Override // kotlin.reflect.KCallable
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public R callBy(java.util.Map<kotlin.reflect.KParameter, ? extends java.lang.Object> r15) throws kotlin.reflect.full.IllegalCallableAccessException {
        /*
            Method dump skipped, instruction units count: 482
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: kotlin.reflect.w.internal.KCallableImpl.callBy(java.util.Map):java.lang.Object");
    }

    @Override // kotlin.reflect.KAnnotatedElement
    public List<Annotation> getAnnotations() {
        List<Annotation> listInvoke = this.f6270f.invoke();
        o.e(listInvoke, "_annotations()");
        return listInvoke;
    }

    @Override // kotlin.reflect.KCallable
    public List<KParameter> getParameters() {
        ArrayList<KParameter> arrayListInvoke = this.f6271m.invoke();
        o.e(arrayListInvoke, "_parameters()");
        return arrayListInvoke;
    }

    @Override // kotlin.reflect.KCallable
    public KType getReturnType() {
        KTypeImpl kTypeImplInvoke = this.f6272n.invoke();
        o.e(kTypeImplInvoke, "_returnType()");
        return kTypeImplInvoke;
    }

    @Override // kotlin.reflect.KCallable
    public List<KTypeParameter> getTypeParameters() {
        List<KTypeParameterImpl> listInvoke = this.f6273o.invoke();
        o.e(listInvoke, "_typeParameters()");
        return listInvoke;
    }

    @Override // kotlin.reflect.KCallable
    public KVisibility getVisibility() {
        r visibility = o().getVisibility();
        o.e(visibility, "descriptor.visibility");
        kotlin.reflect.w.internal.y0.h.c cVar = v0.a;
        o.f(visibility, "<this>");
        if (o.a(visibility, q.f6983e)) {
            return KVisibility.PUBLIC;
        }
        if (o.a(visibility, q.f6981c)) {
            return KVisibility.PROTECTED;
        }
        if (o.a(visibility, q.f6982d)) {
            return KVisibility.INTERNAL;
        }
        if (o.a(visibility, q.a) ? true : o.a(visibility, q.f6980b)) {
            return KVisibility.PRIVATE;
        }
        return null;
    }

    @Override // kotlin.reflect.KCallable
    public boolean isAbstract() {
        return o().l() == c0.ABSTRACT;
    }

    @Override // kotlin.reflect.KCallable
    public boolean isFinal() {
        return o().l() == c0.FINAL;
    }

    @Override // kotlin.reflect.KCallable
    public boolean isOpen() {
        return o().l() == c0.OPEN;
    }

    public final Object j(KType kType) {
        Class clsL1 = i.l1(i.r1(kType));
        if (clsL1.isArray()) {
            Object objNewInstance = Array.newInstance(clsL1.getComponentType(), 0);
            o.e(objNewInstance, "type.jvmErasure.java.run…\"\n            )\n        }");
            return objNewInstance;
        }
        StringBuilder sbF = g.a.a.a.a.F("Cannot instantiate the default empty array of type ");
        sbF.append(clsL1.getSimpleName());
        sbF.append(", because it is not an array type");
        throw new KotlinReflectionInternalError(sbF.toString());
    }

    public abstract Caller<?> l();

    /* JADX INFO: renamed from: m */
    public abstract KDeclarationContainerImpl getF6383q();

    public abstract Caller<?> n();

    public abstract kotlin.reflect.w.internal.y0.d.b o();

    public final boolean p() {
        return o.a(getF6282r(), "<init>") && getF6383q().j().isAnnotation();
    }

    public abstract boolean q();
}
