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

import androidx.compose.runtime.*

@Composable
fun Test(start: Int, end: Int) {
    val a = remember { A() }
    for (i in start until end) {
        val b = a.get(bKey)
        if (i == 2) {
            a.get(cKey)
        }
    }
}

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

@Composable
@FunctionKeyMeta(key = -1700906474, startOffset = 84, endOffset = 366)
fun Test(start: Int, end: Int, %composer: Composer?, %changed: Int) {
  %composer = %composer.startRestartGroup(<>)
  sourceInformation(%composer, "C(Test)N(start,end)<rememb...>,*<get(bK...>:Test.kt")
  val %dirty = %changed
  if (%changed and 0b0110 == 0) {
    %dirty = %dirty or if (%composer.changed(start)) 0b0100 else 0b0010
  }
  if (%changed and 0b00110000 == 0) {
    %dirty = %dirty or if (%composer.changed(end)) 0b00100000 else 0b00010000
  }
  if (%composer.shouldExecute(%dirty and 0b00010011 != 0b00010010, %dirty and 0b0001)) {
    if (isTraceInProgress()) {
      traceEventStart(<>, %dirty, -1, <>)
    }
    val a = <block>{
      sourceInformationMarkerStart(%composer, <>, "CC(remember):Test.kt#9igjgp")
      val tmp0_group = %composer.cache(false) {
        A()
      }
      sourceInformationMarkerEnd(%composer)
      tmp0_group
    }
    val <iterator> = start until end.iterator()
    while (<iterator>.hasNext()) {
      val i = <iterator>.next()
      val b = a.get(bKey, %composer, 0b00110110)
      if (i == 0b0010) {
        %composer.startReplaceGroup(<>)
        sourceInformation(%composer, "<get(cK...>")
        a.get(cKey, %composer, 0b00110110)
        %composer.endReplaceGroup()
      } else {
        %composer.startReplaceGroup(<>)
        %composer.endReplaceGroup()
      }
    }
    if (isTraceInProgress()) {
      traceEventEnd()
    }
  } else {
    %composer.skipToGroupEnd()
  }
  %composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
    Test(start, end, %composer, updateChangedFlags(%changed or 0b0001))
  }
}
