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

import androidx.compose.runtime.*

@Composable
fun Ref(flag: Boolean, content: @Composable (Int) -> Int) {
    Ref(flag, if (flag) ::Fn else ::Fn2)
}

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

@Composable
@FunctionKeyMeta(key = 1102418427, startOffset = 84, endOffset = 210)
fun Ref(flag: Boolean, content: Function3<Int, Composer, Int, Int>, %composer: Composer?, %changed: Int) {
  %composer = %composer.startRestartGroup(<>)
  sourceInformation(%composer, "C(Ref)N(flag,content)<Ref(fl...>:Test.kt")
  val %dirty = %changed
  if (%changed and 0b0110 == 0) {
    %dirty = %dirty or if (%composer.changed(flag)) 0b0100 else 0b0010
  }
  if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
    if (isTraceInProgress()) {
      traceEventStart(<>, %dirty, -1, <>)
    }
    Ref(flag, if (flag) {
      %composer.startReplaceGroup(<>)
      sourceInformation(%composer, "<::Fn>")
      val tmp2_group = <block>{
        sourceInformationMarkerStart(%composer, <>, "CC(remember):Test.kt#9igjgp")
        val tmp0_group = %composer.cache(false) {
          @Composable
          fun Fn(int: Int, %composer: Composer?, %changed: Int): Int {
            %composer.startReplaceGroup(<>)
            sourceInformation(%composer, "C(Fn)N(int):Test.kt")
            val tmp0 = Fn(int, %composer, 0b1110 and %changed)
            %composer.endReplaceGroup()
            return tmp0
          }
          ::Fn
        }
        sourceInformationMarkerEnd(%composer)
        tmp0_group
      }
      %composer.endReplaceGroup()
      tmp2_group
    } else {
      %composer.startReplaceGroup(<>)
      sourceInformation(%composer, "<::Fn2>")
      val tmp3_group = <block>{
        sourceInformationMarkerStart(%composer, <>, "CC(remember):Test.kt#9igjgp")
        val tmp1_group = %composer.cache(false) {
          @Composable
          fun Fn2(int: Int, %composer: Composer?, %changed: Int): Int {
            %composer.startReplaceGroup(<>)
            sourceInformation(%composer, "C(Fn2)N(int):Test.kt")
            val tmp0 = Fn2(int, %composer, 0b1110 and %changed)
            %composer.endReplaceGroup()
            return tmp0
          }
          ::Fn2
        }
        sourceInformationMarkerEnd(%composer)
        tmp1_group
      }
      %composer.endReplaceGroup()
      tmp3_group
    }, %composer, 0b1110 and %dirty)
    if (isTraceInProgress()) {
      traceEventEnd()
    }
  } else {
    %composer.skipToGroupEnd()
  }
  %composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
    Ref(flag, content, %composer, updateChangedFlags(%changed or 0b0001))
  }
}
