import java.io.*
fun print_day_17() {
    val yellow = "\u001B[33m"
    val reset = "\u001b[0m"
    val green = "\u001B[32m"
    println(yellow + "-".repeat(25) + "Advent of Code - Day 17" + "-".repeat(25) + reset)
    println(green)
    val process = Runtime.getRuntime().exec("figlet Trick Shot -c -f small")
    val reader = BufferedReader(InputStreamReader(process.inputStream))
    reader.forEachLine { println(it) }
    println(reset)
    println(yellow + "-".repeat(33) + "Output" + "-".repeat(33) + reset + "\n")
}

fun main() {
    print_day_17()
    println("Puzzle 1: ${Day17().part_1()}")
    println("Puzzle 2: ${Day17().part_2()}")
    println("\n" + "\u001B[33m" + "=".repeat(72) + "\u001b[0m" + "\n")
}

class Day17 {

    data class BoundingBox(val xRange: IntRange, val yRange: IntRange)
    private val target = File("../Input/day17.txt").readLines().first().drop(13)
        .split(", ").map { it.drop(2).split("..").let { (a, b) -> a.toInt()..b.toInt() }}
        .let { BoundingBox(it[0], it[1]) }

    fun part_1() = (1..400).flatMap { x -> (1..400).map { y -> checkStep(x, y, target) } }.fold(0) { max, step -> if (step.first) maxOf(max, step.second) else max }
    fun part_2() = (1..400).flatMap { x -> (-400..400).map { y -> checkStep(x, y, target).first } }.count { it }

    data class Coord(var x:Int, var y:Int)
    data class Velocity(var x:Int, var y:Int)
    private fun checkStep(xVelocity: Int, yVelocity: Int, target: BoundingBox): Pair<Boolean, Int> {
        val p = Coord(0, 0)
        val v = Velocity(xVelocity, yVelocity)
        var maxHeight = 0
        var hitTarget = false
        while (p.x <= target.xRange.last && p.y >= target.yRange.first) {
            p.x += v.x
            p.y += v.y

            maxHeight = maxOf(p.y, maxHeight)
            if (p.x in target.xRange && p.y in target.yRange) {
                hitTarget = true
                break
            }

            if (v.x > 0) v.x--
            v.y--
        }
        return Pair(hitTarget, maxHeight)
    }
}

Compiled from "day17.kt"
public final class Day17 {
  private final Day17$BoundingBox target;

