import kotlin.time.ExperimentalTime
import kotlin.time.measureTime

class Day23 {
    fun parse(input: List<String>): Set<Point> {
        return input.flatMapIndexed { y, line ->
            line.mapIndexed { x, c ->
                if (c == '#') {
                    Point(x, y)
                } else {
                    null
                }
            }
        }.filterNotNull().toSet()
    }

    private val directions = arrayOf(Direction.Up, Direction.Down, Direction.Left, Direction.Right)

    fun getNext(direction: Direction): Direction {
        val index = (directions.indexOf(direction) + 1 + directions.size) % directions.size
        return directions[index]
    }

    fun getNeighbors(point: Point): List<Point> {
        return (-1..1)
            .flatMap { x ->
                (-1..1)
                    .map { y -> Point(point.x + x, point.y + y) }
            }
            .filter { p -> p != point }
    }

    fun canMove(point: Point, neighbors: List<Point>, direction: Direction): Point? {
        return when (direction) {
            Direction.Up -> if (neighbors.none { p -> p.y == point.y - 1 }) Point(point.x, point.y - 1) else null
            Direction.Down -> if (neighbors.none { p -> p.y == point.y + 1 }) Point(point.x, point.y + 1) else null
            Direction.Left -> if (neighbors.none { p -> p.x == point.x - 1 }) Point(point.x - 1, point.y) else null
            Direction.Right -> if (neighbors.none { p -> p.x == point.x + 1 }) Point(point.x + 1, point.y) else null
        }
    }

    fun move(points: Set<Point>, direction: Direction): Set<Point> {
        val proposals = mutableMapOf<Point, Point>()
        for (point in points) {
            val neighbors = getNeighbors(point).filter { it in points }
            if (neighbors.isEmpty()) {
                continue
            }

            var cursor = direction
            while (true) {
                val target = canMove(point, neighbors, cursor)
                if (target != null) {
                    proposals[point] = target
                    break
                }
                cursor = getNext(cursor)
                if (cursor == direction) {
                    break
                }
            }
        }

        val reverseMap = proposals.asIterable().groupBy({ pair -> pair.value }, { pair -> pair.key })
        val moves = reverseMap.filter { it.value.size == 1 }.map { it.value[0] to it.key }.toMap()

        return points
            .filter { p -> !moves.containsKey(p) }
            .union(moves.values)
            .toSet()
    }

    fun play1(points: Set<Point>): Set<Point> {
        var direction = Direction.Up
        var cursor = points

        for (i in 1..10) {
            cursor = move(cursor, direction)
            direction = getNext(direction)
        }

        return cursor
    }

    fun play2(points: Set<Point>): Int {
        var direction = Direction.Up
        var cursor = points

        var i = 0
        do {
            val newCursor = move(cursor, direction)
            direction = getNext(direction)
            val same = newCursor == cursor
            cursor = newCursor
            ++i
        } while (!same)

        return i
    }

    fun print(points: Set<Point>) {
        val maxX = points.maxOf { p -> p.x }
        val maxY = points.maxOf { p -> p.y }
        val minX = points.minOf { p -> p.x }
        val minY = points.minOf { p -> p.y }

        for (y in (minY - 1)..(maxY + 1)) {
            for (x in (minX - 1)..(maxX + 1)) {
                if (Point(x, y) in points) {
                    print('#')
                } else {
                    print('.')
                }
            }
            println()
        }
        println()
    }

    fun part1(input: List<String>): String {
        val points = parse(input)
        val result = play1(points)
        return calc(result)
    }

    private fun calc(result: Set<Point>): String {
        val maxX = result.maxOf { p -> p.x }
        val maxY = result.maxOf { p -> p.y }
        val minX = result.minOf { p -> p.x }
        val minY = result.minOf { p -> p.y }

        val dx = maxX - minX + 1
        val dy = maxY - minY + 1

        println("dx $dx dy $dy size ${result.size}")
        val answer = dx * dy - result.size
        return answer.toString()
    }

    fun part2(input: List<String>): String {
        val points = parse(input)
        val result = play2(points)
        return result.toString()
    }
}

@OptIn(ExperimentalTime::class)
@Suppress("DuplicatedCode")
fun main() {
    val solution = Day23()
    val name = solution.javaClass.name

    val execution = setOf(
        ExecutionMode.Test1,
        ExecutionMode.Test2,
        ExecutionMode.Exec1,
        ExecutionMode.Exec2
    )

    fun test() {
        val expected1 = "110"
        val expected2 = "20"

        val testInput = readInput("${name}_test")
        if (execution.contains(ExecutionMode.Test1)) {
            println("Test part 1")
            assert(solution.part1(testInput), expected1)
            println("> Passed")
        }
        if (execution.contains(ExecutionMode.Test2)) {
            println("Test part 2")
            assert(solution.part2(testInput), expected2)
            println("> Passed")
            println()
        }
        println("=================================")
        println()
    }

    fun run() {
        val input = readInput(name)
        if (execution.contains(ExecutionMode.Exec1)) {
            val elapsed1 = measureTime {
                println("Part 1: " + solution.part1(input))
            }
            println("Elapsed: $elapsed1")
            println()
        }

        if (execution.contains(ExecutionMode.Exec2)) {
            val elapsed2 = measureTime {
                println("Part 2: " + solution.part2(input))
            }
            println("Elapsed: $elapsed2")
            println()
        }
    }

    test()
    run()
}

Compiled from "Day23.kt"
public final class Day23Kt {
  public static final void main();
    Code:
       0: new           #8                  // class Day23
       3: dup
       4: invokespecial #11                 // Method Day23."<init>":()V
       7: astore_0
       8: aload_0
       9: invokevirtual #15                 // Method java/lang/Object.getClass:()Ljava/lang/Class;
      12: invokevirtual #21                 // Method java/lang/Class.getName:()Ljava/lang/String;
      15: astore_1
      16: iconst_4
      17: anewarray     #23                 // class ExecutionMode
      20: astore_3
      21: aload_3
      22: iconst_0
      23: getstatic     #27                 // Field ExecutionMode.Test1:LExecutionMode;
      26: aastore
      27: aload_3
      28: iconst_1
      29: getstatic     #30                 // Field ExecutionMode.Test2:LExecutionMode;
      32: aastore
      33: aload_3
      34: iconst_2
      35: getstatic     #33                 // Field ExecutionMode.Exec1:LExecutionMode;
      38: aastore
      39: aload_3
      40: iconst_3
      41: getstatic     #36                 // Field ExecutionMode.Exec2:LExecutionMode;
      44: aastore
      45: aload_3
      46: invokestatic  #42                 // Method kotlin/collections/SetsKt.setOf:([Ljava/lang/Object;)Ljava/util/Set;
      49: astore_2
      50: aload_1
      51: aload_2
      52: aload_0
      53: invokestatic  #46                 // Method main$test:(Ljava/lang/String;Ljava/util/Set;LDay23;)V
      56: aload_1
      57: aload_2
      58: aload_0
      59: invokestatic  #49                 // Method main$run:(Ljava/lang/String;Ljava/util/Set;LDay23;)V
      62: return

