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

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


@Composable
fun Test(a: Int, b: Boolean, c: Int = 0, d: Foo = Foo(), e: List<Int> = emptyList()) {
    A(a, b, c, d, e)
}

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

@Composable
@FunctionKeyMeta(key = -1868175978, startOffset = 165, endOffset = 274)
fun Test(a: Int, b: Boolean, c: Int, d: Foo?, e: List<Int>?, %composer: Composer?, %changed: Int, %default: Int) {
  %composer = %composer.startRestartGroup(<>)
  sourceInformation(%composer, "C(Test)N(a,b,c,d,e)<A(a,>:Test.kt")
  val %dirty = %changed
  if (%changed and 0b0110 == 0) {
    %dirty = %dirty or if (%composer.changed(a)) 0b0100 else 0b0010
  }
  if (%changed and 0b00110000 == 0) {
    %dirty = %dirty or if (%composer.changed(b)) 0b00100000 else 0b00010000
  }
  if (%default and 0b0100 != 0) {
    %dirty = %dirty or 0b000110000000
  } else if (%changed and 0b000110000000 == 0) {
    %dirty = %dirty or if (%composer.changed(c)) 0b000100000000 else 0b10000000
  }
  if (%changed and 0b110000000000 == 0) {
    %dirty = %dirty or if (%default and 0b1000 == 0 && %composer.changed(d)) 0b100000000000 else 0b010000000000
  }
  if (%default and 0b00010000 != 0) {
    %dirty = %dirty or 0b0110000000000000
  } else if (%changed and 0b0110000000000000 == 0) {
    %dirty = %dirty or if (%composer.changedInstance(e)) 0b0100000000000000 else 0b0010000000000000
  }
  if (%composer.shouldExecute(%dirty and 0b0010010010010011 != 0b0010010010010010, %dirty and 0b0001)) {
    %composer.startDefaults()
    if (%changed and 0b0001 == 0 || %composer.defaultsInvalid) {
      if (%default and 0b0100 != 0) {
        c = 0
      }
      if (%default and 0b1000 != 0) {
        d = Foo()
        %dirty = %dirty and 0b0001110000000000.inv()
      }
      if (%default and 0b00010000 != 0) {
        e = emptyList()
      }
    } else {
      %composer.skipToGroupEnd()
      if (%default and 0b1000 != 0) {
        %dirty = %dirty and 0b0001110000000000.inv()
      }
    }
    %composer.endDefaults()
    if (isTraceInProgress()) {
      traceEventStart(<>, %dirty, -1, <>)
    }
    A(a, b, c, d as Foo, e as List<Int>, %composer, 0b1110 and %dirty or 0b01110000 and %dirty or 0b001110000000 and %dirty or 0b0001110000000000 and %dirty or 0b1110000000000000 and %dirty)
    if (isTraceInProgress()) {
      traceEventEnd()
    }
  } else {
    %composer.skipToGroupEnd()
  }
  %composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
    Test(a, b, c, d, e, %composer, updateChangedFlags(%changed or 0b0001), %default)
  }
}