  public Day17();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: new           #10                 // class java/io/File
       8: dup
       9: ldc           #12                 // String ../Input/day17.txt
      11: invokespecial #15                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      14: aconst_null
      15: iconst_1
      16: aconst_null
      17: invokestatic  #21                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      20: invokestatic  #27                 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
      23: checkcast     #29                 // class java/lang/String
      26: bipush        13
      28: invokestatic  #35                 // Method kotlin/text/StringsKt.drop:(Ljava/lang/String;I)Ljava/lang/String;
      31: checkcast     #37                 // class java/lang/CharSequence
      34: iconst_1
      35: anewarray     #29                 // class java/lang/String
      38: astore_1
      39: aload_1
      40: iconst_0
      41: ldc           #39                 // String ,
      43: aastore
      44: aload_1
      45: iconst_0
      46: iconst_0
      47: bipush        6
      49: aconst_null
      50: invokestatic  #43                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      53: checkcast     #45                 // class java/lang/Iterable
      56: astore_1
      57: astore        15
      59: iconst_0
      60: istore_2
      61: aload_1
      62: astore_3
      63: new           #47                 // class java/util/ArrayList
      66: dup
      67: aload_1
      68: bipush        10
      70: invokestatic  #51                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      73: invokespecial #54                 // Method java/util/ArrayList."<init>":(I)V
      76: checkcast     #56                 // class java/util/Collection
      79: astore        4
      81: iconst_0
      82: istore        5
      84: aload_3
      85: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      90: astore        6
      92: aload         6
      94: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      99: ifeq          218
     102: aload         6
     104: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     109: astore        7
     111: aload         4
     113: aload         7
     115: checkcast     #29                 // class java/lang/String
     118: astore        8
     120: astore        16
     122: iconst_0
     123: istore        9
     125: aload         8
     127: iconst_2
     128: invokestatic  #35                 // Method kotlin/text/StringsKt.drop:(Ljava/lang/String;I)Ljava/lang/String;
     131: checkcast     #37                 // class java/lang/CharSequence
     134: iconst_1
     135: anewarray     #29                 // class java/lang/String
     138: astore        10
     140: aload         10
     142: iconst_0
     143: ldc           #72                 // String ..
     145: aastore
     146: aload         10
     148: iconst_0
     149: iconst_0
     150: bipush        6
     152: aconst_null
     153: invokestatic  #43                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     156: astore        11
     158: iconst_0
     159: istore        12
     161: aload         11
     163: iconst_0
     164: invokeinterface #78,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     169: checkcast     #29                 // class java/lang/String
     172: astore        13
     174: aload         11
     176: iconst_1
     177: invokeinterface #78,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     182: checkcast     #29                 // class java/lang/String
     185: astore        14
     187: new           #80                 // class kotlin/ranges/IntRange
     190: dup
     191: aload         13
     193: invokestatic  #86                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     196: aload         14
     198: invokestatic  #86                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     201: invokespecial #89                 // Method kotlin/ranges/IntRange."<init>":(II)V
     204: nop
     205: nop
     206: aload         16
     208: swap
     209: invokeinterface #93,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     214: pop
     215: goto          92
     218: aload         4
     220: checkcast     #74                 // class java/util/List
     223: nop
     224: aload         15
     226: swap
     227: astore_2
     228: astore        15
     230: iconst_0
     231: istore_3
     232: new           #95                 // class Day17$BoundingBox
     235: dup
     236: aload_2
     237: iconst_0
     238: invokeinterface #78,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     243: checkcast     #80                 // class kotlin/ranges/IntRange
     246: aload_2
     247: iconst_1
     248: invokeinterface #78,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     253: checkcast     #80                 // class kotlin/ranges/IntRange
     256: invokespecial #98                 // Method Day17$BoundingBox."<init>":(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)V
     259: aload         15
     261: swap
     262: nop
     263: putfield      #102                // Field target:LDay17$BoundingBox;
     266: return

