package androidx.compose.runtime.changelist;

import J4.a;
import J4.c;
import J4.e;
import androidx.compose.runtime.Anchor;
import androidx.compose.runtime.Applier;
import androidx.compose.runtime.ComposeNodeLifecycleCallback;
import androidx.compose.runtime.Composition;
import androidx.compose.runtime.CompositionContext;
import androidx.compose.runtime.ControlledComposition;
import androidx.compose.runtime.MovableContentState;
import androidx.compose.runtime.MovableContentStateReference;
import androidx.compose.runtime.RecomposeScopeImpl;
import androidx.compose.runtime.RememberManager;
import androidx.compose.runtime.RememberObserverHolder;
import androidx.compose.runtime.SlotTable;
import androidx.compose.runtime.SlotWriter;
import androidx.compose.runtime.changelist.Operation;
import androidx.compose.runtime.changelist.Operations;
import androidx.compose.runtime.internal.IntRef;
import androidx.compose.runtime.internal.StabilityInferred;
import java.util.List;
import kotlin.jvm.internal.F;
import kotlin.jvm.internal.o;

/* JADX INFO: loaded from: classes.dex */
@StabilityInferred(parameters = 0)
public final class ChangeList extends OperationsDebugStringFormattable {
    public static final int $stable = 8;
    private final Operations operations = new Operations();

    public static /* synthetic */ void pushExecuteOperationsIn$default(ChangeList changeList, ChangeList changeList2, IntRef intRef, int i6, Object obj) {
        if ((i6 & 2) != 0) {
            intRef = null;
        }
        changeList.pushExecuteOperationsIn(changeList2, intRef);
    }

    public final void clear() {
        this.operations.clear();
    }

    public final void executeAndFlushAllPendingChanges(Applier<?> applier, SlotWriter slotWriter, RememberManager rememberManager, OperationErrorContext operationErrorContext) {
        this.operations.executeAndFlushAllPendingOperations(applier, slotWriter, rememberManager, operationErrorContext);
    }

    public final int getSize() {
        return this.operations.getSize();
    }

    public final boolean isEmpty() {
        return this.operations.isEmpty();
    }

    public final boolean isNotEmpty() {
        return this.operations.isNotEmpty();
    }

    public final void pushAdvanceSlotsBy(int i6) {
        Operations operations = this.operations;
        Operation.AdvanceSlotsBy advanceSlotsBy = Operation.AdvanceSlotsBy.INSTANCE;
        operations.pushOp(advanceSlotsBy);
        Operations operationsM143constructorimpl = Operations.WriteScope.m143constructorimpl(operations);
        operationsM143constructorimpl.intArgs[operationsM143constructorimpl.intArgsSize - operationsM143constructorimpl.opCodes[operationsM143constructorimpl.opCodesSize - 1].getInts()] = i6;
        operations.ensureAllArgumentsPushedFor(advanceSlotsBy);
    }

    public final void pushAppendValue(Anchor anchor, Object obj) {
        Operations operations = this.operations;
        Operation.AppendValue appendValue = Operation.AppendValue.INSTANCE;
        operations.pushOp(appendValue);
        Operations.WriteScope.m152setObjects4uCC6AY(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(0), anchor, Operation.ObjectParameter.m120constructorimpl(1), obj);
        operations.ensureAllArgumentsPushedFor(appendValue);
    }

    public final void pushCopyNodesToNewAnchorLocation(List<? extends Object> list, IntRef intRef) {
        if (list.isEmpty()) {
            return;
        }
        Operations operations = this.operations;
        Operation.CopyNodesToNewAnchorLocation copyNodesToNewAnchorLocation = Operation.CopyNodesToNewAnchorLocation.INSTANCE;
        operations.pushOp(copyNodesToNewAnchorLocation);
        Operations.WriteScope.m152setObjects4uCC6AY(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(1), list, Operation.ObjectParameter.m120constructorimpl(0), intRef);
        operations.ensureAllArgumentsPushedFor(copyNodesToNewAnchorLocation);
    }

