//
// 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. Since there
    // are no other composable calls, the function body group will suffice.
    when {
        x == R(a) -> NA()
        x > R(b) -> NA()
        else -> NA()
    }
}

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

@NonRestartableComposable
@Composable
@FunctionKeyMeta(key = -1008580451, startOffset = 227, endOffset = 676)
fun Example(x: Int, %composer: Composer?, %changed: Int) {
  sourceInformationMarkerStart(%composer, <>, "C(Example):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()
  if (isTraceInProgress()) {
    traceEventEnd()
  }
  sourceInformationMarkerEnd(%composer)
}
