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*/()
        /* InstanceInitializerCall */

  }

  val x: Int
    field = x
    get

  val y: Int
    field = y
    get

  operator fun component1(): Int {
    return #x
  }

  operator fun component2(): Int {
    return #y
  }

  fun copy(x: Int = #x, y: Int = #y): P {
    return P(x = x, y = y)
  }

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

  override fun hashCode(): Int {
    var result: Int = #x.hashCode()
    result = result.times(other = 31).plus(other = #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 = #x, arg1 = #x).not() -> return false
    }
    when {
      EQEQ(arg0 = #y, arg1 = #y).not() -> return false
    }
    return true
  }

}

