package tn;

/* loaded from: classes3.dex */
public abstract class s {
    public static final h a(m mVar) {
        kotlin.jvm.internal.t.g(mVar, "<this>");
        m b10 = mVar.b();
        if (b10 == null || (mVar instanceof k0)) {
            return null;
        }
        if (!b(b10)) {
            return a(b10);
        }
        if (b10 instanceof h) {
            return (h) b10;
        }
        return null;
    }

    public static final boolean b(m mVar) {
        kotlin.jvm.internal.t.g(mVar, "<this>");
        return mVar.b() instanceof k0;
    }

    public static final boolean c(y yVar) {
        hp.m0 q10;
        hp.e0 y10;
        hp.e0 returnType;
        kotlin.jvm.internal.t.g(yVar, "<this>");
        m b10 = yVar.b();
        e eVar = b10 instanceof e ? (e) b10 : null;
        if (eVar == null) {
            return false;
        }
        e eVar2 = to.h.g(eVar) ? eVar : null;
        if (eVar2 == null || (q10 = eVar2.q()) == null || (y10 = kp.a.y(q10)) == null || (returnType = yVar.getReturnType()) == null || !kotlin.jvm.internal.t.b(yVar.getName(), mp.q.f29610e)) {
            return false;
        }
        if ((!kp.a.n(returnType) && !kp.a.o(returnType)) || yVar.i().size() != 1) {
            return false;
        }
        hp.e0 type = ((i1) yVar.i().get(0)).getType();
        kotlin.jvm.internal.t.f(type, "getType(...)");
        return kotlin.jvm.internal.t.b(kp.a.y(type), y10) && yVar.m0().isEmpty() && yVar.g0() == null;
    }

    public static final e d(g0 g0Var, ro.c fqName, ao.b lookupLocation) {
        h hVar;
        ap.h v02;
        kotlin.jvm.internal.t.g(g0Var, "<this>");
        kotlin.jvm.internal.t.g(fqName, "fqName");
        kotlin.jvm.internal.t.g(lookupLocation, "lookupLocation");
        if (fqName.d()) {
            return null;
        }
        ro.c e10 = fqName.e();
        kotlin.jvm.internal.t.f(e10, "parent(...)");
        ap.h o10 = g0Var.M(e10).o();
        ro.f g10 = fqName.g();
        kotlin.jvm.internal.t.f(g10, "shortName(...)");
        h e11 = o10.e(g10, lookupLocation);
        e eVar = e11 instanceof e ? (e) e11 : null;
        if (eVar != null) {
            return eVar;
        }
        ro.c e12 = fqName.e();
        kotlin.jvm.internal.t.f(e12, "parent(...)");
        e d10 = d(g0Var, e12, lookupLocation);
        if (d10 == null || (v02 = d10.v0()) == null) {
            hVar = null;
        } else {
            ro.f g11 = fqName.g();
            kotlin.jvm.internal.t.f(g11, "shortName(...)");
            hVar = v02.e(g11, lookupLocation);
        }
        if (hVar instanceof e) {
            return (e) hVar;
        }
        return null;
    }
}
