fun main() {
    fun part1(input: List<String>): Int {
        val grid = Grid(input.map { it.toCharArray().asList().map(Char::digitToInt) })

        val outside = 2 * grid.width + 2 * (grid.height - 2)
        var otherVisible = 0

        for (x in 1 until grid.width - 1)
            for (y in 1 until grid.height - 1) {
                var visible = false
                val cell = grid.get(x, y)

                dirs@ for (direction in Vector2d.DIRECTIONS) {
                    var neighbour = cell.position + direction

                    while (neighbour in grid) {
                        if (grid[neighbour].value >= cell.value) // not visible - check other directions
                            continue@dirs

                        neighbour += direction

                        if (neighbour !in grid) { // we reached the end - it is visible!
                            visible = true
                            break@dirs
                        }
                    }
                }

                if (visible)
                    otherVisible += 1
            }

        return outside + otherVisible
    }

    fun part2(input: List<String>): Int {
        val grid = Grid(input.map { it.toCharArray().asList().map(Char::digitToInt) })

        var bestScore = 0

        for (x in 1 until grid.width - 1)
            for (y in 1 until grid.height - 1) {
                val cell = grid.get(x, y)

                val score = Vector2d.DIRECTIONS.map { direction ->
                    var dirScore = 0
                    var neighbour = cell.position + direction

                    while (neighbour in grid) {
                        dirScore += 1

                        if (grid[neighbour].value >= cell.value)
                            break

                        neighbour += direction
                    }

                    dirScore
                }.reduce(Int::times)

                if (score > bestScore)
                    bestScore = score
            }

        return bestScore
    }

    test(
        day = 8,
        testTarget1 = 21,
        testTarget2 = 8,
        part1 = ::part1,
        part2 = ::part2,
    )
}

Compiled from "Day08.kt"
final class Day08Kt$main$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<java.util.List<? extends java.lang.String>, java.lang.Integer> {
  public static final Day08Kt$main$1 INSTANCE;

  Day08Kt$main$1();
    Code:
       0: aload_0
       1: iconst_1
       2: ldc           #11                 // class kotlin/jvm/internal/Intrinsics$Kotlin
       4: ldc           #13                 // String part1
       6: ldc           #15                 // String main$part1(Ljava/util/List;)I
       8: iconst_0
       9: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      12: return

  public final java.lang.Integer invoke(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #25                 // String p0
       3: invokestatic  #31                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokestatic  #37                 // Method Day08Kt.access$main$part1:(Ljava/util/List;)I
      10: invokestatic  #43                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      13: areturn

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #47                 // class java/util/List
       5: invokevirtual #49                 // Method invoke:(Ljava/util/List;)Ljava/lang/Integer;
       8: areturn

  static {};
    Code:
       0: new           #2                  // class Day08Kt$main$1
       3: dup
       4: invokespecial #54                 // Method "<init>":()V
       7: putstatic     #57                 // Field INSTANCE:LDay08Kt$main$1;
      10: return
}

Compiled from "Day08.kt"
final class Day08Kt$main$2 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<java.util.List<? extends java.lang.String>, java.lang.Integer> {
  public static final Day08Kt$main$2 INSTANCE;

  Day08Kt$main$2();
    Code:
       0: aload_0
       1: iconst_1
       2: ldc           #11                 // class kotlin/jvm/internal/Intrinsics$Kotlin
       4: ldc           #13                 // String part2
       6: ldc           #15                 // String main$part2(Ljava/util/List;)I
       8: iconst_0
       9: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      12: return

  public final java.lang.Integer invoke(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #25                 // String p0
       3: invokestatic  #31                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokestatic  #37                 // Method Day08Kt.access$main$part2:(Ljava/util/List;)I
      10: invokestatic  #43                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      13: areturn

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #47                 // class java/util/List
       5: invokevirtual #49                 // Method invoke:(Ljava/util/List;)Ljava/lang/Integer;
       8: areturn

  static {};
    Code:
       0: new           #2                  // class Day08Kt$main$2
       3: dup
       4: invokespecial #54                 // Method "<init>":()V
       7: putstatic     #57                 // Field INSTANCE:LDay08Kt$main$2;
      10: return
}

Compiled from "Day08.kt"
public final class Day08Kt {
  public static final void main();
    Code:
       0: bipush        8
       2: bipush        21
       4: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
       7: bipush        8
       9: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      12: getstatic     #18                 // Field Day08Kt$main$1.INSTANCE:LDay08Kt$main$1;
      15: checkcast     #20                 // class kotlin/jvm/functions/Function1
      18: getstatic     #25                 // Field Day08Kt$main$2.INSTANCE:LDay08Kt$main$2;
      21: checkcast     #20                 // class kotlin/jvm/functions/Function1
      24: invokestatic  #31                 // Method UtilsKt.test:(ILjava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
      27: return

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

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: checkcast     #41                 // class java/lang/Iterable
       4: astore_2
       5: iconst_0
       6: istore_3
       7: aload_2
       8: astore        4
      10: new           #43                 // class java/util/ArrayList
      13: dup
      14: aload_2
      15: bipush        10
      17: invokestatic  #49                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      20: invokespecial #53                 // Method java/util/ArrayList."<init>":(I)V
      23: checkcast     #55                 // class java/util/Collection
      26: astore        5
      28: iconst_0
      29: istore        6
      31: aload         4
      33: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      38: astore        7
      40: aload         7
      42: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      47: ifeq          205
      50: aload         7
      52: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: astore        8
      59: aload         5
      61: aload         8
      63: checkcast     #71                 // class java/lang/String
      66: astore        9
      68: astore        21
      70: iconst_0
      71: istore        10
      73: aload         9
      75: invokevirtual #75                 // Method java/lang/String.toCharArray:()[C
      78: dup
      79: ldc           #77                 // String toCharArray(...)
      81: invokestatic  #83                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      84: invokestatic  #89                 // Method kotlin/collections/ArraysKt.asList:([C)Ljava/util/List;
      87: checkcast     #41                 // class java/lang/Iterable
      90: astore        11
      92: iconst_0
      93: istore        12
      95: aload         11
      97: astore        13
      99: new           #43                 // class java/util/ArrayList
     102: dup
     103: aload         11
     105: bipush        10
     107: invokestatic  #49                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     110: invokespecial #53                 // Method java/util/ArrayList."<init>":(I)V
     113: checkcast     #55                 // class java/util/Collection
     116: astore        14
     118: iconst_0
     119: istore        15
     121: aload         13
     123: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     128: astore        16
     130: aload         16
     132: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     137: ifeq          186
     140: aload         16
     142: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     147: astore        17
     149: aload         14
     151: aload         17
     153: checkcast     #91                 // class java/lang/Character
     156: invokevirtual #95                 // Method java/lang/Character.charValue:()C
     159: istore        18
     161: astore        19
     163: iconst_0
     164: istore        20
     166: iload         18
     168: invokestatic  #101                // Method kotlin/text/CharsKt.digitToInt:(C)I
     171: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     174: aload         19
     176: swap
     177: invokeinterface #105,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     182: pop
     183: goto          130
     186: aload         14
     188: checkcast     #107                // class java/util/List
     191: nop
     192: nop
     193: aload         21
     195: swap
     196: invokeinterface #105,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     201: pop
     202: goto          40
     205: aload         5
     207: checkcast     #107                // class java/util/List
     210: nop
     211: astore        22
     213: new           #109                // class Grid
     216: dup
     217: aload         22
     219: invokespecial #112                // Method Grid."<init>":(Ljava/util/List;)V
     222: astore_1
     223: iconst_2
     224: aload_1
     225: invokevirtual #116                // Method Grid.getWidth:()I
     228: imul
     229: iconst_2
     230: aload_1
     231: invokevirtual #119                // Method Grid.getHeight:()I
     234: iconst_2
     235: isub
     236: imul
     237: iadd
     238: istore_2
     239: iconst_0
     240: istore_3
     241: iconst_1
     242: istore        4
     244: aload_1
     245: invokevirtual #116                // Method Grid.getWidth:()I
     248: iconst_1
     249: isub
     250: istore        5
     252: iload         4
     254: iload         5
     256: if_icmpge     423
     259: iconst_1
     260: istore        6
     262: aload_1
     263: invokevirtual #119                // Method Grid.getHeight:()I
     266: iconst_1
     267: isub
     268: istore        7
     270: iload         6
     272: iload         7
     274: if_icmpge     417
     277: iconst_0
     278: istore        8
     280: aload_1
     281: iload         4
     283: iload         6
     285: invokevirtual #123                // Method Grid.get:(II)LGridCell;
     288: astore        9
     290: getstatic     #129                // Field Vector2d.Companion:LVector2d$Companion;
     293: invokevirtual #135                // Method Vector2d$Companion.getDIRECTIONS:()[LVector2d;
     296: astore        10
     298: iconst_0
     299: istore        11
     301: aload         10
     303: arraylength
     304: istore        12
     306: iload         11
     308: iload         12
     310: if_icmpge     403
     313: aload         10
     315: iload         11
     317: aaload
     318: astore        13
     320: aload         9
     322: invokevirtual #141                // Method GridCell.getPosition:()LVector2d;
     325: aload         13
     327: invokevirtual #145                // Method Vector2d.plus:(LVector2d;)LVector2d;
     330: astore        14
     332: aload_1
     333: aload         14
     335: invokevirtual #149                // Method Grid.contains:(LVector2d;)Z
     338: ifeq          397
     341: aload_1
     342: aload         14
     344: invokevirtual #152                // Method Grid.get:(LVector2d;)LGridCell;
     347: invokevirtual #155                // Method GridCell.getValue:()Ljava/lang/Object;
     350: checkcast     #157                // class java/lang/Number
     353: invokevirtual #160                // Method java/lang/Number.intValue:()I
     356: aload         9
     358: invokevirtual #155                // Method GridCell.getValue:()Ljava/lang/Object;
     361: checkcast     #157                // class java/lang/Number
     364: invokevirtual #160                // Method java/lang/Number.intValue:()I
     367: if_icmplt     373
     370: goto          397
     373: aload         14
     375: aload         13
     377: invokevirtual #145                // Method Vector2d.plus:(LVector2d;)LVector2d;
     380: astore        14
     382: aload_1
     383: aload         14
     385: invokevirtual #149                // Method Grid.contains:(LVector2d;)Z
     388: ifne          332
     391: iconst_1
     392: istore        8
     394: goto          403
     397: iinc          11, 1
     400: goto          306
     403: iload         8
     405: ifeq          411
     408: iinc          3, 1
     411: iinc          6, 1
     414: goto          270
     417: iinc          4, 1
     420: goto          252
     423: iload_2
     424: iload_3
     425: iadd
     426: ireturn