  public final int part_1();
    Code:
       0: new           #80                 // class kotlin/ranges/IntRange
       3: dup
       4: iconst_1
       5: sipush        400
       8: invokespecial #89                 // Method kotlin/ranges/IntRange."<init>":(II)V
      11: checkcast     #45                 // class java/lang/Iterable
      14: astore_1
      15: iconst_0
      16: istore_2
      17: aload_1
      18: astore_3
      19: new           #47                 // class java/util/ArrayList
      22: dup
      23: invokespecial #125                // Method java/util/ArrayList."<init>":()V
      26: checkcast     #56                 // class java/util/Collection
      29: astore        4
      31: iconst_0
      32: istore        5
      34: aload_3
      35: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      40: astore        6
      42: aload         6
      44: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      49: ifeq          201
      52: aload         6
      54: checkcast     #127                // class kotlin/collections/IntIterator
      57: invokevirtual #130                // Method kotlin/collections/IntIterator.nextInt:()I
      60: istore        7
      62: iload         7
      64: istore        8
      66: iconst_0
      67: istore        9
      69: new           #80                 // class kotlin/ranges/IntRange
      72: dup
      73: iconst_1
      74: sipush        400
      77: invokespecial #89                 // Method kotlin/ranges/IntRange."<init>":(II)V
      80: checkcast     #45                 // class java/lang/Iterable
      83: astore        10
      85: iconst_0
      86: istore        11
      88: aload         10
      90: astore        12
      92: new           #47                 // class java/util/ArrayList
      95: dup
      96: aload         10
      98: bipush        10
     100: invokestatic  #51                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     103: invokespecial #54                 // Method java/util/ArrayList."<init>":(I)V
     106: checkcast     #56                 // class java/util/Collection
     109: astore        13
     111: iconst_0
     112: istore        14
     114: aload         12
     116: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     121: astore        15
     123: aload         15
     125: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     130: ifeq          178
     133: aload         15
     135: checkcast     #127                // class kotlin/collections/IntIterator
     138: invokevirtual #130                // Method kotlin/collections/IntIterator.nextInt:()I
     141: istore        16
     143: aload         13
     145: iload         16
     147: istore        17
     149: astore        18
     151: iconst_0
     152: istore        19
     154: aload_0
     155: iload         8
     157: iload         17
     159: aload_0
     160: getfield      #102                // Field target:LDay17$BoundingBox;
     163: invokespecial #134                // Method checkStep:(IILDay17$BoundingBox;)Lkotlin/Pair;
     166: aload         18
     168: swap
     169: invokeinterface #93,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     174: pop
     175: goto          123
     178: aload         13
     180: checkcast     #74                 // class java/util/List
     183: nop
     184: checkcast     #45                 // class java/lang/Iterable
     187: nop
     188: astore        8
     190: aload         4
     192: aload         8
     194: invokestatic  #138                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     197: pop
     198: goto          42
     201: aload         4
     203: checkcast     #74                 // class java/util/List
     206: nop
     207: checkcast     #45                 // class java/lang/Iterable
     210: astore_1
     211: iconst_0
     212: istore_2
     213: iconst_0
     214: istore_3
     215: iload_2
     216: istore        4
     218: aload_1
     219: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     224: astore        5
     226: aload         5
     228: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     233: ifeq          299
     236: aload         5
     238: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     243: astore        6
     245: iload         4
     247: aload         6
     249: checkcast     #140                // class kotlin/Pair
     252: astore        7
     254: istore        8
     256: iconst_0
     257: istore        9
     259: aload         7
     261: invokevirtual #143                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     264: checkcast     #145                // class java/lang/Boolean
     267: invokevirtual #148                // Method java/lang/Boolean.booleanValue:()Z
     270: ifeq          292
     273: iload         8
     275: aload         7
     277: invokevirtual #151                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     280: checkcast     #153                // class java/lang/Number
     283: invokevirtual #156                // Method java/lang/Number.intValue:()I
     286: invokestatic  #162                // Method java/lang/Math.max:(II)I
     289: goto          294
     292: iload         8
     294: istore        4
     296: goto          226
     299: iload         4
     301: ireturn

