object Day17 {
    // val targetArea = 20..30 to -10..-5
    val targetArea = 248..285 to -85..-56

    data class Coord(val x: Int, val y: Int) {
        constructor(coord: Pair<Int, Int>) : this(coord.first, coord.second)
    }

    private fun Pair<IntRange, IntRange>.toCoords(): List<Coord> {
        val (xs, ys) = this
        return xs.flatMap { row -> ys.map { col -> Coord(row, col) } }
    }

    private fun Pair<IntRange, IntRange>.draw(path: List<Coord>) {
        val targetArea = this.toCoords()
        println("\n")
        val maxCols = (path + targetArea).maxOf { it.x } + 2
        val maxRows = (path + targetArea).maxOf { it.y } + 2
        val minRows = (path + targetArea).minOf { it.y } - 2

        (minRows..maxRows).reversed().forEach { row ->
            print(row.toString().padStart(3, ' ') + "  ")
            (0..maxCols).forEach { col ->
                print(
                    when {
                        path.contains(Coord(col, row)) -> "#"
                        targetArea.contains(Coord(col, row)) -> "T"
                        else -> "."
                    }
                )
            }
            println()
        }
    }

    private fun Pair<IntRange, IntRange>.outOfBounds(point: Coord): Boolean {
        val (xs, ys) = this
        val (x, y) = point
        return x > xs.last || y < ys.first
    }

    fun Pair<IntRange, IntRange>.within(point: Coord): Boolean {
        val (xs, ys) = this
        val (x, y) = point
        return xs.contains(x) && ys.contains(y)
    }

    private fun fire(x: Int, y: Int): List<Coord> {
        val velocity = generateSequence(x to y) { (x, y) ->
            (when {
                x > 0 -> x - 1
                x < 0 -> x + 1
                else -> 0
            }) to y - 1
        }.iterator()

        return generateSequence(Coord(0 to 0)) { (x, y) ->
            val (x2, y2) = velocity.next()
            Coord((x + x2) to (y + y2))
        }
            .takeWhile { targetArea.within(it) || !targetArea.outOfBounds(it) }
            .toList()
    }

    object Part1 {
        fun run() {
            val paths = (0..100).flatMap { x ->
                (0..100).map { y ->
                    (x to y) to fire(x, y)
                }
            }
                .filter { (_, path) -> targetArea.within(path.last()) }
                .sortedBy { (_, path) -> path.maxByOrNull { it.y }!!.y }

            println(paths.maxOf { (_, path) -> path.maxOf{ it.y } })

            targetArea.draw(fire(23, 84))
        }
    }

    object Part2 {
        fun run() {
            val paths = (20..300).flatMap { x ->
                (-100..100).map { y ->
                    (x to y) to fire(x, y)
                }
            }
                .filter { (_, path) -> targetArea.within(path.last()) }
                .map {(velocity, _) ->  velocity}

            println(paths.size)
        }
    }
}

fun main() {
    Day17.Part1.run()
    Day17.Part2.run()
}

Compiled from "Day17.kt"
public final class Day17 {
  public static final Day17 INSTANCE;

  private static final kotlin.Pair<kotlin.ranges.IntRange, kotlin.ranges.IntRange> targetArea;

  private Day17();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final kotlin.Pair<kotlin.ranges.IntRange, kotlin.ranges.IntRange> getTargetArea();
    Code:
       0: getstatic     #18                 // Field targetArea:Lkotlin/Pair;
       3: areturn

  private final java.util.List<Day17$Coord> toCoords(kotlin.Pair<kotlin.ranges.IntRange, kotlin.ranges.IntRange>);
    Code:
       0: aload_1
       1: invokevirtual #27                 // Method kotlin/Pair.component1:()Ljava/lang/Object;
       4: checkcast     #29                 // class kotlin/ranges/IntRange
       7: astore_2
       8: aload_1
       9: invokevirtual #32                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
      12: checkcast     #29                 // class kotlin/ranges/IntRange
      15: astore_3
      16: aload_2
      17: checkcast     #34                 // class java/lang/Iterable
      20: astore        4
      22: iconst_0
      23: istore        5
      25: aload         4
      27: astore        6
      29: new           #36                 // class java/util/ArrayList
      32: dup
      33: invokespecial #37                 // Method java/util/ArrayList."<init>":()V
      36: checkcast     #39                 // class java/util/Collection
      39: astore        7
      41: iconst_0
      42: istore        8
      44: aload         6
      46: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      51: astore        9
      53: aload         9
      55: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      60: ifeq          201
      63: aload         9
      65: checkcast     #51                 // class kotlin/collections/IntIterator
      68: invokevirtual #55                 // Method kotlin/collections/IntIterator.nextInt:()I
      71: istore        10
      73: iload         10
      75: istore        11
      77: iconst_0
      78: istore        12
      80: aload_3
      81: checkcast     #34                 // class java/lang/Iterable
      84: astore        13
      86: iconst_0
      87: istore        14
      89: aload         13
      91: astore        15
      93: new           #36                 // class java/util/ArrayList
      96: dup
      97: aload         13
      99: bipush        10
     101: invokestatic  #61                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     104: invokespecial #64                 // Method java/util/ArrayList."<init>":(I)V
     107: checkcast     #39                 // class java/util/Collection
     110: astore        16
     112: iconst_0
     113: istore        17
     115: aload         15
     117: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     122: astore        18
     124: aload         18
     126: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     131: ifeq          178
     134: aload         18
     136: checkcast     #51                 // class kotlin/collections/IntIterator
     139: invokevirtual #55                 // Method kotlin/collections/IntIterator.nextInt:()I
     142: istore        19
     144: aload         16
     146: iload         19
     148: istore        20
     150: astore        21
     152: iconst_0
     153: istore        22
     155: new           #66                 // class Day17$Coord
     158: dup
     159: iload         11
     161: iload         20
     163: invokespecial #69                 // Method Day17$Coord."<init>":(II)V
     166: aload         21
     168: swap
     169: invokeinterface #73,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     174: pop
     175: goto          124
     178: aload         16
     180: checkcast     #75                 // class java/util/List
     183: nop
     184: checkcast     #34                 // class java/lang/Iterable
     187: nop
     188: astore        11
     190: aload         7
     192: aload         11
     194: invokestatic  #79                 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     197: pop
     198: goto          53
     201: aload         7
     203: checkcast     #75                 // class java/util/List
     206: nop
     207: areturn

