package hp;

/* loaded from: classes3.dex */
public final class o extends q implements m, jp.e {

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

    /* renamed from: q, reason: collision with root package name */
    private final m0 f21990q;

    /* renamed from: r, reason: collision with root package name */
    private final boolean f21991r;

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

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

        private final boolean a(s1 s1Var) {
            s1Var.K0();
            return (s1Var.K0().p() instanceof tn.e1) || (s1Var instanceof kotlin.reflect.jvm.internal.impl.types.checker.i);
        }

        public static /* synthetic */ o c(a aVar, s1 s1Var, boolean z10, boolean z11, int i10, Object obj) {
            if ((i10 & 2) != 0) {
                z10 = false;
            }
            if ((i10 & 4) != 0) {
                z11 = false;
            }
            return aVar.b(s1Var, z10, z11);
        }

        private final boolean d(s1 s1Var, boolean z10) {
            boolean z11 = false;
            if (!a(s1Var)) {
                return false;
            }
            tn.h p10 = s1Var.K0().p();
            vn.k0 k0Var = p10 instanceof vn.k0 ? (vn.k0) p10 : null;
            if (k0Var != null && !k0Var.Q0()) {
                z11 = true;
            }
            if (z11) {
                return true;
            }
            return (z10 && (s1Var.K0().p() instanceof tn.e1)) ? p1.l(s1Var) : !kotlin.reflect.jvm.internal.impl.types.checker.n.f26447a.a(s1Var);
        }

        public final o b(s1 type, boolean z10, boolean z11) {
            kotlin.jvm.internal.t.g(type, "type");
            if (type instanceof o) {
                return (o) type;
            }
            kotlin.jvm.internal.k kVar = null;
            if (!z11 && !d(type, z10)) {
                return null;
            }
            if (type instanceof y) {
                y yVar = (y) type;
                kotlin.jvm.internal.t.b(yVar.S0().K0(), yVar.T0().K0());
            }
            return new o(b0.c(type).O0(false), z10, kVar);
        }
    }

    public /* synthetic */ o(m0 m0Var, boolean z10, kotlin.jvm.internal.k kVar) {
        this(m0Var, z10);
    }

    @Override // hp.q, hp.e0
    public boolean L0() {
        return false;
    }

    @Override // hp.s1
    /* renamed from: R0 */
    public m0 O0(boolean z10) {
        return z10 ? T0().O0(z10) : this;
    }

    @Override // hp.s1
    /* renamed from: S0 */
    public m0 Q0(z0 newAttributes) {
        kotlin.jvm.internal.t.g(newAttributes, "newAttributes");
        return new o(T0().Q0(newAttributes), this.f21991r);
    }

    @Override // hp.q
    protected m0 T0() {
        return this.f21990q;
    }

    public final m0 W0() {
        return this.f21990q;
    }

    @Override // hp.q
    /* renamed from: X0, reason: merged with bridge method [inline-methods] */
    public o V0(m0 delegate) {
        kotlin.jvm.internal.t.g(delegate, "delegate");
        return new o(delegate, this.f21991r);
    }

    @Override // hp.m
    public e0 q0(e0 replacement) {
        kotlin.jvm.internal.t.g(replacement, "replacement");
        return q0.e(replacement.N0(), this.f21991r);
    }

    @Override // hp.m0
    public String toString() {
        return T0() + " & Any";
    }

    @Override // hp.m
    public boolean x0() {
        T0().K0();
        return T0().K0().p() instanceof tn.e1;
    }

    private o(m0 m0Var, boolean z10) {
        this.f21990q = m0Var;
        this.f21991r = z10;
    }
}