  public final int part_2();
    Code:
       0: new           #80                 // class kotlin/ranges/IntRange
       3: dup
       4: iconst_1
       5: sipush        400
       8: invokespecial #89                 // Method kotlin/ranges/IntRange."<init>":(II)V
      11: checkcast     #45                 // class java/lang/Iterable
      14: astore_1
      15: iconst_0
      16: istore_2
      17: aload_1
      18: astore_3
      19: new           #47                 // class java/util/ArrayList
      22: dup
      23: invokespecial #125                // Method java/util/ArrayList."<init>":()V
      26: checkcast     #56                 // class java/util/Collection
      29: astore        4
      31: iconst_0
      32: istore        5
      34: aload_3
      35: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      40: astore        6
      42: aload         6
      44: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      49: ifeq          215
      52: aload         6
      54: checkcast     #127                // class kotlin/collections/IntIterator
      57: invokevirtual #130                // Method kotlin/collections/IntIterator.nextInt:()I
      60: istore        7
      62: iload         7
      64: istore        8
      66: iconst_0
      67: istore        9
      69: new           #80                 // class kotlin/ranges/IntRange
      72: dup
      73: sipush        -400
      76: sipush        400
      79: invokespecial #89                 // Method kotlin/ranges/IntRange."<init>":(II)V
      82: checkcast     #45                 // class java/lang/Iterable
      85: astore        10
      87: iconst_0
      88: istore        11
      90: aload         10
      92: astore        12
      94: new           #47                 // class java/util/ArrayList
      97: dup
      98: aload         10
     100: bipush        10
     102: invokestatic  #51                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     105: invokespecial #54                 // Method java/util/ArrayList."<init>":(I)V
     108: checkcast     #56                 // class java/util/Collection
     111: astore        13
     113: iconst_0
     114: istore        14
     116: aload         12
     118: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     123: astore        15
     125: aload         15
     127: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     132: ifeq          192
     135: aload         15
     137: checkcast     #127                // class kotlin/collections/IntIterator
     140: invokevirtual #130                // Method kotlin/collections/IntIterator.nextInt:()I
     143: istore        16
     145: aload         13
     147: iload         16
     149: istore        17
     151: astore        18
     153: iconst_0
     154: istore        19
     156: aload_0
     157: iload         8
     159: iload         17
     161: aload_0
     162: getfield      #102                // Field target:LDay17$BoundingBox;
     165: invokespecial #134                // Method checkStep:(IILDay17$BoundingBox;)Lkotlin/Pair;
     168: invokevirtual #143                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     171: checkcast     #145                // class java/lang/Boolean
     174: invokevirtual #148                // Method java/lang/Boolean.booleanValue:()Z
     177: invokestatic  #185                // Method java/lang/Boolean.valueOf:(Z)Ljava/lang/Boolean;
     180: aload         18
     182: swap
     183: invokeinterface #93,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     188: pop
     189: goto          125
     192: aload         13
     194: checkcast     #74                 // class java/util/List
     197: nop
     198: checkcast     #45                 // class java/lang/Iterable
     201: nop
     202: astore        8
     204: aload         4
     206: aload         8
     208: invokestatic  #138                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     211: pop
     212: goto          42
     215: aload         4
     217: checkcast     #74                 // class java/util/List
     220: nop
     221: checkcast     #45                 // class java/lang/Iterable
     224: astore_1
     225: nop
     226: iconst_0
     227: istore_2
     228: aload_1
     229: instanceof    #56                 // class java/util/Collection
     232: ifeq          251
     235: aload_1
     236: checkcast     #56                 // class java/util/Collection
     239: invokeinterface #188,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     244: ifeq          251
     247: iconst_0
     248: goto          312
     251: iconst_0
     252: istore_3
     253: aload_1
     254: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     259: astore        4
     261: aload         4
     263: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     268: ifeq          311
     271: aload         4
     273: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     278: astore        5
     280: aload         5
     282: checkcast     #145                // class java/lang/Boolean
     285: invokevirtual #148                // Method java/lang/Boolean.booleanValue:()Z
     288: istore        6
     290: iconst_0
     291: istore        7
     293: iload         6
     295: ifeq          261
     298: iinc          3, 1
     301: iload_3
     302: ifge          261
     305: invokestatic  #191                // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V
     308: goto          261
     311: iload_3
     312: ireturn