  private final void draw(kotlin.Pair<kotlin.ranges.IntRange, kotlin.ranges.IntRange>, java.util.List<Day17$Coord>);
    Code:
       0: aload_0
       1: aload_1
       2: invokespecial #107                // Method toCoords:(Lkotlin/Pair;)Ljava/util/List;
       5: astore_3
       6: ldc           #109                // String \n
       8: getstatic     #115                // Field java/lang/System.out:Ljava/io/PrintStream;
      11: swap
      12: invokevirtual #121                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      15: aload_2
      16: checkcast     #39                 // class java/util/Collection
      19: aload_3
      20: checkcast     #34                 // class java/lang/Iterable
      23: invokestatic  #125                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
      26: checkcast     #34                 // class java/lang/Iterable
      29: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      34: astore        6
      36: aload         6
      38: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      43: ifne          54
      46: new           #127                // class java/util/NoSuchElementException
      49: dup
      50: invokespecial #128                // Method java/util/NoSuchElementException."<init>":()V
      53: athrow
      54: aload         6
      56: invokeinterface #131,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      61: checkcast     #66                 // class Day17$Coord
      64: astore        7
      66: iconst_0
      67: istore        8
      69: aload         7
      71: invokevirtual #134                // Method Day17$Coord.getX:()I
      74: istore        7
      76: aload         6
      78: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      83: ifeq          122
      86: aload         6
      88: invokeinterface #131,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      93: checkcast     #66                 // class Day17$Coord
      96: astore        8
      98: iconst_0
      99: istore        9
     101: aload         8
     103: invokevirtual #134                // Method Day17$Coord.getX:()I
     106: istore        8
     108: iload         7
     110: iload         8
     112: if_icmpge     76
     115: iload         8
     117: istore        7
     119: goto          76
     122: iload         7
     124: iconst_2
     125: iadd
     126: istore        4
     128: aload_2
     129: checkcast     #39                 // class java/util/Collection
     132: aload_3
     133: checkcast     #34                 // class java/lang/Iterable
     136: invokestatic  #125                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     139: checkcast     #34                 // class java/lang/Iterable
     142: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     147: astore        7
     149: aload         7
     151: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     156: ifne          167
     159: new           #127                // class java/util/NoSuchElementException
     162: dup
     163: invokespecial #128                // Method java/util/NoSuchElementException."<init>":()V
     166: athrow
     167: aload         7
     169: invokeinterface #131,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     174: checkcast     #66                 // class Day17$Coord
     177: astore        8
     179: iconst_0
     180: istore        9
     182: aload         8
     184: invokevirtual #137                // Method Day17$Coord.getY:()I
     187: istore        8
     189: aload         7
     191: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     196: ifeq          235
     199: aload         7
     201: invokeinterface #131,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     206: checkcast     #66                 // class Day17$Coord
     209: astore        9
     211: iconst_0
     212: istore        10
     214: aload         9
     216: invokevirtual #137                // Method Day17$Coord.getY:()I
     219: istore        9
     221: iload         8
     223: iload         9
     225: if_icmpge     189
     228: iload         9
     230: istore        8
     232: goto          189
     235: iload         8
     237: iconst_2
     238: iadd
     239: istore        5
     241: aload_2
     242: checkcast     #39                 // class java/util/Collection
     245: aload_3
     246: checkcast     #34                 // class java/lang/Iterable
     249: invokestatic  #125                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     252: checkcast     #34                 // class java/lang/Iterable
     255: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     260: astore        8
     262: aload         8
     264: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     269: ifne          280
     272: new           #127                // class java/util/NoSuchElementException
     275: dup
     276: invokespecial #128                // Method java/util/NoSuchElementException."<init>":()V
     279: athrow
     280: aload         8
     282: invokeinterface #131,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     287: checkcast     #66                 // class Day17$Coord
     290: astore        9
     292: iconst_0
     293: istore        10
     295: aload         9
     297: invokevirtual #137                // Method Day17$Coord.getY:()I
     300: istore        9
     302: aload         8
     304: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     309: ifeq          348
     312: aload         8
     314: invokeinterface #131,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     319: checkcast     #66                 // class Day17$Coord
     322: astore        10
     324: iconst_0
     325: istore        11
     327: aload         10
     329: invokevirtual #137                // Method Day17$Coord.getY:()I
     332: istore        10
     334: iload         9
     336: iload         10
     338: if_icmple     302
     341: iload         10
     343: istore        9
     345: goto          302
     348: iload         9
     350: iconst_2
     351: isub
     352: istore        6
     354: new           #29                 // class kotlin/ranges/IntRange
     357: dup
     358: iload         6
     360: iload         5
     362: invokespecial #138                // Method kotlin/ranges/IntRange."<init>":(II)V
     365: checkcast     #140                // class kotlin/ranges/IntProgression
     368: invokestatic  #146                // Method kotlin/ranges/RangesKt.reversed:(Lkotlin/ranges/IntProgression;)Lkotlin/ranges/IntProgression;
     371: checkcast     #34                 // class java/lang/Iterable
     374: astore        7
     376: iconst_0
     377: istore        8
     379: aload         7
     381: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     386: astore        9
     388: aload         9
     390: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     395: ifeq          585
     398: aload         9
     400: checkcast     #51                 // class kotlin/collections/IntIterator
     403: invokevirtual #55                 // Method kotlin/collections/IntIterator.nextInt:()I
     406: istore        10
     408: iload         10
     410: istore        11
     412: iconst_0
     413: istore        12
     415: new           #148                // class java/lang/StringBuilder
     418: dup
     419: invokespecial #149                // Method java/lang/StringBuilder."<init>":()V
     422: iload         11
     424: invokestatic  #155                // Method java/lang/String.valueOf:(I)Ljava/lang/String;
     427: iconst_3
     428: bipush        32
     430: invokestatic  #161                // Method kotlin/text/StringsKt.padStart:(Ljava/lang/String;IC)Ljava/lang/String;
     433: invokevirtual #165                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     436: ldc           #167                // String
     438: invokevirtual #165                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     441: invokevirtual #171                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     444: getstatic     #115                // Field java/lang/System.out:Ljava/io/PrintStream;
     447: swap
     448: invokevirtual #174                // Method java/io/PrintStream.print:(Ljava/lang/Object;)V
     451: new           #29                 // class kotlin/ranges/IntRange
     454: dup
     455: iconst_0
     456: iload         4
     458: invokespecial #138                // Method kotlin/ranges/IntRange."<init>":(II)V
     461: checkcast     #34                 // class java/lang/Iterable
     464: astore        13
     466: iconst_0
     467: istore        14
     469: aload         13
     471: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     476: astore        15
     478: aload         15
     480: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     485: ifeq          573
     488: aload         15
     490: checkcast     #51                 // class kotlin/collections/IntIterator
     493: invokevirtual #55                 // Method kotlin/collections/IntIterator.nextInt:()I
     496: istore        16
     498: iload         16
     500: istore        17
     502: iconst_0
     503: istore        18
     505: nop
     506: aload_2
     507: new           #66                 // class Day17$Coord
     510: dup
     511: iload         17
     513: iload         11
     515: invokespecial #69                 // Method Day17$Coord."<init>":(II)V
     518: invokeinterface #177,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
     523: ifeq          531
     526: ldc           #179                // String #
     528: goto          558
     531: aload_3
     532: new           #66                 // class Day17$Coord
     535: dup
     536: iload         17
     538: iload         11
     540: invokespecial #69                 // Method Day17$Coord."<init>":(II)V
     543: invokeinterface #177,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
     548: ifeq          556
     551: ldc           #181                // String T
     553: goto          558
     556: ldc           #183                // String .
     558: astore        19
     560: getstatic     #115                // Field java/lang/System.out:Ljava/io/PrintStream;
     563: aload         19
     565: invokevirtual #174                // Method java/io/PrintStream.print:(Ljava/lang/Object;)V
     568: nop
     569: nop
     570: goto          478
     573: nop
     574: getstatic     #115                // Field java/lang/System.out:Ljava/io/PrintStream;
     577: invokevirtual #185                // Method java/io/PrintStream.println:()V
     580: nop
     581: nop
     582: goto          388
     585: nop
     586: return

