//
// Source
// ------------------------------------------

@file:OptIn(
  InternalComposeApi::class,
)
package test

import androidx.compose.runtime.InternalComposeApi
import androidx.compose.runtime.ComposeCompilerApi
import androidx.compose.runtime.Composable
import androidx.compose.runtime.NonRestartableComposable


@Composable
fun B(vararg values: Int) {
    print(values)
}

@NonRestartableComposable
@Composable
fun Test() {
    B(0, 1, 2, 3)
}

//
// Transformed IR
// ------------------------------------------

@Composable
@FunctionKeyMeta(key = -919269264, startOffset = 274, endOffset = 321)
fun B(values: IntArray, %composer: Composer?, %changed: Int) {
  %composer = %composer.startRestartGroup(<>)
  sourceInformation(%composer, "C(B)N(values):Test.kt#2487m")
  val %dirty = %changed
  %composer.startMovableGroup(<>, values.size)
  %dirty = %dirty or if (%composer.changed(values.size)) 0b0100 else 0
  val <iterator> = values.iterator()
  while (<iterator>.hasNext()) {
    val value = <iterator>.next()
    %dirty = %dirty or if (%composer.changed(value)) 0b0100 else 0
  }
  %composer.endMovableGroup()
  if (%dirty and 0b1110 == 0) {
    %dirty = %dirty or 0b0010
  }
  if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
    if (isTraceInProgress()) {
      traceEventStart(<>, %dirty, -1, <>)
    }
    print(values)
    if (isTraceInProgress()) {
      traceEventEnd()
    }
  } else {
    %composer.skipToGroupEnd()
  }
  %composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
    B(values, %composer, updateChangedFlags(%changed or 0b0001))
  }
}
@NonRestartableComposable
@Composable
@FunctionKeyMeta(key = 1047912774, startOffset = 361, endOffset = 393)
fun Test(%composer: Composer?, %changed: Int) {
  sourceInformationMarkerStart(%composer, <>, "C(Test)<B(0,>:Test.kt#2487m")
  if (isTraceInProgress()) {
    traceEventStart(<>, %changed, -1, <>)
  }
  B(0, 1, 2, 3, %composer, 0)
  if (isTraceInProgress()) {
    traceEventEnd()
  }
  sourceInformationMarkerEnd(%composer)
}