  private static final int main$part2(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: checkcast     #41                 // class java/lang/Iterable
       4: astore_2
       5: iconst_0
       6: istore_3
       7: aload_2
       8: astore        4
      10: new           #43                 // class java/util/ArrayList
      13: dup
      14: aload_2
      15: bipush        10
      17: invokestatic  #49                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      20: invokespecial #53                 // Method java/util/ArrayList."<init>":(I)V
      23: checkcast     #55                 // class java/util/Collection
      26: astore        5
      28: iconst_0
      29: istore        6
      31: aload         4
      33: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      38: astore        7
      40: aload         7
      42: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      47: ifeq          205
      50: aload         7
      52: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: astore        8
      59: aload         5
      61: aload         8
      63: checkcast     #71                 // class java/lang/String
      66: astore        9
      68: astore        22
      70: iconst_0
      71: istore        10
      73: aload         9
      75: invokevirtual #75                 // Method java/lang/String.toCharArray:()[C
      78: dup
      79: ldc           #77                 // String toCharArray(...)
      81: invokestatic  #83                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      84: invokestatic  #89                 // Method kotlin/collections/ArraysKt.asList:([C)Ljava/util/List;
      87: checkcast     #41                 // class java/lang/Iterable
      90: astore        11
      92: iconst_0
      93: istore        12
      95: aload         11
      97: astore        13
      99: new           #43                 // class java/util/ArrayList
     102: dup
     103: aload         11
     105: bipush        10
     107: invokestatic  #49                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     110: invokespecial #53                 // Method java/util/ArrayList."<init>":(I)V
     113: checkcast     #55                 // class java/util/Collection
     116: astore        14
     118: iconst_0
     119: istore        15
     121: aload         13
     123: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     128: astore        16
     130: aload         16
     132: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     137: ifeq          186
     140: aload         16
     142: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     147: astore        17
     149: aload         14
     151: aload         17
     153: checkcast     #91                 // class java/lang/Character
     156: invokevirtual #95                 // Method java/lang/Character.charValue:()C
     159: istore        18
     161: astore        19
     163: iconst_0
     164: istore        20
     166: iload         18
     168: invokestatic  #101                // Method kotlin/text/CharsKt.digitToInt:(C)I
     171: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     174: aload         19
     176: swap
     177: invokeinterface #105,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     182: pop
     183: goto          130
     186: aload         14
     188: checkcast     #107                // class java/util/List
     191: nop
     192: nop
     193: aload         22
     195: swap
     196: invokeinterface #105,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     201: pop
     202: goto          40
     205: aload         5
     207: checkcast     #107                // class java/util/List
     210: nop
     211: astore        23
     213: new           #109                // class Grid
     216: dup
     217: aload         23
     219: invokespecial #112                // Method Grid."<init>":(Ljava/util/List;)V
     222: astore_1
     223: iconst_0
     224: istore_2
     225: iconst_1
     226: istore_3
     227: aload_1
     228: invokevirtual #116                // Method Grid.getWidth:()I
     231: iconst_1
     232: isub
     233: istore        4
     235: iload_3
     236: iload         4
     238: if_icmpge     560
     241: iconst_1
     242: istore        5
     244: aload_1
     245: invokevirtual #119                // Method Grid.getHeight:()I
     248: iconst_1
     249: isub
     250: istore        6
     252: iload         5
     254: iload         6
     256: if_icmpge     554
     259: aload_1
     260: iload_3
     261: iload         5
     263: invokevirtual #123                // Method Grid.get:(II)LGridCell;
     266: astore        7
     268: getstatic     #129                // Field Vector2d.Companion:LVector2d$Companion;
     271: invokevirtual #135                // Method Vector2d$Companion.getDIRECTIONS:()[LVector2d;
     274: astore        9
     276: iconst_0
     277: istore        10
     279: aload         9
     281: astore        11
     283: new           #43                 // class java/util/ArrayList
     286: dup
     287: aload         9
     289: arraylength
     290: invokespecial #53                 // Method java/util/ArrayList."<init>":(I)V
     293: checkcast     #55                 // class java/util/Collection
     296: astore        12
     298: iconst_0
     299: istore        13
     301: iconst_0
     302: istore        14
     304: aload         11
     306: arraylength
     307: istore        15
     309: iload         14
     311: iload         15
     313: if_icmpge     425
     316: aload         11
     318: iload         14
     320: aaload
     321: astore        16
     323: aload         12
     325: aload         16
     327: astore        17
     329: astore        21
     331: iconst_0
     332: istore        18
     334: iconst_0
     335: istore        19
     337: aload         7
     339: invokevirtual #141                // Method GridCell.getPosition:()LVector2d;
     342: aload         17
     344: invokevirtual #145                // Method Vector2d.plus:(LVector2d;)LVector2d;
     347: astore        20
     349: aload_1
     350: aload         20
     352: invokevirtual #149                // Method Grid.contains:(LVector2d;)Z
     355: ifeq          405
     358: iinc          19, 1
     361: aload_1
     362: aload         20
     364: invokevirtual #152                // Method Grid.get:(LVector2d;)LGridCell;
     367: invokevirtual #155                // Method GridCell.getValue:()Ljava/lang/Object;
     370: checkcast     #157                // class java/lang/Number
     373: invokevirtual #160                // Method java/lang/Number.intValue:()I
     376: aload         7
     378: invokevirtual #155                // Method GridCell.getValue:()Ljava/lang/Object;
     381: checkcast     #157                // class java/lang/Number
     384: invokevirtual #160                // Method java/lang/Number.intValue:()I
     387: if_icmplt     393
     390: goto          405
     393: aload         20
     395: aload         17
     397: invokevirtual #145                // Method Vector2d.plus:(LVector2d;)LVector2d;
     400: astore        20
     402: goto          349
     405: iload         19
     407: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     410: aload         21
     412: swap
     413: invokeinterface #105,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     418: pop
     419: iinc          14, 1
     422: goto          309
     425: aload         12
     427: checkcast     #107                // class java/util/List
     430: nop
     431: checkcast     #41                 // class java/lang/Iterable
     434: astore        9
     436: nop
     437: iconst_0
     438: istore        10
     440: aload         9
     442: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     447: astore        11
     449: aload         11
     451: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     456: ifne          469
     459: new           #196                // class java/lang/UnsupportedOperationException
     462: dup
     463: ldc           #198                // String Empty collection can\'t be reduced.
     465: invokespecial #201                // Method java/lang/UnsupportedOperationException."<init>":(Ljava/lang/String;)V
     468: athrow
     469: aload         11
     471: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     476: astore        12
     478: aload         11
     480: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     485: ifeq          529
     488: aload         12
     490: aload         11
     492: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     497: checkcast     #157                // class java/lang/Number
     500: invokevirtual #160                // Method java/lang/Number.intValue:()I
     503: istore        13
     505: checkcast     #157                // class java/lang/Number
     508: invokevirtual #160                // Method java/lang/Number.intValue:()I
     511: istore        14
     513: iconst_0
     514: istore        15
     516: iload         14
     518: iload         13
     520: imul
     521: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     524: astore        12
     526: goto          478
     529: aload         12
     531: checkcast     #157                // class java/lang/Number
     534: invokevirtual #160                // Method java/lang/Number.intValue:()I
     537: istore        8
     539: iload         8
     541: iload_2
     542: if_icmple     548
     545: iload         8
     547: istore_2
     548: iinc          5, 1
     551: goto          252
     554: iinc          3, 1
     557: goto          235
     560: iload_2
     561: ireturn

  public static final int access$main$part1(java.util.List);
    Code:
       0: aload_0
       1: invokestatic  #218                // Method main$part1:(Ljava/util/List;)I
       4: ireturn

  public static final int access$main$part2(java.util.List);
    Code:
       0: aload_0
       1: invokestatic  #221                // Method main$part2:(Ljava/util/List;)I
       4: ireturn
}


fun main() {
    fun ropeTailTravel(input: List<String>, ropeLength: Int): Int {
        val knots = Array(ropeLength) { Vector2d(0, 0) }
        val visited = mutableSetOf(knots.last())

        for (command in input) {
            val (direction, steps) = command.split(" ")

            repeat(steps.toInt()) {
                knots[0] += when (direction) {
                    "U" -> Vector2d.UP
                    "D" -> Vector2d.DOWN
                    "L" -> Vector2d.LEFT
                    "R" -> Vector2d.RIGHT
                    else -> throw Exception("Unknown command $direction")
                }

                for (n in 1 until knots.size) {
                    val diff = knots[n - 1] - knots[n]

                    if (diff.length() > 1) // we need to move
                        knots[n] += diff.normalized()
                }

                visited.add(knots.last())
            }
        }

        return visited.size
    }

    fun part1(input: List<String>) = ropeTailTravel(input, 2)

    fun part2(input: List<String>) = ropeTailTravel(input, 10)

    test(
        day = 9,
        testTarget1 = 13,
        testTarget2 = 1,
        part1 = ::part1,
        part2 = ::part2,
    )
}

Compiled from "Day09.kt"
final class Day09Kt$main$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<java.util.List<? extends java.lang.String>, java.lang.Integer> {
  public static final Day09Kt$main$1 INSTANCE;