  private final kotlin.Pair<java.lang.Boolean, java.lang.Integer> checkStep(int, int, Day17$BoundingBox);
    Code:
       0: new           #201                // class Day17$Coord
       3: dup
       4: iconst_0
       5: iconst_0
       6: invokespecial #202                // Method Day17$Coord."<init>":(II)V
       9: astore        4
      11: new           #204                // class Day17$Velocity
      14: dup
      15: iload_1
      16: iload_2
      17: invokespecial #205                // Method Day17$Velocity."<init>":(II)V
      20: astore        5
      22: iconst_0
      23: istore        6
      25: iconst_0
      26: istore        7
      28: aload         4
      30: invokevirtual #208                // Method Day17$Coord.getX:()I
      33: aload_3
      34: invokevirtual #212                // Method Day17$BoundingBox.getXRange:()Lkotlin/ranges/IntRange;
      37: invokevirtual #215                // Method kotlin/ranges/IntRange.getLast:()I
      40: if_icmpgt     257
      43: aload         4
      45: invokevirtual #218                // Method Day17$Coord.getY:()I
      48: aload_3
      49: invokevirtual #221                // Method Day17$BoundingBox.getYRange:()Lkotlin/ranges/IntRange;
      52: invokevirtual #223                // Method kotlin/ranges/IntRange.getFirst:()I
      55: if_icmplt     257
      58: aload         4
      60: aload         4
      62: invokevirtual #208                // Method Day17$Coord.getX:()I
      65: aload         5
      67: invokevirtual #224                // Method Day17$Velocity.getX:()I
      70: iadd
      71: invokevirtual #227                // Method Day17$Coord.setX:(I)V
      74: aload         4
      76: aload         4
      78: invokevirtual #218                // Method Day17$Coord.getY:()I
      81: aload         5
      83: invokevirtual #228                // Method Day17$Velocity.getY:()I
      86: iadd
      87: invokevirtual #231                // Method Day17$Coord.setY:(I)V
      90: aload         4
      92: invokevirtual #218                // Method Day17$Coord.getY:()I
      95: iload         6
      97: invokestatic  #162                // Method java/lang/Math.max:(II)I
     100: istore        6
     102: aload_3
     103: invokevirtual #212                // Method Day17$BoundingBox.getXRange:()Lkotlin/ranges/IntRange;
     106: astore        8
     108: aload         8
     110: invokevirtual #223                // Method kotlin/ranges/IntRange.getFirst:()I
     113: istore        9
     115: aload         8
     117: invokevirtual #215                // Method kotlin/ranges/IntRange.getLast:()I
     120: istore        10
     122: aload         4
     124: invokevirtual #208                // Method Day17$Coord.getX:()I
     127: istore        11
     129: iload         9
     131: iload         11
     133: if_icmpgt     151
     136: iload         11
     138: iload         10
     140: if_icmpgt     147
     143: iconst_1
     144: goto          152
     147: iconst_0
     148: goto          152
     151: iconst_0
     152: ifeq          214
     155: aload_3
     156: invokevirtual #221                // Method Day17$BoundingBox.getYRange:()Lkotlin/ranges/IntRange;
     159: astore        8
     161: aload         8
     163: invokevirtual #223                // Method kotlin/ranges/IntRange.getFirst:()I
     166: istore        9
     168: aload         8
     170: invokevirtual #215                // Method kotlin/ranges/IntRange.getLast:()I
     173: istore        10
     175: aload         4
     177: invokevirtual #218                // Method Day17$Coord.getY:()I
     180: istore        11
     182: iload         9
     184: iload         11
     186: if_icmpgt     204
     189: iload         11
     191: iload         10
     193: if_icmpgt     200
     196: iconst_1
     197: goto          205
     200: iconst_0
     201: goto          205
     204: iconst_0
     205: ifeq          214
     208: iconst_1
     209: istore        7
     211: goto          257
     214: aload         5
     216: invokevirtual #224                // Method Day17$Velocity.getX:()I
     219: ifle          238
     222: aload         5
     224: invokevirtual #224                // Method Day17$Velocity.getX:()I
     227: istore        8
     229: aload         5
     231: iload         8
     233: iconst_m1
     234: iadd
     235: invokevirtual #232                // Method Day17$Velocity.setX:(I)V
     238: aload         5
     240: invokevirtual #228                // Method Day17$Velocity.getY:()I
     243: istore        8
     245: aload         5
     247: iload         8
     249: iconst_m1
     250: iadd
     251: invokevirtual #233                // Method Day17$Velocity.setY:(I)V
     254: goto          28
     257: new           #140                // class kotlin/Pair
     260: dup
     261: iload         7
     263: invokestatic  #185                // Method java/lang/Boolean.valueOf:(Z)Ljava/lang/Boolean;
     266: iload         6
     268: invokestatic  #236                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     271: invokespecial #239                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     274: areturn
}

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

  private 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 void setX(int);
    Code:
       0: aload_0
       1: iload_1
       2: putfield      #13                 // Field x:I
       5: return

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

  public final void setY(int);
    Code:
       0: aload_0
       1: iload_1
       2: putfield      #16                 // Field y:I
       5: 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 #32                 // 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 #36                 // Method copy:(II)LDay17$Coord;
      28: areturn

  public java.lang.String toString();
    Code:
       0: new           #40                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #41                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #43                 // String Coord(x=
       9: invokevirtual #47                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field x:I
      16: invokevirtual #50                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #52                 // String , y=
      21: invokevirtual #47                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #16                 // Field y:I
      28: invokevirtual #50                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #55                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #57                 // 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  #63                 // 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  #63                 // 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 "day17.kt"
