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

import androidx.compose.runtime.Composable
import androidx.compose.runtime.NonRestartableComposable
import androidx.compose.runtime.ReadOnlyComposable


@Composable
fun Test(x: Int = 0, y: Int = 0) {
    used(y)
    Wrap {
        if (x > 0) {
            A(x)
        } else {
            A(x)
        }
    }
}

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

@Composable
@FunctionKeyMeta(key = -1700906474, startOffset = 165, endOffset = 312)
fun Test(x: Int, y: Int, %composer: Composer?, %changed: Int, %default: Int) {
  %composer = %composer.startRestartGroup(<>)
  sourceInformation(%composer, "C(Test)<{>,<Wrap>:Test.kt")
  val %dirty = %changed
  if (%default and 0b0001 != 0) {
    %dirty = %dirty or 0b0110
  } else if (%changed and 0b0110 == 0) {
    %dirty = %dirty or if (%composer.changed(x)) 0b0100 else 0b0010
  }
  if (%default and 0b0010 != 0) {
    %dirty = %dirty or 0b00110000
  } else if (%changed and 0b00110000 == 0) {
    %dirty = %dirty or if (%composer.changed(y)) 0b00100000 else 0b00010000
  }
  if (%composer.shouldExecute(%dirty and 0b00010011 != 0b00010010, %dirty and 0b0001)) {
    if (%default and 0b0001 != 0) {
      x = 0
    }
    if (%default and 0b0010 != 0) {
      y = 0
    }
    if (isTraceInProgress()) {
      traceEventStart(<>, %dirty, -1, <>)
    }
    used(y)
    Wrap(rememberComposableLambda(<>, true, { %composer: Composer?, %changed: Int ->
      sourceInformation(%composer, "C:Test.kt")
      if (%composer.shouldExecute(%changed and 0b0011 != 0b0010, %changed and 0b0001)) {
        if (isTraceInProgress()) {
          traceEventStart(<>, %changed, -1, <>)
        }
        if (x > 0) {
          %composer.startReplaceGroup(<>)
          sourceInformation(%composer, "<A(x)>")
          A(x, 0, %composer, 0, 0b0010)
          %composer.endReplaceGroup()
        } else {
          %composer.startReplaceGroup(<>)
          sourceInformation(%composer, "<A(x)>")
          A(x, 0, %composer, 0, 0b0010)
          %composer.endReplaceGroup()
        }
        if (isTraceInProgress()) {
          traceEventEnd()
        }
      } else {
        %composer.skipToGroupEnd()
      }
    }, %composer, 0b00110110), %composer, 0b0110)
    if (isTraceInProgress()) {
      traceEventEnd()
    }
  } else {
    %composer.skipToGroupEnd()
  }
  %composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
    Test(x, y, %composer, updateChangedFlags(%changed or 0b0001), %default)
  }
}
