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

import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember


@Composable
fun test1(x: KnownStable) {
    remember(x) { 1 }
}
@Composable
fun test2(x: KnownUnstable) {
    remember(x) { 1 }
}
@Composable
fun test3(x: Uncertain) {
    remember(x) { 1 }
}

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

@Composable
@FunctionKeyMeta(key = -473819879, startOffset = 98, endOffset = 149)
fun test1(x: KnownStable, %composer: Composer?, %changed: Int) {
  %composer = %composer.startRestartGroup(<>)
  sourceInformation(%composer, "C(test1)N(x)<rememb...>:Test.kt")
  val %dirty = %changed
  if (%changed and 0b0110 == 0) {
    %dirty = %dirty or if (%composer.changed(x)) 0b0100 else 0b0010
  }
  if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
    if (isTraceInProgress()) {
      traceEventStart(<>, %dirty, -1, <>)
    }
    sourceInformationMarkerStart(%composer, <>, "CC(remember):Test.kt#9igjgp")
    val tmp0_group = %composer.cache(%dirty and 0b1110 == 0b0100) {
      1
    }
    sourceInformationMarkerEnd(%composer)
    tmp0_group
    if (isTraceInProgress()) {
      traceEventEnd()
    }
  } else {
    %composer.skipToGroupEnd()
  }
  %composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
    test1(x, %composer, updateChangedFlags(%changed or 0b0001))
  }
}
@Composable
@FunctionKeyMeta(key = -301765569, startOffset = 162, endOffset = 215)
fun test2(x: KnownUnstable, %composer: Composer?, %changed: Int) {
  %composer = %composer.startRestartGroup(<>)
  sourceInformation(%composer, "C(test2)N(x)<rememb...>:Test.kt")
  val %dirty = %changed
  if (%changed and 0b0110 == 0) {
    %dirty = %dirty or if (%composer.changedInstance(x)) 0b0100 else 0b0010
  }
  if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
    if (isTraceInProgress()) {
      traceEventStart(<>, %dirty, -1, <>)
    }
    sourceInformationMarkerStart(%composer, <>, "CC(remember):Test.kt#9igjgp")
    val tmp0_group = %composer.cache(%composer.changed(x)) {
      1
    }
    sourceInformationMarkerEnd(%composer)
    tmp0_group
    if (isTraceInProgress()) {
      traceEventEnd()
    }
  } else {
    %composer.skipToGroupEnd()
  }
  %composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
    test2(x, %composer, updateChangedFlags(%changed or 0b0001))
  }
}
@Composable
@FunctionKeyMeta(key = -2145116948, startOffset = 228, endOffset = 277)
fun test3(x: Uncertain, %composer: Composer?, %changed: Int) {
  %composer = %composer.startRestartGroup(<>)
  sourceInformation(%composer, "C(test3)N(x)<rememb...>:Test.kt")
  val %dirty = %changed
  if (%changed and 0b0110 == 0) {
    %dirty = %dirty or if (if (%changed and 0b1000 == 0) {
      %composer.changed(x)
    } else {
      %composer.changedInstance(x)
    }
    ) 0b0100 else 0b0010
  }
  if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
    if (isTraceInProgress()) {
      traceEventStart(<>, %dirty, -1, <>)
    }
    sourceInformationMarkerStart(%composer, <>, "CC(remember):Test.kt#9igjgp")
    val tmp0_group = %composer.cache(%dirty and 0b1110 == 0b0100 || %dirty and 0b1000 != 0 && %composer.changed(x)) {
      1
    }
    sourceInformationMarkerEnd(%composer)
    tmp0_group
    if (isTraceInProgress()) {
      traceEventEnd()
    }
  } else {
    %composer.skipToGroupEnd()
  }
  %composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
    test3(x, %composer, updateChangedFlags(%changed or 0b0001))
  }
}