  private final boolean outOfBounds(kotlin.Pair<kotlin.ranges.IntRange, kotlin.ranges.IntRange>, Day17$Coord);
    Code:
       0: aload_1
       1: invokevirtual #27                 // Method kotlin/Pair.component1:()Ljava/lang/Object;
       4: checkcast     #29                 // class kotlin/ranges/IntRange
       7: astore_3
       8: aload_1
       9: invokevirtual #32                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
      12: checkcast     #29                 // class kotlin/ranges/IntRange
      15: astore        4
      17: aload_2
      18: invokevirtual #206                // Method Day17$Coord.component1:()I
      21: istore        5
      23: aload_2
      24: invokevirtual #208                // Method Day17$Coord.component2:()I
      27: istore        6
      29: iload         5
      31: aload_3
      32: invokevirtual #211                // Method kotlin/ranges/IntRange.getLast:()I
      35: if_icmpgt     48
      38: iload         6
      40: aload         4
      42: invokevirtual #214                // Method kotlin/ranges/IntRange.getFirst:()I
      45: if_icmpge     52
      48: iconst_1
      49: goto          53
      52: iconst_0
      53: ireturn

  public final boolean within(kotlin.Pair<kotlin.ranges.IntRange, kotlin.ranges.IntRange>, Day17$Coord);
    Code:
       0: aload_1
       1: ldc           #221                // String <this>
       3: invokestatic  #227                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #228                // String point
       9: invokestatic  #227                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_1
      13: invokevirtual #27                 // Method kotlin/Pair.component1:()Ljava/lang/Object;
      16: checkcast     #29                 // class kotlin/ranges/IntRange
      19: astore_3
      20: aload_1
      21: invokevirtual #32                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
      24: checkcast     #29                 // class kotlin/ranges/IntRange
      27: astore        4
      29: aload_2
      30: invokevirtual #206                // Method Day17$Coord.component1:()I
      33: istore        5
      35: aload_2
      36: invokevirtual #208                // Method Day17$Coord.component2:()I
      39: istore        6
      41: aload_3
      42: iload         5
      44: invokevirtual #231                // Method kotlin/ranges/IntRange.contains:(I)Z
      47: ifeq          64
      50: aload         4
      52: iload         6
      54: invokevirtual #231                // Method kotlin/ranges/IntRange.contains:(I)Z
      57: ifeq          64
      60: iconst_1
      61: goto          65
      64: iconst_0
      65: ireturn

  private final java.util.List<Day17$Coord> fire(int, int);
    Code:
       0: iload_1
       1: invokestatic  #240                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
       4: iload_2
       5: invokestatic  #240                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
       8: invokestatic  #246                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      11: invokedynamic #265,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      16: invokestatic  #271                // Method kotlin/sequences/SequencesKt.generateSequence:(Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      19: invokeinterface #274,  1          // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
      24: astore_3
      25: new           #66                 // class Day17$Coord
      28: dup
      29: iconst_0
      30: invokestatic  #240                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      33: iconst_0
      34: invokestatic  #240                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      37: invokestatic  #246                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      40: invokespecial #277                // Method Day17$Coord."<init>":(Lkotlin/Pair;)V
      43: aload_3
      44: invokedynamic #287,  0            // InvokeDynamic #1:invoke:(Ljava/util/Iterator;)Lkotlin/jvm/functions/Function1;
      49: invokestatic  #271                // Method kotlin/sequences/SequencesKt.generateSequence:(Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      52: invokedynamic #295,  0            // InvokeDynamic #2:invoke:()Lkotlin/jvm/functions/Function1;
      57: invokestatic  #299                // Method kotlin/sequences/SequencesKt.takeWhile:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      60: invokestatic  #303                // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;
      63: areturn

