fun use(s: P) {
}

fun testForInListUnused() {
  { // BLOCK
    val tmp0_iterator: MutableIterator<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */ /*as MutableList<*> */.iterator()
    while (tmp0_iterator.hasNext()) { // BLOCK
      val x: @NotNull @EnhancedNullability P = tmp0_iterator.next()
      { // BLOCK
      }
    }
  }
}

fun testForInListDestructured() {
  { // BLOCK
    val tmp0_iterator: MutableIterator<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */ /*as MutableList<*> */.iterator()
    while (tmp0_iterator.hasNext()) { // BLOCK
      val tmp1_loop_parameter: @NotNull @EnhancedNullability P = tmp0_iterator.next()
      val x: Int = tmp1_loop_parameter /*!! @NotNull P */.component1()
      val y: Int = tmp1_loop_parameter /*!! @NotNull P */.component2()
      { // BLOCK
      }
    }
  }
}

fun testDesugaredForInList() {
  val iterator: MutableIterator<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */ /*as MutableList<*> */.iterator()
  while (iterator.hasNext()) { // BLOCK
    val x: @NotNull P = iterator.next() /*!! @NotNull P */
  }
}

fun testForInArrayUnused(j: J) {
  { // BLOCK
    val tmp0_iterator: Iterator<@EnhancedNullability P> = j.arrayOfNotNull() /*!! Array<out @EnhancedNullability P> */ /*as Array<@EnhancedNullability P> */.iterator()
    while (tmp0_iterator.hasNext()) { // BLOCK
      val x: @EnhancedNullability P = tmp0_iterator.next()
      { // BLOCK
      }
    }
  }
}

fun testForInListUse() {
  { // BLOCK
    val tmp0_iterator: MutableIterator<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */ /*as MutableList<*> */.iterator()
    while (tmp0_iterator.hasNext()) { // BLOCK
      val x: @NotNull @EnhancedNullability P = tmp0_iterator.next()
      { // BLOCK
        use(s = x /*!! @NotNull P */)
        use(s = x)
      }
    }
  }
}

fun testForInArrayUse(j: J) {
  { // BLOCK
    val tmp0_iterator: Iterator<@EnhancedNullability P> = j.arrayOfNotNull() /*!! Array<out @EnhancedNullability P> */ /*as Array<@EnhancedNullability P> */.iterator()
    while (tmp0_iterator.hasNext()) { // BLOCK
      val x: @EnhancedNullability P = tmp0_iterator.next()
      { // BLOCK
        use(s = x /*!! P */)
        use(s = x)
      }
    }
  }
}

interface K {
  abstract fun arrayOfNotNull(): Array<P>

}

data class P {
  constructor(x: Int, y: Int) /* primary */ {
    super/*Any*/()
    /* <init>() */

  }

  val x: Int
    field = x
    get

  val y: Int
    field = y
    get

  operator fun component1(): Int {
    return <this>.#x
  }

  operator fun component2(): Int {
    return <this>.#y
  }

  fun copy(x: Int = <this>.#x, y: Int = <this>.#y): P {
    return P(x = x, y = y)
  }

  override fun toString(): String {
    return "P(" + "x=" + <this>.#x + ", " + "y=" + <this>.#y + ")"
  }

  override fun hashCode(): Int {
    var result: Int = <this>.#x.hashCode()
    result = result.times(other = 31).plus(other = <this>.#y.hashCode())
    return result
  }

  override operator fun equals(other: Any?): Boolean {
    when {
      EQEQEQ(arg0 = <this>, arg1 = other) -> return true
    }
    when {
      other !is P -> return false
    }
    val tmp0_other_with_cast: P = other as P
    when {
      EQEQ(arg0 = <this>.#x, arg1 = tmp0_other_with_cast.#x).not() -> return false
    }
    when {
      EQEQ(arg0 = <this>.#y, arg1 = tmp0_other_with_cast.#y).not() -> return false
    }
    return true
  }

}
