sealed class ArrayMap : Iterable { protected constructor() /* primary */ { super/*Any*/() /* () */ } abstract fun copy(): ArrayMap abstract operator fun get(index: Int): T? abstract operator fun set(index: Int, value: T) abstract val size: Int abstract get } internal class ArrayMapImpl : ArrayMap { private var data: Array field = data private get private set override var size: Int field = 0 override get private open set data class Entry : Entry { override val key: Int field = key override get override val value: T field = value override get constructor(key: Int, value: T) /* primary */ { super/*Any*/() /* () */ } operator fun component1(): Int { return .#key } operator fun component2(): T { return .#value } fun copy(key: Int = .#key, value: T = .#value): Entry { return Entry(key = key, value = value) } override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } when { other !is Entry -> return false } val tmp_0: Entry = other as Entry when { EQEQ(arg0 = .#key, arg1 = tmp_0.#key).not() -> return false } when { EQEQ(arg0 = .#value, arg1 = tmp_0.#value).not() -> return false } return true } override fun hashCode(): Int { var result: Int = .#key.hashCode() result = result.times(other = 31).plus(other = when { EQEQ(arg0 = .#value, arg1 = null) -> 0 else -> .#value.hashCode() }) return result } override fun toString(): String { return "Entry(" + "key=" + .#key + ", " + "value=" + .#value + ")" } } companion object Companion { private constructor() /* primary */ { super/*Any*/() /* () */ } private const val DEFAULT_SIZE: Int field = 20 private get private const val INCREASE_K: Int field = 2 private get } private constructor(data: Array) /* primary */ { super/*ArrayMap*/() /* () */ } constructor() { this/*ArrayMapImpl*/(data = arrayOfNulls(size = Companion.())) } override fun copy(): ArrayMap { return ArrayMapImpl(data = .().copyOf()) } private fun ensureCapacity(index: Int) { when { lessOrEqual(arg0 = .().(), arg1 = index) -> { // BLOCK .( = .().copyOf(newSize = .().().times(other = Companion.()))) } } } fun entries(): List> { return .().mapIndexedNotNull>(transform = local fun (index: Int, value: Any?): Entry? { return when { EQEQ(arg0 = value, arg1 = null).not() -> Entry(key = index, value = value as T) else -> null } } ) } override operator fun get(index: Int): T? { return .().getOrNull(index = index) as T? } override operator fun iterator(): Iterator { return { // BLOCK local class : AbstractIterator { private var index: Int field = -1 private get private set constructor() /* primary */ { super/*AbstractIterator*/() /* () */ } protected override fun computeNext() { { // BLOCK do// COMPOSITE { { // BLOCK val tmp_1: = { // BLOCK val tmp_2: Int = tmp_1.() tmp_1.( = tmp_2.inc()) tmp_2 } } /*~> Unit */ // } while (when { less(arg0 = .(), arg1 = .().()) -> EQEQ(arg0 = .().get(index = .()), arg1 = null) else -> false }) } when { greaterOrEqual(arg0 = .(), arg1 = .().()) -> { // BLOCK .done() } else -> { // BLOCK .setNext(value = .().get(index = .()) as T) } } } } () } } fun remove(index: Int) { when { EQEQ(arg0 = .().get(index = index), arg1 = null).not() -> { // BLOCK { // BLOCK val tmp_3: ArrayMapImpl = { // BLOCK val tmp_4: Int = tmp_3.() tmp_3.( = tmp_4.dec()) tmp_4 } } } /*~> Unit */ } .().set(index = index, value = null) } override operator fun set(index: Int, value: T) { .ensureCapacity(index = index) when { EQEQ(arg0 = .().get(index = index), arg1 = null) -> { // BLOCK { // BLOCK val tmp_5: ArrayMapImpl = { // BLOCK val tmp_6: Int = tmp_5.() tmp_5.( = tmp_6.inc()) tmp_6 } } } /*~> Unit */ } .().set(index = index, value = value) } } internal class OneElementArrayMap : ArrayMap { val value: T field = value get val index: Int field = index get constructor(value: T, index: Int) /* primary */ { super/*ArrayMap*/() /* () */ } override fun copy(): ArrayMap { return OneElementArrayMap(value = .(), index = .()) } override operator fun get(index: Int): T? { return when { EQEQ(arg0 = index, arg1 = .()) -> .() else -> null } } override operator fun iterator(): Iterator { return { // BLOCK local class : Iterator { private var notVisited: Boolean field = true private get private set constructor() /* primary */ { super/*Any*/() /* () */ } override operator fun hasNext(): Boolean { return .() } override operator fun next(): T { when { .() -> { // BLOCK .( = false) return .() } else -> { // BLOCK throw NoSuchElementException() } } } } () } } override operator fun set(index: Int, value: T) { throw IllegalStateException() } override val size: Int override get(): Int { return 1 } } internal object EmptyArrayMap : ArrayMap { private constructor() /* primary */ { super/*ArrayMap*/() /* () */ } override fun copy(): ArrayMap { return } override operator fun get(index: Int): Nothing? { return null } override operator fun iterator(): Iterator { return { // BLOCK local class : Iterator { constructor() /* primary */ { super/*Any*/() /* () */ } override operator fun hasNext(): Boolean { return false } override operator fun next(): Nothing { throw NoSuchElementException() } } () } } override operator fun set(index: Int, value: Nothing) { throw IllegalStateException() } override val size: Int override get(): Int { return 0 } } fun ArrayMap<*>.isEmpty(): Boolean { return EQEQ(arg0 = .(), arg1 = 0) } fun ArrayMap<*>.isNotEmpty(): Boolean { return EQEQ(arg0 = .(), arg1 = 0).not() }