package androidx.compose.runtime;

import V4.C;
import V4.E;
import m3.AbstractC2467b;
import w4.C3137A;

/* JADX INFO: loaded from: classes.dex */
public final class RecomposerKt {
    public static final int recomposerKey = 1000;
    private static final Object ProduceAnotherFrame = new Object();
    private static final Object FramePending = new Object();

    /* JADX INFO: renamed from: androidx.compose.runtime.RecomposerKt$withRunningRecomposer$2, reason: invalid class name */
    @C4.e(c = "androidx.compose.runtime.RecomposerKt$withRunningRecomposer$2", f = "Recomposer.kt", l = {101, 103}, m = "invokeSuspend", v = 1)
    public static final class AnonymousClass2 extends C4.j implements J4.e {
        final /* synthetic */ J4.f $block;
        private /* synthetic */ Object L$0;
        int label;

        /* JADX INFO: renamed from: androidx.compose.runtime.RecomposerKt$withRunningRecomposer$2$1, reason: invalid class name */
        @C4.e(c = "androidx.compose.runtime.RecomposerKt$withRunningRecomposer$2$1", f = "Recomposer.kt", l = {100}, m = "invokeSuspend", v = 1)
        public static final class AnonymousClass1 extends C4.j implements J4.e {
            final /* synthetic */ Recomposer $recomposer;
            int label;

            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            public AnonymousClass1(Recomposer recomposer, A4.d dVar) {
                super(2, dVar);
                this.$recomposer = recomposer;
            }

            @Override // C4.a
            public final A4.d create(Object obj, A4.d dVar) {
                return new AnonymousClass1(this.$recomposer, dVar);
            }

            @Override // J4.e
            public final Object invoke(C c6, A4.d dVar) {
                return ((AnonymousClass1) create(c6, dVar)).invokeSuspend(C3137A.f25453a);
            }

            @Override // C4.a
            public final Object invokeSuspend(Object obj) {
                B4.a aVar = B4.a.f492a;
                int i6 = this.label;
                if (i6 == 0) {
                    AbstractC2467b.l(obj);
                    Recomposer recomposer = this.$recomposer;
                    this.label = 1;
                    if (recomposer.runRecomposeAndApplyChanges(this) == aVar) {
                        return aVar;
                    }
                } else {
                    if (i6 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    AbstractC2467b.l(obj);
                }
                return C3137A.f25453a;
            }
        }

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public AnonymousClass2(J4.f fVar, A4.d dVar) {
            super(2, dVar);
            this.$block = fVar;
        }

        @Override // C4.a
        public final A4.d create(Object obj, A4.d dVar) {
            AnonymousClass2 anonymousClass2 = new AnonymousClass2(this.$block, dVar);
            anonymousClass2.L$0 = obj;
            return anonymousClass2;
        }

        @Override // J4.e
        public final Object invoke(C c6, A4.d dVar) {
            return ((AnonymousClass2) create(c6, dVar)).invokeSuspend(C3137A.f25453a);
        }

        @Override // C4.a
        public final Object invokeSuspend(Object obj) {
            Recomposer recomposer;
            B4.a aVar = B4.a.f492a;
            int i6 = this.label;
            if (i6 == 0) {
                AbstractC2467b.l(obj);
                C c6 = (C) this.L$0;
                recomposer = new Recomposer(c6.getCoroutineContext());
                E.y(c6, null, null, new AnonymousClass1(recomposer, null), 3);
                J4.f fVar = this.$block;
                this.L$0 = recomposer;
                this.label = 1;
                obj = fVar.invoke(c6, recomposer, this);
                if (obj != aVar) {
                }
            }
            if (i6 != 1) {
                if (i6 != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                Object obj2 = this.L$0;
                AbstractC2467b.l(obj);
                return obj2;
            }
            recomposer = (Recomposer) this.L$0;
            AbstractC2467b.l(obj);
            recomposer.close();
            this.L$0 = obj;
            this.label = 2;
            return recomposer.join(this) == aVar ? aVar : obj;
        }
    }

    private static final long getRecomposerCompoundHashKey() {
        return 1000;
    }

    public static final <R> Object withRunningRecomposer(J4.f fVar, A4.d dVar) {
        return E.k(new AnonymousClass2(fVar, null), dVar);
    }
}