  private static final kotlin.Pair fire$lambda$7(kotlin.Pair);
    Code:
       0: aload_0
       1: ldc_w         #307                // String <destruct>
       4: invokestatic  #227                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokevirtual #27                 // Method kotlin/Pair.component1:()Ljava/lang/Object;
      11: checkcast     #309                // class java/lang/Number
      14: invokevirtual #312                // Method java/lang/Number.intValue:()I
      17: istore_1
      18: aload_0
      19: invokevirtual #32                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
      22: checkcast     #309                // class java/lang/Number
      25: invokevirtual #312                // Method java/lang/Number.intValue:()I
      28: istore_2
      29: nop
      30: iload_1
      31: ifle          40
      34: iload_1
      35: iconst_1
      36: isub
      37: goto          51
      40: iload_1
      41: ifge          50
      44: iload_1
      45: iconst_1
      46: iadd
      47: goto          51
      50: iconst_0
      51: invokestatic  #240                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      54: iload_2
      55: iconst_1
      56: isub
      57: invokestatic  #240                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      60: invokestatic  #246                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      63: areturn

  private static final Day17$Coord fire$lambda$8(java.util.Iterator, Day17$Coord);
    Code:
       0: aload_1
       1: ldc_w         #307                // String <destruct>
       4: invokestatic  #227                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_1
       8: invokevirtual #206                // Method Day17$Coord.component1:()I
      11: istore_2
      12: aload_1
      13: invokevirtual #208                // Method Day17$Coord.component2:()I
      16: istore_3
      17: aload_0
      18: invokeinterface #131,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      23: checkcast     #23                 // class kotlin/Pair
      26: astore        4
      28: aload         4
      30: invokevirtual #27                 // Method kotlin/Pair.component1:()Ljava/lang/Object;
      33: checkcast     #309                // class java/lang/Number
      36: invokevirtual #312                // Method java/lang/Number.intValue:()I
      39: istore        5
      41: aload         4
      43: invokevirtual #32                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
      46: checkcast     #309                // class java/lang/Number
      49: invokevirtual #312                // Method java/lang/Number.intValue:()I
      52: istore        6
      54: new           #66                 // class Day17$Coord
      57: dup
      58: iload_2
      59: iload         5
      61: iadd
      62: invokestatic  #240                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      65: iload_3
      66: iload         6
      68: iadd
      69: invokestatic  #240                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      72: invokestatic  #246                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      75: invokespecial #277                // Method Day17$Coord."<init>":(Lkotlin/Pair;)V
      78: areturn

  private static final boolean fire$lambda$9(Day17$Coord);
    Code:
       0: aload_0
       1: ldc_w         #316                // String it
       4: invokestatic  #227                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: getstatic     #319                // Field INSTANCE:LDay17;
      10: getstatic     #319                // Field INSTANCE:LDay17;
      13: pop
      14: getstatic     #18                 // Field targetArea:Lkotlin/Pair;
      17: aload_0
      18: invokevirtual #321                // Method within:(Lkotlin/Pair;LDay17$Coord;)Z
      21: ifne          41
      24: getstatic     #319                // Field INSTANCE:LDay17;
      27: getstatic     #319                // Field INSTANCE:LDay17;
      30: pop
      31: getstatic     #18                 // Field targetArea:Lkotlin/Pair;
      34: aload_0
      35: invokespecial #323                // Method outOfBounds:(Lkotlin/Pair;LDay17$Coord;)Z
      38: ifne          45
      41: iconst_1
      42: goto          46
      45: iconst_0
      46: ireturn

  public static final void access$draw(Day17, kotlin.Pair, java.util.List);
    Code:
       0: aload_0
       1: aload_1
       2: aload_2
       3: invokespecial #327                // Method draw:(Lkotlin/Pair;Ljava/util/List;)V
       6: return

  public static final java.util.List access$fire(Day17, int, int);
    Code:
       0: aload_0
       1: iload_1
       2: iload_2
       3: invokespecial #333                // Method fire:(II)Ljava/util/List;
       6: areturn

  static {};
    Code:
       0: new           #2                  // class Day17
       3: dup
       4: invokespecial #335                // Method "<init>":()V
       7: putstatic     #319                // Field INSTANCE:LDay17;
      10: new           #29                 // class kotlin/ranges/IntRange
      13: dup
      14: sipush        248
      17: sipush        285
      20: invokespecial #138                // Method kotlin/ranges/IntRange."<init>":(II)V
      23: new           #29                 // class kotlin/ranges/IntRange
      26: dup
      27: bipush        -85
      29: bipush        -56
      31: invokespecial #138                // Method kotlin/ranges/IntRange."<init>":(II)V
      34: invokestatic  #246                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      37: putstatic     #18                 // Field targetArea:Lkotlin/Pair;
      40: return
}

Compiled from "Day17.kt"
public final class Day17$Part2 {
  public static final Day17$Part2 INSTANCE;