  public static void main(java.lang.String[]);
    Code:
       0: invokestatic  #58                 // Method main:()V
       3: return

  private static final void main$test(java.lang.String, java.util.Set<? extends ExecutionMode>, Day23);
    Code:
       0: ldc           #63                 // String 110
       2: astore_3
       3: ldc           #65                 // String 20
       5: astore        4
       7: new           #67                 // class java/lang/StringBuilder
      10: dup
      11: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
      14: aload_0
      15: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      18: ldc           #74                 // String _test
      20: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      23: invokevirtual #77                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      26: invokestatic  #83                 // Method UtilsKt.readInput:(Ljava/lang/String;)Ljava/util/List;
      29: astore        5
      31: aload_1
      32: getstatic     #27                 // Field ExecutionMode.Test1:LExecutionMode;
      35: invokeinterface #89,  2           // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
      40: ifeq          71
      43: ldc           #91                 // String Test part 1
      45: getstatic     #97                 // Field java/lang/System.out:Ljava/io/PrintStream;
      48: swap
      49: invokevirtual #103                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      52: aload_2
      53: aload         5
      55: invokevirtual #107                // Method Day23.part1:(Ljava/util/List;)Ljava/lang/String;
      58: aload_3
      59: invokestatic  #111                // Method UtilsKt.assert:(Ljava/lang/Object;Ljava/lang/Object;)V
      62: ldc           #113                // String > Passed
      64: getstatic     #97                 // Field java/lang/System.out:Ljava/io/PrintStream;
      67: swap
      68: invokevirtual #103                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      71: aload_1
      72: getstatic     #30                 // Field ExecutionMode.Test2:LExecutionMode;
      75: invokeinterface #89,  2           // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
      80: ifeq          118
      83: ldc           #115                // String Test part 2
      85: getstatic     #97                 // Field java/lang/System.out:Ljava/io/PrintStream;
      88: swap
      89: invokevirtual #103                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      92: aload_2
      93: aload         5
      95: invokevirtual #118                // Method Day23.part2:(Ljava/util/List;)Ljava/lang/String;
      98: aload         4
     100: invokestatic  #111                // Method UtilsKt.assert:(Ljava/lang/Object;Ljava/lang/Object;)V
     103: ldc           #113                // String > Passed
     105: getstatic     #97                 // Field java/lang/System.out:Ljava/io/PrintStream;
     108: swap
     109: invokevirtual #103                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     112: getstatic     #97                 // Field java/lang/System.out:Ljava/io/PrintStream;
     115: invokevirtual #120                // Method java/io/PrintStream.println:()V
     118: ldc           #122                // String =================================
     120: getstatic     #97                 // Field java/lang/System.out:Ljava/io/PrintStream;
     123: swap
     124: invokevirtual #103                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     127: getstatic     #97                 // Field java/lang/System.out:Ljava/io/PrintStream;
     130: invokevirtual #120                // Method java/io/PrintStream.println:()V
     133: return

  private static final void main$run(java.lang.String, java.util.Set<? extends ExecutionMode>, Day23);
    Code:
       0: aload_0
       1: invokestatic  #135                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
       4: aload_0
       5: invokestatic  #83                 // Method UtilsKt.readInput:(Ljava/lang/String;)Ljava/util/List;
       8: astore_3
       9: aload_1
      10: getstatic     #33                 // Field ExecutionMode.Exec1:LExecutionMode;
      13: invokeinterface #89,  2           // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
      18: ifeq          118
      21: iconst_0
      22: istore        6
      24: getstatic     #141                // Field kotlin/time/TimeSource$Monotonic.INSTANCE:Lkotlin/time/TimeSource$Monotonic;
      27: astore        7
      29: iconst_0
      30: istore        8
      32: aload         7
      34: invokevirtual #145                // Method kotlin/time/TimeSource$Monotonic."markNow-z9LOYto":()J
      37: lstore        9
      39: iconst_0
      40: istore        11
      42: new           #67                 // class java/lang/StringBuilder
      45: dup
      46: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
      49: ldc           #147                // String Part 1:
      51: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      54: aload_2
      55: aload_3
      56: invokevirtual #107                // Method Day23.part1:(Ljava/util/List;)Ljava/lang/String;
      59: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      62: invokevirtual #77                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      65: getstatic     #97                 // Field java/lang/System.out:Ljava/io/PrintStream;
      68: swap
      69: invokevirtual #103                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      72: nop
      73: nop
      74: lload         9
      76: invokestatic  #153                // Method kotlin/time/TimeSource$Monotonic$ValueTimeMark."elapsedNow-UwyO8pc":(J)J
      79: nop
      80: lstore        4
      82: new           #67                 // class java/lang/StringBuilder
      85: dup
      86: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
      89: ldc           #155                // String Elapsed:
      91: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      94: lload         4
      96: invokestatic  #161                // Method kotlin/time/Duration."toString-impl":(J)Ljava/lang/String;
      99: invokevirtual #164                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
     102: invokevirtual #77                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     105: getstatic     #97                 // Field java/lang/System.out:Ljava/io/PrintStream;
     108: swap
     109: invokevirtual #103                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     112: getstatic     #97                 // Field java/lang/System.out:Ljava/io/PrintStream;
     115: invokevirtual #120                // Method java/io/PrintStream.println:()V
     118: aload_1
     119: getstatic     #36                 // Field ExecutionMode.Exec2:LExecutionMode;
     122: invokeinterface #89,  2           // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
     127: ifeq          227
     130: iconst_0
     131: istore        6
     133: getstatic     #141                // Field kotlin/time/TimeSource$Monotonic.INSTANCE:Lkotlin/time/TimeSource$Monotonic;
     136: astore        7
     138: iconst_0
     139: istore        8
     141: aload         7
     143: invokevirtual #145                // Method kotlin/time/TimeSource$Monotonic."markNow-z9LOYto":()J
     146: lstore        9
     148: iconst_0
     149: istore        11
     151: new           #67                 // class java/lang/StringBuilder
     154: dup
     155: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
     158: ldc           #166                // String Part 2:
     160: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     163: aload_2
     164: aload_3
     165: invokevirtual #118                // Method Day23.part2:(Ljava/util/List;)Ljava/lang/String;
     168: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     171: invokevirtual #77                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     174: getstatic     #97                 // Field java/lang/System.out:Ljava/io/PrintStream;
     177: swap
     178: invokevirtual #103                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     181: nop
     182: nop
     183: lload         9
     185: invokestatic  #153                // Method kotlin/time/TimeSource$Monotonic$ValueTimeMark."elapsedNow-UwyO8pc":(J)J
     188: nop
     189: lstore        4
     191: new           #67                 // class java/lang/StringBuilder
     194: dup
     195: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
     198: ldc           #155                // String Elapsed:
     200: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     203: lload         4
     205: invokestatic  #161                // Method kotlin/time/Duration."toString-impl":(J)Ljava/lang/String;
     208: invokevirtual #164                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
     211: invokevirtual #77                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     214: getstatic     #97                 // Field java/lang/System.out:Ljava/io/PrintStream;
     217: swap
     218: invokevirtual #103                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     221: getstatic     #97                 // Field java/lang/System.out:Ljava/io/PrintStream;
     224: invokevirtual #120                // Method java/io/PrintStream.println:()V
     227: return
}