    public final void pushCopySlotTableToAnchorLocation(MovableContentState movableContentState, CompositionContext compositionContext, MovableContentStateReference movableContentStateReference, MovableContentStateReference movableContentStateReference2) {
        Operations operations = this.operations;
        Operation.CopySlotTableToAnchorLocation copySlotTableToAnchorLocation = Operation.CopySlotTableToAnchorLocation.INSTANCE;
        operations.pushOp(copySlotTableToAnchorLocation);
        Operations.WriteScope.m153setObjectsOGa0p1M(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(0), movableContentState, Operation.ObjectParameter.m120constructorimpl(1), compositionContext, Operation.ObjectParameter.m120constructorimpl(3), movableContentStateReference2, Operation.ObjectParameter.m120constructorimpl(2), movableContentStateReference);
        operations.ensureAllArgumentsPushedFor(copySlotTableToAnchorLocation);
    }

    public final void pushDeactivateCurrentGroup() {
        this.operations.push(Operation.DeactivateCurrentGroup.INSTANCE);
    }

    public final void pushDetermineMovableContentNodeIndex(IntRef intRef, Anchor anchor) {
        Operations operations = this.operations;
        Operation.DetermineMovableContentNodeIndex determineMovableContentNodeIndex = Operation.DetermineMovableContentNodeIndex.INSTANCE;
        operations.pushOp(determineMovableContentNodeIndex);
        Operations.WriteScope.m152setObjects4uCC6AY(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(0), intRef, Operation.ObjectParameter.m120constructorimpl(1), anchor);
        operations.ensureAllArgumentsPushedFor(determineMovableContentNodeIndex);
    }

    public final void pushDowns(Object[] objArr) {
        if (objArr.length == 0) {
            return;
        }
        Operations operations = this.operations;
        Operation.Downs downs = Operation.Downs.INSTANCE;
        operations.pushOp(downs);
        Operations.WriteScope.m151setObjectDKhxnng(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(0), objArr);
        operations.ensureAllArgumentsPushedFor(downs);
    }

    public final void pushEndCompositionScope(c cVar, Composition composition) {
        Operations operations = this.operations;
        Operation.EndCompositionScope endCompositionScope = Operation.EndCompositionScope.INSTANCE;
        operations.pushOp(endCompositionScope);
        Operations.WriteScope.m152setObjects4uCC6AY(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(0), cVar, Operation.ObjectParameter.m120constructorimpl(1), composition);
        operations.ensureAllArgumentsPushedFor(endCompositionScope);
    }

    public final void pushEndCurrentGroup() {
        this.operations.push(Operation.EndCurrentGroup.INSTANCE);
    }

    public final void pushEndMovableContentPlacement() {
        this.operations.push(Operation.EndMovableContentPlacement.INSTANCE);
    }

    public final void pushEndResumingScope(RecomposeScopeImpl recomposeScopeImpl) {
        Operations operations = this.operations;
        Operation.EndResumingScope endResumingScope = Operation.EndResumingScope.INSTANCE;
        operations.pushOp(endResumingScope);
        Operations.WriteScope.m151setObjectDKhxnng(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(0), recomposeScopeImpl);
        operations.ensureAllArgumentsPushedFor(endResumingScope);
    }

    public final void pushEnsureGroupStarted(Anchor anchor) {
        Operations operations = this.operations;
        Operation.EnsureGroupStarted ensureGroupStarted = Operation.EnsureGroupStarted.INSTANCE;
        operations.pushOp(ensureGroupStarted);
        Operations.WriteScope.m151setObjectDKhxnng(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(0), anchor);
        operations.ensureAllArgumentsPushedFor(ensureGroupStarted);
    }

    public final void pushEnsureRootStarted() {
        this.operations.push(Operation.EnsureRootGroupStarted.INSTANCE);
    }

