package y0;

/* loaded from: classes.dex */
public abstract class l3 extends j1.y implements j1.q {

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

    /* renamed from: r, reason: collision with root package name */
    private a f51618r;

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public static final class a extends j1.z {

        /* renamed from: c, reason: collision with root package name */
        private Object f51619c;

        public a(Object obj) {
            this.f51619c = obj;
        }

        @Override // j1.z
        public void c(j1.z zVar) {
            kotlin.jvm.internal.t.e(zVar, "null cannot be cast to non-null type androidx.compose.runtime.SnapshotMutableStateImpl.StateStateRecord<T of androidx.compose.runtime.SnapshotMutableStateImpl.StateStateRecord>");
            this.f51619c = ((a) zVar).f51619c;
        }

        @Override // j1.z
        public j1.z d() {
            return new a(this.f51619c);
        }

        public final Object i() {
            return this.f51619c;
        }

        public final void j(Object obj) {
            this.f51619c = obj;
        }
    }

    /* loaded from: classes.dex */
    static final class b extends kotlin.jvm.internal.v implements dn.l {
        b() {
            super(1);
        }

        public final void a(Object obj) {
            l3.this.setValue(obj);
        }

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

    public l3(Object obj, m3 m3Var) {
        this.f51617q = m3Var;
        a aVar = new a(obj);
        if (j1.k.f23492e.e()) {
            a aVar2 = new a(obj);
            aVar2.h(1);
            aVar.g(aVar2);
        }
        this.f51618r = aVar;
    }

    @Override // j1.q
    public m3 c() {
        return this.f51617q;
    }

    @Override // y0.q1
    public dn.l e() {
        return new b();
    }

    @Override // j1.x
    public j1.z g() {
        return this.f51618r;
    }

    @Override // y0.q1, y0.y3
    public Object getValue() {
        return ((a) j1.p.X(this.f51618r, this)).i();
    }

    @Override // j1.x
    public j1.z m(j1.z zVar, j1.z zVar2, j1.z zVar3) {
        kotlin.jvm.internal.t.e(zVar, "null cannot be cast to non-null type androidx.compose.runtime.SnapshotMutableStateImpl.StateStateRecord<T of androidx.compose.runtime.SnapshotMutableStateImpl>");
        a aVar = (a) zVar;
        kotlin.jvm.internal.t.e(zVar2, "null cannot be cast to non-null type androidx.compose.runtime.SnapshotMutableStateImpl.StateStateRecord<T of androidx.compose.runtime.SnapshotMutableStateImpl>");
        a aVar2 = (a) zVar2;
        kotlin.jvm.internal.t.e(zVar3, "null cannot be cast to non-null type androidx.compose.runtime.SnapshotMutableStateImpl.StateStateRecord<T of androidx.compose.runtime.SnapshotMutableStateImpl>");
        a aVar3 = (a) zVar3;
        if (c().a(aVar2.i(), aVar3.i())) {
            return zVar2;
        }
        Object b10 = c().b(aVar.i(), aVar2.i(), aVar3.i());
        if (b10 == null) {
            return null;
        }
        j1.z d10 = aVar3.d();
        kotlin.jvm.internal.t.e(d10, "null cannot be cast to non-null type androidx.compose.runtime.SnapshotMutableStateImpl.StateStateRecord<T of androidx.compose.runtime.SnapshotMutableStateImpl.mergeRecords$lambda$4>");
        ((a) d10).j(b10);
        return d10;
    }

    @Override // y0.q1
    public Object o() {
        return getValue();
    }

    @Override // j1.x
    public void r(j1.z zVar) {
        kotlin.jvm.internal.t.e(zVar, "null cannot be cast to non-null type androidx.compose.runtime.SnapshotMutableStateImpl.StateStateRecord<T of androidx.compose.runtime.SnapshotMutableStateImpl>");
        this.f51618r = (a) zVar;
    }

    @Override // y0.q1
    public void setValue(Object obj) {
        j1.k c10;
        a aVar = (a) j1.p.F(this.f51618r);
        if (c().a(aVar.i(), obj)) {
            return;
        }
        a aVar2 = this.f51618r;
        j1.p.J();
        synchronized (j1.p.I()) {
            c10 = j1.k.f23492e.c();
            ((a) j1.p.S(aVar2, this, c10, aVar)).j(obj);
            rm.n0 n0Var = rm.n0.f34904a;
        }
        j1.p.Q(c10, this);
    }

    public String toString() {
        return "MutableState(value=" + ((a) j1.p.F(this.f51618r)).i() + ")@" + hashCode();
    }
}