  Day09Kt$main$1();
    Code:
       0: aload_0
       1: iconst_1
       2: ldc           #11                 // class kotlin/jvm/internal/Intrinsics$Kotlin
       4: ldc           #13                 // String part1
       6: ldc           #15                 // String main$part1(Ljava/util/List;)I
       8: iconst_0
       9: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      12: return

  public final java.lang.Integer invoke(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #25                 // String p0
       3: invokestatic  #31                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokestatic  #37                 // Method Day09Kt.access$main$part1:(Ljava/util/List;)I
      10: invokestatic  #43                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      13: areturn

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #47                 // class java/util/List
       5: invokevirtual #49                 // Method invoke:(Ljava/util/List;)Ljava/lang/Integer;
       8: areturn

  static {};
    Code:
       0: new           #2                  // class Day09Kt$main$1
       3: dup
       4: invokespecial #54                 // Method "<init>":()V
       7: putstatic     #57                 // Field INSTANCE:LDay09Kt$main$1;
      10: return
}

Compiled from "Day09.kt"
public final class Day09Kt {
  public static final void main();
    Code:
       0: bipush        9
       2: bipush        13
       4: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
       7: iconst_1
       8: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      11: getstatic     #18                 // Field Day09Kt$main$1.INSTANCE:LDay09Kt$main$1;
      14: checkcast     #20                 // class kotlin/jvm/functions/Function1
      17: getstatic     #25                 // Field Day09Kt$main$2.INSTANCE:LDay09Kt$main$2;
      20: checkcast     #20                 // class kotlin/jvm/functions/Function1
      23: invokestatic  #31                 // Method UtilsKt.test:(ILjava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
      26: return

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