public final class Day17$BoundingBox {
  private final kotlin.ranges.IntRange xRange;

  private final kotlin.ranges.IntRange yRange;

  public Day17$BoundingBox(kotlin.ranges.IntRange, kotlin.ranges.IntRange);
    Code:
       0: aload_1
       1: ldc           #9                  // String xRange
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #17                 // String yRange
       9: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_0
      13: invokespecial #20                 // Method java/lang/Object."<init>":()V
      16: aload_0
      17: aload_1
      18: putfield      #23                 // Field xRange:Lkotlin/ranges/IntRange;
      21: aload_0
      22: aload_2
      23: putfield      #25                 // Field yRange:Lkotlin/ranges/IntRange;
      26: return

  public final kotlin.ranges.IntRange getXRange();
    Code:
       0: aload_0
       1: getfield      #23                 // Field xRange:Lkotlin/ranges/IntRange;
       4: areturn

  public final kotlin.ranges.IntRange getYRange();
    Code:
       0: aload_0
       1: getfield      #25                 // Field yRange:Lkotlin/ranges/IntRange;
       4: areturn

  public final kotlin.ranges.IntRange component1();
    Code:
       0: aload_0
       1: getfield      #23                 // Field xRange:Lkotlin/ranges/IntRange;
       4: areturn

  public final kotlin.ranges.IntRange component2();
    Code:
       0: aload_0
       1: getfield      #25                 // Field yRange:Lkotlin/ranges/IntRange;
       4: areturn

  public final Day17$BoundingBox copy(kotlin.ranges.IntRange, kotlin.ranges.IntRange);
    Code:
       0: aload_1
       1: ldc           #9                  // String xRange
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #17                 // String yRange
       9: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: new           #2                  // class Day17$BoundingBox
      15: dup
      16: aload_1
      17: aload_2
      18: invokespecial #36                 // Method "<init>":(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)V
      21: areturn