  private Day17$Part2();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final void run();
    Code:
       0: new           #13                 // class kotlin/ranges/IntRange
       3: dup
       4: bipush        20
       6: sipush        300
       9: invokespecial #16                 // Method kotlin/ranges/IntRange."<init>":(II)V
      12: checkcast     #18                 // class java/lang/Iterable
      15: astore_2
      16: iconst_0
      17: istore_3
      18: aload_2
      19: astore        4
      21: new           #20                 // class java/util/ArrayList
      24: dup
      25: invokespecial #21                 // Method java/util/ArrayList."<init>":()V
      28: checkcast     #23                 // class java/util/Collection
      31: astore        5
      33: iconst_0
      34: istore        6
      36: aload         4
      38: invokeinterface #27,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      43: astore        7
      45: aload         7
      47: invokeinterface #33,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      52: ifeq          218
      55: aload         7
      57: checkcast     #35                 // class kotlin/collections/IntIterator
      60: invokevirtual #39                 // Method kotlin/collections/IntIterator.nextInt:()I
      63: istore        8
      65: iload         8
      67: istore        9
      69: iconst_0
      70: istore        10
      72: new           #13                 // class kotlin/ranges/IntRange
      75: dup
      76: bipush        -100
      78: bipush        100
      80: invokespecial #16                 // Method kotlin/ranges/IntRange."<init>":(II)V
      83: checkcast     #18                 // class java/lang/Iterable
      86: astore        11
      88: iconst_0
      89: istore        12
      91: aload         11
      93: astore        13
      95: new           #20                 // class java/util/ArrayList
      98: dup
      99: aload         11
     101: bipush        10
     103: invokestatic  #45                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     106: invokespecial #48                 // Method java/util/ArrayList."<init>":(I)V
     109: checkcast     #23                 // class java/util/Collection
     112: astore        14
     114: iconst_0
     115: istore        15
     117: aload         13
     119: invokeinterface #27,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     124: astore        16
     126: aload         16
     128: invokeinterface #33,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     133: ifeq          195
     136: aload         16
     138: checkcast     #35                 // class kotlin/collections/IntIterator
     141: invokevirtual #39                 // Method kotlin/collections/IntIterator.nextInt:()I
     144: istore        17
     146: aload         14
     148: iload         17
     150: istore        18
     152: astore        19
     154: iconst_0
     155: istore        20
     157: iload         9
     159: invokestatic  #54                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     162: iload         18
     164: invokestatic  #54                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     167: invokestatic  #60                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     170: getstatic     #66                 // Field Day17.INSTANCE:LDay17;
     173: iload         9
     175: iload         18
     177: invokestatic  #70                 // Method Day17.access$fire:(LDay17;II)Ljava/util/List;
     180: invokestatic  #60                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     183: aload         19
     185: swap
     186: invokeinterface #74,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     191: pop
     192: goto          126
     195: aload         14
     197: checkcast     #76                 // class java/util/List
     200: nop
     201: checkcast     #18                 // class java/lang/Iterable
     204: nop
     205: astore        9
     207: aload         5
     209: aload         9
     211: invokestatic  #80                 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     214: pop
     215: goto          45
     218: aload         5
     220: checkcast     #76                 // class java/util/List
     223: nop
     224: checkcast     #18                 // class java/lang/Iterable
     227: astore_2
     228: nop
     229: iconst_0
     230: istore_3
     231: aload_2
     232: astore        4
     234: new           #20                 // class java/util/ArrayList
     237: dup
     238: invokespecial #21                 // Method java/util/ArrayList."<init>":()V
     241: checkcast     #23                 // class java/util/Collection
     244: astore        5
     246: iconst_0
     247: istore        6
     249: aload         4
     251: invokeinterface #27,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     256: astore        7
     258: aload         7
     260: invokeinterface #33,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     265: ifeq          333
     268: aload         7
     270: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     275: astore        8
     277: aload         8
     279: checkcast     #86                 // class kotlin/Pair
     282: astore        9
     284: iconst_0
     285: istore        10
     287: aload         9
     289: invokevirtual #89                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
     292: checkcast     #76                 // class java/util/List
     295: astore        11
     297: getstatic     #66                 // Field Day17.INSTANCE:LDay17;
     300: getstatic     #66                 // Field Day17.INSTANCE:LDay17;
     303: invokevirtual #93                 // Method Day17.getTargetArea:()Lkotlin/Pair;
     306: aload         11
     308: invokestatic  #97                 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     311: checkcast     #99                 // class Day17$Coord
     314: invokevirtual #103                // Method Day17.within:(Lkotlin/Pair;LDay17$Coord;)Z
     317: ifeq          258
     320: aload         5
     322: aload         8
     324: invokeinterface #74,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     329: pop
     330: goto          258
     333: aload         5
     335: checkcast     #76                 // class java/util/List
     338: nop
     339: checkcast     #18                 // class java/lang/Iterable
     342: astore_2
     343: nop
     344: iconst_0
     345: istore_3
     346: aload_2
     347: astore        4
     349: new           #20                 // class java/util/ArrayList
     352: dup
     353: aload_2
     354: bipush        10
     356: invokestatic  #45                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     359: invokespecial #48                 // Method java/util/ArrayList."<init>":(I)V
     362: checkcast     #23                 // class java/util/Collection
     365: astore        5
     367: iconst_0
     368: istore        6
     370: aload         4
     372: invokeinterface #27,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     377: astore        7
     379: aload         7
     381: invokeinterface #33,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     386: ifeq          436
     389: aload         7
     391: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     396: astore        8
     398: aload         5
     400: aload         8
     402: checkcast     #86                 // class kotlin/Pair
     405: astore        9
     407: astore        21
     409: iconst_0
     410: istore        10
     412: aload         9
     414: invokevirtual #106                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     417: checkcast     #86                 // class kotlin/Pair
     420: astore        11
     422: aload         11
     424: aload         21
     426: swap
     427: invokeinterface #74,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     432: pop
     433: goto          379
     436: aload         5
     438: checkcast     #76                 // class java/util/List
     441: nop
     442: astore_1
     443: aload_1
     444: invokeinterface #109,  1          // InterfaceMethod java/util/List.size:()I
     449: istore_2
     450: getstatic     #115                // Field java/lang/System.out:Ljava/io/PrintStream;
     453: iload_2
     454: invokevirtual #120                // Method java/io/PrintStream.println:(I)V
     457: return

  static {};
    Code:
       0: new           #2                  // class Day17$Part2
       3: dup
       4: invokespecial #153                // Method "<init>":()V
       7: putstatic     #155                // Field INSTANCE:LDay17$Part2;
      10: return
}