Compiled from "Day23.kt"
public final class Day23$WhenMappings {
  public static final int[] $EnumSwitchMapping$0;

  static {};
    Code:
       0: invokestatic  #14                 // Method Direction.values:()[LDirection;
       3: arraylength
       4: newarray       int
       6: astore_0
       7: nop
       8: aload_0
       9: getstatic     #18                 // Field Direction.Up:LDirection;
      12: invokevirtual #22                 // Method Direction.ordinal:()I
      15: iconst_1
      16: iastore
      17: goto          21
      20: astore_1
      21: nop
      22: aload_0
      23: getstatic     #25                 // Field Direction.Down:LDirection;
      26: invokevirtual #22                 // Method Direction.ordinal:()I
      29: iconst_2
      30: iastore
      31: goto          35
      34: astore_1
      35: nop
      36: aload_0
      37: getstatic     #28                 // Field Direction.Left:LDirection;
      40: invokevirtual #22                 // Method Direction.ordinal:()I
      43: iconst_3
      44: iastore
      45: goto          49
      48: astore_1
      49: nop
      50: aload_0
      51: getstatic     #31                 // Field Direction.Right:LDirection;
      54: invokevirtual #22                 // Method Direction.ordinal:()I
      57: iconst_4
      58: iastore
      59: goto          63
      62: astore_1
      63: aload_0
      64: putstatic     #35                 // Field $EnumSwitchMapping$0:[I
      67: return
    Exception table:
       from    to  target type
           7    17    20   Class java/lang/NoSuchFieldError
          21    31    34   Class java/lang/NoSuchFieldError
          35    45    48   Class java/lang/NoSuchFieldError
          49    59    62   Class java/lang/NoSuchFieldError
}

Compiled from "Day23.kt"
public final class Day23 {
  private final Direction[] directions;

  public Day23();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: iconst_4
       6: anewarray     #10                 // class Direction
       9: astore_1
      10: aload_1
      11: iconst_0
      12: getstatic     #14                 // Field Direction.Up:LDirection;
      15: aastore
      16: aload_1
      17: iconst_1
      18: getstatic     #17                 // Field Direction.Down:LDirection;
      21: aastore
      22: aload_1
      23: iconst_2
      24: getstatic     #20                 // Field Direction.Left:LDirection;
      27: aastore
      28: aload_1
      29: iconst_3
      30: getstatic     #23                 // Field Direction.Right:LDirection;
      33: aastore
      34: aload_1
      35: putfield      #27                 // Field directions:[LDirection;
      38: return

