package androidx.compose.runtime;

import B.B0;
import V4.C;
import V4.C0763h0;
import V4.C0769k0;
import V4.C0772m;
import V4.E;
import V4.InterfaceC0765i0;
import V4.InterfaceC0770l;
import V4.InterfaceC0782u;
import V4.u0;
import Y4.C0851q;
import Y4.H;
import Y4.InterfaceC0843i;
import Y4.a0;
import Y4.c0;
import Z4.w;
import a.AbstractC0872a;
import androidx.compose.runtime.Recomposer;
import androidx.compose.runtime.collection.MultiValueMap;
import androidx.compose.runtime.collection.MutableVector;
import androidx.compose.runtime.collection.ScatterSetWrapper;
import androidx.compose.runtime.collection.ScatterSetWrapperKt;
import androidx.compose.runtime.external.kotlinx.collections.immutable.ExtensionsKt;
import androidx.compose.runtime.external.kotlinx.collections.immutable.PersistentSet;
import androidx.compose.runtime.internal.SnapshotThreadLocal;
import androidx.compose.runtime.internal.StabilityInferred;
import androidx.compose.runtime.internal.Trace;
import androidx.compose.runtime.internal.Utils_androidKt;
import androidx.compose.runtime.snapshots.MutableSnapshot;
import androidx.compose.runtime.snapshots.ObserverHandle;
import androidx.compose.runtime.snapshots.ReaderKind;
import androidx.compose.runtime.snapshots.Snapshot;
import androidx.compose.runtime.snapshots.SnapshotApplyResult;
import androidx.compose.runtime.snapshots.StateObjectImpl;
import androidx.compose.runtime.snapshots.TransparentObserverMutableSnapshot;
import androidx.compose.runtime.snapshots.TransparentObserverSnapshot;
import androidx.compose.runtime.tooling.ComposeStackTraceMode;
import androidx.compose.runtime.tooling.CompositionData;
import androidx.compose.runtime.tooling.CompositionObserverHandle;
import androidx.compose.runtime.tooling.CompositionObserverKt;
import androidx.compose.runtime.tooling.CompositionRegistrationObserver;
import androidx.compose.runtime.tooling.ObservableComposition;
import androidx.media3.exoplayer.analytics.AnalyticsListener;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CancellationException;
import java.util.concurrent.atomic.AtomicReference;
import m3.AbstractC2467b;
import n.J;
import n.N;
import n.O;
import n.U;
import n.V;
import n.X;
import n.Z;
import n2.AbstractC2613d;
import w4.C3137A;
import w4.InterfaceC3141c;
import x4.AbstractC3250p;
import x4.AbstractC3251q;
import x4.AbstractC3257w;
import x4.y;

/* JADX INFO: loaded from: classes.dex */
@StabilityInferred(parameters = 0)
public final class Recomposer extends CompositionContext {
    private final List<ControlledComposition> _knownCompositions;
    private List<? extends ControlledComposition> _knownCompositionsCache;
    private final H _state;
    private final BroadcastFrameClock broadcastFrameClock;
    private long changeCount;
    private Throwable closeCause;
    private final MutableVector<ControlledComposition> compositionInvalidations;
    private final List<ControlledComposition> compositionsAwaitingApply;
    private Set<ControlledComposition> compositionsRemoved;
    private int concurrentCompositionsOutstanding;
    private final A4.j effectCoroutineContext;
    private final InterfaceC0782u effectJob;
    private RecomposerErrorState errorState;
    private List<ControlledComposition> failedCompositions;
    private boolean frameClockPaused;
    private boolean isClosed;
    private final List<MovableContentStateReference> movableContentAwaitingInsert;
    private final N movableContentNestedExtractionsPending;
    private final NestedContentMap movableContentNestedStatesAvailable;
    private final N movableContentRemoved;
    private final N movableContentStatesAvailable;
    private final NextFrameEndCallbackQueue nextFrameEndCallbackQueue;
    private final SnapshotThreadLocal<O> pausedScopes;
    private final RecomposerInfoImpl recomposerInfo;
    private J registrationObservers;
    private InterfaceC0765i0 runnerJob;
    private O snapshotInvalidations;
    private final Object stateLock;
    private InterfaceC0770l workContinuation;
    public static final Companion Companion = new Companion(null);
    public static final int $stable = 8;
    private static final H _runningRecomposers = Y4.O.c(ExtensionsKt.persistentSetOf());
    private static final AtomicReference<Boolean> _hotReloadEnabled = new AtomicReference<>(Boolean.FALSE);

    public static final class Companion {
        public /* synthetic */ Companion(kotlin.jvm.internal.h hVar) {
            this();
        }

        /* JADX INFO: Access modifiers changed from: private */
        public final void addRunning(RecomposerInfoImpl recomposerInfoImpl) {
            PersistentSet persistentSet;
            PersistentSet persistentSetAdd;
            do {
                persistentSet = (PersistentSet) ((c0) Recomposer._runningRecomposers).getValue();
                persistentSetAdd = persistentSet.add(recomposerInfoImpl);
                if (persistentSet == persistentSetAdd) {
                    return;
                }
            } while (!((c0) Recomposer._runningRecomposers).i(persistentSet, persistentSetAdd));
        }

        /* JADX INFO: Access modifiers changed from: private */
        public final void removeRunning(RecomposerInfoImpl recomposerInfoImpl) {
            PersistentSet persistentSet;
            PersistentSet persistentSetRemove;
            do {
                persistentSet = (PersistentSet) ((c0) Recomposer._runningRecomposers).getValue();
                persistentSetRemove = persistentSet.remove(recomposerInfoImpl);
                if (persistentSet == persistentSetRemove) {
                    return;
                }
            } while (!((c0) Recomposer._runningRecomposers).i(persistentSet, persistentSetRemove));
        }

        public final void clearErrors$runtime() {
            Iterable iterable = (Iterable) ((c0) Recomposer._runningRecomposers).getValue();
            ArrayList arrayList = new ArrayList();
            Iterator it = iterable.iterator();
            while (it.hasNext()) {
                RecomposerErrorState recomposerErrorStateResetErrorState = ((RecomposerInfoImpl) it.next()).resetErrorState();
                if (recomposerErrorStateResetErrorState != null) {
                    arrayList.add(recomposerErrorStateResetErrorState);
                }
            }
        }

        public final Set<RecomposerInfo> currentRunningRecomposers$runtime() {
            return (Set) ((c0) Recomposer._runningRecomposers).getValue();
        }

        public final List<RecomposerErrorInfo> getCurrentErrors$runtime() {
            Iterable iterable = (Iterable) ((c0) Recomposer._runningRecomposers).getValue();
            ArrayList arrayList = new ArrayList();
            Iterator it = iterable.iterator();
            while (it.hasNext()) {
                RecomposerErrorInfo currentError = ((RecomposerInfoImpl) it.next()).getCurrentError();
                if (currentError != null) {
                    arrayList.add(currentError);
                }
            }
            return arrayList;
        }

        public final a0 getRunningRecomposers() {
            return Recomposer._runningRecomposers;
        }

        public final void invalidateGroupsWithKey$runtime(int i6) {
            Recomposer._hotReloadEnabled.set(Boolean.TRUE);
            for (RecomposerInfoImpl recomposerInfoImpl : (Iterable) ((c0) Recomposer._runningRecomposers).getValue()) {
                RecomposerErrorInfo currentError = recomposerInfoImpl.getCurrentError();
                if (currentError == null || currentError.getRecoverable()) {
                    recomposerInfoImpl.resetErrorState();
                    recomposerInfoImpl.invalidateGroupsWithKey(i6);
                    recomposerInfoImpl.retryFailedCompositions();
                }
            }
        }

        public final void loadStateAndComposeForHotReload$runtime(Object obj) {
            Recomposer._hotReloadEnabled.set(Boolean.TRUE);
            Iterator it = ((Iterable) ((c0) Recomposer._runningRecomposers).getValue()).iterator();
            while (it.hasNext()) {
                ((RecomposerInfoImpl) it.next()).resetErrorState();
            }
            kotlin.jvm.internal.o.f(obj, "null cannot be cast to non-null type kotlin.collections.List<androidx.compose.runtime.Recomposer.HotReloadable>");
            List list = (List) obj;
            int size = list.size();
            for (int i6 = 0; i6 < size; i6++) {
                ((HotReloadable) list.get(i6)).resetContent();
            }
            int size2 = list.size();
            for (int i7 = 0; i7 < size2; i7++) {
                ((HotReloadable) list.get(i7)).recompose();
            }
            Iterator it2 = ((Iterable) ((c0) Recomposer._runningRecomposers).getValue()).iterator();
            while (it2.hasNext()) {
                ((RecomposerInfoImpl) it2.next()).retryFailedCompositions();
            }
        }

        public final Object saveStateAndDisposeForHotReload$runtime() {
            Recomposer._hotReloadEnabled.set(Boolean.TRUE);
            Iterable iterable = (Iterable) ((c0) Recomposer._runningRecomposers).getValue();
            ArrayList arrayList = new ArrayList();
            Iterator it = iterable.iterator();
            while (it.hasNext()) {
                AbstractC3257w.L(((RecomposerInfoImpl) it.next()).saveStateAndDisposeForHotReload(), arrayList);
            }
            return arrayList;
        }

        public final void setHotReloadEnabled$runtime(boolean z6) {
            Recomposer._hotReloadEnabled.set(Boolean.valueOf(z6));
        }

        private Companion() {
        }
    }

    public static final class HotReloadable {
        private J4.e composable;
        private final CompositionImpl composition;

        public HotReloadable(CompositionImpl compositionImpl) {
            this.composition = compositionImpl;
            this.composable = compositionImpl.getComposable();
        }

        public final void clearContent() {
            if (this.composition.isRoot()) {
                this.composition.setContent(ComposableSingletons$RecomposerKt.INSTANCE.m17getLambda$1091980426$runtime());
            }
        }

        public final void recompose() {
            if (this.composition.isRoot()) {
                this.composition.setContent(this.composable);
            }
        }

        public final void resetContent() {
            this.composition.setComposable(this.composable);
        }
    }

    public static final class RecomposerErrorState implements RecomposerErrorInfo {
        private final Throwable cause;
        private final boolean recoverable;

        public RecomposerErrorState(boolean z6, Throwable th) {
            this.recoverable = z6;
            this.cause = th;
        }

        @Override // androidx.compose.runtime.RecomposerErrorInfo
        public Throwable getCause() {
            return this.cause;
        }

        @Override // androidx.compose.runtime.RecomposerErrorInfo
        public boolean getRecoverable() {
            return this.recoverable;
        }
    }

    public final class RecomposerInfoImpl implements RecomposerInfo {
        public RecomposerInfoImpl() {
        }

        @Override // androidx.compose.runtime.RecomposerInfo
        public long getChangeCount() {
            return Recomposer.this.getChangeCount();
        }

        public final RecomposerErrorInfo getCurrentError() {
            RecomposerErrorState recomposerErrorState;
            Object obj = Recomposer.this.stateLock;
            Recomposer recomposer = Recomposer.this;
            synchronized (obj) {
                recomposerErrorState = recomposer.errorState;
            }
            return recomposerErrorState;
        }

        @Override // androidx.compose.runtime.RecomposerInfo
        public boolean getHasPendingWork() {
            return Recomposer.this.getHasPendingWork();
        }

        @Override // androidx.compose.runtime.RecomposerInfo
        public InterfaceC0843i getState() {
            return Recomposer.this.getCurrentState();
        }

        public final void invalidateGroupsWithKey(int i6) {
            List listKnownCompositions = Recomposer.this.knownCompositions();
            ArrayList arrayList = new ArrayList(listKnownCompositions.size());
            int size = listKnownCompositions.size();
            for (int i7 = 0; i7 < size; i7++) {
                ControlledComposition controlledComposition = (ControlledComposition) listKnownCompositions.get(i7);
                CompositionImpl compositionImpl = controlledComposition instanceof CompositionImpl ? (CompositionImpl) controlledComposition : null;
                if (compositionImpl != null) {
                    arrayList.add(compositionImpl);
                }
            }
            int size2 = arrayList.size();
            for (int i8 = 0; i8 < size2; i8++) {
                ((CompositionImpl) arrayList.get(i8)).invalidateGroupsWithKey(i6);
            }
        }

        @Override // androidx.compose.runtime.RecomposerInfo
        public CompositionObserverHandle observe(CompositionRegistrationObserver compositionRegistrationObserver) {
            return CompositionObserverKt.observe(Recomposer.this, compositionRegistrationObserver);
        }

        public final RecomposerErrorState resetErrorState() {
            return Recomposer.this.resetErrorState();
        }

        public final void retryFailedCompositions() {
            Recomposer.this.retryFailedCompositions();
        }

        public final List<HotReloadable> saveStateAndDisposeForHotReload() {
            List listKnownCompositions = Recomposer.this.knownCompositions();
            ArrayList arrayList = new ArrayList(listKnownCompositions.size());
            int size = listKnownCompositions.size();
            for (int i6 = 0; i6 < size; i6++) {
                ControlledComposition controlledComposition = (ControlledComposition) listKnownCompositions.get(i6);
                CompositionImpl compositionImpl = controlledComposition instanceof CompositionImpl ? (CompositionImpl) controlledComposition : null;
                if (compositionImpl != null) {
                    arrayList.add(compositionImpl);
                }
            }
            ArrayList arrayList2 = new ArrayList(arrayList.size());
            int size2 = arrayList.size();
            for (int i7 = 0; i7 < size2; i7++) {
                HotReloadable hotReloadable = new HotReloadable((CompositionImpl) arrayList.get(i7));
                hotReloadable.clearContent();
                arrayList2.add(hotReloadable);
            }
            return arrayList2;
        }
    }

    /* JADX WARN: Failed to restore enum class, 'enum' modifier and super class removed */
    /* JADX WARN: Unknown enum class pattern. Please report as an issue! */
    public static final class State {
        private static final /* synthetic */ D4.a $ENTRIES;
        private static final /* synthetic */ State[] $VALUES;
        public static final State ShutDown = new State("ShutDown", 0);
        public static final State ShuttingDown = new State("ShuttingDown", 1);
        public static final State Inactive = new State("Inactive", 2);
        public static final State InactivePendingWork = new State("InactivePendingWork", 3);
        public static final State Idle = new State("Idle", 4);
        public static final State PendingWork = new State("PendingWork", 5);

        private static final /* synthetic */ State[] $values() {
            return new State[]{ShutDown, ShuttingDown, Inactive, InactivePendingWork, Idle, PendingWork};
        }

        static {
            State[] stateArr$values = $values();
            $VALUES = stateArr$values;
            $ENTRIES = A4.g.E(stateArr$values);
        }