Compiled from "Day17.kt"
public final class Day17$Coord {
  private final int x;

  private final int y;

  public Day17$Coord(int, int);
    Code:
       0: aload_0
       1: invokespecial #9                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: iload_1
       6: putfield      #13                 // Field x:I
       9: aload_0
      10: iload_2
      11: putfield      #16                 // Field y:I
      14: return

  public final int getX();
    Code:
       0: aload_0
       1: getfield      #13                 // Field x:I
       4: ireturn

  public final int getY();
    Code:
       0: aload_0
       1: getfield      #16                 // Field y:I
       4: ireturn

  public Day17$Coord(kotlin.Pair<java.lang.Integer, java.lang.Integer>);
    Code:
       0: aload_1
       1: ldc           #26                 // String coord
       3: invokestatic  #32                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: invokevirtual #38                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      11: checkcast     #40                 // class java/lang/Number
      14: invokevirtual #43                 // Method java/lang/Number.intValue:()I
      17: aload_1
      18: invokevirtual #46                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      21: checkcast     #40                 // class java/lang/Number
      24: invokevirtual #43                 // Method java/lang/Number.intValue:()I
      27: invokespecial #48                 // Method "<init>":(II)V
      30: return

  public final int component1();
    Code:
       0: aload_0
       1: getfield      #13                 // Field x:I
       4: ireturn

  public final int component2();
    Code:
       0: aload_0
       1: getfield      #16                 // Field y:I
       4: ireturn

  public final Day17$Coord copy(int, int);
    Code:
       0: new           #2                  // class Day17$Coord
       3: dup
       4: iload_1
       5: iload_2
       6: invokespecial #48                 // Method "<init>":(II)V
       9: areturn