  private static final int main$ropeTailTravel(java.util.List<java.lang.String>, int);
    Code:
       0: iconst_0
       1: istore_3
       2: iload_1
       3: anewarray     #41                 // class Vector2d
       6: astore        4
       8: iload_3
       9: iload_1
      10: if_icmpge     36
      13: iload_3
      14: istore        5
      16: aload         4
      18: iload         5
      20: new           #41                 // class Vector2d
      23: dup
      24: iconst_0
      25: iconst_0
      26: invokespecial #45                 // Method Vector2d."<init>":(II)V
      29: aastore
      30: iinc          3, 1
      33: goto          8
      36: aload         4
      38: astore_2
      39: iconst_1
      40: anewarray     #41                 // class Vector2d
      43: astore        4
      45: aload         4
      47: iconst_0
      48: aload_2
      49: invokestatic  #51                 // Method kotlin/collections/ArraysKt.last:([Ljava/lang/Object;)Ljava/lang/Object;
      52: aastore
      53: aload         4
      55: invokestatic  #57                 // Method kotlin/collections/SetsKt.mutableSetOf:([Ljava/lang/Object;)Ljava/util/Set;
      58: astore_3
      59: aload_0
      60: invokeinterface #63,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      65: astore        4
      67: aload         4
      69: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      74: ifeq          426
      77: aload         4
      79: invokeinterface #73,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      84: checkcast     #75                 // class java/lang/String
      87: astore        5
      89: aload         5
      91: checkcast     #77                 // class java/lang/CharSequence
      94: iconst_1
      95: anewarray     #75                 // class java/lang/String
      98: astore        7
     100: aload         7
     102: iconst_0
     103: ldc           #79                 // String
     105: aastore
     106: aload         7
     108: iconst_0
     109: iconst_0
     110: bipush        6
     112: aconst_null
     113: invokestatic  #85                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     116: astore        6
     118: aload         6
     120: iconst_0
     121: invokeinterface #89,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     126: checkcast     #75                 // class java/lang/String
     129: astore        7
     131: aload         6
     133: iconst_1
     134: invokeinterface #89,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     139: checkcast     #75                 // class java/lang/String
     142: astore        8
     144: aload         8
     146: invokestatic  #93                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     149: istore        9
     151: iconst_0
     152: istore        10
     154: iload         10
     156: iload         9
     158: if_icmpge     67
     161: iload         10
     163: istore        11
     165: iconst_0
     166: istore        12
     168: aload_2
     169: iconst_0
     170: aload_2
     171: iconst_0
     172: aaload
     173: aload         7
     175: astore        13
     177: aload         13
     179: invokevirtual #97                 // Method java/lang/String.hashCode:()I
     182: lookupswitch  { // 4
                    68: 237
                    76: 263
                    82: 224
                    85: 250
               default: 312
          }
     224: aload         13
     226: ldc           #99                 // String R
     228: invokevirtual #103                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     231: ifne          303
     234: goto          312
     237: aload         13
     239: ldc           #105                // String D
     241: invokevirtual #103                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     244: ifne          285
     247: goto          312
     250: aload         13
     252: ldc           #107                // String U
     254: invokevirtual #103                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     257: ifne          276
     260: goto          312
     263: aload         13
     265: ldc           #109                // String L
     267: invokevirtual #103                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     270: ifne          294
     273: goto          312
     276: getstatic     #113                // Field Vector2d.Companion:LVector2d$Companion;
     279: invokevirtual #119                // Method Vector2d$Companion.getUP:()LVector2d;
     282: goto          340
     285: getstatic     #113                // Field Vector2d.Companion:LVector2d$Companion;
     288: invokevirtual #122                // Method Vector2d$Companion.getDOWN:()LVector2d;
     291: goto          340
     294: getstatic     #113                // Field Vector2d.Companion:LVector2d$Companion;
     297: invokevirtual #125                // Method Vector2d$Companion.getLEFT:()LVector2d;
     300: goto          340
     303: getstatic     #113                // Field Vector2d.Companion:LVector2d$Companion;
     306: invokevirtual #128                // Method Vector2d$Companion.getRIGHT:()LVector2d;
     309: goto          340
     312: new           #130                // class java/lang/Exception
     315: dup
     316: new           #132                // class java/lang/StringBuilder
     319: dup
     320: invokespecial #134                // Method java/lang/StringBuilder."<init>":()V
     323: ldc           #136                // String Unknown command
     325: invokevirtual #140                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     328: aload         7
     330: invokevirtual #140                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     333: invokevirtual #144                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     336: invokespecial #147                // Method java/lang/Exception."<init>":(Ljava/lang/String;)V
     339: athrow
     340: invokevirtual #151                // Method Vector2d.plus:(LVector2d;)LVector2d;
     343: aastore
     344: iconst_1
     345: istore        13
     347: aload_2
     348: arraylength
     349: istore        14
     351: iload         13
     353: iload         14
     355: if_icmpge     408
     358: aload_2
     359: iload         13
     361: iconst_1
     362: isub
     363: aaload
     364: aload_2
     365: iload         13
     367: aaload
     368: invokevirtual #154                // Method Vector2d.minus:(LVector2d;)LVector2d;
     371: astore        15
     373: aload         15
     375: invokevirtual #157                // Method Vector2d.length:()I
     378: iconst_1
     379: if_icmple     402
     382: iload         13
     384: istore        16
     386: aload_2
     387: iload         16
     389: aload_2
     390: iload         16
     392: aaload
     393: aload         15
     395: invokevirtual #160                // Method Vector2d.normalized:()LVector2d;
     398: invokevirtual #151                // Method Vector2d.plus:(LVector2d;)LVector2d;
     401: aastore
     402: iinc          13, 1
     405: goto          351
     408: aload_3
     409: aload_2
     410: invokestatic  #51                 // Method kotlin/collections/ArraysKt.last:([Ljava/lang/Object;)Ljava/lang/Object;
     413: invokeinterface #165,  2          // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
     418: pop
     419: nop
     420: iinc          10, 1
     423: goto          154
     426: aload_3
     427: invokeinterface #168,  1          // InterfaceMethod java/util/Set.size:()I
     432: ireturn

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: iconst_2
       2: invokestatic  #191                // Method main$ropeTailTravel:(Ljava/util/List;I)I
       5: ireturn

  private static final int main$part2(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: bipush        10
       3: invokestatic  #191                // Method main$ropeTailTravel:(Ljava/util/List;I)I
       6: ireturn

  public static final int access$main$part1(java.util.List);
    Code:
       0: aload_0
       1: invokestatic  #195                // Method main$part1:(Ljava/util/List;)I
       4: ireturn

  public static final int access$main$part2(java.util.List);
    Code:
       0: aload_0
       1: invokestatic  #198                // Method main$part2:(Ljava/util/List;)I
       4: ireturn
}

Compiled from "Day09.kt"
final class Day09Kt$main$2 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<java.util.List<? extends java.lang.String>, java.lang.Integer> {
  public static final Day09Kt$main$2 INSTANCE;

  Day09Kt$main$2();
    Code:
       0: aload_0
       1: iconst_1
       2: ldc           #11                 // class kotlin/jvm/internal/Intrinsics$Kotlin
       4: ldc           #13                 // String part2
       6: ldc           #15                 // String main$part2(Ljava/util/List;)I
       8: iconst_0
       9: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      12: return

  public final java.lang.Integer invoke(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #25                 // String p0
       3: invokestatic  #31                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokestatic  #37                 // Method Day09Kt.access$main$part2:(Ljava/util/List;)I
      10: invokestatic  #43                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      13: areturn

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #47                 // class java/util/List
       5: invokevirtual #49                 // Method invoke:(Ljava/util/List;)Ljava/lang/Integer;
       8: areturn

  static {};
    Code:
       0: new           #2                  // class Day09Kt$main$2
       3: dup
       4: invokespecial #54                 // Method "<init>":()V
       7: putstatic     #57                 // Field INSTANCE:LDay09Kt$main$2;
      10: return
}


fun main() {
    fun part1(input: List<String>): Int {
        val occupied = input.map { it.ints() }.map { (x, y, z) -> Vector3d(x, y, z) }.toSet()

        return occupied.sumOf { cube -> 6 - Vector3d.DIRECTIONS.count { dir -> cube + dir in occupied } }
    }

    fun part2(input: List<String>): Int {
        val occupied = input.map { it.ints() }.map { (x, y, z) -> Vector3d(x, y, z) }.toMutableSet()

        val minX = occupied.minOf { it.x } - 1
        val minY = occupied.minOf { it.y } - 1
        val minZ = occupied.minOf { it.z } - 1
        val maxX = occupied.maxOf { it.x } + 1
        val maxY = occupied.maxOf { it.y } + 1
        val maxZ = occupied.maxOf { it.z } + 1

        val xRange = minX..maxX
        val yRange = minY..maxY
        val zRange = minZ..maxZ

        val all = xRange.map { x -> yRange.map { y -> zRange.map { z -> Vector3d(x, y, z) } } }.flatten().flatten().toSet()
        val airOutside = mutableSetOf<Vector3d>()
        val visitQueue = mutableListOf(Vector3d(minX, minY, minZ))

        while (visitQueue.isNotEmpty()) { // fill the outside with air!
            val candidate = visitQueue.removeLast()

            airOutside += candidate

            for (direction in Vector3d.DIRECTIONS) {
                val next = candidate + direction

                if (next in airOutside || next in occupied || next.x !in xRange || next.y !in yRange || next.z !in zRange)
                    continue

                visitQueue += next
            }
        }

        val airPockets = all - airOutside - occupied

        occupied += airPockets

        return occupied.sumOf { cube -> 6 - Vector3d.DIRECTIONS.count { dir -> cube + dir in occupied } }
    }

    test(
        day = 18,
        testTarget1 = 64,
        testTarget2 = 58,
        part1 = ::part1,
        part2 = ::part2,
    )
}

Compiled from "Day18.kt"
final class Day18Kt$main$2 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<java.util.List<? extends java.lang.String>, java.lang.Integer> {
  public static final Day18Kt$main$2 INSTANCE;

