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

import androidx.compose.runtime.Composable
import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.runtime.key
import androidx.compose.runtime.NonRestartableComposable


@NonRestartableComposable @Composable
fun Example(x: Int) {
    // composable calls are in the condition blocks of the when statement. Since these
    // are conditionally executed, we can't statically know the number of groups during
    // execution. as a result, we must wrap the when clause with a group.
    when {
        x == R(a) -> NA()
        x > R(b) -> NA()
        else -> NA()
    }
    A()
}

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

@NonRestartableComposable
@Composable
@FunctionKeyMeta(key = -1008580451, startOffset = 227, endOffset = 596)
fun Example(x: Int, %composer: Composer?, %changed: Int) {
  sourceInformationMarkerStart(%composer, <>, "C(Example)<A()>:Test.kt")
  if (isTraceInProgress()) {
    traceEventStart(<>, %changed, -1, <>)
  }
  %composer.startReplaceGroup(<>)
  sourceInformation(%composer, "<R(a)>,<R(b)>")
  when {
    x == R(a, %composer, 0) -> {
      NA()
    }
    x > R(b, %composer, 0) -> {
      NA()
    }
    else -> {
      NA()
    }
  }
  %composer.endReplaceGroup()
  A(%composer, 0)
  if (isTraceInProgress()) {
    traceEventEnd()
  }
  sourceInformationMarkerEnd(%composer)
}