  public static Day17$Coord copy$default(Day17$Coord, int, int, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #13                 // Field x:I
      10: istore_1
      11: iload_3
      12: iconst_2
      13: iand
      14: ifeq          22
      17: aload_0
      18: getfield      #16                 // Field y:I
      21: istore_2
      22: aload_0
      23: iload_1
      24: iload_2
      25: invokevirtual #57                 // Method copy:(II)LDay17$Coord;
      28: areturn

  public java.lang.String toString();
    Code:
       0: new           #61                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #62                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #64                 // String Coord(x=
       9: invokevirtual #68                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field x:I
      16: invokevirtual #71                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #73                 // String , y=
      21: invokevirtual #68                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #16                 // Field y:I
      28: invokevirtual #71                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #76                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #78                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      39: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #13                 // Field x:I
       4: invokestatic  #84                 // Method java/lang/Integer.hashCode:(I)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #16                 // Field y:I
      16: invokestatic  #84                 // Method java/lang/Integer.hashCode:(I)I
      19: iadd
      20: istore_1
      21: iload_1
      22: ireturn

  public boolean equals(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: if_acmpne     7
       5: iconst_1
       6: ireturn
       7: aload_1
       8: instanceof    #2                  // class Day17$Coord
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day17$Coord
      20: astore_2
      21: aload_0
      22: getfield      #13                 // Field x:I
      25: aload_2
      26: getfield      #13                 // Field x:I
      29: if_icmpeq     34
      32: iconst_0
      33: ireturn
      34: aload_0
      35: getfield      #16                 // Field y:I
      38: aload_2
      39: getfield      #16                 // Field y:I
      42: if_icmpeq     47
      45: iconst_0
      46: ireturn
      47: iconst_1
      48: ireturn
}

Compiled from "Comparisons.kt"
public final class Day17$Part1$run$$inlined$sortedBy$1<T> implements java.util.Comparator {
  public Day17$Part1$run$$inlined$sortedBy$1();
    Code:
       0: aload_0
       1: invokespecial #16                 // Method java/lang/Object."<init>":()V
       4: return

  public final int compare(T, T);
    Code:
       0: aload_1
       1: checkcast     #23                 // class kotlin/Pair
       4: astore_3
       5: iconst_0
       6: istore        4
       8: aload_3
       9: invokevirtual #27                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
      12: checkcast     #29                 // class java/util/List
      15: astore        5
      17: aload         5
      19: checkcast     #31                 // class java/lang/Iterable
      22: astore        6
      24: iconst_0
      25: istore        7
      27: aload         6
      29: invokeinterface #35,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      34: astore        8
      36: aload         8
      38: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      43: ifne          50
      46: aconst_null
      47: goto          144
      50: aload         8
      52: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: astore        9
      59: aload         8
      61: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      66: ifne          74
      69: aload         9
      71: goto          144
      74: aload         9
      76: checkcast     #46                 // class Day17$Coord
      79: astore        10
      81: iconst_0
      82: istore        11
      84: aload         10
      86: invokevirtual #50                 // Method Day17$Coord.getY:()I
      89: istore        10
      91: aload         8
      93: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      98: astore        11
     100: aload         11
     102: checkcast     #46                 // class Day17$Coord
     105: astore        12
     107: iconst_0
     108: istore        13
     110: aload         12
     112: invokevirtual #50                 // Method Day17$Coord.getY:()I
     115: istore        12
     117: iload         10
     119: iload         12
     121: if_icmpge     132
     124: aload         11
     126: astore        9
     128: iload         12
     130: istore        10
     132: aload         8
     134: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     139: ifne          91
     142: aload         9
     144: dup
     145: invokestatic  #56                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     148: checkcast     #46                 // class Day17$Coord
     151: invokevirtual #50                 // Method Day17$Coord.getY:()I
     154: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     157: checkcast     #64                 // class java/lang/Comparable
     160: aload_2
     161: checkcast     #23                 // class kotlin/Pair
     164: astore_3
     165: astore        14
     167: iconst_0
     168: istore        4
     170: aload_3
     171: invokevirtual #27                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
     174: checkcast     #29                 // class java/util/List
     177: astore        5
     179: aload         5
     181: checkcast     #31                 // class java/lang/Iterable
     184: astore        6
     186: iconst_0
     187: istore        7
     189: aload         6
     191: invokeinterface #35,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     196: astore        8
     198: aload         8
     200: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     205: ifne          212
     208: aconst_null
     209: goto          306
     212: aload         8
     214: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     219: astore        9
     221: aload         8
     223: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     228: ifne          236
     231: aload         9
     233: goto          306
     236: aload         9
     238: checkcast     #46                 // class Day17$Coord
     241: astore        10
     243: iconst_0
     244: istore        11
     246: aload         10
     248: invokevirtual #50                 // Method Day17$Coord.getY:()I
     251: istore        10
     253: aload         8
     255: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     260: astore        11
     262: aload         11
     264: checkcast     #46                 // class Day17$Coord
     267: astore        12
     269: iconst_0
     270: istore        13
     272: aload         12
     274: invokevirtual #50                 // Method Day17$Coord.getY:()I
     277: istore        12
     279: iload         10
     281: iload         12
     283: if_icmpge     294
     286: aload         11
     288: astore        9
     290: iload         12
     292: istore        10
     294: aload         8
     296: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     301: ifne          253
     304: aload         9
     306: dup
     307: invokestatic  #56                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     310: checkcast     #46                 // class Day17$Coord
     313: invokevirtual #50                 // Method Day17$Coord.getY:()I
     316: invokestatic  #62                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     319: aload         14
     321: swap
     322: checkcast     #64                 // class java/lang/Comparable
     325: invokestatic  #70                 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I
     328: ireturn
}

Compiled from "Day17.kt"
public final class Day17Kt {
  public static final void main();
    Code:
       0: getstatic     #12                 // Field Day17$Part1.INSTANCE:LDay17$Part1;
       3: invokevirtual #15                 // Method Day17$Part1.run:()V
       6: getstatic     #20                 // Field Day17$Part2.INSTANCE:LDay17$Part2;
       9: invokevirtual #21                 // Method Day17$Part2.run:()V
      12: return

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

Compiled from "Day17.kt"
public final class Day17$Part1 {
  public static final Day17$Part1 INSTANCE;

  private Day17$Part1();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final void run();
    Code:
       0: new           #13                 // class kotlin/ranges/IntRange
       3: dup
       4: iconst_0
       5: bipush        100
       7: invokespecial #16                 // Method kotlin/ranges/IntRange."<init>":(II)V
      10: checkcast     #18                 // class java/lang/Iterable
      13: astore_2
      14: iconst_0
      15: istore_3
      16: aload_2
      17: astore        4
      19: new           #20                 // class java/util/ArrayList
      22: dup
      23: invokespecial #21                 // Method java/util/ArrayList."<init>":()V
      26: checkcast     #23                 // class java/util/Collection
      29: astore        5
      31: iconst_0
      32: istore        6
      34: aload         4
      36: invokeinterface #27,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      41: astore        7
      43: aload         7
      45: invokeinterface #33,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      50: ifeq          215
      53: aload         7
      55: checkcast     #35                 // class kotlin/collections/IntIterator
      58: invokevirtual #39                 // Method kotlin/collections/IntIterator.nextInt:()I
      61: istore        8
      63: iload         8
      65: istore        9
      67: iconst_0
      68: istore        10
      70: new           #13                 // class kotlin/ranges/IntRange
      73: dup
      74: iconst_0
      75: bipush        100
      77: invokespecial #16                 // Method kotlin/ranges/IntRange."<init>":(II)V
      80: checkcast     #18                 // class java/lang/Iterable
      83: astore        11
      85: iconst_0
      86: istore        12
      88: aload         11
      90: astore        13
      92: new           #20                 // class java/util/ArrayList
      95: dup
      96: aload         11
      98: bipush        10
     100: invokestatic  #45                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     103: invokespecial #48                 // Method java/util/ArrayList."<init>":(I)V
     106: checkcast     #23                 // class java/util/Collection
     109: astore        14
     111: iconst_0
     112: istore        15
     114: aload         13
     116: invokeinterface #27,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     121: astore        16
     123: aload         16
     125: invokeinterface #33,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     130: ifeq          192
     133: aload         16
     135: checkcast     #35                 // class kotlin/collections/IntIterator
     138: invokevirtual #39                 // Method kotlin/collections/IntIterator.nextInt:()I
     141: istore        17
     143: aload         14
     145: iload         17
     147: istore        18
     149: astore        19
     151: iconst_0
     152: istore        20
     154: iload         9
     156: invokestatic  #54                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     159: iload         18
     161: invokestatic  #54                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     164: invokestatic  #60                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     167: getstatic     #66                 // Field Day17.INSTANCE:LDay17;
     170: iload         9
     172: iload         18
     174: invokestatic  #70                 // Method Day17.access$fire:(LDay17;II)Ljava/util/List;
     177: invokestatic  #60                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     180: aload         19
     182: swap
     183: invokeinterface #74,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     188: pop
     189: goto          123
     192: aload         14
     194: checkcast     #76                 // class java/util/List
     197: nop
     198: checkcast     #18                 // class java/lang/Iterable
     201: nop
     202: astore        9
     204: aload         5
     206: aload         9
     208: invokestatic  #80                 // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     211: pop
     212: goto          43
     215: aload         5
     217: checkcast     #76                 // class java/util/List
     220: nop
     221: checkcast     #18                 // class java/lang/Iterable
     224: astore_2
     225: nop
     226: iconst_0
     227: istore_3
     228: aload_2
     229: astore        4
     231: new           #20                 // class java/util/ArrayList
     234: dup
     235: invokespecial #21                 // Method java/util/ArrayList."<init>":()V
     238: checkcast     #23                 // class java/util/Collection
     241: astore        5
     243: iconst_0
     244: istore        6
     246: aload         4
     248: invokeinterface #27,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     253: astore        7
     255: aload         7
     257: invokeinterface #33,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     262: ifeq          330
     265: aload         7
     267: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     272: astore        8
     274: aload         8
     276: checkcast     #86                 // class kotlin/Pair
     279: astore        9
     281: iconst_0
     282: istore        10
     284: aload         9
     286: invokevirtual #89                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
     289: checkcast     #76                 // class java/util/List
     292: astore        11
     294: getstatic     #66                 // Field Day17.INSTANCE:LDay17;
     297: getstatic     #66                 // Field Day17.INSTANCE:LDay17;
     300: invokevirtual #93                 // Method Day17.getTargetArea:()Lkotlin/Pair;
     303: aload         11
     305: invokestatic  #97                 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     308: checkcast     #99                 // class Day17$Coord
     311: invokevirtual #103                // Method Day17.within:(Lkotlin/Pair;LDay17$Coord;)Z
     314: ifeq          255
     317: aload         5
     319: aload         8
     321: invokeinterface #74,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     326: pop
     327: goto          255
     330: aload         5
     332: checkcast     #76                 // class java/util/List
     335: nop
     336: checkcast     #18                 // class java/lang/Iterable
     339: astore_2
     340: nop
     341: iconst_0
     342: istore_3
     343: aload_2
     344: new           #105                // class Day17$Part1$run$$inlined$sortedBy$1
     347: dup
     348: invokespecial #106                // Method Day17$Part1$run$$inlined$sortedBy$1."<init>":()V
     351: checkcast     #108                // class java/util/Comparator
     354: invokestatic  #112                // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;
     357: astore_1
     358: aload_1
     359: checkcast     #18                 // class java/lang/Iterable
     362: invokeinterface #27,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     367: astore_3
     368: aload_3
     369: invokeinterface #33,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     374: ifne          385
     377: new           #114                // class java/util/NoSuchElementException
     380: dup
     381: invokespecial #115                // Method java/util/NoSuchElementException."<init>":()V
     384: athrow
     385: aload_3
     386: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     391: checkcast     #86                 // class kotlin/Pair
     394: astore        4
     396: iconst_0
     397: istore        5
     399: aload         4
     401: invokevirtual #89                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
     404: checkcast     #76                 // class java/util/List
     407: astore        6
     409: aload         6
     411: checkcast     #18                 // class java/lang/Iterable
     414: invokeinterface #27,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     419: astore        7
     421: aload         7
     423: invokeinterface #33,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     428: ifne          439
     431: new           #114                // class java/util/NoSuchElementException
     434: dup
     435: invokespecial #115                // Method java/util/NoSuchElementException."<init>":()V
     438: athrow
     439: aload         7
     441: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     446: checkcast     #99                 // class Day17$Coord
     449: astore        8
     451: iconst_0
     452: istore        9
     454: aload         8
     456: invokevirtual #118                // Method Day17$Coord.getY:()I
     459: istore        8
     461: aload         7
     463: invokeinterface #33,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     468: ifeq          507
     471: aload         7
     473: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     478: checkcast     #99                 // class Day17$Coord
     481: astore        9
     483: iconst_0
     484: istore        10
     486: aload         9
     488: invokevirtual #118                // Method Day17$Coord.getY:()I
     491: istore        9
     493: iload         8
     495: iload         9
     497: if_icmpge     461
     500: iload         9
     502: istore        8
     504: goto          461
     507: iload         8
     509: nop
     510: istore        4
     512: aload_3
     513: invokeinterface #33,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     518: ifeq          662
     521: aload_3
     522: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     527: checkcast     #86                 // class kotlin/Pair
     530: astore        5
     532: iconst_0
     533: istore        6
     535: aload         5
     537: invokevirtual #89                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
     540: checkcast     #76                 // class java/util/List
     543: astore        7
     545: aload         7
     547: checkcast     #18                 // class java/lang/Iterable
     550: invokeinterface #27,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     555: astore        8
     557: aload         8
     559: invokeinterface #33,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     564: ifne          575
     567: new           #114                // class java/util/NoSuchElementException
     570: dup
     571: invokespecial #115                // Method java/util/NoSuchElementException."<init>":()V
     574: athrow
     575: aload         8
     577: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     582: checkcast     #99                 // class Day17$Coord
     585: astore        9
     587: iconst_0
     588: istore        10
     590: aload         9
     592: invokevirtual #118                // Method Day17$Coord.getY:()I
     595: istore        9
     597: aload         8
     599: invokeinterface #33,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     604: ifeq          643
     607: aload         8
     609: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     614: checkcast     #99                 // class Day17$Coord
     617: astore        10
     619: iconst_0
     620: istore        11
     622: aload         10
     624: invokevirtual #118                // Method Day17$Coord.getY:()I
     627: istore        10
     629: iload         9
     631: iload         10
     633: if_icmpge     597
     636: iload         10
     638: istore        9
     640: goto          597
     643: iload         9
     645: nop
     646: istore        5
     648: iload         4
     650: iload         5
     652: if_icmpge     512
     655: iload         5
     657: istore        4
     659: goto          512
     662: iload         4
     664: istore_2
     665: getstatic     #124                // Field java/lang/System.out:Ljava/io/PrintStream;
     668: iload_2
     669: invokevirtual #129                // Method java/io/PrintStream.println:(I)V
     672: getstatic     #66                 // Field Day17.INSTANCE:LDay17;
     675: getstatic     #66                 // Field Day17.INSTANCE:LDay17;
     678: invokevirtual #93                 // Method Day17.getTargetArea:()Lkotlin/Pair;
     681: getstatic     #66                 // Field Day17.INSTANCE:LDay17;
     684: bipush        23
     686: bipush        84
     688: invokestatic  #70                 // Method Day17.access$fire:(LDay17;II)Ljava/util/List;
     691: invokestatic  #133                // Method Day17.access$draw:(LDay17;Lkotlin/Pair;Ljava/util/List;)V
     694: return

  static {};
    Code:
       0: new           #2                  // class Day17$Part1
       3: dup
       4: invokespecial #169                // Method "<init>":()V
       7: putstatic     #171                // Field INSTANCE:LDay17$Part1;
      10: return
}