fun test_1(value: Any?): String? {
  return { // BLOCK
    val tmp0_safe_receiver: Any? = value
    when {
      EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
      else -> tmp0_safe_receiver.let<Any, Nothing>(block = local fun <anonymous>(it: Any): Nothing {
        return "O"
      }
)
    }
  }
}

fun test_2(value: Any?): String? {
  return run<Nothing?>(block = local fun <anonymous>(): Nothing? {
    return { // BLOCK
      val tmp0_safe_receiver: Any? = value
      when {
        EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
        else -> tmp0_safe_receiver.let<Any, Nothing>(block = local fun <anonymous>(it: Any): Nothing {
          return "K"
        }
)
      }
    }
  }
)
}

fun box(): String {
  var result: String = ""
  result = result.plus(other = { // BLOCK
    val tmp0_elvis_lhs: String? = test_1(value = 1)
    when {
      EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> return "fail 1"
      else -> tmp0_elvis_lhs
    }
  })
  result = result.plus(other = { // BLOCK
    val tmp1_elvis_lhs: String? = test_2(value = 1)
    when {
      EQEQ(arg0 = tmp1_elvis_lhs, arg1 = null) -> return "fail 2"
      else -> tmp1_elvis_lhs
    }
  })
  return result
}
