package kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors;

import com.google.android.gms.measurement.api.AppMeasurementSdk;
import defpackage.cr4;
import defpackage.e6a;
import defpackage.hk7;
import defpackage.ik2;
import defpackage.iw7;
import defpackage.jk2;
import defpackage.km8;
import defpackage.kp6;
import defpackage.kw7;
import defpackage.n41;
import defpackage.pq6;
import defpackage.qq3;
import defpackage.sg8;
import defpackage.sq3;
import defpackage.vx8;
import defpackage.wo5;
import defpackage.y41;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import kotlin.reflect.KProperty;
import kotlin.reflect.jvm.internal.impl.descriptors.ClassDescriptor;
import kotlin.reflect.jvm.internal.impl.descriptors.ClassifierDescriptor;
import kotlin.reflect.jvm.internal.impl.descriptors.DeclarationDescriptor;
import kotlin.reflect.jvm.internal.impl.descriptors.PropertyDescriptor;
import kotlin.reflect.jvm.internal.impl.descriptors.SimpleFunctionDescriptor;
import kotlin.reflect.jvm.internal.impl.descriptors.TypeAliasDescriptor;
import kotlin.reflect.jvm.internal.impl.incremental.components.LookupLocation;
import kotlin.reflect.jvm.internal.impl.metadata.ProtoBuf;
import kotlin.reflect.jvm.internal.impl.name.ClassId;
import kotlin.reflect.jvm.internal.impl.name.Name;
import kotlin.reflect.jvm.internal.impl.protobuf.AbstractMessageLite;
import kotlin.reflect.jvm.internal.impl.protobuf.MessageLite;
import kotlin.reflect.jvm.internal.impl.protobuf.Parser;
import kotlin.reflect.jvm.internal.impl.resolve.MemberComparator;
import kotlin.reflect.jvm.internal.impl.resolve.scopes.DescriptorKindFilter;
import kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScopeImpl;
import kotlin.reflect.jvm.internal.impl.serialization.deserialization.DeserializationContext;
import kotlin.reflect.jvm.internal.impl.serialization.deserialization.MemberDeserializer;
import kotlin.reflect.jvm.internal.impl.serialization.deserialization.NameResolverUtilKt;
import kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope;
import kotlin.reflect.jvm.internal.impl.storage.MemoizedFunctionToNotNull;
import kotlin.reflect.jvm.internal.impl.storage.MemoizedFunctionToNullable;
import kotlin.reflect.jvm.internal.impl.storage.NotNullLazyValue;
import kotlin.reflect.jvm.internal.impl.storage.NullableLazyValue;
import kotlin.reflect.jvm.internal.impl.storage.StorageKt;
import kotlin.reflect.jvm.internal.impl.storage.StorageManager;
import kotlin.reflect.jvm.internal.impl.utils.CollectionsKt;

/* JADX INFO: loaded from: classes3.dex */
public abstract class DeserializedMemberScope extends MemberScopeImpl {
    static final /* synthetic */ KProperty<Object>[] $$delegatedProperties;

    @kp6
    private final DeserializationContext c;

    @kp6
    private final NotNullLazyValue classNames$delegate;

    @kp6
    private final NullableLazyValue classifierNamesLazy$delegate;

    @kp6
    private final Implementation impl;

    public interface Implementation {
        void addFunctionsAndPropertiesTo(@kp6 Collection<DeclarationDescriptor> collection, @kp6 DescriptorKindFilter descriptorKindFilter, @kp6 sq3<? super Name, Boolean> sq3Var, @kp6 LookupLocation lookupLocation);

        @kp6
        Collection<SimpleFunctionDescriptor> getContributedFunctions(@kp6 Name name, @kp6 LookupLocation lookupLocation);

        @kp6
        Collection<PropertyDescriptor> getContributedVariables(@kp6 Name name, @kp6 LookupLocation lookupLocation);

        @kp6
        Set<Name> getFunctionNames();

        @pq6
        TypeAliasDescriptor getTypeAliasByName(@kp6 Name name);

        @kp6
        Set<Name> getTypeAliasNames();

        @kp6
        Set<Name> getVariableNames();
    }

    @vx8
    public final class NoReorderImplementation implements Implementation {
        static final /* synthetic */ KProperty<Object>[] $$delegatedProperties;

        @kp6
        private final NotNullLazyValue allFunctions$delegate;

        @kp6
        private final NotNullLazyValue allProperties$delegate;

        @kp6
        private final NotNullLazyValue allTypeAliases$delegate;

        @kp6
        private final NotNullLazyValue declaredFunctions$delegate;

        @kp6
        private final NotNullLazyValue declaredProperties$delegate;

        @kp6
        private final List<ProtoBuf.Function> functionList;

        @kp6
        private final NotNullLazyValue functionNames$delegate;

        @kp6
        private final NotNullLazyValue functionsByName$delegate;

        @kp6
        private final NotNullLazyValue propertiesByName$delegate;

        @kp6
        private final List<ProtoBuf.Property> propertyList;
        final /* synthetic */ DeserializedMemberScope this$0;

        @kp6
        private final List<ProtoBuf.TypeAlias> typeAliasList;

        @kp6
        private final NotNullLazyValue typeAliasesByName$delegate;

        @kp6
        private final NotNullLazyValue variableNames$delegate;

        static {
            hk7 hk7Var = new hk7(NoReorderImplementation.class, "declaredFunctions", "getDeclaredFunctions()Ljava/util/List;", 0);
            kw7 kw7Var = iw7.a;
            $$delegatedProperties = new KProperty[]{kw7Var.property1(hk7Var), n41.w(NoReorderImplementation.class, "declaredProperties", "getDeclaredProperties()Ljava/util/List;", 0, kw7Var), n41.w(NoReorderImplementation.class, "allTypeAliases", "getAllTypeAliases()Ljava/util/List;", 0, kw7Var), n41.w(NoReorderImplementation.class, "allFunctions", "getAllFunctions()Ljava/util/List;", 0, kw7Var), n41.w(NoReorderImplementation.class, "allProperties", "getAllProperties()Ljava/util/List;", 0, kw7Var), n41.w(NoReorderImplementation.class, "typeAliasesByName", "getTypeAliasesByName()Ljava/util/Map;", 0, kw7Var), n41.w(NoReorderImplementation.class, "functionsByName", "getFunctionsByName()Ljava/util/Map;", 0, kw7Var), n41.w(NoReorderImplementation.class, "propertiesByName", "getPropertiesByName()Ljava/util/Map;", 0, kw7Var), n41.w(NoReorderImplementation.class, "functionNames", "getFunctionNames()Ljava/util/Set;", 0, kw7Var), n41.w(NoReorderImplementation.class, "variableNames", "getVariableNames()Ljava/util/Set;", 0, kw7Var)};
        }