  public static Day17$BoundingBox copy$default(Day17$BoundingBox, kotlin.ranges.IntRange, kotlin.ranges.IntRange, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #23                 // Field xRange:Lkotlin/ranges/IntRange;
      10: astore_1
      11: iload_3
      12: iconst_2
      13: iand
      14: ifeq          22
      17: aload_0
      18: getfield      #25                 // Field yRange:Lkotlin/ranges/IntRange;
      21: astore_2
      22: aload_0
      23: aload_1
      24: aload_2
      25: invokevirtual #40                 // Method copy:(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)LDay17$BoundingBox;
      28: areturn

  public java.lang.String toString();
    Code:
       0: new           #44                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #45                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #47                 // String BoundingBox(xRange=
       9: invokevirtual #51                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #23                 // Field xRange:Lkotlin/ranges/IntRange;
      16: invokevirtual #54                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      19: ldc           #56                 // String , yRange=
      21: invokevirtual #51                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #25                 // Field yRange:Lkotlin/ranges/IntRange;
      28: invokevirtual #54                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #59                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #61                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      39: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #23                 // Field xRange:Lkotlin/ranges/IntRange;
       4: invokevirtual #67                 // Method kotlin/ranges/IntRange.hashCode:()I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #25                 // Field yRange:Lkotlin/ranges/IntRange;
      16: invokevirtual #67                 // Method kotlin/ranges/IntRange.hashCode:()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$BoundingBox
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day17$BoundingBox
      20: astore_2
      21: aload_0
      22: getfield      #23                 // Field xRange:Lkotlin/ranges/IntRange;
      25: aload_2
      26: getfield      #23                 // Field xRange:Lkotlin/ranges/IntRange;
      29: invokestatic  #76                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      32: ifne          37
      35: iconst_0
      36: ireturn
      37: aload_0
      38: getfield      #25                 // Field yRange:Lkotlin/ranges/IntRange;
      41: aload_2
      42: getfield      #25                 // Field yRange:Lkotlin/ranges/IntRange;
      45: invokestatic  #76                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      48: ifne          53
      51: iconst_0
      52: ireturn
      53: iconst_1
      54: ireturn
}

Compiled from "day17.kt"
public final class Day17Kt {
  public static final void print_day_17();
    Code:
       0: ldc           #8                  // String \u001b[33m
       2: astore_0
       3: ldc           #10                 // String \u001b[0m
       5: astore_1
       6: ldc           #12                 // String \u001b[32m
       8: astore_2
       9: new           #14                 // class java/lang/StringBuilder
      12: dup
      13: invokespecial #17                 // Method java/lang/StringBuilder."<init>":()V
      16: aload_0
      17: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      20: ldc           #23                 // String -
      22: checkcast     #25                 // class java/lang/CharSequence
      25: bipush        25
      27: invokestatic  #31                 // Method kotlin/text/StringsKt.repeat:(Ljava/lang/CharSequence;I)Ljava/lang/String;
      30: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      33: ldc           #33                 // String Advent of Code - Day 17
      35: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      38: ldc           #23                 // String -
      40: checkcast     #25                 // class java/lang/CharSequence
      43: bipush        25
      45: invokestatic  #31                 // Method kotlin/text/StringsKt.repeat:(Ljava/lang/CharSequence;I)Ljava/lang/String;
      48: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      51: aload_1
      52: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      55: invokevirtual #37                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      58: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      61: swap
      62: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      65: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      68: aload_2
      69: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      72: invokestatic  #55                 // Method java/lang/Runtime.getRuntime:()Ljava/lang/Runtime;
      75: ldc           #57                 // String figlet Trick Shot -c -f small
      77: invokevirtual #61                 // Method java/lang/Runtime.exec:(Ljava/lang/String;)Ljava/lang/Process;
      80: astore_3
      81: new           #63                 // class java/io/BufferedReader
      84: dup
      85: new           #65                 // class java/io/InputStreamReader
      88: dup
      89: aload_3
      90: invokevirtual #71                 // Method java/lang/Process.getInputStream:()Ljava/io/InputStream;
      93: invokespecial #74                 // Method java/io/InputStreamReader."<init>":(Ljava/io/InputStream;)V
      96: checkcast     #76                 // class java/io/Reader
      99: invokespecial #79                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;)V
     102: astore        4
     104: aload         4
     106: checkcast     #76                 // class java/io/Reader
     109: invokedynamic #98,  0             // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
     114: invokestatic  #104                // Method kotlin/io/TextStreamsKt.forEachLine:(Ljava/io/Reader;Lkotlin/jvm/functions/Function1;)V
     117: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     120: aload_1
     121: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     124: new           #14                 // class java/lang/StringBuilder
     127: dup
     128: invokespecial #17                 // Method java/lang/StringBuilder."<init>":()V
     131: aload_0
     132: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     135: ldc           #23                 // String -
     137: checkcast     #25                 // class java/lang/CharSequence
     140: bipush        33
     142: invokestatic  #31                 // Method kotlin/text/StringsKt.repeat:(Ljava/lang/CharSequence;I)Ljava/lang/String;
     145: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     148: ldc           #106                // String Output
     150: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     153: ldc           #23                 // String -
     155: checkcast     #25                 // class java/lang/CharSequence
     158: bipush        33
     160: invokestatic  #31                 // Method kotlin/text/StringsKt.repeat:(Ljava/lang/CharSequence;I)Ljava/lang/String;
     163: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     166: aload_1
     167: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     170: bipush        10
     172: invokevirtual #109                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     175: invokevirtual #37                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     178: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     181: swap
     182: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     185: return

