package test

class C {
  constructor() /* primary */ {
    super/*Any*/()
    /* <init>() */

  }

}

var C?.p: Int
  get(): Int {
    return 42
  }
  set(value: Int) {
  }

operator fun Int?.inc(): Int? {
  return { // BLOCK
    val tmp_0: Int? = <this>
    when {
      EQEQ(arg0 = tmp_0, arg1 = null) -> null
      else -> tmp_0.inc()
    }
  }
}

operator fun Int?.get(index: Int): Int {
  return 42
}

operator fun Int?.set(index: Int, value: Int) {
}

fun testProperty(nc: C?) {
  { // BLOCK
    val tmp_1: C? = nc
    when {
      EQEQ(arg0 = tmp_1, arg1 = null) -> null
      else -> { // BLOCK
        val tmp_2: C = tmp_1
        val tmp_3: Int = tmp_2.<get-p>()
        tmp_2.<set-p>(value = tmp_3.inc())
        tmp_3
      }
    }
  } /*~> Unit */
}

fun testArrayAccess(nc: C?) {
  { // BLOCK
    val tmp_4: C? = nc
    when {
      EQEQ(arg0 = tmp_4, arg1 = null) -> null
      else -> { // BLOCK
        val tmp_5: Int = tmp_4.<get-p>()
        val tmp_6: Int = 0
        val tmp_7: Int = tmp_5.get(index = tmp_6)
        tmp_5.set(index = tmp_6, value = tmp_7.inc())
        tmp_7
      }
    }
  } /*~> Unit */
}