    public final void pushExecuteOperationsIn(ChangeList changeList, IntRef intRef) {
        if (changeList.isNotEmpty()) {
            Operations operations = this.operations;
            Operation.ApplyChangeList applyChangeList = Operation.ApplyChangeList.INSTANCE;
            operations.pushOp(applyChangeList);
            Operations.WriteScope.m152setObjects4uCC6AY(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(0), changeList, Operation.ObjectParameter.m120constructorimpl(1), intRef);
            operations.ensureAllArgumentsPushedFor(applyChangeList);
        }
    }

    public final void pushInsertSlots(Anchor anchor, SlotTable slotTable) {
        Operations operations = this.operations;
        Operation.InsertSlots insertSlots = Operation.InsertSlots.INSTANCE;
        operations.pushOp(insertSlots);
        Operations.WriteScope.m152setObjects4uCC6AY(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(0), anchor, Operation.ObjectParameter.m120constructorimpl(1), slotTable);
        operations.ensureAllArgumentsPushedFor(insertSlots);
    }

    public final void pushMoveCurrentGroup(int i6) {
        Operations operations = this.operations;
        Operation.MoveCurrentGroup moveCurrentGroup = Operation.MoveCurrentGroup.INSTANCE;
        operations.pushOp(moveCurrentGroup);
        Operations operationsM143constructorimpl = Operations.WriteScope.m143constructorimpl(operations);
        operationsM143constructorimpl.intArgs[operationsM143constructorimpl.intArgsSize - operationsM143constructorimpl.opCodes[operationsM143constructorimpl.opCodesSize - 1].getInts()] = i6;
        operations.ensureAllArgumentsPushedFor(moveCurrentGroup);
    }

    public final void pushMoveNode(int i6, int i7, int i8) {
        Operations operations = this.operations;
        Operation.MoveNode moveNode = Operation.MoveNode.INSTANCE;
        operations.pushOp(moveNode);
        Operations operationsM143constructorimpl = Operations.WriteScope.m143constructorimpl(operations);
        int ints = operationsM143constructorimpl.intArgsSize - operationsM143constructorimpl.opCodes[operationsM143constructorimpl.opCodesSize - 1].getInts();
        int[] iArr = operationsM143constructorimpl.intArgs;
        iArr[ints + 1] = i6;
        iArr[ints] = i7;
        iArr[ints + 2] = i8;
        operations.ensureAllArgumentsPushedFor(moveNode);
    }

    public final void pushReleaseMovableGroupAtCurrent(ControlledComposition controlledComposition, CompositionContext compositionContext, MovableContentStateReference movableContentStateReference) {
        Operations operations = this.operations;
        Operation.ReleaseMovableGroupAtCurrent releaseMovableGroupAtCurrent = Operation.ReleaseMovableGroupAtCurrent.INSTANCE;
        operations.pushOp(releaseMovableGroupAtCurrent);
        Operations.WriteScope.m154setObjectst7hvbck(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(0), controlledComposition, Operation.ObjectParameter.m120constructorimpl(1), compositionContext, Operation.ObjectParameter.m120constructorimpl(2), movableContentStateReference);
        operations.ensureAllArgumentsPushedFor(releaseMovableGroupAtCurrent);
    }

    public final void pushRemember(RememberObserverHolder rememberObserverHolder) {
        Operations operations = this.operations;
        Operation.Remember remember = Operation.Remember.INSTANCE;
        operations.pushOp(remember);
        Operations.WriteScope.m151setObjectDKhxnng(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(0), rememberObserverHolder);
        operations.ensureAllArgumentsPushedFor(remember);
    }

    public final void pushRememberPausingScope(RecomposeScopeImpl recomposeScopeImpl) {
        Operations operations = this.operations;
        Operation.RememberPausingScope rememberPausingScope = Operation.RememberPausingScope.INSTANCE;
        operations.pushOp(rememberPausingScope);
        Operations.WriteScope.m151setObjectDKhxnng(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(0), recomposeScopeImpl);
        operations.ensureAllArgumentsPushedFor(rememberPausingScope);
    }

