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

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


@Composable fun Wrap(y: Int, content: @Composable (x: Int) -> Unit) {
    content(y)
}
@Composable
fun Test(x: Int = 0, y: Int = 0) {
    used(y)
    Wrap(10) {
        used(it)
        A(x)
    }
}

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

@Composable
@ComposableInferredTarget(scheme = "[0[0]]")
@FunctionKeyMeta(key = 873858164, startOffset = 165, endOffset = 239)
fun Wrap(y: Int, content: Function3<@[ParameterName(name = 'x')] Int, Composer, Int, Unit>, %composer: Composer?, %changed: Int) {
  %composer = %composer.startRestartGroup(<>)
  sourceInformation(%composer, "C(Wrap)P(1)<conten...>:Test.kt")
  val %dirty = %changed
  if (%changed and 0b0110 == 0) {
    %dirty = %dirty or if (%composer.changed(y)) 0b0100 else 0b0010
  }
  if (%changed and 0b00110000 == 0) {
    %dirty = %dirty or if (%composer.changedInstance(content)) 0b00100000 else 0b00010000
  }
  if (%composer.shouldExecute(%dirty and 0b00010011 != 0b00010010, %dirty and 0b0001)) {
    if (isTraceInProgress()) {
      traceEventStart(<>, %dirty, -1, <>)
    }
    content(y, %composer, 0b1110 and %dirty or 0b01110000 and %dirty)
    if (isTraceInProgress()) {
      traceEventEnd()
    }
  } else {
    %composer.skipToGroupEnd()
  }
  %composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
    Wrap(y, content, %composer, updateChangedFlags(%changed or 0b0001))
  }
}
@Composable
@FunctionKeyMeta(key = -1700906474, startOffset = 252, endOffset = 351)
fun Test(x: Int, y: Int, %composer: Composer?, %changed: Int, %default: Int) {
  %composer = %composer.startRestartGroup(<>)
  sourceInformation(%composer, "C(Test)<{>,<Wrap(1...>: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(10, rememberComposableLambda(<>, true, { it: Int, %composer: Composer?, %changed: Int ->
      sourceInformation(%composer, "C<A(x)>:Test.kt")
      val %dirty = %changed
      if (%changed and 0b0110 == 0) {
        %dirty = %dirty or if (%composer.changed(it)) 0b0100 else 0b0010
      }
      if (%composer.shouldExecute(%dirty and 0b00010011 != 0b00010010, %dirty and 0b0001)) {
        if (isTraceInProgress()) {
          traceEventStart(<>, %dirty, -1, <>)
        }
        used(it)
        A(x, 0, %composer, 0, 0b0010)
        if (isTraceInProgress()) {
          traceEventEnd()
        }
      } else {
        %composer.skipToGroupEnd()
      }
    }, %composer, 0b00110110), %composer, 0b00110110)
    if (isTraceInProgress()) {
      traceEventEnd()
    }
  } else {
    %composer.skipToGroupEnd()
  }
  %composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
    Test(x, y, %composer, updateChangedFlags(%changed or 0b0001), %default)
  }
}