  public final java.util.Set<Point> parse(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #35                 // String input
       3: invokestatic  #41                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: checkcast     #43                 // class java/lang/Iterable
      10: astore_2
      11: new           #45                 // class java/util/ArrayList
      14: dup
      15: invokespecial #46                 // Method java/util/ArrayList."<init>":()V
      18: checkcast     #48                 // class java/util/Collection
      21: astore_3
      22: iconst_0
      23: istore        4
      25: aload_2
      26: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      31: astore        5
      33: aload         5
      35: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      40: ifeq          221
      43: aload         5
      45: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      50: astore        6
      52: iload         4
      54: iinc          4, 1
      57: istore        7
      59: iload         7
      61: ifge          67
      64: invokestatic  #67                 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
      67: iload         7
      69: aload         6
      71: checkcast     #69                 // class java/lang/String
      74: astore        8
      76: istore        9
      78: iconst_0
      79: istore        10
      81: aload         8
      83: checkcast     #71                 // class java/lang/CharSequence
      86: astore        11
      88: iconst_0
      89: istore        12
      91: aload         11
      93: astore        13
      95: new           #45                 // class java/util/ArrayList
      98: dup
      99: aload         11
     101: invokeinterface #75,  1           // InterfaceMethod java/lang/CharSequence.length:()I
     106: invokespecial #78                 // Method java/util/ArrayList."<init>":(I)V
     109: checkcast     #48                 // class java/util/Collection
     112: astore        14
     114: iconst_0
     115: istore        15
     117: iconst_0
     118: istore        16
     120: iconst_0
     121: istore        17
     123: iload         17
     125: aload         13
     127: invokeinterface #75,  1           // InterfaceMethod java/lang/CharSequence.length:()I
     132: if_icmpge     202
     135: aload         13
     137: iload         17
     139: invokeinterface #82,  2           // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     144: istore        18
     146: aload         14
     148: iload         16
     150: iinc          16, 1
     153: iload         18
     155: istore        19
     157: istore        20
     159: astore        21
     161: iconst_0
     162: istore        22
     164: iload         19
     166: bipush        35
     168: if_icmpne     185
     171: new           #84                 // class Point
     174: dup
     175: iload         20
     177: iload         9
     179: invokespecial #87                 // Method Point."<init>":(II)V
     182: goto          186
     185: aconst_null
     186: nop
     187: aload         21
     189: swap
     190: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     195: pop
     196: iinc          17, 1
     199: goto          123
     202: aload         14
     204: checkcast     #93                 // class java/util/List
     207: nop
     208: checkcast     #43                 // class java/lang/Iterable
     211: nop
     212: aload_3
     213: swap
     214: invokestatic  #97                 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     217: pop
     218: goto          33
     221: aload_3
     222: checkcast     #93                 // class java/util/List
     225: checkcast     #43                 // class java/lang/Iterable
     228: invokestatic  #101                // Method kotlin/collections/CollectionsKt.filterNotNull:(Ljava/lang/Iterable;)Ljava/util/List;
     231: checkcast     #43                 // class java/lang/Iterable
     234: invokestatic  #105                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
     237: areturn

  public final Direction getNext(Direction);
    Code:
       0: aload_1
       1: ldc           #128                // String direction
       3: invokestatic  #41                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #27                 // Field directions:[LDirection;
      10: aload_1
      11: invokestatic  #134                // Method kotlin/collections/ArraysKt.indexOf:([Ljava/lang/Object;Ljava/lang/Object;)I
      14: iconst_1
      15: iadd
      16: aload_0
      17: getfield      #27                 // Field directions:[LDirection;
      20: arraylength
      21: iadd
      22: aload_0
      23: getfield      #27                 // Field directions:[LDirection;
      26: arraylength
      27: irem
      28: istore_2
      29: aload_0
      30: getfield      #27                 // Field directions:[LDirection;
      33: iload_2
      34: aaload
      35: areturn

  public final java.util.List<Point> getNeighbors(Point);
    Code:
       0: aload_1
       1: ldc           #140                // String point
       3: invokestatic  #41                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #142                // class kotlin/ranges/IntRange
       9: dup
      10: iconst_m1
      11: iconst_1
      12: invokespecial #143                // Method kotlin/ranges/IntRange."<init>":(II)V
      15: checkcast     #43                 // class java/lang/Iterable
      18: astore_2
      19: nop
      20: iconst_0
      21: istore_3
      22: aload_2
      23: astore        4
      25: new           #45                 // class java/util/ArrayList
      28: dup
      29: invokespecial #46                 // Method java/util/ArrayList."<init>":()V
      32: checkcast     #48                 // class java/util/Collection
      35: astore        5
      37: iconst_0
      38: istore        6
      40: aload         4
      42: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      47: astore        7
      49: aload         7
      51: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      56: ifeq          216
      59: aload         7
      61: checkcast     #145                // class kotlin/collections/IntIterator
      64: invokevirtual #148                // Method kotlin/collections/IntIterator.nextInt:()I
      67: istore        8
      69: iload         8
      71: istore        9
      73: iconst_0
      74: istore        10
      76: new           #142                // class kotlin/ranges/IntRange
      79: dup
      80: iconst_m1
      81: iconst_1
      82: invokespecial #143                // Method kotlin/ranges/IntRange."<init>":(II)V
      85: checkcast     #43                 // class java/lang/Iterable
      88: astore        11
      90: nop
      91: iconst_0
      92: istore        12
      94: aload         11
      96: astore        13
      98: new           #45                 // class java/util/ArrayList
     101: dup
     102: aload         11
     104: bipush        10
     106: invokestatic  #152                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     109: invokespecial #78                 // Method java/util/ArrayList."<init>":(I)V
     112: checkcast     #48                 // class java/util/Collection
     115: astore        14
     117: iconst_0
     118: istore        15
     120: aload         13
     122: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     127: astore        16
     129: aload         16
     131: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     136: ifeq          193
     139: aload         16
     141: checkcast     #145                // class kotlin/collections/IntIterator
     144: invokevirtual #148                // Method kotlin/collections/IntIterator.nextInt:()I
     147: istore        17
     149: aload         14
     151: iload         17
     153: istore        18
     155: astore        19
     157: iconst_0
     158: istore        20
     160: new           #84                 // class Point
     163: dup
     164: aload_1
     165: invokevirtual #155                // Method Point.getX:()I
     168: iload         9
     170: iadd
     171: aload_1
     172: invokevirtual #158                // Method Point.getY:()I
     175: iload         18
     177: iadd
     178: invokespecial #87                 // Method Point."<init>":(II)V
     181: aload         19
     183: swap
     184: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     189: pop
     190: goto          129
     193: aload         14
     195: checkcast     #93                 // class java/util/List
     198: nop
     199: checkcast     #43                 // class java/lang/Iterable
     202: nop
     203: astore        9
     205: aload         5
     207: aload         9
     209: invokestatic  #97                 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     212: pop
     213: goto          49
     216: aload         5
     218: checkcast     #93                 // class java/util/List
     221: nop
     222: checkcast     #43                 // class java/lang/Iterable
     225: astore_2
     226: nop
     227: iconst_0
     228: istore_3
     229: aload_2
     230: astore        4
     232: new           #45                 // class java/util/ArrayList
     235: dup
     236: invokespecial #46                 // Method java/util/ArrayList."<init>":()V
     239: checkcast     #48                 // class java/util/Collection
     242: astore        5
     244: iconst_0
     245: istore        6
     247: aload         4
     249: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     254: astore        7
     256: aload         7
     258: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     263: ifeq          315
     266: aload         7
     268: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     273: astore        8
     275: aload         8
     277: checkcast     #84                 // class Point
     280: astore        9
     282: iconst_0
     283: istore        10
     285: aload         9
     287: aload_1
     288: invokestatic  #162                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     291: ifne          298
     294: iconst_1
     295: goto          299
     298: iconst_0
     299: ifeq          256
     302: aload         5
     304: aload         8
     306: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     311: pop
     312: goto          256
     315: aload         5
     317: checkcast     #93                 // class java/util/List
     320: nop
     321: areturn

  public final Point canMove(Point, java.util.List<Point>, Direction);
    Code:
       0: aload_1
       1: ldc           #140                // String point
       3: invokestatic  #41                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #189                // String neighbors
       9: invokestatic  #41                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_3
      13: ldc           #128                // String direction
      15: invokestatic  #41                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      18: aload_3
      19: getstatic     #195                // Field Day23$WhenMappings.$EnumSwitchMapping$0:[I
      22: swap
      23: invokevirtual #198                // Method Direction.ordinal:()I
      26: iaload
      27: tableswitch   { // 1 to 4
                     1: 56
                     2: 182
                     3: 308
                     4: 434
               default: 560
          }
      56: aload_2
      57: checkcast     #43                 // class java/lang/Iterable
      60: astore        4
      62: iconst_0
      63: istore        5
      65: aload         4
      67: instanceof    #48                 // class java/util/Collection
      70: ifeq          90
      73: aload         4
      75: checkcast     #48                 // class java/util/Collection
      78: invokeinterface #201,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
      83: ifeq          90
      86: iconst_1
      87: goto          155
      90: aload         4
      92: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      97: astore        6
      99: aload         6
     101: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     106: ifeq          154
     109: aload         6
     111: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     116: astore        7
     118: aload         7
     120: checkcast     #84                 // class Point
     123: astore        8
     125: iconst_0
     126: istore        9
     128: aload         8
     130: invokevirtual #158                // Method Point.getY:()I
     133: aload_1
     134: invokevirtual #158                // Method Point.getY:()I
     137: iconst_1
     138: isub
     139: if_icmpne     146
     142: iconst_1
     143: goto          147
     146: iconst_0
     147: ifeq          99
     150: iconst_0
     151: goto          155
     154: iconst_1
     155: ifeq          178
     158: new           #84                 // class Point
     161: dup
     162: aload_1
     163: invokevirtual #155                // Method Point.getX:()I
     166: aload_1
     167: invokevirtual #158                // Method Point.getY:()I
     170: iconst_1
     171: isub
     172: invokespecial #87                 // Method Point."<init>":(II)V
     175: goto          568
     178: aconst_null
     179: goto          568
     182: aload_2
     183: checkcast     #43                 // class java/lang/Iterable
     186: astore        4
     188: iconst_0
     189: istore        5
     191: aload         4
     193: instanceof    #48                 // class java/util/Collection
     196: ifeq          216
     199: aload         4
     201: checkcast     #48                 // class java/util/Collection
     204: invokeinterface #201,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     209: ifeq          216
     212: iconst_1
     213: goto          281
     216: aload         4
     218: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     223: astore        6
     225: aload         6
     227: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     232: ifeq          280
     235: aload         6
     237: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     242: astore        7
     244: aload         7
     246: checkcast     #84                 // class Point
     249: astore        8
     251: iconst_0
     252: istore        9
     254: aload         8
     256: invokevirtual #158                // Method Point.getY:()I
     259: aload_1
     260: invokevirtual #158                // Method Point.getY:()I
     263: iconst_1
     264: iadd
     265: if_icmpne     272
     268: iconst_1
     269: goto          273
     272: iconst_0
     273: ifeq          225
     276: iconst_0
     277: goto          281
     280: iconst_1
     281: ifeq          304
     284: new           #84                 // class Point
     287: dup
     288: aload_1
     289: invokevirtual #155                // Method Point.getX:()I
     292: aload_1
     293: invokevirtual #158                // Method Point.getY:()I
     296: iconst_1
     297: iadd
     298: invokespecial #87                 // Method Point."<init>":(II)V
     301: goto          568
     304: aconst_null
     305: goto          568
     308: aload_2
     309: checkcast     #43                 // class java/lang/Iterable
     312: astore        4
     314: iconst_0
     315: istore        5
     317: aload         4
     319: instanceof    #48                 // class java/util/Collection
     322: ifeq          342
     325: aload         4
     327: checkcast     #48                 // class java/util/Collection
     330: invokeinterface #201,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     335: ifeq          342
     338: iconst_1
     339: goto          407
     342: aload         4
     344: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     349: astore        6
     351: aload         6
     353: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     358: ifeq          406
     361: aload         6
     363: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     368: astore        7
     370: aload         7
     372: checkcast     #84                 // class Point
     375: astore        8
     377: iconst_0
     378: istore        9
     380: aload         8
     382: invokevirtual #155                // Method Point.getX:()I
     385: aload_1
     386: invokevirtual #155                // Method Point.getX:()I
     389: iconst_1
     390: isub
     391: if_icmpne     398
     394: iconst_1
     395: goto          399
     398: iconst_0
     399: ifeq          351
     402: iconst_0
     403: goto          407
     406: iconst_1
     407: ifeq          430
     410: new           #84                 // class Point
     413: dup
     414: aload_1
     415: invokevirtual #155                // Method Point.getX:()I
     418: iconst_1
     419: isub
     420: aload_1
     421: invokevirtual #158                // Method Point.getY:()I
     424: invokespecial #87                 // Method Point."<init>":(II)V
     427: goto          568
     430: aconst_null
     431: goto          568
     434: aload_2
     435: checkcast     #43                 // class java/lang/Iterable
     438: astore        4
     440: iconst_0
     441: istore        5
     443: aload         4
     445: instanceof    #48                 // class java/util/Collection
     448: ifeq          468
     451: aload         4
     453: checkcast     #48                 // class java/util/Collection
     456: invokeinterface #201,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     461: ifeq          468
     464: iconst_1
     465: goto          533
     468: aload         4
     470: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     475: astore        6
     477: aload         6
     479: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     484: ifeq          532
     487: aload         6
     489: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     494: astore        7
     496: aload         7
     498: checkcast     #84                 // class Point
     501: astore        8
     503: iconst_0
     504: istore        9
     506: aload         8
     508: invokevirtual #155                // Method Point.getX:()I
     511: aload_1
     512: invokevirtual #155                // Method Point.getX:()I
     515: iconst_1
     516: iadd
     517: if_icmpne     524
     520: iconst_1
     521: goto          525
     524: iconst_0
     525: ifeq          477
     528: iconst_0
     529: goto          533
     532: iconst_1
     533: ifeq          556
     536: new           #84                 // class Point
     539: dup
     540: aload_1
     541: invokevirtual #155                // Method Point.getX:()I
     544: iconst_1
     545: iadd
     546: aload_1
     547: invokevirtual #158                // Method Point.getY:()I
     550: invokespecial #87                 // Method Point."<init>":(II)V
     553: goto          568
     556: aconst_null
     557: goto          568
     560: new           #203                // class kotlin/NoWhenBranchMatchedException
     563: dup
     564: invokespecial #204                // Method kotlin/NoWhenBranchMatchedException."<init>":()V
     567: athrow
     568: areturn

  public final java.util.Set<Point> move(java.util.Set<Point>, Direction);
    Code:
       0: aload_1
       1: ldc           #216                // String points
       3: invokestatic  #41                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #128                // String direction
       9: invokestatic  #41                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: new           #218                // class java/util/LinkedHashMap
      15: dup
      16: invokespecial #219                // Method java/util/LinkedHashMap."<init>":()V
      19: checkcast     #221                // class java/util/Map
      22: astore_3
      23: aload_1
      24: invokeinterface #224,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
      29: astore        4
      31: aload         4
      33: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      38: ifeq          221
      41: aload         4
      43: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      48: checkcast     #84                 // class Point
      51: astore        5
      53: aload_0
      54: aload         5
      56: invokevirtual #226                // Method getNeighbors:(LPoint;)Ljava/util/List;
      59: checkcast     #43                 // class java/lang/Iterable
      62: astore        7
      64: iconst_0
      65: istore        8
      67: aload         7
      69: astore        9
      71: new           #45                 // class java/util/ArrayList
      74: dup
      75: invokespecial #46                 // Method java/util/ArrayList."<init>":()V
      78: checkcast     #48                 // class java/util/Collection
      81: astore        10
      83: iconst_0
      84: istore        11
      86: aload         9
      88: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      93: astore        12
      95: aload         12
      97: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     102: ifeq          148
     105: aload         12
     107: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     112: astore        13
     114: aload         13
     116: checkcast     #84                 // class Point
     119: astore        14
     121: iconst_0
     122: istore        15
     124: aload_1
     125: aload         14
     127: invokeinterface #229,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
     132: ifeq          95
     135: aload         10
     137: aload         13
     139: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     144: pop
     145: goto          95
     148: aload         10
     150: checkcast     #93                 // class java/util/List
     153: nop
     154: astore        6
     156: aload         6
     158: invokeinterface #230,  1          // InterfaceMethod java/util/List.isEmpty:()Z
     163: ifeq          169
     166: goto          31
     169: aload_2
     170: astore        7
     172: nop
     173: aload_0
     174: aload         5
     176: aload         6
     178: aload         7
     180: invokevirtual #232                // Method canMove:(LPoint;Ljava/util/List;LDirection;)LPoint;
     183: astore        8
     185: aload         8
     187: ifnull        204
     190: aload_3
     191: aload         5
     193: aload         8
     195: invokeinterface #236,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     200: pop
     201: goto          31
     204: aload_0
     205: aload         7
     207: invokevirtual #238                // Method getNext:(LDirection;)LDirection;
     210: astore        7
     212: aload         7
     214: aload_2
     215: if_acmpne     172
     218: goto          31
     221: aload_3
     222: invokeinterface #242,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     227: checkcast     #43                 // class java/lang/Iterable
     230: astore        5
     232: nop
     233: iconst_0
     234: istore        6
     236: aload         5
     238: astore        7
     240: new           #218                // class java/util/LinkedHashMap
     243: dup
     244: invokespecial #219                // Method java/util/LinkedHashMap."<init>":()V
     247: checkcast     #221                // class java/util/Map
     250: astore        8
     252: iconst_0
     253: istore        9
     255: aload         7
     257: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     262: astore        10
     264: aload         10
     266: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     271: ifeq          404
     274: aload         10
     276: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     281: astore        11
     283: aload         11
     285: checkcast     #244                // class java/util/Map$Entry
     288: astore        12
     290: iconst_0
     291: istore        13
     293: aload         12
     295: invokeinterface #247,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     300: checkcast     #84                 // class Point
     303: astore        14
     305: aload         8
     307: astore        15
     309: iconst_0
     310: istore        16
     312: aload         15
     314: aload         14
     316: invokeinterface #251,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     321: astore        17
     323: aload         17
     325: ifnonnull     360
     328: iconst_0
     329: istore        18
     331: new           #45                 // class java/util/ArrayList
     334: dup
     335: invokespecial #46                 // Method java/util/ArrayList."<init>":()V
     338: checkcast     #93                 // class java/util/List
     341: astore        18
     343: aload         15
     345: aload         14
     347: aload         18
     349: invokeinterface #236,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     354: pop
     355: aload         18
     357: goto          362
     360: aload         17
     362: nop
     363: checkcast     #93                 // class java/util/List
     366: astore        12
     368: aload         12
     370: aload         11
     372: checkcast     #244                // class java/util/Map$Entry
     375: astore        13
     377: astore        20
     379: iconst_0
     380: istore        19
     382: aload         13
     384: invokeinterface #254,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     389: checkcast     #84                 // class Point
     392: aload         20
     394: swap
     395: invokeinterface #255,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     400: pop
     401: goto          264
     404: aload         8
     406: nop
     407: astore        4
     409: aload         4
     411: astore        6
     413: iconst_0
     414: istore        7
     416: aload         6
     418: astore        8
     420: new           #218                // class java/util/LinkedHashMap
     423: dup
     424: invokespecial #219                // Method java/util/LinkedHashMap."<init>":()V
     427: checkcast     #221                // class java/util/Map
     430: astore        9
     432: iconst_0
     433: istore        10
     435: aload         8
     437: invokeinterface #242,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     442: invokeinterface #224,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     447: astore        11
     449: aload         11
     451: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     456: ifeq          530
     459: aload         11
     461: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     466: checkcast     #244                // class java/util/Map$Entry
     469: astore        12
     471: aload         12
     473: astore        13
     475: iconst_0
     476: istore        14
     478: aload         13
     480: invokeinterface #247,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     485: checkcast     #93                 // class java/util/List
     488: invokeinterface #258,  1          // InterfaceMethod java/util/List.size:()I
     493: iconst_1
     494: if_icmpne     501
     497: iconst_1
     498: goto          502
     501: iconst_0
     502: ifeq          449
     505: aload         9
     507: aload         12
     509: invokeinterface #254,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     514: aload         12
     516: invokeinterface #247,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     521: invokeinterface #236,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     526: pop
     527: goto          449
     530: aload         9
     532: nop
     533: astore        6
     535: nop
     536: iconst_0
     537: istore        7
     539: aload         6
     541: astore        8
     543: new           #45                 // class java/util/ArrayList
     546: dup
     547: aload         6
     549: invokeinterface #259,  1          // InterfaceMethod java/util/Map.size:()I
     554: invokespecial #78                 // Method java/util/ArrayList."<init>":(I)V
     557: checkcast     #48                 // class java/util/Collection
     560: astore        9
     562: iconst_0
     563: istore        10
     565: aload         8
     567: invokeinterface #242,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     572: invokeinterface #224,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     577: astore        11
     579: aload         11
     581: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     586: ifeq          650
     589: aload         11
     591: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     596: checkcast     #244                // class java/util/Map$Entry
     599: astore        12
     601: aload         9
     603: aload         12
     605: astore        13
     607: astore        20
     609: iconst_0
     610: istore        14
     612: aload         13
     614: invokeinterface #247,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     619: checkcast     #93                 // class java/util/List
     622: iconst_0
     623: invokeinterface #262,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     628: aload         13
     630: invokeinterface #254,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     635: invokestatic  #268                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     638: aload         20
     640: swap
     641: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     646: pop
     647: goto          579
     650: aload         9
     652: checkcast     #93                 // class java/util/List
     655: nop
     656: checkcast     #43                 // class java/lang/Iterable
     659: invokestatic  #274                // Method kotlin/collections/MapsKt.toMap:(Ljava/lang/Iterable;)Ljava/util/Map;
     662: astore        5
     664: aload_1
     665: checkcast     #43                 // class java/lang/Iterable
     668: astore        6
     670: nop
     671: iconst_0
     672: istore        7
     674: aload         6
     676: astore        8
     678: new           #45                 // class java/util/ArrayList
     681: dup
     682: invokespecial #46                 // Method java/util/ArrayList."<init>":()V
     685: checkcast     #48                 // class java/util/Collection
     688: astore        9
     690: iconst_0
     691: istore        10
     693: aload         8
     695: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     700: astore        11
     702: aload         11
     704: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     709: ifeq          764
     712: aload         11
     714: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     719: astore        12
     721: aload         12
     723: checkcast     #84                 // class Point
     726: astore        13
     728: iconst_0
     729: istore        14
     731: aload         5
     733: aload         13
     735: invokeinterface #277,  2          // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
     740: ifne          747
     743: iconst_1
     744: goto          748
     747: iconst_0
     748: ifeq          702
     751: aload         9
     753: aload         12
     755: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     760: pop
     761: goto          702
     764: aload         9
     766: checkcast     #93                 // class java/util/List
     769: nop
     770: checkcast     #43                 // class java/lang/Iterable
     773: aload         5
     775: invokeinterface #281,  1          // InterfaceMethod java/util/Map.values:()Ljava/util/Collection;
     780: checkcast     #43                 // class java/lang/Iterable
     783: invokestatic  #285                // Method kotlin/collections/CollectionsKt.union:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;
     786: checkcast     #43                 // class java/lang/Iterable
     789: invokestatic  #105                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
     792: areturn

  public final java.util.Set<Point> play1(java.util.Set<Point>);
    Code:
       0: aload_1
       1: ldc           #216                // String points
       3: invokestatic  #41                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: getstatic     #14                 // Field Direction.Up:LDirection;
       9: astore_2
      10: aload_1
      11: astore_3
      12: iconst_1
      13: istore        4
      15: iload         4
      17: bipush        11
      19: if_icmpge     41
      22: aload_0
      23: aload_3
      24: aload_2
      25: invokevirtual #316                // Method move:(Ljava/util/Set;LDirection;)Ljava/util/Set;
      28: astore_3
      29: aload_0
      30: aload_2
      31: invokevirtual #238                // Method getNext:(LDirection;)LDirection;
      34: astore_2
      35: iinc          4, 1
      38: goto          15
      41: aload_3
      42: areturn

  public final int play2(java.util.Set<Point>);
    Code:
       0: aload_1
       1: ldc           #216                // String points
       3: invokestatic  #41                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: getstatic     #14                 // Field Direction.Up:LDirection;
       9: astore_2
      10: aload_1
      11: astore_3
      12: iconst_0
      13: istore        4
      15: aload_0
      16: aload_3
      17: aload_2
      18: invokevirtual #316                // Method move:(Ljava/util/Set;LDirection;)Ljava/util/Set;
      21: astore        5
      23: aload_0
      24: aload_2
      25: invokevirtual #238                // Method getNext:(LDirection;)LDirection;
      28: astore_2
      29: aload         5
      31: aload_3
      32: invokestatic  #162                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      35: istore        6
      37: aload         5
      39: astore_3
      40: iinc          4, 1
      43: iload         6
      45: ifeq          15
      48: iload         4
      50: ireturn

  public final void print(java.util.Set<Point>);
    Code:
       0: aload_1
       1: ldc           #216                // String points
       3: invokestatic  #41                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: checkcast     #43                 // class java/lang/Iterable
      10: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      15: astore        4
      17: aload         4
      19: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      24: ifne          35
      27: new           #328                // class java/util/NoSuchElementException
      30: dup
      31: invokespecial #329                // Method java/util/NoSuchElementException."<init>":()V
      34: athrow
      35: aload         4
      37: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      42: checkcast     #84                 // class Point
      45: astore        5
      47: iconst_0
      48: istore        6
      50: aload         5
      52: invokevirtual #155                // Method Point.getX:()I
      55: istore        5
      57: aload         4
      59: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      64: ifeq          103
      67: aload         4
      69: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      74: checkcast     #84                 // class Point
      77: astore        6
      79: iconst_0
      80: istore        7
      82: aload         6
      84: invokevirtual #155                // Method Point.getX:()I
      87: istore        6
      89: iload         5
      91: iload         6
      93: if_icmpge     57
      96: iload         6
      98: istore        5
     100: goto          57
     103: iload         5
     105: istore_2
     106: aload_1
     107: checkcast     #43                 // class java/lang/Iterable
     110: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     115: astore        5
     117: aload         5
     119: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     124: ifne          135
     127: new           #328                // class java/util/NoSuchElementException
     130: dup
     131: invokespecial #329                // Method java/util/NoSuchElementException."<init>":()V
     134: athrow
     135: aload         5
     137: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     142: checkcast     #84                 // class Point
     145: astore        6
     147: iconst_0
     148: istore        7
     150: aload         6
     152: invokevirtual #158                // Method Point.getY:()I
     155: istore        6
     157: aload         5
     159: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     164: ifeq          203
     167: aload         5
     169: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     174: checkcast     #84                 // class Point
     177: astore        7
     179: iconst_0
     180: istore        8
     182: aload         7
     184: invokevirtual #158                // Method Point.getY:()I
     187: istore        7
     189: iload         6
     191: iload         7
     193: if_icmpge     157
     196: iload         7
     198: istore        6
     200: goto          157
     203: iload         6
     205: istore_3
     206: aload_1
     207: checkcast     #43                 // class java/lang/Iterable
     210: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     215: astore        6
     217: aload         6
     219: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     224: ifne          235
     227: new           #328                // class java/util/NoSuchElementException
     230: dup
     231: invokespecial #329                // Method java/util/NoSuchElementException."<init>":()V
     234: athrow
     235: aload         6
     237: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     242: checkcast     #84                 // class Point
     245: astore        7
     247: iconst_0
     248: istore        8
     250: aload         7
     252: invokevirtual #155                // Method Point.getX:()I
     255: istore        7
     257: aload         6
     259: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     264: ifeq          303
     267: aload         6
     269: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     274: checkcast     #84                 // class Point
     277: astore        8
     279: iconst_0
     280: istore        9
     282: aload         8
     284: invokevirtual #155                // Method Point.getX:()I
     287: istore        8
     289: iload         7
     291: iload         8
     293: if_icmple     257
     296: iload         8
     298: istore        7
     300: goto          257
     303: iload         7
     305: istore        4
     307: aload_1
     308: checkcast     #43                 // class java/lang/Iterable
     311: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     316: astore        7
     318: aload         7
     320: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     325: ifne          336
     328: new           #328                // class java/util/NoSuchElementException
     331: dup
     332: invokespecial #329                // Method java/util/NoSuchElementException."<init>":()V
     335: athrow
     336: aload         7
     338: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     343: checkcast     #84                 // class Point
     346: astore        8
     348: iconst_0
     349: istore        9
     351: aload         8
     353: invokevirtual #158                // Method Point.getY:()I
     356: istore        8
     358: aload         7
     360: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     365: ifeq          404
     368: aload         7
     370: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     375: checkcast     #84                 // class Point
     378: astore        9
     380: iconst_0
     381: istore        10
     383: aload         9
     385: invokevirtual #158                // Method Point.getY:()I
     388: istore        9
     390: iload         8
     392: iload         9
     394: if_icmple     358
     397: iload         9
     399: istore        8
     401: goto          358
     404: iload         8
     406: istore        5
     408: iload         5
     410: iconst_1
     411: isub
     412: istore        6
     414: iload_3
     415: iconst_1
     416: iadd
     417: istore        7
     419: iload         6
     421: iload         7
     423: if_icmpgt     523
     426: iload         4
     428: iconst_1
     429: isub
     430: istore        8
     432: iload_2
     433: iconst_1
     434: iadd
     435: istore        9
     437: iload         8
     439: iload         9
     441: if_icmpgt     504
     444: aload_1
     445: new           #84                 // class Point
     448: dup
     449: iload         8
     451: iload         6
     453: invokespecial #87                 // Method Point."<init>":(II)V
     456: invokeinterface #229,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
     461: ifeq          479
     464: bipush        35
     466: istore        10
     468: getstatic     #335                // Field java/lang/System.out:Ljava/io/PrintStream;
     471: iload         10
     473: invokevirtual #340                // Method java/io/PrintStream.print:(C)V
     476: goto          491
     479: bipush        46
     481: istore        10
     483: getstatic     #335                // Field java/lang/System.out:Ljava/io/PrintStream;
     486: iload         10
     488: invokevirtual #340                // Method java/io/PrintStream.print:(C)V
     491: iload         8
     493: iload         9
     495: if_icmpeq     504
     498: iinc          8, 1
     501: goto          444
     504: getstatic     #335                // Field java/lang/System.out:Ljava/io/PrintStream;
     507: invokevirtual #343                // Method java/io/PrintStream.println:()V
     510: iload         6
     512: iload         7
     514: if_icmpeq     523
     517: iinc          6, 1
     520: goto          426
     523: getstatic     #335                // Field java/lang/System.out:Ljava/io/PrintStream;
     526: invokevirtual #343                // Method java/io/PrintStream.println:()V
     529: return

  public final java.lang.String part1(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #35                 // String input
       3: invokestatic  #41                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: invokevirtual #356                // Method parse:(Ljava/util/List;)Ljava/util/Set;
      11: astore_2
      12: aload_0
      13: aload_2
      14: invokevirtual #358                // Method play1:(Ljava/util/Set;)Ljava/util/Set;
      17: astore_3
      18: aload_0
      19: aload_3
      20: invokespecial #362                // Method calc:(Ljava/util/Set;)Ljava/lang/String;
      23: areturn

  private final java.lang.String calc(java.util.Set<Point>);
    Code:
       0: aload_1
       1: checkcast     #43                 // class java/lang/Iterable
       4: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
       9: astore        4
      11: aload         4
      13: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      18: ifne          29
      21: new           #328                // class java/util/NoSuchElementException
      24: dup
      25: invokespecial #329                // Method java/util/NoSuchElementException."<init>":()V
      28: athrow
      29: aload         4
      31: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      36: checkcast     #84                 // class Point
      39: astore        5
      41: iconst_0
      42: istore        6
      44: aload         5
      46: invokevirtual #155                // Method Point.getX:()I
      49: istore        5
      51: aload         4
      53: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      58: ifeq          97
      61: aload         4
      63: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      68: checkcast     #84                 // class Point
      71: astore        6
      73: iconst_0
      74: istore        7
      76: aload         6
      78: invokevirtual #155                // Method Point.getX:()I
      81: istore        6
      83: iload         5
      85: iload         6
      87: if_icmpge     51
      90: iload         6
      92: istore        5
      94: goto          51
      97: iload         5
      99: istore_2
     100: aload_1
     101: checkcast     #43                 // class java/lang/Iterable
     104: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     109: astore        5
     111: aload         5
     113: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     118: ifne          129
     121: new           #328                // class java/util/NoSuchElementException
     124: dup
     125: invokespecial #329                // Method java/util/NoSuchElementException."<init>":()V
     128: athrow
     129: aload         5
     131: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     136: checkcast     #84                 // class Point
     139: astore        6
     141: iconst_0
     142: istore        7
     144: aload         6
     146: invokevirtual #158                // Method Point.getY:()I
     149: istore        6
     151: aload         5
     153: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     158: ifeq          197
     161: aload         5
     163: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     168: checkcast     #84                 // class Point
     171: astore        7
     173: iconst_0
     174: istore        8
     176: aload         7
     178: invokevirtual #158                // Method Point.getY:()I
     181: istore        7
     183: iload         6
     185: iload         7
     187: if_icmpge     151
     190: iload         7
     192: istore        6
     194: goto          151
     197: iload         6
     199: istore_3
     200: aload_1
     201: checkcast     #43                 // class java/lang/Iterable
     204: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     209: astore        6
     211: aload         6
     213: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     218: ifne          229
     221: new           #328                // class java/util/NoSuchElementException
     224: dup
     225: invokespecial #329                // Method java/util/NoSuchElementException."<init>":()V
     228: athrow
     229: aload         6
     231: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     236: checkcast     #84                 // class Point
     239: astore        7
     241: iconst_0
     242: istore        8
     244: aload         7
     246: invokevirtual #155                // Method Point.getX:()I
     249: istore        7
     251: aload         6
     253: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     258: ifeq          297
     261: aload         6
     263: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     268: checkcast     #84                 // class Point
     271: astore        8
     273: iconst_0
     274: istore        9
     276: aload         8
     278: invokevirtual #155                // Method Point.getX:()I
     281: istore        8
     283: iload         7
     285: iload         8
     287: if_icmple     251
     290: iload         8
     292: istore        7
     294: goto          251
     297: iload         7
     299: istore        4
     301: aload_1
     302: checkcast     #43                 // class java/lang/Iterable
     305: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     310: astore        7
     312: aload         7
     314: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     319: ifne          330
     322: new           #328                // class java/util/NoSuchElementException
     325: dup
     326: invokespecial #329                // Method java/util/NoSuchElementException."<init>":()V
     329: athrow
     330: aload         7
     332: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     337: checkcast     #84                 // class Point
     340: astore        8
     342: iconst_0
     343: istore        9
     345: aload         8
     347: invokevirtual #158                // Method Point.getY:()I
     350: istore        8
     352: aload         7
     354: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     359: ifeq          398
     362: aload         7
     364: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     369: checkcast     #84                 // class Point
     372: astore        9
     374: iconst_0
     375: istore        10
     377: aload         9
     379: invokevirtual #158                // Method Point.getY:()I
     382: istore        9
     384: iload         8
     386: iload         9
     388: if_icmple     352
     391: iload         9
     393: istore        8
     395: goto          352
     398: iload         8
     400: istore        5
     402: iload_2
     403: iload         4
     405: isub
     406: iconst_1
     407: iadd
     408: istore        6
     410: iload_3
     411: iload         5
     413: isub
     414: iconst_1
     415: iadd
     416: istore        7
     418: new           #366                // class java/lang/StringBuilder
     421: dup
     422: invokespecial #367                // Method java/lang/StringBuilder."<init>":()V
     425: ldc_w         #369                // String dx
     428: invokevirtual #373                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     431: iload         6
     433: invokevirtual #376                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     436: ldc_w         #378                // String  dy
     439: invokevirtual #373                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     442: iload         7
     444: invokevirtual #376                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     447: ldc_w         #380                // String  size
     450: invokevirtual #373                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     453: aload_1
     454: invokeinterface #381,  1          // InterfaceMethod java/util/Set.size:()I
     459: invokevirtual #376                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     462: invokevirtual #385                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     465: getstatic     #335                // Field java/lang/System.out:Ljava/io/PrintStream;
     468: swap
     469: invokevirtual #388                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     472: iload         6
     474: iload         7
     476: imul
     477: aload_1
     478: invokeinterface #381,  1          // InterfaceMethod java/util/Set.size:()I
     483: isub
     484: istore        8
     486: iload         8
     488: invokestatic  #392                // Method java/lang/String.valueOf:(I)Ljava/lang/String;
     491: areturn

  public final java.lang.String part2(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #35                 // String input
       3: invokestatic  #41                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: invokevirtual #356                // Method parse:(Ljava/util/List;)Ljava/util/Set;
      11: astore_2
      12: aload_0
      13: aload_2
      14: invokevirtual #402                // Method play2:(Ljava/util/Set;)I
      17: istore_3
      18: iload_3
      19: invokestatic  #392                // Method java/lang/String.valueOf:(I)Ljava/lang/String;
      22: areturn
}