    public final void pushRemoveCurrentGroup() {
        this.operations.push(Operation.RemoveCurrentGroup.INSTANCE);
    }

    public final void pushRemoveNode(int i6, int i7) {
        Operations operations = this.operations;
        Operation.RemoveNode removeNode = Operation.RemoveNode.INSTANCE;
        operations.pushOp(removeNode);
        Operations operationsM143constructorimpl = Operations.WriteScope.m143constructorimpl(operations);
        int ints = operationsM143constructorimpl.intArgsSize - operationsM143constructorimpl.opCodes[operationsM143constructorimpl.opCodesSize - 1].getInts();
        int[] iArr = operationsM143constructorimpl.intArgs;
        iArr[ints] = i6;
        iArr[ints + 1] = i7;
        operations.ensureAllArgumentsPushedFor(removeNode);
    }

    public final void pushResetSlots() {
        this.operations.push(Operation.ResetSlots.INSTANCE);
    }

    public final void pushSideEffect(a aVar) {
        Operations operations = this.operations;
        Operation.SideEffect sideEffect = Operation.SideEffect.INSTANCE;
        operations.pushOp(sideEffect);
        Operations.WriteScope.m151setObjectDKhxnng(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(0), aVar);
        operations.ensureAllArgumentsPushedFor(sideEffect);
    }

    public final void pushSkipToEndOfCurrentGroup() {
        this.operations.push(Operation.SkipToEndOfCurrentGroup.INSTANCE);
    }

    public final void pushStartResumingScope(RecomposeScopeImpl recomposeScopeImpl) {
        Operations operations = this.operations;
        Operation.StartResumingScope startResumingScope = Operation.StartResumingScope.INSTANCE;
        operations.pushOp(startResumingScope);
        Operations.WriteScope.m151setObjectDKhxnng(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(0), recomposeScopeImpl);
        operations.ensureAllArgumentsPushedFor(startResumingScope);
    }

    public final void pushTrimValues(int i6) {
        Operations operations = this.operations;
        Operation.TrimParentValues trimParentValues = Operation.TrimParentValues.INSTANCE;
        operations.pushOp(trimParentValues);
        Operations operationsM143constructorimpl = Operations.WriteScope.m143constructorimpl(operations);
        operationsM143constructorimpl.intArgs[operationsM143constructorimpl.intArgsSize - operationsM143constructorimpl.opCodes[operationsM143constructorimpl.opCodesSize - 1].getInts()] = i6;
        operations.ensureAllArgumentsPushedFor(trimParentValues);
    }

    public final void pushUpdateAnchoredValue(Object obj, Anchor anchor, int i6) {
        Operations operations = this.operations;
        Operation.UpdateAnchoredValue updateAnchoredValue = Operation.UpdateAnchoredValue.INSTANCE;
        operations.pushOp(updateAnchoredValue);
        Operations operationsM143constructorimpl = Operations.WriteScope.m143constructorimpl(operations);
        Operations.WriteScope.m152setObjects4uCC6AY(operationsM143constructorimpl, Operation.ObjectParameter.m120constructorimpl(0), obj, Operation.ObjectParameter.m120constructorimpl(1), anchor);
        operationsM143constructorimpl.intArgs[operationsM143constructorimpl.intArgsSize - operationsM143constructorimpl.opCodes[operationsM143constructorimpl.opCodesSize - 1].getInts()] = i6;
        operations.ensureAllArgumentsPushedFor(updateAnchoredValue);
    }

    public final void pushUpdateAuxData(Object obj) {
        Operations operations = this.operations;
        Operation.UpdateAuxData updateAuxData = Operation.UpdateAuxData.INSTANCE;
        operations.pushOp(updateAuxData);
        Operations.WriteScope.m151setObjectDKhxnng(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(0), obj);
        operations.ensureAllArgumentsPushedFor(updateAuxData);
    }

