package bo;

import bo.i0;
import java.util.List;
import ko.o;
import tn.i1;
import to.g;

/* loaded from: classes3.dex */
public final class t implements to.g {

    /* renamed from: a, reason: collision with root package name */
    public static final a f7163a = new a(null);

    /* loaded from: classes3.dex */
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(kotlin.jvm.internal.k kVar) {
            this();
        }

        private final boolean b(tn.y yVar) {
            Object D0;
            if (yVar.i().size() != 1) {
                return false;
            }
            tn.m b10 = yVar.b();
            tn.e eVar = b10 instanceof tn.e ? (tn.e) b10 : null;
            if (eVar == null) {
                return false;
            }
            List i10 = yVar.i();
            kotlin.jvm.internal.t.f(i10, "getValueParameters(...)");
            D0 = sm.c0.D0(i10);
            tn.h p10 = ((i1) D0).getType().K0().p();
            tn.e eVar2 = p10 instanceof tn.e ? (tn.e) p10 : null;
            return eVar2 != null && qn.g.r0(eVar) && kotlin.jvm.internal.t.b(xo.c.l(eVar), xo.c.l(eVar2));
        }

        private final ko.o c(tn.y yVar, i1 i1Var) {
            if (ko.y.e(yVar) || b(yVar)) {
                hp.e0 type = i1Var.getType();
                kotlin.jvm.internal.t.f(type, "getType(...)");
                return ko.y.g(kp.a.w(type));
            }
            hp.e0 type2 = i1Var.getType();
            kotlin.jvm.internal.t.f(type2, "getType(...)");
            return ko.y.g(type2);
        }

        public final boolean a(tn.a superDescriptor, tn.a subDescriptor) {
            List<rm.v> b12;
            kotlin.jvm.internal.t.g(superDescriptor, "superDescriptor");
            kotlin.jvm.internal.t.g(subDescriptor, "subDescriptor");
            if ((subDescriptor instanceof p002do.e) && (superDescriptor instanceof tn.y)) {
                p002do.e eVar = (p002do.e) subDescriptor;
                eVar.i().size();
                tn.y yVar = (tn.y) superDescriptor;
                yVar.i().size();
                List i10 = eVar.a().i();
                kotlin.jvm.internal.t.f(i10, "getValueParameters(...)");
                List i11 = yVar.a().i();
                kotlin.jvm.internal.t.f(i11, "getValueParameters(...)");
                b12 = sm.c0.b1(i10, i11);
                for (rm.v vVar : b12) {
                    i1 i1Var = (i1) vVar.a();
                    i1 i1Var2 = (i1) vVar.b();
                    kotlin.jvm.internal.t.d(i1Var);
                    boolean z10 = c((tn.y) subDescriptor, i1Var) instanceof o.d;
                    kotlin.jvm.internal.t.d(i1Var2);
                    if (z10 != (c(yVar, i1Var2) instanceof o.d)) {
                        return true;
                    }
                }
            }
            return false;
        }
    }

    private final boolean c(tn.a aVar, tn.a aVar2, tn.e eVar) {
        if ((aVar instanceof tn.b) && (aVar2 instanceof tn.y) && !qn.g.g0(aVar2)) {
            f fVar = f.f7113o;
            tn.y yVar = (tn.y) aVar2;
            ro.f name = yVar.getName();
            kotlin.jvm.internal.t.f(name, "getName(...)");
            if (!fVar.l(name)) {
                i0.a aVar3 = i0.f7127a;
                ro.f name2 = yVar.getName();
                kotlin.jvm.internal.t.f(name2, "getName(...)");
                if (!aVar3.k(name2)) {
                    return false;
                }
            }
            tn.b e10 = h0.e((tn.b) aVar);
            boolean z10 = aVar instanceof tn.y;
            tn.y yVar2 = z10 ? (tn.y) aVar : null;
            if ((!(yVar2 != null && yVar.s0() == yVar2.s0())) && (e10 == null || !yVar.s0())) {
                return true;
            }
            if ((eVar instanceof p002do.c) && yVar.Y() == null && e10 != null && !h0.f(eVar, e10)) {
                if ((e10 instanceof tn.y) && z10 && f.k((tn.y) e10) != null) {
                    String c10 = ko.y.c(yVar, false, false, 2, null);
                    tn.y a10 = ((tn.y) aVar).a();
                    kotlin.jvm.internal.t.f(a10, "getOriginal(...)");
                    if (kotlin.jvm.internal.t.b(c10, ko.y.c(a10, false, false, 2, null))) {
                        return false;
                    }
                }
                return true;
            }
        }
        return false;
    }

    @Override // to.g
    public g.a a() {
        return g.a.CONFLICTS_ONLY;
    }

    @Override // to.g
    public g.b b(tn.a superDescriptor, tn.a subDescriptor, tn.e eVar) {
        kotlin.jvm.internal.t.g(superDescriptor, "superDescriptor");
        kotlin.jvm.internal.t.g(subDescriptor, "subDescriptor");
        if (!c(superDescriptor, subDescriptor, eVar) && !f7163a.a(superDescriptor, subDescriptor)) {
            return g.b.UNKNOWN;
        }
        return g.b.INCOMPATIBLE;
    }
}