        public NoReorderImplementation(@kp6 final DeserializedMemberScope deserializedMemberScope, @kp6 List<ProtoBuf.Function> list, @kp6 List<ProtoBuf.Property> list2, List<ProtoBuf.TypeAlias> list3) {
            cr4.g(list, "functionList");
            cr4.g(list2, "propertyList");
            cr4.g(list3, "typeAliasList");
            this.this$0 = deserializedMemberScope;
            this.functionList = list;
            this.propertyList = list2;
            this.typeAliasList = deserializedMemberScope.getC().getComponents().getConfiguration().getTypeAliasesAllowed() ? list3 : ik2.a;
            this.declaredFunctions$delegate = deserializedMemberScope.getC().getStorageManager().createLazyValue(new qq3(this) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$NoReorderImplementation$$Lambda$0
                private final DeserializedMemberScope.NoReorderImplementation arg$0;

                {
                    this.arg$0 = this;
                }

                @Override // defpackage.qq3
                public Object invoke() {
                    return this.arg$0.computeFunctions();
                }
            });
            this.declaredProperties$delegate = deserializedMemberScope.getC().getStorageManager().createLazyValue(new qq3(this) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$NoReorderImplementation$$Lambda$1
                private final DeserializedMemberScope.NoReorderImplementation arg$0;

                {
                    this.arg$0 = this;
                }

                @Override // defpackage.qq3
                public Object invoke() {
                    return this.arg$0.computeProperties();
                }
            });
            this.allTypeAliases$delegate = deserializedMemberScope.getC().getStorageManager().createLazyValue(new qq3(this) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$NoReorderImplementation$$Lambda$2
                private final DeserializedMemberScope.NoReorderImplementation arg$0;

                {
                    this.arg$0 = this;
                }

                @Override // defpackage.qq3
                public Object invoke() {
                    return this.arg$0.computeTypeAliases();
                }
            });
            this.allFunctions$delegate = deserializedMemberScope.getC().getStorageManager().createLazyValue(new qq3(this) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$NoReorderImplementation$$Lambda$3
                private final DeserializedMemberScope.NoReorderImplementation arg$0;

                {
                    this.arg$0 = this;
                }

                @Override // defpackage.qq3
                public Object invoke() {
                    return DeserializedMemberScope.NoReorderImplementation.allFunctions_delegate$lambda$3(this.arg$0);
                }
            });
            this.allProperties$delegate = deserializedMemberScope.getC().getStorageManager().createLazyValue(new qq3(this) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$NoReorderImplementation$$Lambda$4
                private final DeserializedMemberScope.NoReorderImplementation arg$0;

                {
                    this.arg$0 = this;
                }

                @Override // defpackage.qq3
                public Object invoke() {
                    return DeserializedMemberScope.NoReorderImplementation.allProperties_delegate$lambda$4(this.arg$0);
                }
            });
            this.typeAliasesByName$delegate = deserializedMemberScope.getC().getStorageManager().createLazyValue(new qq3(this) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$NoReorderImplementation$$Lambda$5
                private final DeserializedMemberScope.NoReorderImplementation arg$0;

                {
                    this.arg$0 = this;
                }

                @Override // defpackage.qq3
                public Object invoke() {
                    return DeserializedMemberScope.NoReorderImplementation.typeAliasesByName_delegate$lambda$6(this.arg$0);
                }
            });
            this.functionsByName$delegate = deserializedMemberScope.getC().getStorageManager().createLazyValue(new qq3(this) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$NoReorderImplementation$$Lambda$6
                private final DeserializedMemberScope.NoReorderImplementation arg$0;

                {
                    this.arg$0 = this;
                }

                @Override // defpackage.qq3
                public Object invoke() {
                    return DeserializedMemberScope.NoReorderImplementation.functionsByName_delegate$lambda$8(this.arg$0);
                }
            });
            this.propertiesByName$delegate = deserializedMemberScope.getC().getStorageManager().createLazyValue(new qq3(this) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$NoReorderImplementation$$Lambda$7
                private final DeserializedMemberScope.NoReorderImplementation arg$0;

                {
                    this.arg$0 = this;
                }

                @Override // defpackage.qq3
                public Object invoke() {
                    return DeserializedMemberScope.NoReorderImplementation.propertiesByName_delegate$lambda$10(this.arg$0);
                }
            });
            this.functionNames$delegate = deserializedMemberScope.getC().getStorageManager().createLazyValue(new qq3(this, deserializedMemberScope) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$NoReorderImplementation$$Lambda$8
                private final DeserializedMemberScope.NoReorderImplementation arg$0;
                private final DeserializedMemberScope arg$1;

                {
                    this.arg$0 = this;
                    this.arg$1 = deserializedMemberScope;
                }

                @Override // defpackage.qq3
                public Object invoke() {
                    return DeserializedMemberScope.NoReorderImplementation.functionNames_delegate$lambda$12(this.arg$0, this.arg$1);
                }
            });
            this.variableNames$delegate = deserializedMemberScope.getC().getStorageManager().createLazyValue(new qq3(this, deserializedMemberScope) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$NoReorderImplementation$$Lambda$9
                private final DeserializedMemberScope.NoReorderImplementation arg$0;
                private final DeserializedMemberScope arg$1;

                {
                    this.arg$0 = this;
                    this.arg$1 = deserializedMemberScope;
                }

                @Override // defpackage.qq3
                public Object invoke() {
                    return DeserializedMemberScope.NoReorderImplementation.variableNames_delegate$lambda$14(this.arg$0, this.arg$1);
                }
            });
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final List allFunctions_delegate$lambda$3(NoReorderImplementation noReorderImplementation) {
            return y41.au(noReorderImplementation.computeAllNonDeclaredFunctions(), noReorderImplementation.getDeclaredFunctions());
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final List allProperties_delegate$lambda$4(NoReorderImplementation noReorderImplementation) {
            return y41.au(noReorderImplementation.computeAllNonDeclaredProperties(), noReorderImplementation.getDeclaredProperties());
        }

        private final List<SimpleFunctionDescriptor> computeAllNonDeclaredFunctions() {
            Set<Name> nonDeclaredFunctionNames = this.this$0.getNonDeclaredFunctionNames();
            ArrayList arrayList = new ArrayList();
            Iterator<T> it = nonDeclaredFunctionNames.iterator();
            while (it.hasNext()) {
                y41.i(computeNonDeclaredFunctionsForName((Name) it.next()), arrayList);
            }
            return arrayList;
        }

        private final List<PropertyDescriptor> computeAllNonDeclaredProperties() {
            Set<Name> nonDeclaredVariableNames = this.this$0.getNonDeclaredVariableNames();
            ArrayList arrayList = new ArrayList();
            Iterator<T> it = nonDeclaredVariableNames.iterator();
            while (it.hasNext()) {
                y41.i(computeNonDeclaredPropertiesForName((Name) it.next()), arrayList);
            }
            return arrayList;
        }

        /* JADX INFO: Access modifiers changed from: private */
        public final List<SimpleFunctionDescriptor> computeFunctions() {
            List<ProtoBuf.Function> list = this.functionList;
            DeserializedMemberScope deserializedMemberScope = this.this$0;
            ArrayList arrayList = new ArrayList();
            Iterator<T> it = list.iterator();
            while (it.hasNext()) {
                SimpleFunctionDescriptor simpleFunctionDescriptorLoadFunction = deserializedMemberScope.getC().getMemberDeserializer().loadFunction((ProtoBuf.Function) ((MessageLite) it.next()));
                if (!deserializedMemberScope.isDeclaredFunctionAvailable(simpleFunctionDescriptorLoadFunction)) {
                    simpleFunctionDescriptorLoadFunction = null;
                }
                if (simpleFunctionDescriptorLoadFunction != null) {
                    arrayList.add(simpleFunctionDescriptorLoadFunction);
                }
            }
            return arrayList;
        }

        private final List<SimpleFunctionDescriptor> computeNonDeclaredFunctionsForName(Name name) {
            List<SimpleFunctionDescriptor> declaredFunctions = getDeclaredFunctions();
            DeserializedMemberScope deserializedMemberScope = this.this$0;
            ArrayList arrayList = new ArrayList();
            for (Object obj : declaredFunctions) {
                if (cr4.b(((DeclarationDescriptor) obj).getName(), name)) {
                    arrayList.add(obj);
                }
            }
            int size = arrayList.size();
            deserializedMemberScope.computeNonDeclaredFunctions(name, arrayList);
            return arrayList.subList(size, arrayList.size());
        }

        private final List<PropertyDescriptor> computeNonDeclaredPropertiesForName(Name name) {
            List<PropertyDescriptor> declaredProperties = getDeclaredProperties();
            DeserializedMemberScope deserializedMemberScope = this.this$0;
            ArrayList arrayList = new ArrayList();
            for (Object obj : declaredProperties) {
                if (cr4.b(((DeclarationDescriptor) obj).getName(), name)) {
                    arrayList.add(obj);
                }
            }
            int size = arrayList.size();
            deserializedMemberScope.computeNonDeclaredProperties(name, arrayList);
            return arrayList.subList(size, arrayList.size());
        }

        /* JADX INFO: Access modifiers changed from: private */
        public final List<PropertyDescriptor> computeProperties() {
            List<ProtoBuf.Property> list = this.propertyList;
            DeserializedMemberScope deserializedMemberScope = this.this$0;
            ArrayList arrayList = new ArrayList();
            Iterator<T> it = list.iterator();
            while (it.hasNext()) {
                PropertyDescriptor propertyDescriptorLoadProperty = deserializedMemberScope.getC().getMemberDeserializer().loadProperty((ProtoBuf.Property) ((MessageLite) it.next()));
                if (propertyDescriptorLoadProperty != null) {
                    arrayList.add(propertyDescriptorLoadProperty);
                }
            }
            return arrayList;
        }

        /* JADX INFO: Access modifiers changed from: private */
        public final List<TypeAliasDescriptor> computeTypeAliases() {
            List<ProtoBuf.TypeAlias> list = this.typeAliasList;
            DeserializedMemberScope deserializedMemberScope = this.this$0;
            ArrayList arrayList = new ArrayList();
            Iterator<T> it = list.iterator();
            while (it.hasNext()) {
                TypeAliasDescriptor typeAliasDescriptorLoadTypeAlias = deserializedMemberScope.getC().getMemberDeserializer().loadTypeAlias((ProtoBuf.TypeAlias) ((MessageLite) it.next()));
                if (typeAliasDescriptorLoadTypeAlias != null) {
                    arrayList.add(typeAliasDescriptorLoadTypeAlias);
                }
            }
            return arrayList;
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final Set functionNames_delegate$lambda$12(NoReorderImplementation noReorderImplementation, DeserializedMemberScope deserializedMemberScope) {
            List<ProtoBuf.Function> list = noReorderImplementation.functionList;
            LinkedHashSet linkedHashSet = new LinkedHashSet();
            DeserializedMemberScope deserializedMemberScope2 = noReorderImplementation.this$0;
            Iterator<T> it = list.iterator();
            while (it.hasNext()) {
                linkedHashSet.add(NameResolverUtilKt.getName(deserializedMemberScope2.getC().getNameResolver(), ((ProtoBuf.Function) ((MessageLite) it.next())).getName()));
            }
            return km8.f(linkedHashSet, deserializedMemberScope.getNonDeclaredFunctionNames());
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final Map functionsByName_delegate$lambda$8(NoReorderImplementation noReorderImplementation) {
            List<SimpleFunctionDescriptor> allFunctions = noReorderImplementation.getAllFunctions();
            LinkedHashMap linkedHashMap = new LinkedHashMap();
            for (Object obj : allFunctions) {
                Name name = ((SimpleFunctionDescriptor) obj).getName();
                cr4.f(name, "getName(...)");
                Object arrayList = linkedHashMap.get(name);
                if (arrayList == null) {
                    arrayList = new ArrayList();
                    linkedHashMap.put(name, arrayList);
                }
                ((List) arrayList).add(obj);
            }
            return linkedHashMap;
        }

        private final List<SimpleFunctionDescriptor> getAllFunctions() {
            return (List) StorageKt.getValue(this.allFunctions$delegate, this, (KProperty<?>) $$delegatedProperties[3]);
        }

        private final List<PropertyDescriptor> getAllProperties() {
            return (List) StorageKt.getValue(this.allProperties$delegate, this, (KProperty<?>) $$delegatedProperties[4]);
        }

        private final List<TypeAliasDescriptor> getAllTypeAliases() {
            return (List) StorageKt.getValue(this.allTypeAliases$delegate, this, (KProperty<?>) $$delegatedProperties[2]);
        }

        private final List<SimpleFunctionDescriptor> getDeclaredFunctions() {
            return (List) StorageKt.getValue(this.declaredFunctions$delegate, this, (KProperty<?>) $$delegatedProperties[0]);
        }

        private final List<PropertyDescriptor> getDeclaredProperties() {
            return (List) StorageKt.getValue(this.declaredProperties$delegate, this, (KProperty<?>) $$delegatedProperties[1]);
        }

        private final Map<Name, Collection<SimpleFunctionDescriptor>> getFunctionsByName() {
            return (Map) StorageKt.getValue(this.functionsByName$delegate, this, (KProperty<?>) $$delegatedProperties[6]);
        }

        private final Map<Name, Collection<PropertyDescriptor>> getPropertiesByName() {
            return (Map) StorageKt.getValue(this.propertiesByName$delegate, this, (KProperty<?>) $$delegatedProperties[7]);
        }

        private final Map<Name, TypeAliasDescriptor> getTypeAliasesByName() {
            return (Map) StorageKt.getValue(this.typeAliasesByName$delegate, this, (KProperty<?>) $$delegatedProperties[5]);
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final Map propertiesByName_delegate$lambda$10(NoReorderImplementation noReorderImplementation) {
            List<PropertyDescriptor> allProperties = noReorderImplementation.getAllProperties();
            LinkedHashMap linkedHashMap = new LinkedHashMap();
            for (Object obj : allProperties) {
                Name name = ((PropertyDescriptor) obj).getName();
                cr4.f(name, "getName(...)");
                Object arrayList = linkedHashMap.get(name);
                if (arrayList == null) {
                    arrayList = new ArrayList();
                    linkedHashMap.put(name, arrayList);
                }
                ((List) arrayList).add(obj);
            }
            return linkedHashMap;
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final Map typeAliasesByName_delegate$lambda$6(NoReorderImplementation noReorderImplementation) {
            List<TypeAliasDescriptor> allTypeAliases = noReorderImplementation.getAllTypeAliases();
            int iH = wo5.h(y41.p(allTypeAliases, 10));
            if (iH < 16) {
                iH = 16;
            }
            LinkedHashMap linkedHashMap = new LinkedHashMap(iH);
            for (Object obj : allTypeAliases) {
                Name name = ((TypeAliasDescriptor) obj).getName();
                cr4.f(name, "getName(...)");
                linkedHashMap.put(name, obj);
            }
            return linkedHashMap;
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final Set variableNames_delegate$lambda$14(NoReorderImplementation noReorderImplementation, DeserializedMemberScope deserializedMemberScope) {
            List<ProtoBuf.Property> list = noReorderImplementation.propertyList;
            LinkedHashSet linkedHashSet = new LinkedHashSet();
            DeserializedMemberScope deserializedMemberScope2 = noReorderImplementation.this$0;
            Iterator<T> it = list.iterator();
            while (it.hasNext()) {
                linkedHashSet.add(NameResolverUtilKt.getName(deserializedMemberScope2.getC().getNameResolver(), ((ProtoBuf.Property) ((MessageLite) it.next())).getName()));
            }
            return km8.f(linkedHashSet, deserializedMemberScope.getNonDeclaredVariableNames());
        }

        /* JADX WARN: Multi-variable type inference failed */
        @Override // kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope.Implementation
        public void addFunctionsAndPropertiesTo(@kp6 Collection<DeclarationDescriptor> collection, @kp6 DescriptorKindFilter descriptorKindFilter, @kp6 sq3<? super Name, Boolean> sq3Var, @kp6 LookupLocation lookupLocation) {
            cr4.g(collection, "result");
            cr4.g(descriptorKindFilter, "kindFilter");
            cr4.g(sq3Var, "nameFilter");
            cr4.g(lookupLocation, "location");
            if (descriptorKindFilter.acceptsKinds(DescriptorKindFilter.Companion.getVARIABLES_MASK())) {
                for (Object obj : getAllProperties()) {
                    Name name = ((PropertyDescriptor) obj).getName();
                    cr4.f(name, "getName(...)");
                    if (((Boolean) sq3Var.invoke(name)).booleanValue()) {
                        collection.add(obj);
                    }
                }
            }
            if (descriptorKindFilter.acceptsKinds(DescriptorKindFilter.Companion.getFUNCTIONS_MASK())) {
                for (Object obj2 : getAllFunctions()) {
                    Name name2 = ((SimpleFunctionDescriptor) obj2).getName();
                    cr4.f(name2, "getName(...)");
                    if (((Boolean) sq3Var.invoke(name2)).booleanValue()) {
                        collection.add(obj2);
                    }
                }
            }
        }

        @Override // kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope.Implementation
        @kp6
        public Collection<SimpleFunctionDescriptor> getContributedFunctions(@kp6 Name name, @kp6 LookupLocation lookupLocation) {
            Collection<SimpleFunctionDescriptor> collection;
            cr4.g(name, AppMeasurementSdk.ConditionalUserProperty.NAME);
            cr4.g(lookupLocation, "location");
            boolean zContains = getFunctionNames().contains(name);
            ik2 ik2Var = ik2.a;
            return (zContains && (collection = getFunctionsByName().get(name)) != null) ? collection : ik2Var;
        }

        @Override // kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope.Implementation
        @kp6
        public Collection<PropertyDescriptor> getContributedVariables(@kp6 Name name, @kp6 LookupLocation lookupLocation) {
            Collection<PropertyDescriptor> collection;
            cr4.g(name, AppMeasurementSdk.ConditionalUserProperty.NAME);
            cr4.g(lookupLocation, "location");
            boolean zContains = getVariableNames().contains(name);
            ik2 ik2Var = ik2.a;
            return (zContains && (collection = getPropertiesByName().get(name)) != null) ? collection : ik2Var;
        }

        @Override // kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope.Implementation
        @kp6
        public Set<Name> getFunctionNames() {
            return (Set) StorageKt.getValue(this.functionNames$delegate, this, (KProperty<?>) $$delegatedProperties[8]);
        }

        @Override // kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope.Implementation
        @pq6
        public TypeAliasDescriptor getTypeAliasByName(@kp6 Name name) {
            cr4.g(name, AppMeasurementSdk.ConditionalUserProperty.NAME);
            return getTypeAliasesByName().get(name);
        }

        @Override // kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope.Implementation
        @kp6
        public Set<Name> getTypeAliasNames() {
            List<ProtoBuf.TypeAlias> list = this.typeAliasList;
            LinkedHashSet linkedHashSet = new LinkedHashSet();
            DeserializedMemberScope deserializedMemberScope = this.this$0;
            Iterator<T> it = list.iterator();
            while (it.hasNext()) {
                linkedHashSet.add(NameResolverUtilKt.getName(deserializedMemberScope.getC().getNameResolver(), ((ProtoBuf.TypeAlias) ((MessageLite) it.next())).getName()));
            }
            return linkedHashSet;
        }

        @Override // kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope.Implementation
        @kp6
        public Set<Name> getVariableNames() {
            return (Set) StorageKt.getValue(this.variableNames$delegate, this, (KProperty<?>) $$delegatedProperties[9]);
        }
    }

    @vx8
    public final class OptimizedImplementation implements Implementation {
        static final /* synthetic */ KProperty<Object>[] $$delegatedProperties;

        @kp6
        private final NotNullLazyValue functionNames$delegate;

        @kp6
        private final Map<Name, byte[]> functionProtosBytes;

        @kp6
        private final MemoizedFunctionToNotNull<Name, Collection<SimpleFunctionDescriptor>> functions;

        @kp6
        private final MemoizedFunctionToNotNull<Name, Collection<PropertyDescriptor>> properties;

        @kp6
        private final Map<Name, byte[]> propertyProtosBytes;
        final /* synthetic */ DeserializedMemberScope this$0;

        @kp6
        private final MemoizedFunctionToNullable<Name, TypeAliasDescriptor> typeAliasByName;

        @kp6
        private final Map<Name, byte[]> typeAliasBytes;

        @kp6
        private final NotNullLazyValue variableNames$delegate;

        static {
            hk7 hk7Var = new hk7(OptimizedImplementation.class, "functionNames", "getFunctionNames()Ljava/util/Set;", 0);
            kw7 kw7Var = iw7.a;
            $$delegatedProperties = new KProperty[]{kw7Var.property1(hk7Var), n41.w(OptimizedImplementation.class, "variableNames", "getVariableNames()Ljava/util/Set;", 0, kw7Var)};
        }

        public OptimizedImplementation(@kp6 DeserializedMemberScope deserializedMemberScope, @kp6 List<ProtoBuf.Function> list, @kp6 List<ProtoBuf.Property> list2, List<ProtoBuf.TypeAlias> list3) throws IOException {
            Map<Name, byte[]> mapPackToByteArray;
            cr4.g(list, "functionList");
            cr4.g(list2, "propertyList");
            cr4.g(list3, "typeAliasList");
            this.this$0 = deserializedMemberScope;
            LinkedHashMap linkedHashMap = new LinkedHashMap();
            for (Object obj : list) {
                Name name = NameResolverUtilKt.getName(deserializedMemberScope.getC().getNameResolver(), ((ProtoBuf.Function) ((MessageLite) obj)).getName());
                Object arrayList = linkedHashMap.get(name);
                if (arrayList == null) {
                    arrayList = new ArrayList();
                    linkedHashMap.put(name, arrayList);
                }
                ((List) arrayList).add(obj);
            }
            this.functionProtosBytes = packToByteArray(linkedHashMap);
            DeserializedMemberScope deserializedMemberScope2 = this.this$0;
            LinkedHashMap linkedHashMap2 = new LinkedHashMap();
            for (Object obj2 : list2) {
                Name name2 = NameResolverUtilKt.getName(deserializedMemberScope2.getC().getNameResolver(), ((ProtoBuf.Property) ((MessageLite) obj2)).getName());
                Object arrayList2 = linkedHashMap2.get(name2);
                if (arrayList2 == null) {
                    arrayList2 = new ArrayList();
                    linkedHashMap2.put(name2, arrayList2);
                }
                ((List) arrayList2).add(obj2);
            }
            this.propertyProtosBytes = packToByteArray(linkedHashMap2);
            if (this.this$0.getC().getComponents().getConfiguration().getTypeAliasesAllowed()) {
                DeserializedMemberScope deserializedMemberScope3 = this.this$0;
                LinkedHashMap linkedHashMap3 = new LinkedHashMap();
                for (Object obj3 : list3) {
                    Name name3 = NameResolverUtilKt.getName(deserializedMemberScope3.getC().getNameResolver(), ((ProtoBuf.TypeAlias) ((MessageLite) obj3)).getName());
                    Object arrayList3 = linkedHashMap3.get(name3);
                    if (arrayList3 == null) {
                        arrayList3 = new ArrayList();
                        linkedHashMap3.put(name3, arrayList3);
                    }
                    ((List) arrayList3).add(obj3);
                }
                mapPackToByteArray = packToByteArray(linkedHashMap3);
            } else {
                mapPackToByteArray = jk2.a;
            }
            this.typeAliasBytes = mapPackToByteArray;
            this.functions = this.this$0.getC().getStorageManager().createMemoizedFunction(new sq3(this) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$OptimizedImplementation$$Lambda$0
                private final DeserializedMemberScope.OptimizedImplementation arg$0;

                {
                    this.arg$0 = this;
                }

                @Override // defpackage.sq3
                public Object invoke(Object obj4) {
                    return DeserializedMemberScope.OptimizedImplementation.functions$lambda$5(this.arg$0, (Name) obj4);
                }
            });
            this.properties = this.this$0.getC().getStorageManager().createMemoizedFunction(new sq3(this) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$OptimizedImplementation$$Lambda$1
                private final DeserializedMemberScope.OptimizedImplementation arg$0;

                {
                    this.arg$0 = this;
                }

                @Override // defpackage.sq3
                public Object invoke(Object obj4) {
                    return DeserializedMemberScope.OptimizedImplementation.properties$lambda$6(this.arg$0, (Name) obj4);
                }
            });
            this.typeAliasByName = this.this$0.getC().getStorageManager().createMemoizedFunctionWithNullableValues(new sq3(this) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$OptimizedImplementation$$Lambda$2
                private final DeserializedMemberScope.OptimizedImplementation arg$0;

                {
                    this.arg$0 = this;
                }

                @Override // defpackage.sq3
                public Object invoke(Object obj4) {
                    return DeserializedMemberScope.OptimizedImplementation.typeAliasByName$lambda$7(this.arg$0, (Name) obj4);
                }
            });
            StorageManager storageManager = this.this$0.getC().getStorageManager();
            final DeserializedMemberScope deserializedMemberScope4 = this.this$0;
            this.functionNames$delegate = storageManager.createLazyValue(new qq3(this, deserializedMemberScope4) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$OptimizedImplementation$$Lambda$3
                private final DeserializedMemberScope.OptimizedImplementation arg$0;
                private final DeserializedMemberScope arg$1;

                {
                    this.arg$0 = this;
                    this.arg$1 = deserializedMemberScope4;
                }

                @Override // defpackage.qq3
                public Object invoke() {
                    return DeserializedMemberScope.OptimizedImplementation.functionNames_delegate$lambda$8(this.arg$0, this.arg$1);
                }
            });
            StorageManager storageManager2 = this.this$0.getC().getStorageManager();
            final DeserializedMemberScope deserializedMemberScope5 = this.this$0;
            this.variableNames$delegate = storageManager2.createLazyValue(new qq3(this, deserializedMemberScope5) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$OptimizedImplementation$$Lambda$4
                private final DeserializedMemberScope.OptimizedImplementation arg$0;
                private final DeserializedMemberScope arg$1;

                {
                    this.arg$0 = this;
                    this.arg$1 = deserializedMemberScope5;
                }

                @Override // defpackage.qq3
                public Object invoke() {
                    return DeserializedMemberScope.OptimizedImplementation.variableNames_delegate$lambda$9(this.arg$0, this.arg$1);
                }
            });
        }

        private final Collection<SimpleFunctionDescriptor> computeFunctions(Name name) {
            Map<Name, byte[]> map = this.functionProtosBytes;
            Parser<ProtoBuf.Function> parser = ProtoBuf.Function.PARSER;
            cr4.f(parser, "PARSER");
            DeserializedMemberScope deserializedMemberScope = this.this$0;
            byte[] bArr = map.get(name);
            Collection<ProtoBuf.Function> collectionS = bArr != null ? sg8.s(sg8.k(new DeserializedMemberScope$OptimizedImplementation$computeDescriptors$1$1(parser, new ByteArrayInputStream(bArr), this.this$0))) : ik2.a;
            ArrayList arrayList = new ArrayList(collectionS.size());
            for (ProtoBuf.Function function : collectionS) {
                MemberDeserializer memberDeserializer = deserializedMemberScope.getC().getMemberDeserializer();
                cr4.d(function);
                SimpleFunctionDescriptor simpleFunctionDescriptorLoadFunction = memberDeserializer.loadFunction(function);
                if (!deserializedMemberScope.isDeclaredFunctionAvailable(simpleFunctionDescriptorLoadFunction)) {
                    simpleFunctionDescriptorLoadFunction = null;
                }
                if (simpleFunctionDescriptorLoadFunction != null) {
                    arrayList.add(simpleFunctionDescriptorLoadFunction);
                }
            }
            deserializedMemberScope.computeNonDeclaredFunctions(name, arrayList);
            return CollectionsKt.compact(arrayList);
        }

        private final Collection<PropertyDescriptor> computeProperties(Name name) {
            Map<Name, byte[]> map = this.propertyProtosBytes;
            Parser<ProtoBuf.Property> parser = ProtoBuf.Property.PARSER;
            cr4.f(parser, "PARSER");
            DeserializedMemberScope deserializedMemberScope = this.this$0;
            byte[] bArr = map.get(name);
            Collection<ProtoBuf.Property> collectionS = bArr != null ? sg8.s(sg8.k(new DeserializedMemberScope$OptimizedImplementation$computeDescriptors$1$1(parser, new ByteArrayInputStream(bArr), this.this$0))) : ik2.a;
            ArrayList arrayList = new ArrayList(collectionS.size());
            for (ProtoBuf.Property property : collectionS) {
                MemberDeserializer memberDeserializer = deserializedMemberScope.getC().getMemberDeserializer();
                cr4.d(property);
                PropertyDescriptor propertyDescriptorLoadProperty = memberDeserializer.loadProperty(property);
                if (propertyDescriptorLoadProperty != null) {
                    arrayList.add(propertyDescriptorLoadProperty);
                }
            }
            deserializedMemberScope.computeNonDeclaredProperties(name, arrayList);
            return CollectionsKt.compact(arrayList);
        }

        private final TypeAliasDescriptor createTypeAlias(Name name) {
            ProtoBuf.TypeAlias delimitedFrom;
            byte[] bArr = this.typeAliasBytes.get(name);
            if (bArr == null || (delimitedFrom = ProtoBuf.TypeAlias.parseDelimitedFrom(new ByteArrayInputStream(bArr), this.this$0.getC().getComponents().getExtensionRegistryLite())) == null) {
                return null;
            }
            return this.this$0.getC().getMemberDeserializer().loadTypeAlias(delimitedFrom);
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final Set functionNames_delegate$lambda$8(OptimizedImplementation optimizedImplementation, DeserializedMemberScope deserializedMemberScope) {
            return km8.f(optimizedImplementation.functionProtosBytes.keySet(), deserializedMemberScope.getNonDeclaredFunctionNames());
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final Collection functions$lambda$5(OptimizedImplementation optimizedImplementation, Name name) {
            cr4.g(name, "it");
            return optimizedImplementation.computeFunctions(name);
        }

        private final Map<Name, byte[]> packToByteArray(Map<Name, ? extends Collection<? extends AbstractMessageLite>> map) throws IOException {
            LinkedHashMap linkedHashMap = new LinkedHashMap(wo5.h(map.size()));
            Iterator<T> it = map.entrySet().iterator();
            while (it.hasNext()) {
                Map.Entry entry = (Map.Entry) it.next();
                Object key = entry.getKey();
                ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                Iterable iterable = (Iterable) entry.getValue();
                ArrayList arrayList = new ArrayList(y41.p(iterable, 10));
                Iterator it2 = iterable.iterator();
                while (it2.hasNext()) {
                    ((AbstractMessageLite) it2.next()).writeDelimitedTo(byteArrayOutputStream);
                    arrayList.add(e6a.a);
                }
                linkedHashMap.put(key, byteArrayOutputStream.toByteArray());
            }
            return linkedHashMap;
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final Collection properties$lambda$6(OptimizedImplementation optimizedImplementation, Name name) {
            cr4.g(name, "it");
            return optimizedImplementation.computeProperties(name);
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final TypeAliasDescriptor typeAliasByName$lambda$7(OptimizedImplementation optimizedImplementation, Name name) {
            cr4.g(name, "it");
            return optimizedImplementation.createTypeAlias(name);
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final Set variableNames_delegate$lambda$9(OptimizedImplementation optimizedImplementation, DeserializedMemberScope deserializedMemberScope) {
            return km8.f(optimizedImplementation.propertyProtosBytes.keySet(), deserializedMemberScope.getNonDeclaredVariableNames());
        }

        @Override // kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope.Implementation
        public void addFunctionsAndPropertiesTo(@kp6 Collection<DeclarationDescriptor> collection, @kp6 DescriptorKindFilter descriptorKindFilter, @kp6 sq3<? super Name, Boolean> sq3Var, @kp6 LookupLocation lookupLocation) {
            cr4.g(collection, "result");
            cr4.g(descriptorKindFilter, "kindFilter");
            cr4.g(sq3Var, "nameFilter");
            cr4.g(lookupLocation, "location");
            if (descriptorKindFilter.acceptsKinds(DescriptorKindFilter.Companion.getVARIABLES_MASK())) {
                Set<Name> variableNames = getVariableNames();
                ArrayList arrayList = new ArrayList();
                for (Name name : variableNames) {
                    if (((Boolean) sq3Var.invoke(name)).booleanValue()) {
                        arrayList.addAll(getContributedVariables(name, lookupLocation));
                    }
                }
                MemberComparator.NameAndTypeMemberComparator nameAndTypeMemberComparator = MemberComparator.NameAndTypeMemberComparator.INSTANCE;
                cr4.f(nameAndTypeMemberComparator, "INSTANCE");
                y41.bh(arrayList, nameAndTypeMemberComparator);
                collection.addAll(arrayList);
            }
            if (descriptorKindFilter.acceptsKinds(DescriptorKindFilter.Companion.getFUNCTIONS_MASK())) {
                Set<Name> functionNames = getFunctionNames();
                ArrayList arrayList2 = new ArrayList();
                for (Name name2 : functionNames) {
                    if (((Boolean) sq3Var.invoke(name2)).booleanValue()) {
                        arrayList2.addAll(getContributedFunctions(name2, lookupLocation));
                    }
                }
                MemberComparator.NameAndTypeMemberComparator nameAndTypeMemberComparator2 = MemberComparator.NameAndTypeMemberComparator.INSTANCE;
                cr4.f(nameAndTypeMemberComparator2, "INSTANCE");
                y41.bh(arrayList2, nameAndTypeMemberComparator2);
                collection.addAll(arrayList2);
            }
        }

        @Override // kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope.Implementation
        @kp6
        public Collection<SimpleFunctionDescriptor> getContributedFunctions(@kp6 Name name, @kp6 LookupLocation lookupLocation) {
            cr4.g(name, AppMeasurementSdk.ConditionalUserProperty.NAME);
            cr4.g(lookupLocation, "location");
            return !getFunctionNames().contains(name) ? ik2.a : (Collection) this.functions.invoke(name);
        }

        @Override // kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope.Implementation
        @kp6
        public Collection<PropertyDescriptor> getContributedVariables(@kp6 Name name, @kp6 LookupLocation lookupLocation) {
            cr4.g(name, AppMeasurementSdk.ConditionalUserProperty.NAME);
            cr4.g(lookupLocation, "location");
            return !getVariableNames().contains(name) ? ik2.a : (Collection) this.properties.invoke(name);
        }

        @Override // kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope.Implementation
        @kp6
        public Set<Name> getFunctionNames() {
            return (Set) StorageKt.getValue(this.functionNames$delegate, this, (KProperty<?>) $$delegatedProperties[0]);
        }

        @Override // kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope.Implementation
        @pq6
        public TypeAliasDescriptor getTypeAliasByName(@kp6 Name name) {
            cr4.g(name, AppMeasurementSdk.ConditionalUserProperty.NAME);
            return (TypeAliasDescriptor) this.typeAliasByName.invoke(name);
        }

        @Override // kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope.Implementation
        @kp6
        public Set<Name> getTypeAliasNames() {
            return this.typeAliasBytes.keySet();
        }

        @Override // kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope.Implementation
        @kp6
        public Set<Name> getVariableNames() {
            return (Set) StorageKt.getValue(this.variableNames$delegate, this, (KProperty<?>) $$delegatedProperties[1]);
        }
    }

    static {
        hk7 hk7Var = new hk7(DeserializedMemberScope.class, "classNames", "getClassNames$deserialization()Ljava/util/Set;", 0);
        kw7 kw7Var = iw7.a;
        $$delegatedProperties = new KProperty[]{kw7Var.property1(hk7Var), n41.w(DeserializedMemberScope.class, "classifierNamesLazy", "getClassifierNamesLazy()Ljava/util/Set;", 0, kw7Var)};
    }

    public DeserializedMemberScope(@kp6 DeserializationContext deserializationContext, @kp6 List<ProtoBuf.Function> list, @kp6 List<ProtoBuf.Property> list2, @kp6 List<ProtoBuf.TypeAlias> list3, @kp6 final qq3<? extends Collection<Name>> qq3Var) {
        cr4.g(deserializationContext, "c");
        cr4.g(list, "functionList");
        cr4.g(list2, "propertyList");
        cr4.g(list3, "typeAliasList");
        cr4.g(qq3Var, "classNames");
        this.c = deserializationContext;
        this.impl = createImplementation(list, list2, list3);
        this.classNames$delegate = deserializationContext.getStorageManager().createLazyValue(new qq3(qq3Var) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$$Lambda$0
            private final qq3 arg$0;

            {
                this.arg$0 = qq3Var;
            }

            @Override // defpackage.qq3
            public Object invoke() {
                return DeserializedMemberScope.classNames_delegate$lambda$0(this.arg$0);
            }
        });
        this.classifierNamesLazy$delegate = deserializationContext.getStorageManager().createNullableLazyValue(new qq3(this) { // from class: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope$$Lambda$1
            private final DeserializedMemberScope arg$0;

            {
                this.arg$0 = this;
            }

            @Override // defpackage.qq3
            public Object invoke() {
                return DeserializedMemberScope.classifierNamesLazy_delegate$lambda$1(this.arg$0);
            }
        });
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Set classNames_delegate$lambda$0(qq3 qq3Var) {
        return y41.br((Iterable) qq3Var.invoke());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Set classifierNamesLazy_delegate$lambda$1(DeserializedMemberScope deserializedMemberScope) {
        Set<Name> nonDeclaredClassifierNames = deserializedMemberScope.getNonDeclaredClassifierNames();
        if (nonDeclaredClassifierNames == null) {
            return null;
        }
        return km8.f(km8.f(deserializedMemberScope.getClassNames$deserialization(), deserializedMemberScope.impl.getTypeAliasNames()), nonDeclaredClassifierNames);
    }

    private final Implementation createImplementation(List<ProtoBuf.Function> list, List<ProtoBuf.Property> list2, List<ProtoBuf.TypeAlias> list3) {
        return this.c.getComponents().getConfiguration().getPreserveDeclarationsOrdering() ? new NoReorderImplementation(this, list, list2, list3) : new OptimizedImplementation(this, list, list2, list3);
    }

    private final ClassDescriptor deserializeClass(Name name) {
        return this.c.getComponents().deserializeClass(createClassId(name));
    }

    private final Set<Name> getClassifierNamesLazy() {
        return (Set) StorageKt.getValue(this.classifierNamesLazy$delegate, this, (KProperty<?>) $$delegatedProperties[1]);
    }

    private final TypeAliasDescriptor getTypeAliasByName(Name name) {
        return this.impl.getTypeAliasByName(name);
    }

    public abstract void addEnumEntryDescriptors(@kp6 Collection<DeclarationDescriptor> collection, @kp6 sq3<? super Name, Boolean> sq3Var);

    @kp6
    public final Collection<DeclarationDescriptor> computeDescriptors(@kp6 DescriptorKindFilter descriptorKindFilter, @kp6 sq3<? super Name, Boolean> sq3Var, @kp6 LookupLocation lookupLocation) {
        cr4.g(descriptorKindFilter, "kindFilter");
        cr4.g(sq3Var, "nameFilter");
        cr4.g(lookupLocation, "location");
        ArrayList arrayList = new ArrayList(0);
        DescriptorKindFilter.Companion companion = DescriptorKindFilter.Companion;
        if (descriptorKindFilter.acceptsKinds(companion.getSINGLETON_CLASSIFIERS_MASK())) {
            addEnumEntryDescriptors(arrayList, sq3Var);
        }
        this.impl.addFunctionsAndPropertiesTo(arrayList, descriptorKindFilter, sq3Var, lookupLocation);
        if (descriptorKindFilter.acceptsKinds(companion.getCLASSIFIERS_MASK())) {
            for (Name name : getClassNames$deserialization()) {
                if (((Boolean) sq3Var.invoke(name)).booleanValue()) {
                    CollectionsKt.addIfNotNull(arrayList, deserializeClass(name));
                }
            }
        }
        if (descriptorKindFilter.acceptsKinds(DescriptorKindFilter.Companion.getTYPE_ALIASES_MASK())) {
            for (Name name2 : this.impl.getTypeAliasNames()) {
                if (((Boolean) sq3Var.invoke(name2)).booleanValue()) {
                    CollectionsKt.addIfNotNull(arrayList, this.impl.getTypeAliasByName(name2));
                }
            }
        }
        return CollectionsKt.compact(arrayList);
    }

    public void computeNonDeclaredFunctions(@kp6 Name name, @kp6 List<SimpleFunctionDescriptor> list) {
        cr4.g(name, AppMeasurementSdk.ConditionalUserProperty.NAME);
        cr4.g(list, "functions");
    }

    public void computeNonDeclaredProperties(@kp6 Name name, @kp6 List<PropertyDescriptor> list) {
        cr4.g(name, AppMeasurementSdk.ConditionalUserProperty.NAME);
        cr4.g(list, "descriptors");
    }

    @kp6
    public abstract ClassId createClassId(@kp6 Name name);

    @kp6
    public final DeserializationContext getC() {
        return this.c;
    }

    @kp6
    public final Set<Name> getClassNames$deserialization() {
        return (Set) StorageKt.getValue(this.classNames$delegate, this, (KProperty<?>) $$delegatedProperties[0]);
    }

    @Override // kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScopeImpl, kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScope
    @pq6
    public Set<Name> getClassifierNames() {
        return getClassifierNamesLazy();
    }

    @Override // kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScopeImpl, kotlin.reflect.jvm.internal.impl.resolve.scopes.ResolutionScope
    @pq6
    /* JADX INFO: renamed from: getContributedClassifier */
    public ClassifierDescriptor mo172getContributedClassifier(@kp6 Name name, @kp6 LookupLocation lookupLocation) {
        cr4.g(name, AppMeasurementSdk.ConditionalUserProperty.NAME);
        cr4.g(lookupLocation, "location");
        if (hasClass(name)) {
            return deserializeClass(name);
        }
        if (this.impl.getTypeAliasNames().contains(name)) {
            return getTypeAliasByName(name);
        }
        return null;
    }

    @Override // kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScopeImpl, kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScope, kotlin.reflect.jvm.internal.impl.resolve.scopes.ResolutionScope
    @kp6
    public Collection<SimpleFunctionDescriptor> getContributedFunctions(@kp6 Name name, @kp6 LookupLocation lookupLocation) {
        cr4.g(name, AppMeasurementSdk.ConditionalUserProperty.NAME);
        cr4.g(lookupLocation, "location");
        return this.impl.getContributedFunctions(name, lookupLocation);
    }

    @Override // kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScopeImpl, kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScope
    @kp6
    public Collection<PropertyDescriptor> getContributedVariables(@kp6 Name name, @kp6 LookupLocation lookupLocation) {
        cr4.g(name, AppMeasurementSdk.ConditionalUserProperty.NAME);
        cr4.g(lookupLocation, "location");
        return this.impl.getContributedVariables(name, lookupLocation);
    }

    @Override // kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScopeImpl, kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScope
    @kp6
    public Set<Name> getFunctionNames() {
        return this.impl.getFunctionNames();
    }

    @pq6
    public abstract Set<Name> getNonDeclaredClassifierNames();

    @kp6
    public abstract Set<Name> getNonDeclaredFunctionNames();

    @kp6
    public abstract Set<Name> getNonDeclaredVariableNames();

    @Override // kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScopeImpl, kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScope
    @kp6
    public Set<Name> getVariableNames() {
        return this.impl.getVariableNames();
    }

    public boolean hasClass(@kp6 Name name) {
        cr4.g(name, AppMeasurementSdk.ConditionalUserProperty.NAME);
        return getClassNames$deserialization().contains(name);
    }

    public boolean isDeclaredFunctionAvailable(@kp6 SimpleFunctionDescriptor simpleFunctionDescriptor) {
        cr4.g(simpleFunctionDescriptor, "function");
        return true;
    }
}