  Day18Kt$main$2();
    Code:
       0: aload_0
       1: iconst_1
       2: ldc           #11                 // class kotlin/jvm/internal/Intrinsics$Kotlin
       4: ldc           #13                 // String part2
       6: ldc           #15                 // String main$part2(Ljava/util/List;)I
       8: iconst_0
       9: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      12: return

  public final java.lang.Integer invoke(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #25                 // String p0
       3: invokestatic  #31                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokestatic  #37                 // Method Day18Kt.access$main$part2:(Ljava/util/List;)I
      10: invokestatic  #43                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      13: areturn

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #47                 // class java/util/List
       5: invokevirtual #49                 // Method invoke:(Ljava/util/List;)Ljava/lang/Integer;
       8: areturn

  static {};
    Code:
       0: new           #2                  // class Day18Kt$main$2
       3: dup
       4: invokespecial #54                 // Method "<init>":()V
       7: putstatic     #57                 // Field INSTANCE:LDay18Kt$main$2;
      10: return
}

Compiled from "Day18.kt"
public final class Day18Kt {
  public static final void main();
    Code:
       0: bipush        18
       2: bipush        64
       4: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
       7: bipush        58
       9: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      12: getstatic     #18                 // Field Day18Kt$main$1.INSTANCE:LDay18Kt$main$1;
      15: checkcast     #20                 // class kotlin/jvm/functions/Function1
      18: getstatic     #25                 // Field Day18Kt$main$2.INSTANCE:LDay18Kt$main$2;
      21: checkcast     #20                 // class kotlin/jvm/functions/Function1
      24: invokestatic  #31                 // Method UtilsKt.test:(ILjava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
      27: return

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

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: checkcast     #41                 // class java/lang/Iterable
       4: astore_2
       5: iconst_0
       6: istore_3
       7: aload_2
       8: astore        4
      10: new           #43                 // class java/util/ArrayList
      13: dup
      14: aload_2
      15: bipush        10
      17: invokestatic  #49                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      20: invokespecial #53                 // Method java/util/ArrayList."<init>":(I)V
      23: checkcast     #55                 // class java/util/Collection
      26: astore        5
      28: iconst_0
      29: istore        6
      31: aload         4
      33: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      38: astore        7
      40: aload         7
      42: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      47: ifeq          90
      50: aload         7
      52: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: astore        8
      59: aload         5
      61: aload         8
      63: checkcast     #71                 // class java/lang/String
      66: astore        9
      68: astore        18
      70: iconst_0
      71: istore        10
      73: aload         9
      75: invokestatic  #75                 // Method UtilsKt.ints:(Ljava/lang/String;)Ljava/util/List;
      78: aload         18
      80: swap
      81: invokeinterface #79,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      86: pop
      87: goto          40
      90: aload         5
      92: checkcast     #81                 // class java/util/List
      95: nop
      96: checkcast     #41                 // class java/lang/Iterable
      99: astore_2
     100: nop
     101: iconst_0
     102: istore_3
     103: aload_2
     104: astore        4
     106: new           #43                 // class java/util/ArrayList
     109: dup
     110: aload_2
     111: bipush        10
     113: invokestatic  #49                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     116: invokespecial #53                 // Method java/util/ArrayList."<init>":(I)V
     119: checkcast     #55                 // class java/util/Collection
     122: astore        5
     124: iconst_0
     125: istore        6
     127: aload         4
     129: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     134: astore        7
     136: aload         7
     138: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     143: ifeq          242
     146: aload         7
     148: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     153: astore        8
     155: aload         5
     157: aload         8
     159: checkcast     #81                 // class java/util/List
     162: astore        9
     164: astore        18
     166: iconst_0
     167: istore        10
     169: aload         9
     171: iconst_0
     172: invokeinterface #85,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     177: checkcast     #87                 // class java/lang/Number
     180: invokevirtual #91                 // Method java/lang/Number.intValue:()I
     183: istore        11
     185: aload         9
     187: iconst_1
     188: invokeinterface #85,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     193: checkcast     #87                 // class java/lang/Number
     196: invokevirtual #91                 // Method java/lang/Number.intValue:()I
     199: istore        12
     201: aload         9
     203: iconst_2
     204: invokeinterface #85,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     209: checkcast     #87                 // class java/lang/Number
     212: invokevirtual #91                 // Method java/lang/Number.intValue:()I
     215: istore        13
     217: new           #93                 // class Vector3d
     220: dup
     221: iload         11
     223: iload         12
     225: iload         13
     227: invokespecial #96                 // Method Vector3d."<init>":(III)V
     230: aload         18
     232: swap
     233: invokeinterface #79,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     238: pop
     239: goto          136
     242: aload         5
     244: checkcast     #81                 // class java/util/List
     247: nop
     248: checkcast     #41                 // class java/lang/Iterable
     251: invokestatic  #100                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
     254: astore_1
     255: aload_1
     256: checkcast     #41                 // class java/lang/Iterable
     259: astore_2
     260: iconst_0
     261: istore_3
     262: aload_2
     263: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     268: astore        4
     270: aload         4
     272: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     277: ifeq          394
     280: aload         4
     282: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     287: astore        5
     289: iload_3
     290: aload         5
     292: checkcast     #93                 // class Vector3d
     295: astore        6
     297: istore        18
     299: iconst_0
     300: istore        7
     302: bipush        6
     304: getstatic     #104                // Field Vector3d.Companion:LVector3d$Companion;
     307: invokevirtual #110                // Method Vector3d$Companion.getDIRECTIONS:()[LVector3d;
     310: astore        8
     312: istore        9
     314: iconst_0
     315: istore        10
     317: iconst_0
     318: istore        11
     320: iconst_0
     321: istore        12
     323: aload         8
     325: arraylength
     326: istore        13
     328: iload         12
     330: iload         13
     332: if_icmpge     374
     335: aload         8
     337: iload         12
     339: aaload
     340: astore        14
     342: aload         14
     344: astore        15
     346: iconst_0
     347: istore        16
     349: aload_1
     350: aload         6
     352: aload         15
     354: invokevirtual #114                // Method Vector3d.plus:(LVector3d;)LVector3d;
     357: invokeinterface #119,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
     362: ifeq          368
     365: iinc          11, 1
     368: iinc          12, 1
     371: goto          328
     374: iload         11
     376: istore        17
     378: iload         9
     380: iload         17
     382: isub
     383: istore        19
     385: iload         18
     387: iload         19
     389: iadd
     390: istore_3
     391: goto          270
     394: iload_3
     395: ireturn

