package ko;

import bo.h0;
import java.util.Iterator;
import java.util.List;
import ko.o;
import qn.j;
import tn.i1;
import tn.w0;
import tn.y0;

/* loaded from: classes3.dex */
public abstract class y {
    private static final void a(StringBuilder sb2, hp.e0 e0Var) {
        sb2.append(g(e0Var));
    }

    public static final String b(tn.y yVar, boolean z10, boolean z11) {
        String e10;
        kotlin.jvm.internal.t.g(yVar, "<this>");
        StringBuilder sb2 = new StringBuilder();
        if (z11) {
            if (yVar instanceof tn.l) {
                e10 = "<init>";
            } else {
                e10 = yVar.getName().e();
                kotlin.jvm.internal.t.f(e10, "asString(...)");
            }
            sb2.append(e10);
        }
        sb2.append("(");
        w0 g02 = yVar.g0();
        if (g02 != null) {
            hp.e0 type = g02.getType();
            kotlin.jvm.internal.t.f(type, "getType(...)");
            a(sb2, type);
        }
        Iterator it = yVar.i().iterator();
        while (it.hasNext()) {
            hp.e0 type2 = ((i1) it.next()).getType();
            kotlin.jvm.internal.t.f(type2, "getType(...)");
            a(sb2, type2);
        }
        sb2.append(")");
        if (z10) {
            if (g.c(yVar)) {
                sb2.append("V");
            } else {
                hp.e0 returnType = yVar.getReturnType();
                kotlin.jvm.internal.t.d(returnType);
                a(sb2, returnType);
            }
        }
        String sb3 = sb2.toString();
        kotlin.jvm.internal.t.f(sb3, "toString(...)");
        return sb3;
    }

    public static /* synthetic */ String c(tn.y yVar, boolean z10, boolean z11, int i10, Object obj) {
        if ((i10 & 1) != 0) {
            z10 = true;
        }
        if ((i10 & 2) != 0) {
            z11 = true;
        }
        return b(yVar, z10, z11);
    }

    public static final String d(tn.a aVar) {
        kotlin.jvm.internal.t.g(aVar, "<this>");
        a0 a0Var = a0.f26060a;
        if (to.f.E(aVar)) {
            return null;
        }
        tn.m b10 = aVar.b();
        tn.e eVar = b10 instanceof tn.e ? (tn.e) b10 : null;
        if (eVar == null || eVar.getName().t()) {
            return null;
        }
        tn.a a10 = aVar.a();
        y0 y0Var = a10 instanceof y0 ? (y0) a10 : null;
        if (y0Var == null) {
            return null;
        }
        return x.a(a0Var, eVar, c(y0Var, false, false, 3, null));
    }

    public static final boolean e(tn.a f10) {
        Object D0;
        tn.y k10;
        Object D02;
        kotlin.jvm.internal.t.g(f10, "f");
        if (!(f10 instanceof tn.y)) {
            return false;
        }
        tn.y yVar = (tn.y) f10;
        if (!kotlin.jvm.internal.t.b(yVar.getName().e(), "remove") || yVar.i().size() != 1 || h0.h((tn.b) f10)) {
            return false;
        }
        List i10 = yVar.a().i();
        kotlin.jvm.internal.t.f(i10, "getValueParameters(...)");
        D0 = sm.c0.D0(i10);
        hp.e0 type = ((i1) D0).getType();
        kotlin.jvm.internal.t.f(type, "getType(...)");
        o g10 = g(type);
        o.d dVar = g10 instanceof o.d ? (o.d) g10 : null;
        if ((dVar != null ? dVar.i() : null) != yo.e.INT || (k10 = bo.f.k(yVar)) == null) {
            return false;
        }
        List i11 = k10.a().i();
        kotlin.jvm.internal.t.f(i11, "getValueParameters(...)");
        D02 = sm.c0.D0(i11);
        hp.e0 type2 = ((i1) D02).getType();
        kotlin.jvm.internal.t.f(type2, "getType(...)");
        o g11 = g(type2);
        tn.m b10 = k10.b();
        kotlin.jvm.internal.t.f(b10, "getContainingDeclaration(...)");
        return kotlin.jvm.internal.t.b(xo.c.m(b10), j.a.f33993d0.j()) && (g11 instanceof o.c) && kotlin.jvm.internal.t.b(((o.c) g11).i(), "java/lang/Object");
    }

    public static final String f(tn.e eVar) {
        kotlin.jvm.internal.t.g(eVar, "<this>");
        sn.c cVar = sn.c.f35881a;
        ro.d j10 = xo.c.l(eVar).j();
        kotlin.jvm.internal.t.f(j10, "toUnsafe(...)");
        ro.b n10 = cVar.n(j10);
        if (n10 == null) {
            return g.b(eVar, null, 2, null);
        }
        String f10 = yo.d.b(n10).f();
        kotlin.jvm.internal.t.f(f10, "getInternalName(...)");
        return f10;
    }

    public static final o g(hp.e0 e0Var) {
        kotlin.jvm.internal.t.g(e0Var, "<this>");
        return (o) g.e(e0Var, q.f26150a, d0.f26075o, c0.f26067a, null, null, 32, null);
    }
}
