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

import androidx.compose.runtime.*

@Composable
fun Test(states: List<String>, condition: Boolean) {
    states.forEach { state ->
        key(state) {
            if (condition) {
                LaunchedEffect(state) { println(state) }
            }
            TwoLambdas(
                lambda1 = { println(state) },
                lambda2 = { println(state) }
            )
        }
    }
}

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

@Composable
@FunctionKeyMeta(key = -1277138018, startOffset = 84, endOffset = 578)
fun Test(states: List<String>, condition: Boolean, %composer: Composer?, %changed: Int) {
  %composer = %composer.startRestartGroup(<>)
  sourceInformation(%composer, "C(Test)N(states,condition):Test.kt")
  val %dirty = %changed
  if (%changed and 0b0110 == 0) {
    %dirty = %dirty or if (%composer.changedInstance(states)) 0b0100 else 0b0010
  }
  if (%changed and 0b00110000 == 0) {
    %dirty = %dirty or if (%composer.changed(condition)) 0b00100000 else 0b00010000
  }
  if (%composer.shouldExecute(%dirty and 0b00010011 != 0b00010010, %dirty and 0b0001)) {
    if (isTraceInProgress()) {
      traceEventStart(<>, %dirty, -1, <>)
    }
    states.forEach { state: String ->
      %composer.startMovableGroup(<>, state)
      sourceInformation(%composer, "<{>,<{>,<TwoLam...>")
      if (condition) {
        %composer.startReplaceGroup(<>)
        sourceInformation(%composer, "<{>,<Launch...>")
        LaunchedEffect(state, <block>{
          sourceInformationMarkerStart(%composer, <>, "CC(remember):Test.kt#9igjgp")
          val tmp0_group = %composer.cache(%composer.changed(state)) {
            {
              println(state)
            }
          }
          sourceInformationMarkerEnd(%composer)
          tmp0_group
        }, %composer, 0)
        %composer.endReplaceGroup()
      } else {
        %composer.startReplaceGroup(<>)
        %composer.endReplaceGroup()
      }
      TwoLambdas(<block>{
        sourceInformationMarkerStart(%composer, <>, "CC(remember):Test.kt#9igjgp")
        val tmp1_group = %composer.cache(%composer.changed(state)) {
          {
            println(state)
          }
        }
        sourceInformationMarkerEnd(%composer)
        tmp1_group
      }, <block>{
        sourceInformationMarkerStart(%composer, <>, "CC(remember):Test.kt#9igjgp")
        val tmp2_group = %composer.cache(%composer.changed(state)) {
          { it: Int ->
            println(state)
          }
        }
        sourceInformationMarkerEnd(%composer)
        tmp2_group
      }, %composer, 0)
      %composer.endMovableGroup()
    }
    if (isTraceInProgress()) {
      traceEventEnd()
    }
  } else {
    %composer.skipToGroupEnd()
  }
  %composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
    Test(states, condition, %composer, updateChangedFlags(%changed or 0b0001))
  }
}