  public static final void main();
    Code:
       0: invokestatic  #120                // Method print_day_17:()V
       3: new           #14                 // class java/lang/StringBuilder
       6: dup
       7: invokespecial #17                 // Method java/lang/StringBuilder."<init>":()V
      10: ldc           #122                // String Puzzle 1:
      12: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      15: new           #124                // class Day17
      18: dup
      19: invokespecial #125                // Method Day17."<init>":()V
      22: invokevirtual #129                // Method Day17.part_1:()I
      25: invokevirtual #132                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      28: invokevirtual #37                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      31: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      34: swap
      35: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      38: new           #14                 // class java/lang/StringBuilder
      41: dup
      42: invokespecial #17                 // Method java/lang/StringBuilder."<init>":()V
      45: ldc           #134                // String Puzzle 2:
      47: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      50: new           #124                // class Day17
      53: dup
      54: invokespecial #125                // Method Day17."<init>":()V
      57: invokevirtual #137                // Method Day17.part_2:()I
      60: invokevirtual #132                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      63: invokevirtual #37                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      66: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      69: swap
      70: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      73: new           #14                 // class java/lang/StringBuilder
      76: dup
      77: invokespecial #17                 // Method java/lang/StringBuilder."<init>":()V
      80: ldc           #139                // String \n\u001b[33m
      82: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      85: ldc           #141                // String =
      87: checkcast     #25                 // class java/lang/CharSequence
      90: bipush        72
      92: invokestatic  #31                 // Method kotlin/text/StringsKt.repeat:(Ljava/lang/CharSequence;I)Ljava/lang/String;
      95: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      98: ldc           #143                // String \u001b[0m\n
     100: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     103: invokevirtual #37                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     106: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     109: swap
     110: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     113: return

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

  private static final kotlin.Unit print_day_17$lambda$0(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #150                // String it
       3: invokestatic  #156                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
       9: aload_0
      10: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      13: getstatic     #162                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      16: areturn
}

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

  private int y;

  public Day17$Velocity(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 void setX(int);
    Code:
       0: aload_0
       1: iload_1
       2: putfield      #13                 // Field x:I
       5: return

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

  public final void setY(int);
    Code:
       0: aload_0
       1: iload_1
       2: putfield      #16                 // Field y:I
       5: 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$Velocity copy(int, int);
    Code:
       0: new           #2                  // class Day17$Velocity
       3: dup
       4: iload_1
       5: iload_2
       6: invokespecial #32                 // Method "<init>":(II)V
       9: areturn

  public static Day17$Velocity copy$default(Day17$Velocity, 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 #36                 // Method copy:(II)LDay17$Velocity;
      28: areturn

  public java.lang.String toString();
    Code:
       0: new           #40                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #41                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #43                 // String Velocity(x=
       9: invokevirtual #47                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field x:I
      16: invokevirtual #50                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #52                 // String , y=
      21: invokevirtual #47                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #16                 // Field y:I
      28: invokevirtual #50                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #55                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #57                 // 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  #63                 // 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  #63                 // 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$Velocity
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day17$Velocity
      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
}