    public final <T, V> void pushUpdateNode(V v3, e eVar) {
        Operations operations = this.operations;
        Operation.UpdateNode updateNode = Operation.UpdateNode.INSTANCE;
        operations.pushOp(updateNode);
        Operations operationsM143constructorimpl = Operations.WriteScope.m143constructorimpl(operations);
        int iM120constructorimpl = Operation.ObjectParameter.m120constructorimpl(0);
        int iM120constructorimpl2 = Operation.ObjectParameter.m120constructorimpl(1);
        o.f(eVar, "null cannot be cast to non-null type @[ExtensionFunctionType] kotlin.Function2<kotlin.Any?, kotlin.Any?, kotlin.Unit>");
        F.c(2, eVar);
        Operations.WriteScope.m152setObjects4uCC6AY(operationsM143constructorimpl, iM120constructorimpl, v3, iM120constructorimpl2, eVar);
        operations.ensureAllArgumentsPushedFor(updateNode);
    }

    public final void pushUpdateValue(Object obj, int i6) {
        Operations operations = this.operations;
        Operation.UpdateValue updateValue = Operation.UpdateValue.INSTANCE;
        operations.pushOp(updateValue);
        Operations operationsM143constructorimpl = Operations.WriteScope.m143constructorimpl(operations);
        Operations.WriteScope.m151setObjectDKhxnng(operationsM143constructorimpl, Operation.ObjectParameter.m120constructorimpl(0), obj);
        operationsM143constructorimpl.intArgs[operationsM143constructorimpl.intArgsSize - operationsM143constructorimpl.opCodes[operationsM143constructorimpl.opCodesSize - 1].getInts()] = i6;
        operations.ensureAllArgumentsPushedFor(updateValue);
    }

    public final void pushUps(int i6) {
        Operations operations = this.operations;
        Operation.Ups ups = Operation.Ups.INSTANCE;
        operations.pushOp(ups);
        Operations operationsM143constructorimpl = Operations.WriteScope.m143constructorimpl(operations);
        operationsM143constructorimpl.intArgs[operationsM143constructorimpl.intArgsSize - operationsM143constructorimpl.opCodes[operationsM143constructorimpl.opCodesSize - 1].getInts()] = i6;
        operations.ensureAllArgumentsPushedFor(ups);
    }

    public final void pushUseNode(Object obj) {
        if (obj instanceof ComposeNodeLifecycleCallback) {
            this.operations.push(Operation.UseCurrentNode.INSTANCE);
        }
    }

    @Override // androidx.compose.runtime.changelist.OperationsDebugStringFormattable
    public String toDebugString(String str) {
        StringBuilder sbT = Z0.o.t("ChangeList instance containing ");
        sbT.append(getSize());
        sbT.append(" operations");
        if (sbT.length() > 0) {
            sbT.append(":\n");
            sbT.append(this.operations.toDebugString(str));
        }
        String string = sbT.toString();
        o.g(string, "toString(...)");
        return string;
    }

    public final void pushInsertSlots(Anchor anchor, SlotTable slotTable, FixupList fixupList) {
        Operations operations = this.operations;
        Operation.InsertSlotsWithFixups insertSlotsWithFixups = Operation.InsertSlotsWithFixups.INSTANCE;
        operations.pushOp(insertSlotsWithFixups);
        Operations.WriteScope.m154setObjectst7hvbck(Operations.WriteScope.m143constructorimpl(operations), Operation.ObjectParameter.m120constructorimpl(0), anchor, Operation.ObjectParameter.m120constructorimpl(1), slotTable, Operation.ObjectParameter.m120constructorimpl(2), fixupList);
        operations.ensureAllArgumentsPushedFor(insertSlotsWithFixups);
    }
}