        private State(String str, int i6) {
        }

        public static D4.a getEntries() {
            return $ENTRIES;
        }

        public static State valueOf(String str) {
            return (State) Enum.valueOf(State.class, str);
        }

        public static State[] values() {
            return (State[]) $VALUES.clone();
        }
    }

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

        public AnonymousClass2(A4.d dVar) {
            super(2, dVar);
        }

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

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

        @Override // C4.a
        public final Object invokeSuspend(Object obj) {
            B4.a aVar = B4.a.f492a;
            if (this.label != 0) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            AbstractC2467b.l(obj);
            return Boolean.valueOf(((State) this.L$0).compareTo(State.Idle) > 0);
        }
    }

    /* JADX INFO: renamed from: androidx.compose.runtime.Recomposer$join$2, reason: invalid class name and case insensitive filesystem */
    @C4.e(c = "androidx.compose.runtime.Recomposer$join$2", f = "Recomposer.kt", l = {}, m = "invokeSuspend", v = 1)
    public static final class C09892 extends C4.j implements J4.e {
        /* synthetic */ Object L$0;
        int label;

        public C09892(A4.d dVar) {
            super(2, dVar);
        }

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

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

        @Override // C4.a
        public final Object invokeSuspend(Object obj) {
            B4.a aVar = B4.a.f492a;
            if (this.label != 0) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            AbstractC2467b.l(obj);
            return Boolean.valueOf(((State) this.L$0) == State.ShutDown);
        }
    }

    /* JADX INFO: renamed from: androidx.compose.runtime.Recomposer$recompositionRunner$2, reason: invalid class name and case insensitive filesystem */
    @C4.e(c = "androidx.compose.runtime.Recomposer$recompositionRunner$2", f = "Recomposer.kt", l = {1173}, m = "invokeSuspend", v = 1)
    public static final class C09902 extends C4.j implements J4.e {
        final /* synthetic */ J4.f $block;
        final /* synthetic */ MonotonicFrameClock $parentFrameClock;
        private /* synthetic */ Object L$0;
        Object L$1;
        int label;

        /* JADX INFO: renamed from: androidx.compose.runtime.Recomposer$recompositionRunner$2$2, reason: invalid class name and collision with other inner class name */
        @C4.e(c = "androidx.compose.runtime.Recomposer$recompositionRunner$2$2", f = "Recomposer.kt", l = {1173}, m = "invokeSuspend", v = 1)
        public static final class C00002 extends C4.j implements J4.e {
            final /* synthetic */ J4.f $block;
            final /* synthetic */ MonotonicFrameClock $parentFrameClock;
            private /* synthetic */ Object L$0;
            int label;

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

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

            @Override // J4.e
            public final Object invoke(C c6, A4.d dVar) {
                return ((C00002) 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);
                    C c6 = (C) this.L$0;
                    J4.f fVar = this.$block;
                    MonotonicFrameClock monotonicFrameClock = this.$parentFrameClock;
                    this.label = 1;
                    if (fVar.invoke(c6, monotonicFrameClock, 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 C09902(J4.f fVar, MonotonicFrameClock monotonicFrameClock, A4.d dVar) {
            super(2, dVar);
            this.$block = fVar;
            this.$parentFrameClock = monotonicFrameClock;
        }

        /* JADX INFO: Access modifiers changed from: private */
        /* JADX WARN: Removed duplicated region for block: B:27:0x007c  */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public static final C3137A invokeSuspend$lambda$0(Recomposer recomposer, Set set, Snapshot snapshot) {
            InterfaceC0770l interfaceC0770lDeriveStateLocked;
            synchronized (recomposer.stateLock) {
                try {
                    if (((State) ((c0) recomposer._state).getValue()).compareTo(State.Idle) >= 0) {
                        O o6 = recomposer.snapshotInvalidations;
                        if (set instanceof ScatterSetWrapper) {
                            Z set$runtime = ((ScatterSetWrapper) set).getSet$runtime();
                            Object[] objArr = set$runtime.f21389b;
                            long[] jArr = set$runtime.f21388a;
                            int length = jArr.length - 2;
                            if (length >= 0) {
                                int i6 = 0;
                                while (true) {
                                    long j4 = jArr[i6];
                                    if ((((~j4) << 7) & j4 & (-9187201950435737472L)) != -9187201950435737472L) {
                                        int i7 = 8 - ((~(i6 - length)) >>> 31);
                                        for (int i8 = 0; i8 < i7; i8++) {
                                            if ((255 & j4) < 128) {
                                                Object obj = objArr[(i6 << 3) + i8];
                                                if (!(obj instanceof StateObjectImpl) || ((StateObjectImpl) obj).m269isReadInh_f27i8$runtime(ReaderKind.m257constructorimpl(1))) {
                                                    o6.d(obj);
                                                }
                                            }
                                            j4 >>= 8;
                                        }
                                        if (i7 != 8) {
                                            break;
                                        }
                                        if (i6 == length) {
                                            break;
                                        }
                                        i6++;
                                    }
                                }
                            }
                        } else {
                            for (Object obj2 : set) {
                                if (!(obj2 instanceof StateObjectImpl) || ((StateObjectImpl) obj2).m269isReadInh_f27i8$runtime(ReaderKind.m257constructorimpl(1))) {
                                    o6.d(obj2);
                                }
                            }
                        }
                        interfaceC0770lDeriveStateLocked = recomposer.deriveStateLocked();
                    } else {
                        interfaceC0770lDeriveStateLocked = null;
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
            if (interfaceC0770lDeriveStateLocked != null) {
                interfaceC0770lDeriveStateLocked.resumeWith(C3137A.f25453a);
            }
            return C3137A.f25453a;
        }

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

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

        /* JADX WARN: Removed duplicated region for block: B:48:0x00bb A[EXC_TOP_SPLITTER, SYNTHETIC] */
        /* JADX WARN: Removed duplicated region for block: B:54:0x008f A[EXC_TOP_SPLITTER, SYNTHETIC] */
        @Override // C4.a
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object invokeSuspend(Object obj) throws Throwable {
            InterfaceC0765i0 interfaceC0765i0Q;
            ObserverHandle observerHandle;
            Throwable th;
            Object obj2;
            Object obj3;
            B4.a aVar = B4.a.f492a;
            int i6 = this.label;
            if (i6 != 0) {
                if (i6 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                observerHandle = (ObserverHandle) this.L$1;
                interfaceC0765i0Q = (InterfaceC0765i0) this.L$0;
                try {
                    AbstractC2467b.l(obj);
                    observerHandle.dispose();
                    obj3 = Recomposer.this.stateLock;
                    Recomposer recomposer = Recomposer.this;
                    synchronized (obj3) {
                        try {
                            if (recomposer.runnerJob == interfaceC0765i0Q) {
                                recomposer.runnerJob = null;
                            }
                            recomposer.deriveStateLocked();
                        } catch (Throwable th2) {
                            throw th2;
                        }
                    }
                    Recomposer.Companion.removeRunning(Recomposer.this.recomposerInfo);
                    return C3137A.f25453a;
                } catch (Throwable th3) {
                    th = th3;
                    observerHandle.dispose();
                    obj2 = Recomposer.this.stateLock;
                    Recomposer recomposer2 = Recomposer.this;
                    synchronized (obj2) {
                        try {
                            if (recomposer2.runnerJob == interfaceC0765i0Q) {
                                recomposer2.runnerJob = null;
                            }
                            recomposer2.deriveStateLocked();
                        } catch (Throwable th4) {
                            throw th4;
                        }
                    }
                    Recomposer.Companion.removeRunning(Recomposer.this.recomposerInfo);
                    throw th;
                }
            }
            AbstractC2467b.l(obj);
            interfaceC0765i0Q = E.q(((C) this.L$0).getCoroutineContext());
            Recomposer.this.registerRunnerJob(interfaceC0765i0Q);
            ObserverHandle observerHandleRegisterApplyObserver = Snapshot.Companion.registerApplyObserver(new t(Recomposer.this, 0));
            Recomposer.Companion.addRunning(Recomposer.this.recomposerInfo);
            try {
                List listKnownCompositions = Recomposer.this.knownCompositions();
                int size = listKnownCompositions.size();
                for (int i7 = 0; i7 < size; i7++) {
                    ((ControlledComposition) listKnownCompositions.get(i7)).invalidateAll();
                }
                C00002 c00002 = new C00002(this.$block, this.$parentFrameClock, null);
                this.L$0 = interfaceC0765i0Q;
                this.L$1 = observerHandleRegisterApplyObserver;
                this.label = 1;
                if (E.k(c00002, this) == aVar) {
                    return aVar;
                }
                observerHandle = observerHandleRegisterApplyObserver;
                observerHandle.dispose();
                obj3 = Recomposer.this.stateLock;
                Recomposer recomposer3 = Recomposer.this;
                synchronized (obj3) {
                }
            } catch (Throwable th5) {
                observerHandle = observerHandleRegisterApplyObserver;
                th = th5;
                observerHandle.dispose();
                obj2 = Recomposer.this.stateLock;
                Recomposer recomposer22 = Recomposer.this;
                synchronized (obj2) {
                }
            }
        }
    }

    /* JADX INFO: renamed from: androidx.compose.runtime.Recomposer$runFrameLoop$1, reason: invalid class name */
    @C4.e(c = "androidx.compose.runtime.Recomposer", f = "Recomposer.kt", l = {1042, 1049}, m = "runFrameLoop", v = 1)
    public static final class AnonymousClass1 extends C4.c {
        Object L$0;
        Object L$1;
        Object L$2;
        Object L$3;
        int label;
        /* synthetic */ Object result;

        public AnonymousClass1(A4.d dVar) {
            super(dVar);
        }

        @Override // C4.a
        public final Object invokeSuspend(Object obj) {
            this.result = obj;
            this.label |= Integer.MIN_VALUE;
            return Recomposer.this.runFrameLoop(null, null, this);
        }
    }

    /* JADX INFO: renamed from: androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2, reason: invalid class name and case insensitive filesystem */
    @C4.e(c = "androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2", f = "Recomposer.kt", l = {598, 609}, m = "invokeSuspend", v = 1)
    public static final class C09912 extends C4.j implements J4.f {
        /* synthetic */ Object L$0;
        Object L$1;
        Object L$2;
        Object L$3;
        Object L$4;
        Object L$5;
        Object L$6;
        Object L$7;
        Object L$8;
        int label;

        public C09912(A4.d dVar) {
            super(3, dVar);
        }

        /* JADX WARN: Removed duplicated region for block: B:21:0x0077  */
        /* JADX WARN: Removed duplicated region for block: B:36:0x00bc  */
        /* JADX WARN: Removed duplicated region for block: B:50:0x00ff  */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        private static final void invokeSuspend$clearRecompositionState(Recomposer recomposer, List<ControlledComposition> list, List<MovableContentStateReference> list2, List<ControlledComposition> list3, O o6, O o7, O o8, O o9) {
            char c6;
            long j4;
            long j6;
            synchronized (recomposer.stateLock) {
                try {
                    list.clear();
                    list2.clear();
                    int size = list3.size();
                    for (int i6 = 0; i6 < size; i6++) {
                        ControlledComposition controlledComposition = list3.get(i6);
                        controlledComposition.abandonChanges();
                        recomposer.recordFailedCompositionLocked(controlledComposition);
                    }
                    list3.clear();
                    Object[] objArr = o6.f21389b;
                    long[] jArr = o6.f21388a;
                    int length = jArr.length - 2;
                    if (length >= 0) {
                        int i7 = 0;
                        j4 = 255;
                        while (true) {
                            long j7 = jArr[i7];
                            c6 = 7;
                            j6 = -9187201950435737472L;
                            if ((((~j7) << 7) & j7 & (-9187201950435737472L)) != -9187201950435737472L) {
                                int i8 = 8 - ((~(i7 - length)) >>> 31);
                                for (int i9 = 0; i9 < i8; i9++) {
                                    if ((j7 & 255) < 128) {
                                        ControlledComposition controlledComposition2 = (ControlledComposition) objArr[(i7 << 3) + i9];
                                        controlledComposition2.abandonChanges();
                                        recomposer.recordFailedCompositionLocked(controlledComposition2);
                                    }
                                    j7 >>= 8;
                                }
                                if (i8 != 8) {
                                    break;
                                } else if (i7 == length) {
                                    break;
                                } else {
                                    i7++;
                                }
                            }
                        }
                    } else {
                        c6 = 7;
                        j4 = 255;
                        j6 = -9187201950435737472L;
                    }
                    o6.e();
                    Object[] objArr2 = o7.f21389b;
                    long[] jArr2 = o7.f21388a;
                    int length2 = jArr2.length - 2;
                    if (length2 >= 0) {
                        int i10 = 0;
                        while (true) {
                            long j8 = jArr2[i10];
                            if ((((~j8) << c6) & j8 & j6) != j6) {
                                int i11 = 8 - ((~(i10 - length2)) >>> 31);
                                for (int i12 = 0; i12 < i11; i12++) {
                                    if ((j8 & j4) < 128) {
                                        ((ControlledComposition) objArr2[(i10 << 3) + i12]).changesApplied();
                                    }
                                    j8 >>= 8;
                                }
                                if (i11 != 8) {
                                    break;
                                } else if (i10 == length2) {
                                    break;
                                } else {
                                    i10++;
                                }
                            }
                        }
                    }
                    o7.e();
                    o8.e();
                    Object[] objArr3 = o9.f21389b;
                    long[] jArr3 = o9.f21388a;
                    int length3 = jArr3.length - 2;
                    if (length3 >= 0) {
                        int i13 = 0;
                        while (true) {
                            long j9 = jArr3[i13];
                            if ((((~j9) << c6) & j9 & j6) != j6) {
                                int i14 = 8 - ((~(i13 - length3)) >>> 31);
                                for (int i15 = 0; i15 < i14; i15++) {
                                    if ((j9 & j4) < 128) {
                                        ControlledComposition controlledComposition3 = (ControlledComposition) objArr3[(i13 << 3) + i15];
                                        controlledComposition3.abandonChanges();
                                        recomposer.recordFailedCompositionLocked(controlledComposition3);
                                    }
                                    j9 >>= 8;
                                }
                                if (i14 != 8) {
                                    break;
                                } else if (i13 == length3) {
                                    break;
                                } else {
                                    i13++;
                                }
                            }
                        }
                    }
                    o9.e();
                } catch (Throwable th) {
                    throw th;
                }
            }
        }

        private static final void invokeSuspend$fillToInsert(List<MovableContentStateReference> list, Recomposer recomposer) {
            list.clear();
            synchronized (recomposer.stateLock) {
                try {
                    List list2 = recomposer.movableContentAwaitingInsert;
                    int size = list2.size();
                    for (int i6 = 0; i6 < size; i6++) {
                        list.add((MovableContentStateReference) list2.get(i6));
                    }
                    recomposer.movableContentAwaitingInsert.clear();
                } catch (Throwable th) {
                    throw th;
                }
            }
        }

        /* JADX INFO: Access modifiers changed from: private */
        /* JADX WARN: Multi-variable type inference failed */
        /* JADX WARN: Removed duplicated region for block: B:109:0x01de  */
        /* JADX WARN: Removed duplicated region for block: B:221:0x01a5 A[EXC_TOP_SPLITTER, SYNTHETIC] */
        /* JADX WARN: Removed duplicated region for block: B:226:0x0220 A[EXC_TOP_SPLITTER, SYNTHETIC] */
        /* JADX WARN: Removed duplicated region for block: B:232:0x0125 A[EXC_TOP_SPLITTER, SYNTHETIC] */
        /* JADX WARN: Removed duplicated region for block: B:78:0x0167  */
        /* JADX WARN: Removed duplicated region for block: B:91:0x0199  */
        /* JADX WARN: Type inference failed for: r13v0, types: [java.util.Collection, java.util.List] */
        /* JADX WARN: Type inference failed for: r25v0, types: [n.O, n.Z] */
        /* JADX WARN: Type inference failed for: r3v19 */
        /* JADX WARN: Type inference failed for: r3v20, types: [int] */
        /* JADX WARN: Type inference failed for: r3v21 */
        /* JADX WARN: Type inference failed for: r3v22, types: [int] */
        /* JADX WARN: Type inference failed for: r3v26 */
        /* JADX WARN: Type inference failed for: r3v27 */
        /* JADX WARN: Type inference failed for: r4v15, types: [int] */
        /* JADX WARN: Type inference failed for: r4v22, types: [java.util.List] */
        /* JADX WARN: Type inference failed for: r4v23 */
        /* JADX WARN: Type inference failed for: r4v24 */
        /* JADX WARN: Type inference failed for: r5v8, types: [T[], java.lang.Object[]] */
        /* JADX WARN: Type inference failed for: r8v0 */
        /* JADX WARN: Type inference failed for: r8v1, types: [java.util.Collection, java.util.List] */
        /* JADX WARN: Type inference failed for: r8v4 */
        /* JADX WARN: Type inference failed for: r8v5 */
        /* JADX WARN: Type inference failed for: r8v6 */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public static final C3137A invokeSuspend$lambda$2(Recomposer recomposer, O o6, O o7, List list, List list2, O o8, List list3, O o9, Set set, long j4) {
            boolean z6;
            C3137A c3137a;
            char c6;
            long j6;
            long j7;
            Recomposer recomposer2 = recomposer;
            List list4 = list;
            ?? r8 = list3;
            O o10 = o9;
            if (recomposer2.getHasBroadcastFrameClockAwaiters()) {
                Trace trace = Trace.INSTANCE;
                Object objBeginSection = trace.beginSection("Recomposer:animation");
                try {
                    recomposer2.broadcastFrameClock.sendFrame(j4);
                    Snapshot.Companion.sendApplyNotifications();
                    trace.endSection(objBeginSection);
                } finally {
                    Trace.INSTANCE.endSection(objBeginSection);
                }
            }
            Object objBeginSection2 = Trace.INSTANCE.beginSection("Recomposer:recompose");
            try {
                recomposer2.recordComposerModifications();
                synchronized (recomposer2.stateLock) {
                    try {
                        MutableVector mutableVector = recomposer2.compositionInvalidations;
                        Object[] objArr = mutableVector.content;
                        int size = mutableVector.getSize();
                        z6 = false;
                        for (int i6 = 0; i6 < size; i6++) {
                            list4.add((ControlledComposition) objArr[i6]);
                        }
                        recomposer2.compositionInvalidations.clear();
                    } finally {
                    }
                }
                o6.e();
                o7.e();
                while (true) {
                    if (list4.isEmpty() && list2.isEmpty()) {
                        break;
                    }
                    List list5 = list4;
                    ?? r13 = r8;
                    try {
                        int size2 = list5.size();
                        for (int i7 = 0; i7 < size2; i7++) {
                            ControlledComposition controlledComposition = (ControlledComposition) list5.get(i7);
                            ControlledComposition controlledCompositionPerformRecompose = recomposer2.performRecompose(controlledComposition, o6);
                            if (controlledCompositionPerformRecompose != null) {
                                r13.add(controlledCompositionPerformRecompose);
                            }
                            o7.d(controlledComposition);
                        }
                        list5.clear();
                        if (o6.c() || recomposer2.compositionInvalidations.getSize() != 0) {
                            synchronized (recomposer2.stateLock) {
                                try {
                                    List listKnownCompositionsLocked = recomposer2.knownCompositionsLocked();
                                    int size3 = listKnownCompositionsLocked.size();
                                    for (int i8 = 0; i8 < size3; i8++) {
                                        ControlledComposition controlledComposition2 = (ControlledComposition) listKnownCompositionsLocked.get(i8);
                                        if (!o7.a(controlledComposition2) && controlledComposition2.observesAnyOf(set)) {
                                            list5.add(controlledComposition2);
                                        }
                                    }
                                    MutableVector mutableVector2 = recomposer2.compositionInvalidations;
                                    int size4 = mutableVector2.getSize();
                                    int i9 = 0;
                                    for (int i10 = 0; i10 < size4; i10++) {
                                        ControlledComposition controlledComposition3 = (ControlledComposition) mutableVector2.content[i10];
                                        if (!o7.a(controlledComposition3) && !list5.contains(controlledComposition3)) {
                                            list5.add(controlledComposition3);
                                            i9++;
                                        } else if (i9 > 0) {
                                            Object[] objArr2 = mutableVector2.content;
                                            objArr2[i10 - i9] = objArr2[i10];
                                        }
                                    }
                                    int i11 = size4 - i9;
                                    AbstractC3250p.H(mutableVector2.content, null, i11, size4);
                                    mutableVector2.setSize(i11);
                                } finally {
                                }
                            }
                        }
                        if (list5.isEmpty()) {
                            try {
                                invokeSuspend$fillToInsert(list2, recomposer2);
                                while (!list2.isEmpty()) {
                                    List elements = recomposer2.performInsertValues(list2, o6);
                                    o8.getClass();
                                    kotlin.jvm.internal.o.h(elements, "elements");
                                    Iterator it = elements.iterator();
                                    while (it.hasNext()) {
                                        o8.j(it.next());
                                    }
                                    invokeSuspend$fillToInsert(list2, recomposer2);
                                }
                                list4 = list5;
                                r8 = r13;
                                z6 = false;
                                o10 = o9;
                            } catch (Throwable th) {
                                Recomposer.processCompositionError$default(recomposer2, th, null, true, 2, null);
                                invokeSuspend$clearRecompositionState(recomposer, list5, list2, r13, o8, o9, o6, o7);
                                c3137a = C3137A.f25453a;
                            }
                        } else {
                            recomposer2 = recomposer;
                            list4 = list;
                            r8 = list3;
                            o10 = o9;
                            z6 = false;
                        }
                    } catch (Throwable th2) {
                        try {
                            Recomposer.processCompositionError$default(recomposer, th2, null, true, 2, null);
                            invokeSuspend$clearRecompositionState(recomposer, list, list2, list3, o8, o9, o6, o7);
                            c3137a = C3137A.f25453a;
                            list.clear();
                        } catch (Throwable th3) {
                            list.clear();
                            throw th3;
                        }
                    }
                    return c3137a;
                }
                Snapshot current = Snapshot.Companion.getCurrent();
                Snapshot transparentObserverMutableSnapshot = current instanceof MutableSnapshot ? new TransparentObserverMutableSnapshot((MutableSnapshot) current, null, null, true, false) : new TransparentObserverSnapshot(current, null, true, z6);
                try {
                    Snapshot snapshotMakeCurrent = transparentObserverMutableSnapshot.makeCurrent();
                    try {
                        if (!r8.isEmpty()) {
                            recomposer2.changeCount = recomposer2.getChangeCount() + 1;
                            try {
                                int size5 = r8.size();
                                for (?? r32 = z6; r32 < size5; r32++) {
                                    o10.d((ControlledComposition) r8.get(r32));
                                }
                                int size6 = r8.size();
                                for (?? r33 = z6; r33 < size6; r33++) {
                                    ((ControlledComposition) r8.get(r33)).applyChanges();
                                }
                                r8.clear();
                                if (o8.c()) {
                                    c6 = 7;
                                    j6 = 128;
                                    j7 = 255;
                                } else {
                                    try {
                                        o10.k(o8);
                                        Object[] objArr3 = o8.f21389b;
                                        long[] jArr = o8.f21388a;
                                        c6 = 7;
                                        int length = jArr.length - 2;
                                        j6 = 128;
                                        ?? r42 = z6;
                                        if (length >= 0) {
                                            while (true) {
                                                long j8 = jArr[r42];
                                                j7 = 255;
                                                if ((((~j8) << 7) & j8 & (-9187201950435737472L)) != -9187201950435737472L) {
                                                    int i12 = 8 - ((~(r42 - length)) >>> 31);
                                                    for (int i13 = 0; i13 < i12; i13++) {
                                                        if ((j8 & 255) < 128) {
                                                            ((ControlledComposition) objArr3[(r42 << 3) + i13]).applyLateChanges();
                                                        }
                                                        j8 >>= 8;
                                                    }
                                                    if (i12 != 8) {
                                                        break;
                                                    }
                                                    if (r42 == length) {
                                                        break;
                                                    }
                                                    r42++;
                                                }
                                            }
                                        } else {
                                            j7 = 255;
                                        }
                                    } catch (Throwable th4) {
                                        try {
                                            Recomposer.processCompositionError$default(recomposer, th4, null, false, 6, null);
                                            invokeSuspend$clearRecompositionState(recomposer, list, list2, list3, o8, o10, o6, o7);
                                            c3137a = C3137A.f25453a;
                                            transparentObserverMutableSnapshot.restoreCurrent(snapshotMakeCurrent);
                                            return c3137a;
                                        } finally {
                                            o8.e();
                                        }
                                    }
                                }
                                if (o10.c()) {
                                    try {
                                        Object[] objArr4 = o10.f21389b;
                                        long[] jArr2 = o10.f21388a;
                                        int length2 = jArr2.length - 2;
                                        if (length2 >= 0) {
                                            int i14 = 0;
                                            while (true) {
                                                long j9 = jArr2[i14];
                                                if ((((~j9) << c6) & j9 & (-9187201950435737472L)) != -9187201950435737472L) {
                                                    int i15 = 8 - ((~(i14 - length2)) >>> 31);
                                                    for (int i16 = 0; i16 < i15; i16++) {
                                                        if ((j9 & j7) < j6) {
                                                            ((ControlledComposition) objArr4[(i14 << 3) + i16]).changesApplied();
                                                        }
                                                        j9 >>= 8;
                                                    }
                                                    if (i15 != 8) {
                                                        break;
                                                    }
                                                    if (i14 == length2) {
                                                        break;
                                                    }
                                                    i14++;
                                                }
                                            }
                                        }
                                        o10.e();
                                    } catch (Throwable th5) {
                                        try {
                                            Recomposer.processCompositionError$default(recomposer, th5, null, false, 6, null);
                                            invokeSuspend$clearRecompositionState(recomposer, list, list2, list3, o8, o10, o6, o7);
                                            c3137a = C3137A.f25453a;
                                            transparentObserverMutableSnapshot.restoreCurrent(snapshotMakeCurrent);
                                            return c3137a;
                                        } finally {
                                            o9.e();
                                        }
                                    }
                                }
                                transparentObserverMutableSnapshot.restoreCurrent(snapshotMakeCurrent);
                                transparentObserverMutableSnapshot.dispose();
                                synchronized (recomposer.stateLock) {
                                    recomposer.deriveStateLocked();
                                }
                                Snapshot.Companion.notifyObjectsInitialized();
                                o7.e();
                                o6.e();
                                recomposer.compositionsRemoved = null;
                                Trace.INSTANCE.endSection(objBeginSection2);
                                return C3137A.f25453a;
                            } catch (Throwable th6) {
                                try {
                                    Recomposer.processCompositionError$default(recomposer2, th6, null, false, 6, null);
                                    invokeSuspend$clearRecompositionState(recomposer, list4, list2, r8, o8, o10, o6, o7);
                                    c3137a = C3137A.f25453a;
                                    transparentObserverMutableSnapshot.restoreCurrent(snapshotMakeCurrent);
                                    return c3137a;
                                } finally {
                                    list3.clear();
                                }
                            }
                        }
                        if (o8.c()) {
                        }
                        if (o10.c()) {
                        }
                        transparentObserverMutableSnapshot.restoreCurrent(snapshotMakeCurrent);
                        transparentObserverMutableSnapshot.dispose();
                        synchronized (recomposer.stateLock) {
                        }
                    } catch (Throwable th7) {
                        transparentObserverMutableSnapshot.restoreCurrent(snapshotMakeCurrent);
                        throw th7;
                    }
                } finally {
                    transparentObserverMutableSnapshot.dispose();
                }
                return c3137a;
            } catch (Throwable th8) {
                throw th8;
            }
        }

        @Override // J4.f
        public final Object invoke(C c6, MonotonicFrameClock monotonicFrameClock, A4.d dVar) {
            C09912 c09912 = Recomposer.this.new C09912(dVar);
            c09912.L$0 = monotonicFrameClock;
            return c09912.invokeSuspend(C3137A.f25453a);
        }

        /* JADX WARN: Removed duplicated region for block: B:14:0x00b5  */
        /* JADX WARN: Removed duplicated region for block: B:20:0x00e0  */
        /* JADX WARN: Removed duplicated region for block: B:25:0x0119  */
        /* JADX WARN: Removed duplicated region for block: B:26:0x0122  */
        /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:23:0x0102 -> B:24:0x010a). Please report as a decompilation issue!!! */
        /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:25:0x0119 -> B:12:0x00ad). Please report as a decompilation issue!!! */
        @Override // C4.a
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object invokeSuspend(Object obj) {
            MonotonicFrameClock monotonicFrameClock;
            O o6;
            O o7;
            List list;
            Set set;
            final List list2;
            O o8;
            List list3;
            O o9;
            final List list4;
            final O o10;
            final List list5;
            final O o11;
            B4.a aVar = B4.a.f492a;
            int i6 = this.label;
            if (i6 == 0) {
                AbstractC2467b.l(obj);
                monotonicFrameClock = (MonotonicFrameClock) this.L$0;
                ArrayList arrayList = new ArrayList();
                ArrayList arrayList2 = new ArrayList();
                ArrayList arrayList3 = new ArrayList();
                O o12 = n.a0.f21397a;
                o6 = new O();
                O o13 = new O();
                O o14 = new O();
                Set setWrapIntoSet = ScatterSetWrapperKt.wrapIntoSet(o14);
                o7 = new O();
                list = arrayList;
                set = setWrapIntoSet;
                list2 = arrayList2;
                o8 = o14;
                list3 = arrayList3;
                o9 = o13;
                if (!Recomposer.this.getShouldKeepRecomposing()) {
                }
            } else if (i6 == 1) {
                O o15 = (O) this.L$8;
                set = (Set) this.L$7;
                o8 = (O) this.L$6;
                o9 = (O) this.L$5;
                O o16 = (O) this.L$4;
                List list6 = (List) this.L$3;
                list2 = (List) this.L$2;
                List list7 = (List) this.L$1;
                MonotonicFrameClock monotonicFrameClock2 = (MonotonicFrameClock) this.L$0;
                AbstractC2467b.l(obj);
                o11 = o15;
                monotonicFrameClock = monotonicFrameClock2;
                list4 = list6;
                list5 = list7;
                o10 = o16;
                final Set set2 = set;
                final O o17 = o9;
                final O o18 = o8;
                if (Recomposer.this.recordComposerModifications()) {
                }
            } else {
                if (i6 != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                O o19 = (O) this.L$8;
                set = (Set) this.L$7;
                o8 = (O) this.L$6;
                o9 = (O) this.L$5;
                o6 = (O) this.L$4;
                list3 = (List) this.L$3;
                list2 = (List) this.L$2;
                list = (List) this.L$1;
                MonotonicFrameClock monotonicFrameClock3 = (MonotonicFrameClock) this.L$0;
                AbstractC2467b.l(obj);
                o7 = o19;
                monotonicFrameClock = monotonicFrameClock3;
                Recomposer.this.discardUnusedMovableContentState();
                Recomposer.this.nextFrameEndCallbackQueue.markFrameComplete();
                if (!Recomposer.this.getShouldKeepRecomposing()) {
                    Recomposer recomposer = Recomposer.this;
                    this.L$0 = monotonicFrameClock;
                    this.L$1 = list;
                    this.L$2 = list2;
                    this.L$3 = list3;
                    this.L$4 = o6;
                    this.L$5 = o9;
                    this.L$6 = o8;
                    this.L$7 = set;
                    this.L$8 = o7;
                    this.label = 1;
                    if (recomposer.awaitWorkAvailable(this) != aVar) {
                        List list8 = list;
                        o10 = o6;
                        o11 = o7;
                        list4 = list3;
                        list5 = list8;
                        final Set set22 = set;
                        final O o172 = o9;
                        final O o182 = o8;
                        if (Recomposer.this.recordComposerModifications()) {
                            List list9 = list4;
                            o7 = o11;
                            o6 = o10;
                            list = list5;
                            list3 = list9;
                            o8 = o182;
                            o9 = o172;
                            set = set22;
                            if (!Recomposer.this.getShouldKeepRecomposing()) {
                            }
                        } else {
                            final Recomposer recomposer2 = Recomposer.this;
                            J4.c cVar = new J4.c() { // from class: androidx.compose.runtime.u
                                @Override // J4.c
                                public final Object invoke(Object obj2) {
                                    long jLongValue = ((Long) obj2).longValue();
                                    return Recomposer.C09912.invokeSuspend$lambda$2(recomposer2, o182, o11, list5, list2, o10, list4, o172, set22, jLongValue);
                                }
                            };
                            this.L$0 = monotonicFrameClock;
                            this.L$1 = list5;
                            this.L$2 = list2;
                            this.L$3 = list4;
                            this.L$4 = o10;
                            this.L$5 = o172;
                            this.L$6 = o182;
                            this.L$7 = set22;
                            this.L$8 = o11;
                            this.label = 2;
                            if (monotonicFrameClock.withFrameNanos(cVar, this) != aVar) {
                                List list10 = list4;
                                o7 = o11;
                                o6 = o10;
                                list = list5;
                                list3 = list10;
                                o8 = o182;
                                o9 = o172;
                                set = set22;
                                Recomposer.this.discardUnusedMovableContentState();
                                Recomposer.this.nextFrameEndCallbackQueue.markFrameComplete();
                                if (!Recomposer.this.getShouldKeepRecomposing()) {
                                    return C3137A.f25453a;
                                }
                            }
                        }
                    }
                    return aVar;
                }
            }
        }
    }

    /* JADX INFO: renamed from: androidx.compose.runtime.Recomposer$runRecomposeConcurrentlyAndApplyChanges$2, reason: invalid class name and case insensitive filesystem */
    @C4.e(c = "androidx.compose.runtime.Recomposer$runRecomposeConcurrentlyAndApplyChanges$2", f = "Recomposer.kt", l = {AnalyticsListener.EVENT_AUDIO_UNDERRUN, AnalyticsListener.EVENT_AUDIO_TRACK_INITIALIZED, AnalyticsListener.EVENT_AUDIO_TRACK_RELEASED}, m = "invokeSuspend", v = 1)
    public static final class C09922 extends C4.j implements J4.f {
        final /* synthetic */ A4.j $recomposeCoroutineContext;
        private /* synthetic */ Object L$0;
        /* synthetic */ Object L$1;
        Object L$2;
        int label;
        final /* synthetic */ Recomposer this$0;

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

        @Override // J4.f
        public final Object invoke(C c6, MonotonicFrameClock monotonicFrameClock, A4.d dVar) {
            C09922 c09922 = new C09922(this.$recomposeCoroutineContext, this.this$0, dVar);
            c09922.L$0 = c6;
            c09922.L$1 = monotonicFrameClock;
            return c09922.invokeSuspend(C3137A.f25453a);
        }

        /* JADX WARN: Code restructure failed: missing block: B:23:0x00b1, code lost:
        
            if (r10.awaitWorkAvailable(r18) == r0) goto L81;
         */
        /* JADX WARN: Code restructure failed: missing block: B:80:0x0193, code lost:
        
            if (V4.E.j(r2, r18) != r0) goto L82;
         */
        /* JADX WARN: Removed duplicated region for block: B:22:0x00a3  */
        /* JADX WARN: Removed duplicated region for block: B:76:0x0174  */
        /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:23:0x00b1 -> B:25:0x00b5). Please report as a decompilation issue!!! */
        @Override // C4.a
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object invokeSuspend(Object obj) {
            C c6;
            InterfaceC0765i0 interfaceC0765i0Y;
            ProduceFrameSignal produceFrameSignal;
            O o6;
            A4.d dVarRequestFrameLocked;
            int i6;
            B4.a aVar = B4.a.f492a;
            int i7 = this.label;
            int i8 = 1;
            if (i7 == 0) {
                AbstractC2467b.l(obj);
                C c7 = (C) this.L$0;
                MonotonicFrameClock monotonicFrameClock = (MonotonicFrameClock) this.L$1;
                A4.j jVar = this.$recomposeCoroutineContext;
                C0763h0 c0763h0 = C0763h0.f8306a;
                boolean z6 = jVar.get(c0763h0) == null;
                A4.j jVar2 = this.$recomposeCoroutineContext;
                if (!z6) {
                    PreconditionsKt.throwIllegalArgumentException("recomposeCoroutineContext may not contain a Job; found " + jVar2.get(c0763h0));
                }
                c6 = E.c(c7.getCoroutineContext().plus(this.$recomposeCoroutineContext).plus(new C0769k0(E.q(c7.getCoroutineContext()))));
                ProduceFrameSignal produceFrameSignal2 = new ProduceFrameSignal();
                interfaceC0765i0Y = E.y(c7, null, null, new Recomposer$runRecomposeConcurrentlyAndApplyChanges$2$frameLoop$1(this.this$0, monotonicFrameClock, produceFrameSignal2, null), 3);
                produceFrameSignal = produceFrameSignal2;
                if (this.this$0.getShouldKeepRecomposing()) {
                }
                return aVar;
            }
            if (i7 == 1) {
                interfaceC0765i0Y = (InterfaceC0765i0) this.L$2;
                produceFrameSignal = (ProduceFrameSignal) this.L$1;
                c6 = (C) this.L$0;
                AbstractC2467b.l(obj);
                Recomposer recomposer = this.this$0;
                synchronized (recomposer.stateLock) {
                    o6 = recomposer.snapshotInvalidations;
                    if (o6.c()) {
                        recomposer.snapshotInvalidations = new O();
                    }
                }
                Set<? extends Object> setWrapIntoSet = ScatterSetWrapperKt.wrapIntoSet(o6);
                if (!setWrapIntoSet.isEmpty()) {
                    List listKnownCompositionsLocked = recomposer.knownCompositionsLocked();
                    int size = listKnownCompositionsLocked.size();
                    for (int i9 = 0; i9 < size; i9++) {
                        ((ControlledComposition) listKnownCompositionsLocked.get(i9)).recordModificationsOf(setWrapIntoSet);
                    }
                }
                MutableVector mutableVector = recomposer.compositionInvalidations;
                Object[] objArr = mutableVector.content;
                int size2 = mutableVector.getSize();
                int i10 = 0;
                while (i10 < size2) {
                    ControlledComposition controlledComposition = (ControlledComposition) objArr[i10];
                    synchronized (recomposer.stateLock) {
                        i6 = i8;
                        recomposer.concurrentCompositionsOutstanding++;
                    }
                    E.y(c6, CompositionKt.getRecomposeCoroutineContext(controlledComposition), null, new Recomposer$runRecomposeConcurrentlyAndApplyChanges$2$2$2(recomposer, controlledComposition, null), 2);
                    i10++;
                    i8 = i6;
                }
                int i11 = i8;
                recomposer.compositionInvalidations.clear();
                synchronized (recomposer.stateLock) {
                    if (recomposer.deriveStateLocked() != null) {
                        throw new IllegalStateException("called outside of runRecomposeAndApplyChanges");
                    }
                }
                Object obj2 = this.this$0.stateLock;
                Recomposer recomposer2 = this.this$0;
                synchronized (obj2) {
                    dVarRequestFrameLocked = recomposer2.getHasConcurrentFrameWorkLocked() ? produceFrameSignal.requestFrameLocked() : null;
                }
                if (dVarRequestFrameLocked != null) {
                    dVarRequestFrameLocked.resumeWith(C3137A.f25453a);
                }
                i8 = i11;
                if (this.this$0.getShouldKeepRecomposing()) {
                    InterfaceC0765i0 interfaceC0765i0Q = E.q(c6.getCoroutineContext());
                    this.L$0 = interfaceC0765i0Y;
                    this.L$1 = null;
                    this.L$2 = null;
                    this.label = 2;
                    if (E.j(interfaceC0765i0Q, this) != aVar) {
                        this.L$0 = null;
                        this.label = 3;
                    }
                } else {
                    Recomposer recomposer3 = this.this$0;
                    this.L$0 = c6;
                    this.L$1 = produceFrameSignal;
                    this.L$2 = interfaceC0765i0Y;
                    this.label = i8;
                }
                return aVar;
            }
            if (i7 != 2) {
                if (i7 != 3) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                AbstractC2467b.l(obj);
                return C3137A.f25453a;
            }
            interfaceC0765i0Y = (InterfaceC0765i0) this.L$0;
            AbstractC2467b.l(obj);
            this.L$0 = null;
            this.label = 3;
        }
    }

    public Recomposer(A4.j jVar) {
        final int i6 = 0;
        BroadcastFrameClock broadcastFrameClock = new BroadcastFrameClock(new J4.a(this) { // from class: androidx.compose.runtime.r

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            public final /* synthetic */ Recomposer f11100b;

            {
                this.f11100b = this;
            }

            @Override // J4.a
            public final Object invoke() {
                switch (i6) {
                    case 0:
                        return Recomposer.broadcastFrameClock$lambda$0(this.f11100b);
                    default:
                        return Recomposer.nextFrameEndCallbackQueue$lambda$0(this.f11100b);
                }
            }
        });
        this.broadcastFrameClock = broadcastFrameClock;
        final int i7 = 1;
        this.nextFrameEndCallbackQueue = new NextFrameEndCallbackQueue(new J4.a(this) { // from class: androidx.compose.runtime.r

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            public final /* synthetic */ Recomposer f11100b;

            {
                this.f11100b = this;
            }

            @Override // J4.a
            public final Object invoke() {
                switch (i7) {
                    case 0:
                        return Recomposer.broadcastFrameClock$lambda$0(this.f11100b);
                    default:
                        return Recomposer.nextFrameEndCallbackQueue$lambda$0(this.f11100b);
                }
            }
        });
        this.stateLock = new Object();
        this._knownCompositions = new ArrayList();
        this.snapshotInvalidations = new O();
        this.compositionInvalidations = new MutableVector<>(new ControlledComposition[16], 0);
        this.compositionsAwaitingApply = new ArrayList();
        this.movableContentAwaitingInsert = new ArrayList();
        this.movableContentRemoved = MultiValueMap.m161constructorimpl$default(null, 1, null);
        this.movableContentNestedStatesAvailable = new NestedContentMap();
        this.movableContentStatesAvailable = new N();
        this.movableContentNestedExtractionsPending = MultiValueMap.m161constructorimpl$default(null, 1, null);
        this._state = Y4.O.c(State.Inactive);
        this.pausedScopes = new SnapshotThreadLocal<>();
        C0769k0 c0769k0 = new C0769k0((InterfaceC0765i0) jVar.get(C0763h0.f8306a));
        c0769k0.invokeOnCompletion(new p(this, 5));
        this.effectJob = c0769k0;
        this.effectCoroutineContext = jVar.plus(broadcastFrameClock).plus(c0769k0);
        this.recomposerInfo = new RecomposerInfoImpl();
    }

    private final void addKnownCompositionLocked(ControlledComposition controlledComposition) {
        this._knownCompositions.add(controlledComposition);
        this._knownCompositionsCache = null;
    }

    private final void applyAndCheck(MutableSnapshot mutableSnapshot) {
        try {
            if (mutableSnapshot.apply() instanceof SnapshotApplyResult.Failure) {
                throw new IllegalStateException("Unsupported concurrent change during composition. A state object was modified by composition as well as being modified outside composition.");
            }
        } finally {
            mutableSnapshot.dispose();
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final Object awaitWorkAvailable(A4.d dVar) {
        C0772m c0772m;
        if (getHasSchedulingWork()) {
            return C3137A.f25453a;
        }
        C0772m c0772m2 = new C0772m(1, AbstractC0872a.V(dVar));
        c0772m2.s();
        synchronized (this.stateLock) {
            if (getHasSchedulingWork()) {
                c0772m = c0772m2;
            } else {
                this.workContinuation = c0772m2;
                c0772m = null;
            }
        }
        if (c0772m != null) {
            c0772m.resumeWith(C3137A.f25453a);
        }
        Object objR = c0772m2.r();
        return objR == B4.a.f492a ? objR : C3137A.f25453a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final C3137A broadcastFrameClock$lambda$0(Recomposer recomposer) {
        recomposer.onNewFrameAwaiter();
        return C3137A.f25453a;
    }

    private final void clearKnownCompositionsLocked() {
        List<ControlledComposition> listKnownCompositionsLocked = knownCompositionsLocked();
        int size = listKnownCompositionsLocked.size();
        for (int i6 = 0; i6 < size; i6++) {
            unregisterCompositionLocked(listKnownCompositionsLocked.get(i6));
        }
        this._knownCompositions.clear();
        this._knownCompositionsCache = y.f26065a;
    }

    private final <T> T composing(ControlledComposition controlledComposition, O o6, J4.a aVar) {
        MutableSnapshot mutableSnapshotTakeMutableSnapshot = Snapshot.Companion.takeMutableSnapshot(readObserverOf(controlledComposition), writeObserverOf(controlledComposition, o6));
        try {
            Snapshot snapshotMakeCurrent = mutableSnapshotTakeMutableSnapshot.makeCurrent();
            try {
                return (T) aVar.invoke();
            } finally {
                mutableSnapshotTakeMutableSnapshot.restoreCurrent(snapshotMakeCurrent);
            }
        } finally {
            applyAndCheck(mutableSnapshotTakeMutableSnapshot);
        }
    }

    private static final void deletedMovableContent$lambda$0$recordNestedStatesOf(Recomposer recomposer, MovableContentStateReference movableContentStateReference, MovableContentStateReference movableContentStateReference2) {
        List<MovableContentStateReference> nestedReferences$runtime = movableContentStateReference2.getNestedReferences$runtime();
        if (nestedReferences$runtime != null) {
            int size = nestedReferences$runtime.size();
            for (int i6 = 0; i6 < size; i6++) {
                MovableContentStateReference movableContentStateReference3 = nestedReferences$runtime.get(i6);
                recomposer.movableContentNestedStatesAvailable.add(movableContentStateReference3.getContent$runtime(), new NestedMovableContent(movableContentStateReference3, movableContentStateReference));
                deletedMovableContent$lambda$0$recordNestedStatesOf(recomposer, movableContentStateReference, movableContentStateReference3);
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final InterfaceC0770l deriveStateLocked() {
        State state;
        if (((State) ((c0) this._state).getValue()).compareTo(State.ShuttingDown) <= 0) {
            clearKnownCompositionsLocked();
            this.snapshotInvalidations = new O();
            this.compositionInvalidations.clear();
            this.compositionsAwaitingApply.clear();
            this.movableContentAwaitingInsert.clear();
            this.failedCompositions = null;
            InterfaceC0770l interfaceC0770l = this.workContinuation;
            if (interfaceC0770l != null) {
                interfaceC0770l.i(null);
            }
            this.workContinuation = null;
            this.errorState = null;
            return null;
        }
        if (this.errorState != null) {
            state = State.Inactive;
        } else if (this.runnerJob == null) {
            this.snapshotInvalidations = new O();
            this.compositionInvalidations.clear();
            state = (getHasBroadcastFrameClockAwaitersLocked() || getHasNextFrameEndAwaitersLocked()) ? State.InactivePendingWork : State.Inactive;
        } else {
            state = (this.compositionInvalidations.getSize() == 0 && !this.snapshotInvalidations.c() && this.compositionsAwaitingApply.isEmpty() && this.movableContentAwaitingInsert.isEmpty() && this.concurrentCompositionsOutstanding <= 0 && !getHasBroadcastFrameClockAwaitersLocked() && !getHasNextFrameEndAwaitersLocked() && !MultiValueMap.m170isNotEmptyimpl(this.movableContentRemoved)) ? State.Idle : State.PendingWork;
        }
        ((c0) this._state).j(state);
        if (state != State.PendingWork) {
            return null;
        }
        InterfaceC0770l interfaceC0770l2 = this.workContinuation;
        this.workContinuation = null;
        return interfaceC0770l2;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void discardUnusedMovableContentState() {
        int i6;
        J j4;
        synchronized (this.stateLock) {
            try {
                if (MultiValueMap.m170isNotEmptyimpl(this.movableContentRemoved)) {
                    U uM175valuesimpl = MultiValueMap.m175valuesimpl(this.movableContentRemoved);
                    MultiValueMap.m159clearimpl(this.movableContentRemoved);
                    this.movableContentNestedStatesAvailable.clear();
                    MultiValueMap.m159clearimpl(this.movableContentNestedExtractionsPending);
                    j4 = new J(uM175valuesimpl.f21377b);
                    Object[] objArr = uM175valuesimpl.f21376a;
                    int i7 = uM175valuesimpl.f21377b;
                    for (int i8 = 0; i8 < i7; i8++) {
                        MovableContentStateReference movableContentStateReference = (MovableContentStateReference) objArr[i8];
                        j4.g(new w4.k(movableContentStateReference, this.movableContentStatesAvailable.d(movableContentStateReference)));
                    }
                    this.movableContentStatesAvailable.f();
                } else {
                    j4 = V.f21379b;
                    kotlin.jvm.internal.o.f(j4, "null cannot be cast to non-null type androidx.collection.ObjectList<E of androidx.collection.ObjectListKt.emptyObjectList>");
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        Object[] objArr2 = j4.f21376a;
        int i9 = j4.f21377b;
        for (i6 = 0; i6 < i9; i6++) {
            w4.k kVar = (w4.k) objArr2[i6];
            MovableContentStateReference movableContentStateReference2 = (MovableContentStateReference) kVar.f25469a;
            MovableContentState movableContentState = (MovableContentState) kVar.f25470b;
            if (movableContentState != null) {
                movableContentStateReference2.getComposition$runtime().disposeUnusedMovableContent(movableContentState);
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final C3137A effectJob$lambda$0$0(Recomposer recomposer, Throwable th) {
        InterfaceC0770l interfaceC0770l;
        InterfaceC0770l interfaceC0770l2;
        CancellationException cancellationExceptionA = E.a("Recomposer effect job completed", th);
        synchronized (recomposer.stateLock) {
            try {
                InterfaceC0765i0 interfaceC0765i0 = recomposer.runnerJob;
                interfaceC0770l = null;
                if (interfaceC0765i0 != null) {
                    ((c0) recomposer._state).j(State.ShuttingDown);
                    if (recomposer.isClosed) {
                        interfaceC0770l2 = recomposer.workContinuation;
                        if (interfaceC0770l2 != null) {
                        }
                        recomposer.workContinuation = null;
                        interfaceC0765i0.invokeOnCompletion(new B0(24, recomposer, th));
                        interfaceC0770l = interfaceC0770l2;
                    } else {
                        interfaceC0765i0.cancel(cancellationExceptionA);
                    }
                    interfaceC0770l2 = null;
                    recomposer.workContinuation = null;
                    interfaceC0765i0.invokeOnCompletion(new B0(24, recomposer, th));
                    interfaceC0770l = interfaceC0770l2;
                } else {
                    recomposer.closeCause = cancellationExceptionA;
                    ((c0) recomposer._state).j(State.ShutDown);
                }
            } catch (Throwable th2) {
                throw th2;
            }
        }
        if (interfaceC0770l != null) {
            interfaceC0770l.resumeWith(C3137A.f25453a);
        }
        return C3137A.f25453a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final C3137A effectJob$lambda$0$0$0$0(Recomposer recomposer, Throwable th, Throwable th2) {
        synchronized (recomposer.stateLock) {
            if (th == null) {
                th = null;
            } else if (th2 != null) {
                try {
                    if (th2 instanceof CancellationException) {
                        th2 = null;
                    }
                    if (th2 != null) {
                        AbstractC2613d.b(th, th2);
                    }
                } catch (Throwable th3) {
                    throw th3;
                }
            }
            recomposer.closeCause = th;
            ((c0) recomposer._state).j(State.ShutDown);
        }
        return C3137A.f25453a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final boolean getHasBroadcastFrameClockAwaiters() {
        boolean hasBroadcastFrameClockAwaitersLocked;
        synchronized (this.stateLock) {
            hasBroadcastFrameClockAwaitersLocked = getHasBroadcastFrameClockAwaitersLocked();
        }
        return hasBroadcastFrameClockAwaitersLocked;
    }

    private final boolean getHasBroadcastFrameClockAwaitersLocked() {
        return !this.frameClockPaused && this.broadcastFrameClock.getHasAwaiters();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final boolean getHasConcurrentFrameWorkLocked() {
        return !this.compositionsAwaitingApply.isEmpty() || getHasBroadcastFrameClockAwaitersLocked() || getHasNextFrameEndAwaitersLocked();
    }

    private final boolean getHasFrameWorkLocked() {
        return this.compositionInvalidations.getSize() != 0 || getHasBroadcastFrameClockAwaitersLocked() || getHasNextFrameEndAwaitersLocked() || MultiValueMap.m170isNotEmptyimpl(this.movableContentRemoved);
    }

    private final boolean getHasNextFrameEndAwaitersLocked() {
        return !this.frameClockPaused && this.nextFrameEndCallbackQueue.getHasAwaiters();
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX WARN: Removed duplicated region for block: B:17:0x0025  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean getHasSchedulingWork() {
        boolean z6;
        synchronized (this.stateLock) {
            if (this.snapshotInvalidations.c() || this.compositionInvalidations.getSize() != 0 || getHasBroadcastFrameClockAwaitersLocked()) {
                z6 = true;
            } else if (!getHasNextFrameEndAwaitersLocked()) {
                z6 = false;
            }
        }
        return z6;
    }

    private static /* synthetic */ void getRegistrationObservers$annotations() {
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX WARN: Type inference failed for: r0v7, types: [C4.i, J4.e] */
    public final boolean getShouldKeepRecomposing() {
        boolean z6;
        synchronized (this.stateLock) {
            z6 = this.isClosed;
        }
        if (!z6) {
            return true;
        }
        R4.l lVarL = A4.g.L((C4.i) ((H4.f) ((u0) this.effectJob).getChildren()).f2102b);
        while (lVarL.hasNext()) {
            if (((InterfaceC0765i0) lVarL.next()).isActive()) {
                return true;
            }
        }
        return false;
    }

    @InterfaceC3141c
    public static /* synthetic */ void getState$annotations() {
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final List<ControlledComposition> knownCompositions() {
        List<ControlledComposition> listKnownCompositionsLocked;
        synchronized (this.stateLock) {
            listKnownCompositionsLocked = knownCompositionsLocked();
        }
        return listKnownCompositionsLocked;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final List<ControlledComposition> knownCompositionsLocked() {
        List list = this._knownCompositionsCache;
        if (list != null) {
            return list;
        }
        List<ControlledComposition> list2 = this._knownCompositions;
        List<ControlledComposition> arrayList = list2.isEmpty() ? y.f26065a : new ArrayList(list2);
        this._knownCompositionsCache = arrayList;
        return arrayList;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final C3137A nextFrameEndCallbackQueue$lambda$0(Recomposer recomposer) {
        recomposer.onNewFrameAwaiter();
        return C3137A.f25453a;
    }

    private final void onNewFrameAwaiter() {
        InterfaceC0770l interfaceC0770lDeriveStateLocked;
        synchronized (this.stateLock) {
            interfaceC0770lDeriveStateLocked = deriveStateLocked();
            if (((State) ((c0) this._state).getValue()).compareTo(State.ShuttingDown) <= 0) {
                throw E.a("Recomposer shutdown; frame clock awaiter will never resume", this.closeCause);
            }
        }
        if (interfaceC0770lDeriveStateLocked != null) {
            interfaceC0770lDeriveStateLocked.resumeWith(C3137A.f25453a);
        }
    }

    private final void performInitialMovableContentInserts(ControlledComposition controlledComposition) {
        synchronized (this.stateLock) {
            List<MovableContentStateReference> list = this.movableContentAwaitingInsert;
            int size = list.size();
            for (int i6 = 0; i6 < size; i6++) {
                if (kotlin.jvm.internal.o.c(list.get(i6).getComposition$runtime(), controlledComposition)) {
                    ArrayList arrayList = new ArrayList();
                    performInitialMovableContentInserts$fillToInsert(arrayList, this, controlledComposition);
                    while (!arrayList.isEmpty()) {
                        performInsertValues(arrayList, null);
                        performInitialMovableContentInserts$fillToInsert(arrayList, this, controlledComposition);
                    }
                    return;
                }
            }
        }
    }

    private static final void performInitialMovableContentInserts$fillToInsert(List<MovableContentStateReference> list, Recomposer recomposer, ControlledComposition controlledComposition) {
        list.clear();
        synchronized (recomposer.stateLock) {
            Iterator<MovableContentStateReference> it = recomposer.movableContentAwaitingInsert.iterator();
            while (it.hasNext()) {
                MovableContentStateReference next = it.next();
                if (kotlin.jvm.internal.o.c(next.getComposition$runtime(), controlledComposition)) {
                    list.add(next);
                    it.remove();
                }
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX WARN: Code restructure failed: missing block: B:52:0x0135, code lost:
    
        r3 = r10.size();
        r4 = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:53:0x013a, code lost:
    
        if (r4 >= r3) goto L115;
     */
    /* JADX WARN: Code restructure failed: missing block: B:55:0x0144, code lost:
    
        if (((w4.k) r10.get(r4)).f25470b == null) goto L116;
     */
    /* JADX WARN: Code restructure failed: missing block: B:56:0x0146, code lost:
    
        r4 = r4 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:57:0x0149, code lost:
    
        r3 = new java.util.ArrayList(r10.size());
        r4 = r10.size();
        r9 = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:58:0x0157, code lost:
    
        if (r9 >= r4) goto L117;
     */
    /* JADX WARN: Code restructure failed: missing block: B:59:0x0159, code lost:
    
        r11 = (w4.k) r10.get(r9);
     */
    /* JADX WARN: Code restructure failed: missing block: B:60:0x0161, code lost:
    
        if (r11.f25470b != null) goto L64;
     */
    /* JADX WARN: Code restructure failed: missing block: B:61:0x0163, code lost:
    
        r11 = (androidx.compose.runtime.MovableContentStateReference) r11.f25469a;
     */
    /* JADX WARN: Code restructure failed: missing block: B:64:0x016a, code lost:
    
        r11 = null;
     */
    /* JADX WARN: Code restructure failed: missing block: B:65:0x016b, code lost:
    
        if (r11 == null) goto L119;
     */
    /* JADX WARN: Code restructure failed: missing block: B:66:0x016d, code lost:
    
        r3.add(r11);
     */
    /* JADX WARN: Code restructure failed: missing block: B:67:0x0170, code lost:
    
        r9 = r9 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:68:0x0173, code lost:
    
        r4 = r16.stateLock;
     */
    /* JADX WARN: Code restructure failed: missing block: B:69:0x0175, code lost:
    
        monitor-enter(r4);
     */
    /* JADX WARN: Code restructure failed: missing block: B:70:0x0176, code lost:
    
        x4.AbstractC3257w.L(r3, r16.movableContentAwaitingInsert);
     */
    /* JADX WARN: Code restructure failed: missing block: B:71:0x017b, code lost:
    
        monitor-exit(r4);
     */
    /* JADX WARN: Code restructure failed: missing block: B:72:0x017c, code lost:
    
        r3 = new java.util.ArrayList(r10.size());
        r4 = r10.size();
        r9 = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:73:0x018a, code lost:
    
        if (r9 >= r4) goto L120;
     */
    /* JADX WARN: Code restructure failed: missing block: B:74:0x018c, code lost:
    
        r11 = r10.get(r9);
     */
    /* JADX WARN: Code restructure failed: missing block: B:75:0x0195, code lost:
    
        if (((w4.k) r11).f25470b == null) goto L122;
     */
    /* JADX WARN: Code restructure failed: missing block: B:76:0x0197, code lost:
    
        r3.add(r11);
     */
    /* JADX WARN: Code restructure failed: missing block: B:77:0x019a, code lost:
    
        r9 = r9 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:78:0x019d, code lost:
    
        r10 = r3;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final List<ControlledComposition> performInsertValues(List<MovableContentStateReference> list, O o6) {
        ArrayList arrayList;
        NestedMovableContent nestedMovableContentRemoveLast;
        HashMap map = new HashMap(list.size());
        int size = list.size();
        for (int i6 = 0; i6 < size; i6++) {
            MovableContentStateReference movableContentStateReference = list.get(i6);
            ControlledComposition composition$runtime = movableContentStateReference.getComposition$runtime();
            Object arrayList2 = map.get(composition$runtime);
            if (arrayList2 == null) {
                arrayList2 = new ArrayList();
                map.put(composition$runtime, arrayList2);
            }
            ((ArrayList) arrayList2).add(movableContentStateReference);
        }
        for (Map.Entry entry : map.entrySet()) {
            ControlledComposition controlledComposition = (ControlledComposition) entry.getKey();
            List list2 = (List) entry.getValue();
            if (controlledComposition.isComposing()) {
                ComposerKt.composeImmediateRuntimeError("Check failed");
            }
            MutableSnapshot mutableSnapshotTakeMutableSnapshot = Snapshot.Companion.takeMutableSnapshot(readObserverOf(controlledComposition), writeObserverOf(controlledComposition, o6));
            try {
                Snapshot snapshotMakeCurrent = mutableSnapshotTakeMutableSnapshot.makeCurrent();
                try {
                    synchronized (this.stateLock) {
                        try {
                            arrayList = new ArrayList(list2.size());
                            int size2 = list2.size();
                            for (int i7 = 0; i7 < size2; i7++) {
                                MovableContentStateReference movableContentStateReference2 = (MovableContentStateReference) list2.get(i7);
                                Object objM172removeLastimpl = MultiValueMap.m172removeLastimpl(this.movableContentRemoved, movableContentStateReference2.getContent$runtime());
                                MovableContentStateReference movableContentStateReference3 = (MovableContentStateReference) objM172removeLastimpl;
                                if (movableContentStateReference3 != null) {
                                    this.movableContentNestedStatesAvailable.usedContainer(movableContentStateReference3);
                                }
                                arrayList.add(new w4.k(movableContentStateReference2, objM172removeLastimpl));
                            }
                            if (ComposeRuntimeFlags.isMovingNestedMovableContentEnabled) {
                                int size3 = arrayList.size();
                                int i8 = 0;
                                while (true) {
                                    if (i8 >= size3) {
                                        break;
                                    }
                                    w4.k kVar = (w4.k) arrayList.get(i8);
                                    if (kVar.f25470b == null && this.movableContentNestedStatesAvailable.contains(((MovableContentStateReference) kVar.f25469a).getContent$runtime())) {
                                        ArrayList arrayList3 = new ArrayList(arrayList.size());
                                        int size4 = arrayList.size();
                                        for (int i9 = 0; i9 < size4; i9++) {
                                            w4.k kVar2 = (w4.k) arrayList.get(i9);
                                            if (kVar2.f25470b == null && (nestedMovableContentRemoveLast = this.movableContentNestedStatesAvailable.removeLast(((MovableContentStateReference) kVar2.f25469a).getContent$runtime())) != null) {
                                                MovableContentStateReference content = nestedMovableContentRemoveLast.getContent();
                                                MultiValueMap.m157addimpl(this.movableContentNestedExtractionsPending, nestedMovableContentRemoveLast.getContainer(), content);
                                                kVar2 = new w4.k(kVar2.f25469a, content);
                                            }
                                            arrayList3.add(kVar2);
                                        }
                                        arrayList = arrayList3;
                                    } else {
                                        i8++;
                                    }
                                }
                            }
                        } finally {
                        }
                    }
                    int size5 = arrayList.size();
                    int i10 = 0;
                    while (true) {
                        if (i10 >= size5) {
                            break;
                        }
                        if (((w4.k) arrayList.get(i10)).f25470b != null) {
                            break;
                        }
                        i10++;
                    }
                    controlledComposition.insertMovableContent(arrayList);
                    mutableSnapshotTakeMutableSnapshot.restoreCurrent(snapshotMakeCurrent);
                } catch (Throwable th) {
                    mutableSnapshotTakeMutableSnapshot.restoreCurrent(snapshotMakeCurrent);
                    throw th;
                }
            } finally {
                applyAndCheck(mutableSnapshotTakeMutableSnapshot);
            }
        }
        return AbstractC3251q.C0(map.keySet());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final ControlledComposition performRecompose(ControlledComposition controlledComposition, O o6) {
        if (controlledComposition.isComposing() || controlledComposition.isDisposed()) {
            return null;
        }
        Set<ControlledComposition> set = this.compositionsRemoved;
        if (set != null && set.contains(controlledComposition)) {
            return null;
        }
        MutableSnapshot mutableSnapshotTakeMutableSnapshot = Snapshot.Companion.takeMutableSnapshot(readObserverOf(controlledComposition), writeObserverOf(controlledComposition, o6));
        try {
            Snapshot snapshotMakeCurrent = mutableSnapshotTakeMutableSnapshot.makeCurrent();
            if (o6 != null) {
                try {
                    if (o6.c()) {
                        controlledComposition.prepareCompose(new B2.j(27, o6, controlledComposition));
                    }
                } catch (Throwable th) {
                    mutableSnapshotTakeMutableSnapshot.restoreCurrent(snapshotMakeCurrent);
                    throw th;
                }
            }
            boolean zRecompose = controlledComposition.recompose();
            mutableSnapshotTakeMutableSnapshot.restoreCurrent(snapshotMakeCurrent);
            if (zRecompose) {
                return controlledComposition;
            }
            return null;
        } finally {
            applyAndCheck(mutableSnapshotTakeMutableSnapshot);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX WARN: Removed duplicated region for block: B:14:0x003e  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final C3137A performRecompose$lambda$0$0(O o6, ControlledComposition controlledComposition) {
        Object[] objArr = o6.f21389b;
        long[] jArr = o6.f21388a;
        int length = jArr.length - 2;
        if (length >= 0) {
            int i6 = 0;
            while (true) {
                long j4 = jArr[i6];
                if ((((~j4) << 7) & j4 & (-9187201950435737472L)) != -9187201950435737472L) {
                    int i7 = 8 - ((~(i6 - length)) >>> 31);
                    for (int i8 = 0; i8 < i7; i8++) {
                        if ((255 & j4) < 128) {
                            controlledComposition.recordWriteOf(objArr[(i6 << 3) + i8]);
                        }
                        j4 >>= 8;
                    }
                    if (i7 != 8) {
                        break;
                    }
                    if (i6 == length) {
                        break;
                    }
                    i6++;
                }
            }
        }
        return C3137A.f25453a;
    }

    private final void processCompositionError(Throwable th, ControlledComposition controlledComposition, boolean z6) throws Throwable {
        if (!_hotReloadEnabled.get().booleanValue() || (th instanceof ComposeRuntimeError)) {
            synchronized (this.stateLock) {
                Utils_androidKt.logError("Error was captured in composition.", th);
                RecomposerErrorState recomposerErrorState = this.errorState;
                if (recomposerErrorState != null) {
                    throw recomposerErrorState.getCause();
                }
                this.errorState = new RecomposerErrorState(false, th);
            }
            throw th;
        }
        synchronized (this.stateLock) {
            try {
                Utils_androidKt.logError("Error was captured in composition while live edit was enabled.", th);
                this.compositionsAwaitingApply.clear();
                this.compositionInvalidations.clear();
                this.snapshotInvalidations = new O();
                this.movableContentAwaitingInsert.clear();
                MultiValueMap.m159clearimpl(this.movableContentRemoved);
                this.movableContentStatesAvailable.f();
                this.errorState = new RecomposerErrorState(z6, th);
                if (controlledComposition != null) {
                    recordFailedCompositionLocked(controlledComposition);
                }
                deriveStateLocked();
            } catch (Throwable th2) {
                throw th2;
            }
        }
    }

    public static /* synthetic */ void processCompositionError$default(Recomposer recomposer, Throwable th, ControlledComposition controlledComposition, boolean z6, int i6, Object obj) throws Throwable {
        if ((i6 & 2) != 0) {
            controlledComposition = null;
        }
        if ((i6 & 4) != 0) {
            z6 = false;
        }
        recomposer.processCompositionError(th, controlledComposition, z6);
    }

    private final J4.c readObserverOf(ControlledComposition controlledComposition) {
        return new p(controlledComposition, 4);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final C3137A readObserverOf$lambda$0(ControlledComposition controlledComposition, Object obj) {
        controlledComposition.recordReadOf(obj);
        return C3137A.f25453a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final Object recompositionRunner(J4.f fVar, A4.d dVar) {
        Object objH = E.H(this.broadcastFrameClock, new C09902(fVar, MonotonicFrameClockKt.getMonotonicFrameClock(dVar.getContext()), null), dVar);
        return objH == B4.a.f492a ? objH : C3137A.f25453a;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final boolean recordComposerModifications() {
        boolean hasFrameWorkLocked;
        synchronized (this.stateLock) {
            if (this.snapshotInvalidations.b()) {
                return getHasFrameWorkLocked();
            }
            List<ControlledComposition> listKnownCompositionsLocked = knownCompositionsLocked();
            Set<? extends Object> setWrapIntoSet = ScatterSetWrapperKt.wrapIntoSet(this.snapshotInvalidations);
            this.snapshotInvalidations = new O();
            try {
                int size = listKnownCompositionsLocked.size();
                for (int i6 = 0; i6 < size; i6++) {
                    listKnownCompositionsLocked.get(i6).recordModificationsOf(setWrapIntoSet);
                    if (((State) ((c0) this._state).getValue()).compareTo(State.ShuttingDown) <= 0) {
                        break;
                    }
                }
                synchronized (this.stateLock) {
                    if (deriveStateLocked() != null) {
                        throw new IllegalStateException("called outside of runRecomposeAndApplyChanges");
                    }
                    hasFrameWorkLocked = getHasFrameWorkLocked();
                }
                return hasFrameWorkLocked;
            } catch (Throwable th) {
                synchronized (this.stateLock) {
                    O o6 = this.snapshotInvalidations;
                    Set<? extends Object> elements = setWrapIntoSet;
                    o6.getClass();
                    kotlin.jvm.internal.o.h(elements, "elements");
                    Iterator it = elements.iterator();
                    while (it.hasNext()) {
                        o6.j(it.next());
                    }
                    throw th;
                }
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void recordFailedCompositionLocked(ControlledComposition controlledComposition) {
        List arrayList = this.failedCompositions;
        if (arrayList == null) {
            arrayList = new ArrayList();
            this.failedCompositions = arrayList;
        }
        if (!arrayList.contains(controlledComposition)) {
            arrayList.add(controlledComposition);
        }
        removeKnownCompositionLocked(controlledComposition);
    }

    private final void registerCompositionLocked(ControlledComposition controlledComposition) {
        J j4 = this.registrationObservers;
        if (j4 != null) {
            Object[] objArr = j4.f21376a;
            int i6 = j4.f21377b;
            for (int i7 = 0; i7 < i6; i7++) {
                CompositionRegistrationObserver compositionRegistrationObserver = (CompositionRegistrationObserver) objArr[i7];
                if (controlledComposition instanceof ObservableComposition) {
                    compositionRegistrationObserver.onCompositionRegistered((ObservableComposition) controlledComposition);
                }
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void registerRunnerJob(InterfaceC0765i0 interfaceC0765i0) {
        synchronized (this.stateLock) {
            Throwable th = this.closeCause;
            if (th != null) {
                throw th;
            }
            if (((State) ((c0) this._state).getValue()).compareTo(State.ShuttingDown) <= 0) {
                throw new IllegalStateException("Recomposer shut down");
            }
            if (this.runnerJob != null) {
                throw new IllegalStateException("Recomposer already running");
            }
            this.runnerJob = interfaceC0765i0;
            deriveStateLocked();
        }
    }

    private final void removeKnownCompositionLocked(ControlledComposition controlledComposition) {
        if (this._knownCompositions.remove(controlledComposition)) {
            this._knownCompositionsCache = null;
            unregisterCompositionLocked(controlledComposition);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final RecomposerErrorState resetErrorState() {
        RecomposerErrorState recomposerErrorState;
        synchronized (this.stateLock) {
            recomposerErrorState = this.errorState;
            if (recomposerErrorState != null) {
                this.errorState = null;
                deriveStateLocked();
            }
        }
        return recomposerErrorState;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void retryFailedCompositions() {
        List<ControlledComposition> list;
        int i6;
        synchronized (this.stateLock) {
            list = this.failedCompositions;
            this.failedCompositions = null;
        }
        if (list == null) {
            return;
        }
        while (true) {
            i6 = 0;
            try {
                if (list.isEmpty()) {
                    break;
                }
                ControlledComposition controlledComposition = (ControlledComposition) AbstractC3257w.U(list);
                if (controlledComposition instanceof CompositionImpl) {
                    ((CompositionImpl) controlledComposition).invalidateAll();
                    ((CompositionImpl) controlledComposition).setContent(((CompositionImpl) controlledComposition).getComposable());
                    if (this.errorState != null) {
                        break;
                    }
                }
            } catch (Throwable th) {
                if (!list.isEmpty()) {
                    synchronized (this.stateLock) {
                        int size = list.size();
                        while (i6 < size) {
                            recordFailedCompositionLocked(list.get(i6));
                            i6++;
                        }
                    }
                }
                throw th;
            }
        }
        if (list.isEmpty()) {
            return;
        }
        synchronized (this.stateLock) {
            int size2 = list.size();
            while (i6 < size2) {
                recordFailedCompositionLocked(list.get(i6));
                i6++;
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX WARN: Code restructure failed: missing block: B:23:0x0091, code lost:
    
        if (r5.withFrameNanos(r9, r0) != r1) goto L13;
     */
    /* JADX WARN: Removed duplicated region for block: B:21:0x007a  */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:23:0x0091 -> B:13:0x0039). Please report as a decompilation issue!!! */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object runFrameLoop(MonotonicFrameClock monotonicFrameClock, ProduceFrameSignal produceFrameSignal, A4.d dVar) {
        AnonymousClass1 anonymousClass1;
        List arrayList;
        List arrayList2;
        final List list;
        final List list2;
        MonotonicFrameClock monotonicFrameClock2;
        final ProduceFrameSignal produceFrameSignal2;
        Object obj;
        if (dVar instanceof AnonymousClass1) {
            anonymousClass1 = (AnonymousClass1) dVar;
            int i6 = anonymousClass1.label;
            if ((i6 & Integer.MIN_VALUE) != 0) {
                anonymousClass1.label = i6 - Integer.MIN_VALUE;
            } else {
                anonymousClass1 = new AnonymousClass1(dVar);
            }
        }
        Object obj2 = anonymousClass1.result;
        B4.a aVar = B4.a.f492a;
        int i7 = anonymousClass1.label;
        if (i7 == 0) {
            AbstractC2467b.l(obj2);
            arrayList = new ArrayList();
            arrayList2 = new ArrayList();
            obj = this.stateLock;
            anonymousClass1.L$0 = monotonicFrameClock;
            anonymousClass1.L$1 = produceFrameSignal;
            anonymousClass1.L$2 = arrayList;
            anonymousClass1.L$3 = arrayList2;
            anonymousClass1.label = 1;
            if (produceFrameSignal.awaitFrameRequest(obj, anonymousClass1) != aVar) {
            }
            return aVar;
        }
        if (i7 != 1) {
            if (i7 != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            list2 = (List) anonymousClass1.L$3;
            list = (List) anonymousClass1.L$2;
            produceFrameSignal2 = (ProduceFrameSignal) anonymousClass1.L$1;
            monotonicFrameClock2 = (MonotonicFrameClock) anonymousClass1.L$0;
            AbstractC2467b.l(obj2);
            arrayList = list;
            produceFrameSignal = produceFrameSignal2;
            arrayList2 = list2;
            monotonicFrameClock = monotonicFrameClock2;
            obj = this.stateLock;
            anonymousClass1.L$0 = monotonicFrameClock;
            anonymousClass1.L$1 = produceFrameSignal;
            anonymousClass1.L$2 = arrayList;
            anonymousClass1.L$3 = arrayList2;
            anonymousClass1.label = 1;
            if (produceFrameSignal.awaitFrameRequest(obj, anonymousClass1) != aVar) {
                monotonicFrameClock2 = monotonicFrameClock;
                list2 = arrayList2;
                produceFrameSignal2 = produceFrameSignal;
                list = arrayList;
                J4.c cVar = new J4.c() { // from class: androidx.compose.runtime.s
                    @Override // J4.c
                    public final Object invoke(Object obj3) {
                        long jLongValue = ((Long) obj3).longValue();
                        return Recomposer.runFrameLoop$lambda$0(this.f11103a, list, list2, produceFrameSignal2, jLongValue);
                    }
                };
                anonymousClass1.L$0 = monotonicFrameClock2;
                anonymousClass1.L$1 = produceFrameSignal2;
                anonymousClass1.L$2 = list;
                anonymousClass1.L$3 = list2;
                anonymousClass1.label = 2;
            }
            return aVar;
        }
        list2 = (List) anonymousClass1.L$3;
        list = (List) anonymousClass1.L$2;
        produceFrameSignal2 = (ProduceFrameSignal) anonymousClass1.L$1;
        monotonicFrameClock2 = (MonotonicFrameClock) anonymousClass1.L$0;
        AbstractC2467b.l(obj2);
        J4.c cVar2 = new J4.c() { // from class: androidx.compose.runtime.s
            @Override // J4.c
            public final Object invoke(Object obj3) {
                long jLongValue = ((Long) obj3).longValue();
                return Recomposer.runFrameLoop$lambda$0(this.f11103a, list, list2, produceFrameSignal2, jLongValue);
            }
        };
        anonymousClass1.L$0 = monotonicFrameClock2;
        anonymousClass1.L$1 = produceFrameSignal2;
        anonymousClass1.L$2 = list;
        anonymousClass1.L$3 = list2;
        anonymousClass1.label = 2;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final InterfaceC0770l runFrameLoop$lambda$0(Recomposer recomposer, List list, List list2, ProduceFrameSignal produceFrameSignal, long j4) {
        Object objBeginSection;
        int i6;
        InterfaceC0770l interfaceC0770lDeriveStateLocked;
        if (recomposer.getHasBroadcastFrameClockAwaiters()) {
            Trace trace = Trace.INSTANCE;
            objBeginSection = trace.beginSection("Recomposer:animation");
            try {
                recomposer.broadcastFrameClock.sendFrame(j4);
                Snapshot.Companion.sendApplyNotifications();
                trace.endSection(objBeginSection);
            } finally {
            }
        }
        objBeginSection = Trace.INSTANCE.beginSection("Recomposer:recompose");
        try {
            recomposer.recordComposerModifications();
            synchronized (recomposer.stateLock) {
                try {
                    List<ControlledComposition> list3 = recomposer.compositionsAwaitingApply;
                    int size = list3.size();
                    for (int i7 = 0; i7 < size; i7++) {
                        list2.add(list3.get(i7));
                    }
                    recomposer.compositionsAwaitingApply.clear();
                    MutableVector<ControlledComposition> mutableVector = recomposer.compositionInvalidations;
                    ControlledComposition[] controlledCompositionArr = mutableVector.content;
                    int size2 = mutableVector.getSize();
                    for (int i8 = 0; i8 < size2; i8++) {
                        list.add(controlledCompositionArr[i8]);
                    }
                    recomposer.compositionInvalidations.clear();
                    produceFrameSignal.takeFrameRequestLocked();
                } catch (Throwable th) {
                    throw th;
                }
            }
            O o6 = new O();
            try {
                int size3 = list.size();
                for (int i9 = 0; i9 < size3; i9++) {
                    ControlledComposition controlledCompositionPerformRecompose = recomposer.performRecompose((ControlledComposition) list.get(i9), o6);
                    if (controlledCompositionPerformRecompose != null) {
                        list2.add(controlledCompositionPerformRecompose);
                    }
                }
                list.clear();
                if (!list2.isEmpty()) {
                    recomposer.changeCount++;
                }
                try {
                    int size4 = list2.size();
                    for (i6 = 0; i6 < size4; i6++) {
                        ((ControlledComposition) list2.get(i6)).applyChanges();
                    }
                    list2.clear();
                    synchronized (recomposer.stateLock) {
                        interfaceC0770lDeriveStateLocked = recomposer.deriveStateLocked();
                    }
                    return interfaceC0770lDeriveStateLocked;
                } catch (Throwable th2) {
                    list2.clear();
                    throw th2;
                }
            } catch (Throwable th3) {
                list.clear();
                throw th3;
            }
        } finally {
        }
    }

    private final void unregisterCompositionLocked(ControlledComposition controlledComposition) {
        J j4 = this.registrationObservers;
        if (j4 != null) {
            Object[] objArr = j4.f21376a;
            int i6 = j4.f21377b;
            for (int i7 = 0; i7 < i6; i7++) {
                CompositionRegistrationObserver compositionRegistrationObserver = (CompositionRegistrationObserver) objArr[i7];
                if (controlledComposition instanceof ObservableComposition) {
                    compositionRegistrationObserver.onCompositionUnregistered((ObservableComposition) controlledComposition);
                }
            }
        }
    }

    private final void withTransparentSnapshot(J4.a aVar) {
        Snapshot current = Snapshot.Companion.getCurrent();
        Snapshot transparentObserverMutableSnapshot = current instanceof MutableSnapshot ? new TransparentObserverMutableSnapshot((MutableSnapshot) current, null, null, true, false) : new TransparentObserverSnapshot(current, null, true, false);
        try {
            Snapshot snapshotMakeCurrent = transparentObserverMutableSnapshot.makeCurrent();
            try {
                aVar.invoke();
                transparentObserverMutableSnapshot.restoreCurrent(snapshotMakeCurrent);
                transparentObserverMutableSnapshot.dispose();
            } catch (Throwable th) {
                transparentObserverMutableSnapshot.restoreCurrent(snapshotMakeCurrent);
                throw th;
            }
        } catch (Throwable th2) {
            transparentObserverMutableSnapshot.dispose();
            throw th2;
        }
    }

    private final J4.c writeObserverOf(ControlledComposition controlledComposition, O o6) {
        return new B0(25, controlledComposition, o6);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final C3137A writeObserverOf$lambda$0(ControlledComposition controlledComposition, O o6, Object obj) {
        controlledComposition.recordWriteOf(obj);
        if (o6 != null) {
            o6.d(obj);
        }
        return C3137A.f25453a;
    }

    public final CompositionObserverHandle addCompositionRegistrationObserver$runtime(final CompositionRegistrationObserver compositionRegistrationObserver) {
        synchronized (this.stateLock) {
            try {
                J j4 = this.registrationObservers;
                if (j4 == null) {
                    j4 = new J();
                    this.registrationObservers = j4;
                }
                j4.g(compositionRegistrationObserver);
                List<ControlledComposition> list = this._knownCompositions;
                int size = list.size();
                for (int i6 = 0; i6 < size; i6++) {
                    ControlledComposition controlledComposition = list.get(i6);
                    if (controlledComposition instanceof ObservableComposition) {
                        compositionRegistrationObserver.onCompositionRegistered((ObservableComposition) controlledComposition);
                    }
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return new CompositionObserverHandle() { // from class: androidx.compose.runtime.Recomposer$addCompositionRegistrationObserver$2
            @Override // androidx.compose.runtime.tooling.CompositionObserverHandle
            public void dispose() {
                Object obj = this.this$0.stateLock;
                Recomposer recomposer = this.this$0;
                CompositionRegistrationObserver compositionRegistrationObserver2 = compositionRegistrationObserver;
                synchronized (obj) {
                    J j6 = recomposer.registrationObservers;
                    if (j6 != null) {
                        j6.k(compositionRegistrationObserver2);
                    }
                }
            }
        };
    }

    public final RecomposerInfo asRecomposerInfo() {
        return this.recomposerInfo;
    }

    public final Object awaitIdle(A4.d dVar) {
        Object objCollect = new C0851q(getCurrentState(), new AnonymousClass2(null)).collect(w.f9214a, dVar);
        B4.a aVar = B4.a.f492a;
        C3137A c3137a = C3137A.f25453a;
        if (objCollect != aVar) {
            objCollect = c3137a;
        }
        return objCollect == aVar ? objCollect : c3137a;
    }

    public final void cancel() {
        synchronized (this.stateLock) {
            if (((State) ((c0) this._state).getValue()).compareTo(State.Idle) >= 0) {
                ((c0) this._state).j(State.ShuttingDown);
            }
        }
        ((u0) this.effectJob).cancel(null);
    }

    public final void close() {
        if (((C0769k0) this.effectJob).G(C3137A.f25453a)) {
            synchronized (this.stateLock) {
                this.isClosed = true;
            }
        }
    }

    @Override // androidx.compose.runtime.CompositionContext
    @ComposableInferredTarget(scheme = "[0[0]]")
    public void composeInitial$runtime(ControlledComposition controlledComposition, J4.e eVar) throws Throwable {
        Throwable th;
        boolean z6;
        Recomposer recomposer;
        Throwable th2;
        boolean zIsComposing = controlledComposition.isComposing();
        synchronized (this.stateLock) {
            try {
                State state = (State) ((c0) this._state).getValue();
                State state2 = State.ShuttingDown;
                if (state.compareTo(state2) > 0) {
                    try {
                        boolean zContains = knownCompositionsLocked().contains(controlledComposition);
                        z6 = !zContains;
                        if (!zContains) {
                            registerCompositionLocked(controlledComposition);
                        }
                    } catch (Throwable th3) {
                        th = th3;
                        throw th;
                    }
                } else {
                    z6 = true;
                }
                try {
                    Snapshot.Companion companion = Snapshot.Companion;
                    MutableSnapshot mutableSnapshotTakeMutableSnapshot = companion.takeMutableSnapshot(readObserverOf(controlledComposition), writeObserverOf(controlledComposition, null));
                    try {
                        Snapshot snapshotMakeCurrent = mutableSnapshotTakeMutableSnapshot.makeCurrent();
                        try {
                            controlledComposition.composeContent(eVar);
                            mutableSnapshotTakeMutableSnapshot.restoreCurrent(snapshotMakeCurrent);
                            applyAndCheck(mutableSnapshotTakeMutableSnapshot);
                            synchronized (this.stateLock) {
                                try {
                                    if (((State) ((c0) this._state).getValue()).compareTo(state2) > 0) {
                                        try {
                                            if (!knownCompositionsLocked().contains(controlledComposition)) {
                                                addKnownCompositionLocked(controlledComposition);
                                            }
                                        } catch (Throwable th4) {
                                            th2 = th4;
                                            throw th2;
                                        }
                                    } else {
                                        unregisterCompositionLocked(controlledComposition);
                                    }
                                    if (!zIsComposing) {
                                        companion.notifyObjectsInitialized();
                                    }
                                    try {
                                        performInitialMovableContentInserts(controlledComposition);
                                        try {
                                            controlledComposition.applyChanges();
                                            controlledComposition.applyLateChanges();
                                            if (zIsComposing) {
                                                return;
                                            }
                                            companion.notifyObjectsInitialized();
                                        } catch (Throwable th5) {
                                            processCompositionError$default(this, th5, null, false, 6, null);
                                        }
                                    } catch (Throwable th6) {
                                        processCompositionError(th6, controlledComposition, true);
                                    }
                                } catch (Throwable th7) {
                                    th2 = th7;
                                }
                            }
                        } catch (Throwable th8) {
                            recomposer = this;
                            try {
                                mutableSnapshotTakeMutableSnapshot.restoreCurrent(snapshotMakeCurrent);
                                throw th8;
                            } catch (Throwable th9) {
                                th = th9;
                                Throwable th10 = th;
                                try {
                                    applyAndCheck(mutableSnapshotTakeMutableSnapshot);
                                    throw th10;
                                } catch (Throwable th11) {
                                    th = th11;
                                    Throwable th12 = th;
                                    if (z6) {
                                        synchronized (recomposer.stateLock) {
                                            unregisterCompositionLocked(controlledComposition);
                                        }
                                    }
                                    processCompositionError(th12, controlledComposition, true);
                                }
                            }
                        }
                    } catch (Throwable th13) {
                        th = th13;
                        recomposer = this;
                    }
                } catch (Throwable th14) {
                    th = th14;
                    recomposer = this;
                }
            } catch (Throwable th15) {
                th = th15;
            }
        }
    }

    @Override // androidx.compose.runtime.CompositionContext
    @ComposableInferredTarget(scheme = "[0[0]]")
    public Z composeInitialPaused$runtime(ControlledComposition controlledComposition, ShouldPauseCallback shouldPauseCallback, J4.e eVar) {
        try {
            ShouldPauseCallback andSetShouldPauseCallback = controlledComposition.getAndSetShouldPauseCallback(shouldPauseCallback);
            try {
                composeInitial$runtime(controlledComposition, eVar);
                O o6 = this.pausedScopes.get();
                if (o6 == null) {
                    o6 = n.a0.f21397a;
                    kotlin.jvm.internal.o.f(o6, "null cannot be cast to non-null type androidx.collection.ScatterSet<E of androidx.collection.ScatterSetKt.emptyScatterSet>");
                }
                return o6;
            } finally {
                controlledComposition.getAndSetShouldPauseCallback(andSetShouldPauseCallback);
            }
        } finally {
            this.pausedScopes.set(null);
        }
    }

    @Override // androidx.compose.runtime.CompositionContext
    public void deletedMovableContent$runtime(MovableContentStateReference movableContentStateReference) {
        InterfaceC0770l interfaceC0770lDeriveStateLocked;
        synchronized (this.stateLock) {
            try {
                MultiValueMap.m157addimpl(this.movableContentRemoved, movableContentStateReference.getContent$runtime(), movableContentStateReference);
                if (movableContentStateReference.getNestedReferences$runtime() != null) {
                    deletedMovableContent$lambda$0$recordNestedStatesOf(this, movableContentStateReference, movableContentStateReference);
                }
                interfaceC0770lDeriveStateLocked = deriveStateLocked();
            } catch (Throwable th) {
                throw th;
            }
        }
        if (interfaceC0770lDeriveStateLocked != null) {
            interfaceC0770lDeriveStateLocked.resumeWith(C3137A.f25453a);
        }
    }

    public final long getChangeCount() {
        return this.changeCount;
    }

    @Override // androidx.compose.runtime.CompositionContext
    public boolean getCollectingCallByInformation$runtime() {
        return _hotReloadEnabled.get().booleanValue();
    }

    @Override // androidx.compose.runtime.CompositionContext
    public boolean getCollectingParameterInformation$runtime() {
        return false;
    }

    @Override // androidx.compose.runtime.CompositionContext
    public boolean getCollectingSourceInformation$runtime() {
        return ComposeStackTraceMode.m274equalsimpl0(ComposerKt.getComposeStackTraceMode(), ComposeStackTraceMode.Companion.m281getSourceInformationMD5MrJc());
    }

    @Override // androidx.compose.runtime.CompositionContext
    public long getCompositeKeyHashCode$runtime() {
        return 1000;
    }

    @Override // androidx.compose.runtime.CompositionContext
    public Composition getComposition$runtime() {
        return null;
    }

    public final a0 getCurrentState() {
        return this._state;
    }

    @Override // androidx.compose.runtime.CompositionContext
    public A4.j getEffectCoroutineContext() {
        return this.effectCoroutineContext;
    }

    /* JADX WARN: Removed duplicated region for block: B:23:0x0039  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean getHasPendingWork() {
        boolean z6;
        synchronized (this.stateLock) {
            if (this.snapshotInvalidations.c() || this.compositionInvalidations.getSize() != 0 || this.concurrentCompositionsOutstanding > 0 || !this.compositionsAwaitingApply.isEmpty() || getHasBroadcastFrameClockAwaitersLocked() || getHasNextFrameEndAwaitersLocked()) {
                z6 = true;
            } else if (!MultiValueMap.m170isNotEmptyimpl(this.movableContentRemoved)) {
                z6 = false;
            }
        }
        return z6;
    }

    @Override // androidx.compose.runtime.CompositionContext
    public A4.j getRecomposeCoroutineContext$runtime() {
        return A4.k.f106a;
    }

    @Override // androidx.compose.runtime.CompositionContext
    public boolean getStackTraceEnabled$runtime() {
        return !ComposeStackTraceMode.m274equalsimpl0(ComposerKt.getComposeStackTraceMode(), ComposeStackTraceMode.Companion.m280getNoneMD5MrJc());
    }

    public final InterfaceC0843i getState() {
        return getCurrentState();
    }

    @Override // androidx.compose.runtime.CompositionContext
    public void insertMovableContent$runtime(MovableContentStateReference movableContentStateReference) {
        InterfaceC0770l interfaceC0770lDeriveStateLocked;
        synchronized (this.stateLock) {
            this.movableContentAwaitingInsert.add(movableContentStateReference);
            interfaceC0770lDeriveStateLocked = deriveStateLocked();
        }
        if (interfaceC0770lDeriveStateLocked != null) {
            interfaceC0770lDeriveStateLocked.resumeWith(C3137A.f25453a);
        }
    }

    @Override // androidx.compose.runtime.CompositionContext
    public void invalidate$runtime(ControlledComposition controlledComposition) {
        InterfaceC0770l interfaceC0770lDeriveStateLocked;
        synchronized (this.stateLock) {
            if (this.compositionInvalidations.contains(controlledComposition)) {
                interfaceC0770lDeriveStateLocked = null;
            } else {
                this.compositionInvalidations.add(controlledComposition);
                interfaceC0770lDeriveStateLocked = deriveStateLocked();
            }
        }
        if (interfaceC0770lDeriveStateLocked != null) {
            interfaceC0770lDeriveStateLocked.resumeWith(C3137A.f25453a);
        }
    }

    @Override // androidx.compose.runtime.CompositionContext
    public void invalidateScope$runtime(RecomposeScopeImpl recomposeScopeImpl) {
        InterfaceC0770l interfaceC0770lDeriveStateLocked;
        synchronized (this.stateLock) {
            this.snapshotInvalidations.d(recomposeScopeImpl);
            interfaceC0770lDeriveStateLocked = deriveStateLocked();
        }
        if (interfaceC0770lDeriveStateLocked != null) {
            interfaceC0770lDeriveStateLocked.resumeWith(C3137A.f25453a);
        }
    }

    public final Object join(A4.d dVar) {
        Object objM = Y4.O.m(getCurrentState(), new C09892(null), dVar);
        return objM == B4.a.f492a ? objM : C3137A.f25453a;
    }

    /* JADX WARN: Removed duplicated region for block: B:21:0x006b  */
    @Override // androidx.compose.runtime.CompositionContext
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void movableContentStateReleased$runtime(MovableContentStateReference movableContentStateReference, MovableContentState movableContentState, Applier<?> applier) {
        synchronized (this.stateLock) {
            this.movableContentStatesAvailable.l(movableContentStateReference, movableContentState);
            U uM167getimpl = MultiValueMap.m167getimpl(this.movableContentNestedExtractionsPending, movableContentStateReference);
            if (uM167getimpl.e()) {
                X xExtractNestedStates$runtime = movableContentState.extractNestedStates$runtime(applier, uM167getimpl);
                Object[] objArr = xExtractNestedStates$runtime.f21382b;
                Object[] objArr2 = xExtractNestedStates$runtime.f21383c;
                long[] jArr = xExtractNestedStates$runtime.f21381a;
                int length = jArr.length - 2;
                if (length >= 0) {
                    int i6 = 0;
                    while (true) {
                        long j4 = jArr[i6];
                        if ((((~j4) << 7) & j4 & (-9187201950435737472L)) != -9187201950435737472L) {
                            int i7 = 8 - ((~(i6 - length)) >>> 31);
                            for (int i8 = 0; i8 < i7; i8++) {
                                if ((255 & j4) < 128) {
                                    int i9 = (i6 << 3) + i8;
                                    Object obj = objArr[i9];
                                    this.movableContentStatesAvailable.l((MovableContentStateReference) obj, (MovableContentState) objArr2[i9]);
                                }
                                j4 >>= 8;
                            }
                            if (i7 != 8) {
                                break;
                            } else if (i6 == length) {
                                break;
                            } else {
                                i6++;
                            }
                        }
                    }
                }
            }
        }
    }

    @Override // androidx.compose.runtime.CompositionContext
    public MovableContentState movableContentStateResolve$runtime(MovableContentStateReference movableContentStateReference) {
        MovableContentState movableContentState;
        synchronized (this.stateLock) {
            movableContentState = (MovableContentState) this.movableContentStatesAvailable.j(movableContentStateReference);
        }
        return movableContentState;
    }

    public final void pauseCompositionFrameClock() {
        synchronized (this.stateLock) {
            this.frameClockPaused = true;
        }
    }

    @Override // androidx.compose.runtime.CompositionContext
    public Z recomposePaused$runtime(ControlledComposition controlledComposition, ShouldPauseCallback shouldPauseCallback, Z z6) {
        try {
            recordComposerModifications();
            controlledComposition.recordModificationsOf(ScatterSetWrapperKt.wrapIntoSet(z6));
            ShouldPauseCallback andSetShouldPauseCallback = controlledComposition.getAndSetShouldPauseCallback(shouldPauseCallback);
            try {
                ControlledComposition controlledCompositionPerformRecompose = performRecompose(controlledComposition, null);
                if (controlledCompositionPerformRecompose != null) {
                    performInitialMovableContentInserts(controlledComposition);
                    controlledCompositionPerformRecompose.applyChanges();
                    controlledCompositionPerformRecompose.applyLateChanges();
                }
                O o6 = this.pausedScopes.get();
                if (o6 == null) {
                    o6 = n.a0.f21397a;
                    kotlin.jvm.internal.o.f(o6, "null cannot be cast to non-null type androidx.collection.ScatterSet<E of androidx.collection.ScatterSetKt.emptyScatterSet>");
                }
                return o6;
            } finally {
                controlledComposition.getAndSetShouldPauseCallback(andSetShouldPauseCallback);
            }
        } finally {
            this.pausedScopes.set(null);
        }
    }

    @Override // androidx.compose.runtime.CompositionContext
    public void recordInspectionTable$runtime(Set<CompositionData> set) {
    }

    @Override // androidx.compose.runtime.CompositionContext
    public void registerComposition$runtime(ControlledComposition controlledComposition) {
    }

    @Override // androidx.compose.runtime.CompositionContext
    public void reportPausedScope$runtime(RecomposeScopeImpl recomposeScopeImpl) {
        O o6 = this.pausedScopes.get();
        if (o6 == null) {
            O o7 = n.a0.f21397a;
            o6 = new O();
            this.pausedScopes.set(o6);
        }
        o6.d(recomposeScopeImpl);
    }

    @Override // androidx.compose.runtime.CompositionContext
    public void reportRemovedComposition$runtime(ControlledComposition controlledComposition) {
        synchronized (this.stateLock) {
            try {
                Set linkedHashSet = this.compositionsRemoved;
                if (linkedHashSet == null) {
                    linkedHashSet = new LinkedHashSet();
                    this.compositionsRemoved = linkedHashSet;
                }
                linkedHashSet.add(controlledComposition);
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public final void resumeCompositionFrameClock() {
        InterfaceC0770l interfaceC0770lDeriveStateLocked;
        synchronized (this.stateLock) {
            if (this.frameClockPaused) {
                this.frameClockPaused = false;
                interfaceC0770lDeriveStateLocked = deriveStateLocked();
            } else {
                interfaceC0770lDeriveStateLocked = null;
            }
        }
        if (interfaceC0770lDeriveStateLocked != null) {
            interfaceC0770lDeriveStateLocked.resumeWith(C3137A.f25453a);
        }
    }

    public final Object runRecomposeAndApplyChanges(A4.d dVar) {
        Object objRecompositionRunner = recompositionRunner(new C09912(null), dVar);
        return objRecompositionRunner == B4.a.f492a ? objRecompositionRunner : C3137A.f25453a;
    }

    @ExperimentalComposeApi
    public final Object runRecomposeConcurrentlyAndApplyChanges(A4.j jVar, A4.d dVar) {
        Object objRecompositionRunner = recompositionRunner(new C09922(jVar, this, null), dVar);
        return objRecompositionRunner == B4.a.f492a ? objRecompositionRunner : C3137A.f25453a;
    }

    @Override // androidx.compose.runtime.CompositionContext
    public CancellationHandle scheduleFrameEndCallback(J4.a aVar) {
        return this.nextFrameEndCallbackQueue.scheduleFrameEndCallback(aVar);
    }

    @Override // androidx.compose.runtime.CompositionContext
    public void unregisterComposition$runtime(ControlledComposition controlledComposition) {
        synchronized (this.stateLock) {
            removeKnownCompositionLocked(controlledComposition);
            this.compositionInvalidations.remove(controlledComposition);
            this.compositionsAwaitingApply.remove(controlledComposition);
        }
    }

    private final void recordComposerModifications(J4.c cVar) {
        O o6;
        synchronized (this.stateLock) {
            o6 = this.snapshotInvalidations;
            if (o6.c()) {
                this.snapshotInvalidations = new O();
            }
        }
        Set<? extends Object> setWrapIntoSet = ScatterSetWrapperKt.wrapIntoSet(o6);
        if (!setWrapIntoSet.isEmpty()) {
            List listKnownCompositionsLocked = knownCompositionsLocked();
            int size = listKnownCompositionsLocked.size();
            for (int i6 = 0; i6 < size; i6++) {
                ((ControlledComposition) listKnownCompositionsLocked.get(i6)).recordModificationsOf(setWrapIntoSet);
            }
        }
        MutableVector mutableVector = this.compositionInvalidations;
        Object[] objArr = mutableVector.content;
        int size2 = mutableVector.getSize();
        for (int i7 = 0; i7 < size2; i7++) {
            cVar.invoke(objArr[i7]);
        }
        this.compositionInvalidations.clear();
        synchronized (this.stateLock) {
            if (deriveStateLocked() != null) {
                throw new IllegalStateException("called outside of runRecomposeAndApplyChanges");
            }
        }
    }
}