  private static final int main$part2(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: checkcast     #41                 // class java/lang/Iterable
       4: astore_2
       5: iconst_0
       6: istore_3
       7: aload_2
       8: astore        4
      10: new           #43                 // class java/util/ArrayList
      13: dup
      14: aload_2
      15: bipush        10
      17: invokestatic  #49                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      20: invokespecial #53                 // Method java/util/ArrayList."<init>":(I)V
      23: checkcast     #55                 // class java/util/Collection
      26: astore        5
      28: iconst_0
      29: istore        6
      31: aload         4
      33: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      38: astore        7
      40: aload         7
      42: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      47: ifeq          90
      50: aload         7
      52: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: astore        8
      59: aload         5
      61: aload         8
      63: checkcast     #71                 // class java/lang/String
      66: astore        9
      68: astore        41
      70: iconst_0
      71: istore        10
      73: aload         9
      75: invokestatic  #75                 // Method UtilsKt.ints:(Ljava/lang/String;)Ljava/util/List;
      78: aload         41
      80: swap
      81: invokeinterface #79,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      86: pop
      87: goto          40
      90: aload         5
      92: checkcast     #81                 // class java/util/List
      95: nop
      96: checkcast     #41                 // class java/lang/Iterable
      99: astore_2
     100: nop
     101: iconst_0
     102: istore_3
     103: aload_2
     104: astore        4
     106: new           #43                 // class java/util/ArrayList
     109: dup
     110: aload_2
     111: bipush        10
     113: invokestatic  #49                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     116: invokespecial #53                 // Method java/util/ArrayList."<init>":(I)V
     119: checkcast     #55                 // class java/util/Collection
     122: astore        5
     124: iconst_0
     125: istore        6
     127: aload         4
     129: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     134: astore        7
     136: aload         7
     138: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     143: ifeq          242
     146: aload         7
     148: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     153: astore        8
     155: aload         5
     157: aload         8
     159: checkcast     #81                 // class java/util/List
     162: astore        9
     164: astore        41
     166: iconst_0
     167: istore        10
     169: aload         9
     171: iconst_0
     172: invokeinterface #85,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     177: checkcast     #87                 // class java/lang/Number
     180: invokevirtual #91                 // Method java/lang/Number.intValue:()I
     183: istore        11
     185: aload         9
     187: iconst_1
     188: invokeinterface #85,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     193: checkcast     #87                 // class java/lang/Number
     196: invokevirtual #91                 // Method java/lang/Number.intValue:()I
     199: istore        12
     201: aload         9
     203: iconst_2
     204: invokeinterface #85,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     209: checkcast     #87                 // class java/lang/Number
     212: invokevirtual #91                 // Method java/lang/Number.intValue:()I
     215: istore        13
     217: new           #93                 // class Vector3d
     220: dup
     221: iload         11
     223: iload         12
     225: iload         13
     227: invokespecial #96                 // Method Vector3d."<init>":(III)V
     230: aload         41
     232: swap
     233: invokeinterface #79,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     238: pop
     239: goto          136
     242: aload         5
     244: checkcast     #81                 // class java/util/List
     247: nop
     248: checkcast     #41                 // class java/lang/Iterable
     251: invokestatic  #156                // Method kotlin/collections/CollectionsKt.toMutableSet:(Ljava/lang/Iterable;)Ljava/util/Set;
     254: astore_1
     255: aload_1
     256: checkcast     #41                 // class java/lang/Iterable
     259: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     264: astore        4
     266: aload         4
     268: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     273: ifne          284
     276: new           #158                // class java/util/NoSuchElementException
     279: dup
     280: invokespecial #160                // Method java/util/NoSuchElementException."<init>":()V
     283: athrow
     284: aload         4
     286: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     291: checkcast     #93                 // class Vector3d
     294: astore        5
     296: iconst_0
     297: istore        6
     299: aload         5
     301: invokevirtual #163                // Method Vector3d.getX:()I
     304: istore        5
     306: aload         4
     308: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     313: ifeq          352
     316: aload         4
     318: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     323: checkcast     #93                 // class Vector3d
     326: astore        6
     328: iconst_0
     329: istore        7
     331: aload         6
     333: invokevirtual #163                // Method Vector3d.getX:()I
     336: istore        6
     338: iload         5
     340: iload         6
     342: if_icmple     306
     345: iload         6
     347: istore        5
     349: goto          306
     352: iload         5
     354: iconst_1
     355: isub
     356: istore_2
     357: aload_1
     358: checkcast     #41                 // class java/lang/Iterable
     361: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     366: astore        5
     368: aload         5
     370: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     375: ifne          386
     378: new           #158                // class java/util/NoSuchElementException
     381: dup
     382: invokespecial #160                // Method java/util/NoSuchElementException."<init>":()V
     385: athrow
     386: aload         5
     388: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     393: checkcast     #93                 // class Vector3d
     396: astore        6
     398: iconst_0
     399: istore        7
     401: aload         6
     403: invokevirtual #166                // Method Vector3d.getY:()I
     406: istore        6
     408: aload         5
     410: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     415: ifeq          454
     418: aload         5
     420: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     425: checkcast     #93                 // class Vector3d
     428: astore        7
     430: iconst_0
     431: istore        8
     433: aload         7
     435: invokevirtual #166                // Method Vector3d.getY:()I
     438: istore        7
     440: iload         6
     442: iload         7
     444: if_icmple     408
     447: iload         7
     449: istore        6
     451: goto          408
     454: iload         6
     456: iconst_1
     457: isub
     458: istore_3
     459: aload_1
     460: checkcast     #41                 // class java/lang/Iterable
     463: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     468: astore        6
     470: aload         6
     472: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     477: ifne          488
     480: new           #158                // class java/util/NoSuchElementException
     483: dup
     484: invokespecial #160                // Method java/util/NoSuchElementException."<init>":()V
     487: athrow
     488: aload         6
     490: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     495: checkcast     #93                 // class Vector3d
     498: astore        7
     500: iconst_0
     501: istore        8
     503: aload         7
     505: invokevirtual #169                // Method Vector3d.getZ:()I
     508: istore        7
     510: aload         6
     512: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     517: ifeq          556
     520: aload         6
     522: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     527: checkcast     #93                 // class Vector3d
     530: astore        8
     532: iconst_0
     533: istore        9
     535: aload         8
     537: invokevirtual #169                // Method Vector3d.getZ:()I
     540: istore        8
     542: iload         7
     544: iload         8
     546: if_icmple     510
     549: iload         8
     551: istore        7
     553: goto          510
     556: iload         7
     558: iconst_1
     559: isub
     560: istore        4
     562: aload_1
     563: checkcast     #41                 // class java/lang/Iterable
     566: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     571: astore        7
     573: aload         7
     575: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     580: ifne          591
     583: new           #158                // class java/util/NoSuchElementException
     586: dup
     587: invokespecial #160                // Method java/util/NoSuchElementException."<init>":()V
     590: athrow
     591: aload         7
     593: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     598: checkcast     #93                 // class Vector3d
     601: astore        8
     603: iconst_0
     604: istore        9
     606: aload         8
     608: invokevirtual #163                // Method Vector3d.getX:()I
     611: istore        8
     613: aload         7
     615: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     620: ifeq          659
     623: aload         7
     625: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     630: checkcast     #93                 // class Vector3d
     633: astore        9
     635: iconst_0
     636: istore        10
     638: aload         9
     640: invokevirtual #163                // Method Vector3d.getX:()I
     643: istore        9
     645: iload         8
     647: iload         9
     649: if_icmpge     613
     652: iload         9
     654: istore        8
     656: goto          613
     659: iload         8
     661: iconst_1
     662: iadd
     663: istore        5
     665: aload_1
     666: checkcast     #41                 // class java/lang/Iterable
     669: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     674: astore        8
     676: aload         8
     678: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     683: ifne          694
     686: new           #158                // class java/util/NoSuchElementException
     689: dup
     690: invokespecial #160                // Method java/util/NoSuchElementException."<init>":()V
     693: athrow
     694: aload         8
     696: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     701: checkcast     #93                 // class Vector3d
     704: astore        9
     706: iconst_0
     707: istore        10
     709: aload         9
     711: invokevirtual #166                // Method Vector3d.getY:()I
     714: istore        9
     716: aload         8
     718: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     723: ifeq          762
     726: aload         8
     728: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     733: checkcast     #93                 // class Vector3d
     736: astore        10
     738: iconst_0
     739: istore        11
     741: aload         10
     743: invokevirtual #166                // Method Vector3d.getY:()I
     746: istore        10
     748: iload         9
     750: iload         10
     752: if_icmpge     716
     755: iload         10
     757: istore        9
     759: goto          716
     762: iload         9
     764: iconst_1
     765: iadd
     766: istore        6
     768: aload_1
     769: checkcast     #41                 // class java/lang/Iterable
     772: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     777: astore        9
     779: aload         9
     781: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     786: ifne          797
     789: new           #158                // class java/util/NoSuchElementException
     792: dup
     793: invokespecial #160                // Method java/util/NoSuchElementException."<init>":()V
     796: athrow
     797: aload         9
     799: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     804: checkcast     #93                 // class Vector3d
     807: astore        10
     809: iconst_0
     810: istore        11
     812: aload         10
     814: invokevirtual #169                // Method Vector3d.getZ:()I
     817: istore        10
     819: aload         9
     821: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     826: ifeq          865
     829: aload         9
     831: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     836: checkcast     #93                 // class Vector3d
     839: astore        11
     841: iconst_0
     842: istore        12
     844: aload         11
     846: invokevirtual #169                // Method Vector3d.getZ:()I
     849: istore        11
     851: iload         10
     853: iload         11
     855: if_icmpge     819
     858: iload         11
     860: istore        10
     862: goto          819
     865: iload         10
     867: iconst_1
     868: iadd
     869: istore        7
     871: new           #171                // class kotlin/ranges/IntRange
     874: dup
     875: iload_2
     876: iload         5
     878: invokespecial #174                // Method kotlin/ranges/IntRange."<init>":(II)V
     881: astore        8
     883: new           #171                // class kotlin/ranges/IntRange
     886: dup
     887: iload_3
     888: iload         6
     890: invokespecial #174                // Method kotlin/ranges/IntRange."<init>":(II)V
     893: astore        9
     895: new           #171                // class kotlin/ranges/IntRange
     898: dup
     899: iload         4
     901: iload         7
     903: invokespecial #174                // Method kotlin/ranges/IntRange."<init>":(II)V
     906: astore        10
     908: aload         8
     910: checkcast     #41                 // class java/lang/Iterable
     913: astore        12
     915: iconst_0
     916: istore        13
     918: aload         12
     920: astore        14
     922: new           #43                 // class java/util/ArrayList
     925: dup
     926: aload         12
     928: bipush        10
     930: invokestatic  #49                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     933: invokespecial #53                 // Method java/util/ArrayList."<init>":(I)V
     936: checkcast     #55                 // class java/util/Collection
     939: astore        15
     941: iconst_0
     942: istore        16
     944: aload         14
     946: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     951: astore        17
     953: aload         17
     955: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     960: ifeq          1199
     963: aload         17
     965: checkcast     #176                // class kotlin/collections/IntIterator
     968: invokevirtual #179                // Method kotlin/collections/IntIterator.nextInt:()I
     971: istore        18
     973: aload         15
     975: iload         18
     977: istore        19
     979: astore        41
     981: iconst_0
     982: istore        20
     984: aload         9
     986: checkcast     #41                 // class java/lang/Iterable
     989: astore        21
     991: iconst_0
     992: istore        22
     994: aload         21
     996: astore        23
     998: new           #43                 // class java/util/ArrayList
    1001: dup
    1002: aload         21
    1004: bipush        10
    1006: invokestatic  #49                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
    1009: invokespecial #53                 // Method java/util/ArrayList."<init>":(I)V
    1012: checkcast     #55                 // class java/util/Collection
    1015: astore        24
    1017: iconst_0
    1018: istore        25
    1020: aload         23
    1022: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1027: astore        26
    1029: aload         26
    1031: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1036: ifeq          1180
    1039: aload         26
    1041: checkcast     #176                // class kotlin/collections/IntIterator
    1044: invokevirtual #179                // Method kotlin/collections/IntIterator.nextInt:()I
    1047: istore        27
    1049: aload         24
    1051: iload         27
    1053: istore        28
    1055: astore        29
    1057: iconst_0
    1058: istore        30
    1060: aload         10
    1062: checkcast     #41                 // class java/lang/Iterable
    1065: astore        31
    1067: iconst_0
    1068: istore        32
    1070: aload         31
    1072: astore        33
    1074: new           #43                 // class java/util/ArrayList
    1077: dup
    1078: aload         31
    1080: bipush        10
    1082: invokestatic  #49                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
    1085: invokespecial #53                 // Method java/util/ArrayList."<init>":(I)V
    1088: checkcast     #55                 // class java/util/Collection
    1091: astore        34
    1093: iconst_0
    1094: istore        35
    1096: aload         33
    1098: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1103: astore        36
    1105: aload         36
    1107: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1112: ifeq          1161
    1115: aload         36
    1117: checkcast     #176                // class kotlin/collections/IntIterator
    1120: invokevirtual #179                // Method kotlin/collections/IntIterator.nextInt:()I
    1123: istore        37
    1125: aload         34
    1127: iload         37
    1129: istore        38
    1131: astore        39
    1133: iconst_0
    1134: istore        40
    1136: new           #93                 // class Vector3d
    1139: dup
    1140: iload         19
    1142: iload         28
    1144: iload         38
    1146: invokespecial #96                 // Method Vector3d."<init>":(III)V
    1149: aload         39
    1151: swap
    1152: invokeinterface #79,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1157: pop
    1158: goto          1105
    1161: aload         34
    1163: checkcast     #81                 // class java/util/List
    1166: nop
    1167: nop
    1168: aload         29
    1170: swap
    1171: invokeinterface #79,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1176: pop
    1177: goto          1029
    1180: aload         24
    1182: checkcast     #81                 // class java/util/List
    1185: nop
    1186: nop
    1187: aload         41
    1189: swap
    1190: invokeinterface #79,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1195: pop
    1196: goto          953
    1199: aload         15
    1201: checkcast     #81                 // class java/util/List
    1204: nop
    1205: checkcast     #41                 // class java/lang/Iterable
    1208: invokestatic  #183                // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;
    1211: checkcast     #41                 // class java/lang/Iterable
    1214: invokestatic  #183                // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;
    1217: checkcast     #41                 // class java/lang/Iterable
    1220: invokestatic  #100                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
    1223: astore        11
    1225: new           #185                // class java/util/LinkedHashSet
    1228: dup
    1229: invokespecial #186                // Method java/util/LinkedHashSet."<init>":()V
    1232: checkcast     #116                // class java/util/Set
    1235: astore        12
    1237: iconst_1
    1238: anewarray     #93                 // class Vector3d
    1241: astore        14
    1243: aload         14
    1245: iconst_0
    1246: new           #93                 // class Vector3d
    1249: dup
    1250: iload_2
    1251: iload_3
    1252: iload         4
    1254: invokespecial #96                 // Method Vector3d."<init>":(III)V
    1257: aastore
    1258: aload         14
    1260: invokestatic  #190                // Method kotlin/collections/CollectionsKt.mutableListOf:([Ljava/lang/Object;)Ljava/util/List;
    1263: astore        13
    1265: aload         13
    1267: checkcast     #55                 // class java/util/Collection
    1270: invokeinterface #193,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
    1275: ifne          1282
    1278: iconst_1
    1279: goto          1283
    1282: iconst_0
    1283: ifeq          1542
    1286: aload         13
    1288: invokeinterface #196,  1          // InterfaceMethod java/util/List.removeLast:()Ljava/lang/Object;
    1293: dup
    1294: ldc           #198                // String removeLast(...)
    1296: invokestatic  #204                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
    1299: checkcast     #93                 // class Vector3d
    1302: astore        14
    1304: aload         12
    1306: checkcast     #55                 // class java/util/Collection
    1309: aload         14
    1311: invokeinterface #79,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1316: pop
    1317: getstatic     #104                // Field Vector3d.Companion:LVector3d$Companion;
    1320: invokevirtual #110                // Method Vector3d$Companion.getDIRECTIONS:()[LVector3d;
    1323: astore        15
    1325: iconst_0
    1326: istore        16
    1328: aload         15
    1330: arraylength
    1331: istore        17
    1333: iload         16
    1335: iload         17
    1337: if_icmpge     1265
    1340: aload         15
    1342: iload         16
    1344: aaload
    1345: astore        18
    1347: aload         14
    1349: aload         18
    1351: invokevirtual #114                // Method Vector3d.plus:(LVector3d;)LVector3d;
    1354: astore        19
    1356: aload         12
    1358: aload         19
    1360: invokeinterface #119,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
    1365: ifne          1520
    1368: aload_1
    1369: aload         19
    1371: invokeinterface #119,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
    1376: ifne          1520
    1379: aload         8
    1381: invokevirtual #207                // Method kotlin/ranges/IntRange.getFirst:()I
    1384: istore        20
    1386: aload         8
    1388: invokevirtual #210                // Method kotlin/ranges/IntRange.getLast:()I
    1391: istore        21
    1393: aload         19
    1395: invokevirtual #163                // Method Vector3d.getX:()I
    1398: istore        22
    1400: iload         20
    1402: iload         22
    1404: if_icmpgt     1422
    1407: iload         22
    1409: iload         21
    1411: if_icmpgt     1418
    1414: iconst_1
    1415: goto          1423
    1418: iconst_0
    1419: goto          1423
    1422: iconst_0
    1423: ifeq          1520
    1426: aload         9
    1428: invokevirtual #207                // Method kotlin/ranges/IntRange.getFirst:()I
    1431: istore        20
    1433: aload         9
    1435: invokevirtual #210                // Method kotlin/ranges/IntRange.getLast:()I
    1438: istore        21
    1440: aload         19
    1442: invokevirtual #166                // Method Vector3d.getY:()I
    1445: istore        22
    1447: iload         20
    1449: iload         22
    1451: if_icmpgt     1469
    1454: iload         22
    1456: iload         21
    1458: if_icmpgt     1465
    1461: iconst_1
    1462: goto          1470
    1465: iconst_0
    1466: goto          1470
    1469: iconst_0
    1470: ifeq          1520
    1473: aload         10
    1475: invokevirtual #207                // Method kotlin/ranges/IntRange.getFirst:()I
    1478: istore        20
    1480: aload         10
    1482: invokevirtual #210                // Method kotlin/ranges/IntRange.getLast:()I
    1485: istore        21
    1487: aload         19
    1489: invokevirtual #169                // Method Vector3d.getZ:()I
    1492: istore        22
    1494: iload         20
    1496: iload         22
    1498: if_icmpgt     1516
    1501: iload         22
    1503: iload         21
    1505: if_icmpgt     1512
    1508: iconst_1
    1509: goto          1517
    1512: iconst_0
    1513: goto          1517
    1516: iconst_0
    1517: ifne          1523
    1520: goto          1536
    1523: aload         13
    1525: checkcast     #55                 // class java/util/Collection
    1528: aload         19
    1530: invokeinterface #79,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1535: pop
    1536: iinc          16, 1
    1539: goto          1333
    1542: aload         11
    1544: aload         12
    1546: checkcast     #41                 // class java/lang/Iterable
    1549: invokestatic  #216                // Method kotlin/collections/SetsKt.minus:(Ljava/util/Set;Ljava/lang/Iterable;)Ljava/util/Set;
    1552: aload_1
    1553: checkcast     #41                 // class java/lang/Iterable
    1556: invokestatic  #216                // Method kotlin/collections/SetsKt.minus:(Ljava/util/Set;Ljava/lang/Iterable;)Ljava/util/Set;
    1559: astore        14
    1561: aload_1
    1562: checkcast     #55                 // class java/util/Collection
    1565: aload         14
    1567: checkcast     #41                 // class java/lang/Iterable
    1570: invokestatic  #220                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
    1573: pop
    1574: aload_1
    1575: checkcast     #41                 // class java/lang/Iterable
    1578: astore        15
    1580: iconst_0
    1581: istore        16
    1583: aload         15
    1585: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1590: astore        17
    1592: aload         17
    1594: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1599: ifeq          1718
    1602: aload         17
    1604: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1609: astore        18
    1611: iload         16
    1613: aload         18
    1615: checkcast     #93                 // class Vector3d
    1618: astore        19
    1620: istore        41
    1622: iconst_0
    1623: istore        20
    1625: bipush        6
    1627: getstatic     #104                // Field Vector3d.Companion:LVector3d$Companion;
    1630: invokevirtual #110                // Method Vector3d$Companion.getDIRECTIONS:()[LVector3d;
    1633: astore        21
    1635: istore        22
    1637: iconst_0
    1638: istore        23
    1640: iconst_0
    1641: istore        24
    1643: iconst_0
    1644: istore        25
    1646: aload         21
    1648: arraylength
    1649: istore        26
    1651: iload         25
    1653: iload         26
    1655: if_icmpge     1697
    1658: aload         21
    1660: iload         25
    1662: aaload
    1663: astore        27
    1665: aload         27
    1667: astore        28
    1669: iconst_0
    1670: istore        29
    1672: aload_1
    1673: aload         19
    1675: aload         28
    1677: invokevirtual #114                // Method Vector3d.plus:(LVector3d;)LVector3d;
    1680: invokeinterface #119,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
    1685: ifeq          1691
    1688: iinc          24, 1
    1691: iinc          25, 1
    1694: goto          1651
    1697: iload         24
    1699: istore        30
    1701: iload         22
    1703: iload         30
    1705: isub
    1706: istore        42
    1708: iload         41
    1710: iload         42
    1712: iadd
    1713: istore        16
    1715: goto          1592
    1718: iload         16
    1720: ireturn

  public static final int access$main$part1(java.util.List);
    Code:
       0: aload_0
       1: invokestatic  #252                // Method main$part1:(Ljava/util/List;)I
       4: ireturn

  public static final int access$main$part2(java.util.List);
    Code:
       0: aload_0
       1: invokestatic  #255                // Method main$part2:(Ljava/util/List;)I
       4: ireturn
}

Compiled from "Day18.kt"
final class Day18Kt$main$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<java.util.List<? extends java.lang.String>, java.lang.Integer> {
  public static final Day18Kt$main$1 INSTANCE;

  Day18Kt$main$1();
    Code:
       0: aload_0
       1: iconst_1
       2: ldc           #11                 // class kotlin/jvm/internal/Intrinsics$Kotlin
       4: ldc           #13                 // String part1
       6: ldc           #15                 // String main$part1(Ljava/util/List;)I
       8: iconst_0
       9: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      12: return

  public final java.lang.Integer invoke(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #25                 // String p0
       3: invokestatic  #31                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokestatic  #37                 // Method Day18Kt.access$main$part1:(Ljava/util/List;)I
      10: invokestatic  #43                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      13: areturn

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #47                 // class java/util/List
       5: invokevirtual #49                 // Method invoke:(Ljava/util/List;)Ljava/lang/Integer;
       8: areturn

  static {};
    Code:
       0: new           #2                  // class Day18Kt$main$1
       3: dup
       4: invokespecial #54                 // Method "<init>":()V
       7: putstatic     #57                 // Field INSTANCE:LDay18Kt$main$1;
      10: return
}