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

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


@Composable fun Scratch(vm: MyUnstableViewModel) {
    Dialog(
        content = slotIfNotNull(vm.text) {
            Button(
                onClick = vm::onClickyClicky
            )
        }
    )
}

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

@Composable
@FunctionKeyMeta(key = 905288344, startOffset = 226, endOffset = 512)
fun Scratch(vm: MyUnstableViewModel, %composer: Composer?, %changed: Int) {
  %composer = %composer.startRestartGroup(<>)
  val %dirty = %changed
  if (%changed and 0b0110 == 0) {
    %dirty = %dirty or if (%composer.changedInstance(vm)) 0b0100 else 0b0010
  }
  if (%composer.shouldExecute(%dirty and 0b0011 != 0b0010, %dirty and 0b0001)) {
    if (isTraceInProgress()) {
      traceEventStart(<>, %dirty, -1, <>)
    }
    Dialog(slotIfNotNull(vm.text) { it: String, %composer: Composer?, %changed: Int ->
      %composer.startReplaceGroup(<>)
      Button(<block>{
        val tmp0 = vm
        %composer.cache(%composer.changedInstance(tmp0)) {
          tmp0::onClickyClicky
        }
      }, %composer, 0)
      %composer.endReplaceGroup()
    }, %composer, 0)
    if (isTraceInProgress()) {
      traceEventEnd()
    }
  } else {
    %composer.skipToGroupEnd()
  }
  %composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
    Scratch(vm, %composer, updateChangedFlags(%changed or 0b0001))
  }
}
