package rn;

import gp.n;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import kotlin.jvm.internal.t;
import kotlin.text.y;
import kotlin.text.z;
import rn.g;
import sm.c0;
import sm.x0;
import tn.g0;

/* loaded from: classes3.dex */
public final class a implements un.b {

    /* renamed from: a, reason: collision with root package name */
    private final n f34917a;

    /* renamed from: b, reason: collision with root package name */
    private final g0 f34918b;

    public a(n storageManager, g0 module) {
        t.g(storageManager, "storageManager");
        t.g(module, "module");
        this.f34917a = storageManager;
        this.f34918b = module;
    }

    @Override // un.b
    public Collection a(ro.c packageFqName) {
        Set d10;
        t.g(packageFqName, "packageFqName");
        d10 = x0.d();
        return d10;
    }

    @Override // un.b
    public tn.e b(ro.b classId) {
        boolean U;
        Object e02;
        Object c02;
        t.g(classId, "classId");
        if (classId.k() || classId.l()) {
            return null;
        }
        String b10 = classId.i().b();
        t.f(b10, "asString(...)");
        U = z.U(b10, "Function", false, 2, null);
        if (!U) {
            return null;
        }
        ro.c h10 = classId.h();
        t.f(h10, "getPackageFqName(...)");
        g.b c10 = g.f34934c.a().c(h10, b10);
        if (c10 == null) {
            return null;
        }
        f a10 = c10.a();
        int b11 = c10.b();
        List E = this.f34918b.M(h10).E();
        ArrayList arrayList = new ArrayList();
        for (Object obj : E) {
            if (obj instanceof qn.b) {
                arrayList.add(obj);
            }
        }
        ArrayList arrayList2 = new ArrayList();
        Iterator it = arrayList.iterator();
        while (it.hasNext()) {
            it.next();
        }
        e02 = c0.e0(arrayList2);
        android.support.v4.media.session.b.a(e02);
        c02 = c0.c0(arrayList);
        return new b(this.f34917a, (qn.b) c02, a10, b11);
    }

    @Override // un.b
    public boolean c(ro.c packageFqName, ro.f name) {
        boolean P;
        boolean P2;
        boolean P3;
        boolean P4;
        t.g(packageFqName, "packageFqName");
        t.g(name, "name");
        String e10 = name.e();
        t.f(e10, "asString(...)");
        P = y.P(e10, "Function", false, 2, null);
        if (!P) {
            P2 = y.P(e10, "KFunction", false, 2, null);
            if (!P2) {
                P3 = y.P(e10, "SuspendFunction", false, 2, null);
                if (!P3) {
                    P4 = y.P(e10, "KSuspendFunction", false, 2, null);
                    if (!P4) {
                        return false;
                    }
                }
            }
        }
        return g.f34934c.a().c(packageFqName, e10) != null;
    }
}
