//
// 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) {
    // result blocks have composable calls, so we generate groups round them. It's a
    // statically guaranteed number of groups at execution, so no wrapping group is
    // needed.
    when {
        x < 0 -> A(a)
        x > 30 -> NA()
        else -> A(b)
    }
}

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

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