package r0;

import q2.m0;
import r0.k;
import rm.n0;

/* loaded from: classes.dex */
public abstract class x {

    /* loaded from: classes.dex */
    static final class a extends kotlin.jvm.internal.v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ kotlin.jvm.internal.k0 f34291p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        a(kotlin.jvm.internal.k0 k0Var) {
            super(1);
            this.f34291p = k0Var;
        }

        public final void a(j jVar) {
            if (jVar.c().length() > 0) {
                this.f34291p.f26193p = false;
            }
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((j) obj);
            return n0.f34904a;
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final b3.i b(q2.j0 j0Var, int i10) {
        return e(j0Var, i10) ? j0Var.y(i10) : j0Var.c(i10);
    }

    public static final w c(q2.j0 j0Var, int i10, int i11, int i12, long j10, boolean z10, boolean z11) {
        return new d0(z11, 1, 1, z10 ? null : new k(new k.a(b(j0Var, m0.n(j10)), m0.n(j10), 1L), new k.a(b(j0Var, m0.i(j10)), m0.i(j10), 1L), m0.m(j10)), new j(1L, 1, i10, i11, i12, j0Var));
    }

    public static final boolean d(k kVar, w wVar) {
        if (kVar == null || wVar == null) {
            return true;
        }
        if (kVar.e().d() == kVar.c().d()) {
            return kVar.e().c() == kVar.c().c();
        }
        if ((kVar.d() ? kVar.e() : kVar.c()).c() != 0) {
            return false;
        }
        if (wVar.e().l() != (kVar.d() ? kVar.c() : kVar.e()).c()) {
            return false;
        }
        kotlin.jvm.internal.k0 k0Var = new kotlin.jvm.internal.k0();
        k0Var.f26193p = true;
        wVar.f(new a(k0Var));
        return k0Var.f26193p;
    }

    private static final boolean e(q2.j0 j0Var, int i10) {
        if (!(j0Var.l().j().length() == 0)) {
            int q10 = j0Var.q(i10);
            if (!((i10 == 0 || q10 != j0Var.q(i10 + (-1))) && (i10 == j0Var.l().j().length() || q10 != j0Var.q(i10 + 1)))) {
                return false;
            }
        }
        return true;
    }
}
