import java.util.*
import kotlin.String
import kotlin.collections.List
import kotlin.math.min

object Day17 {
    enum class Direction {
        UP,
        DOWN,
        LEFT,
        RIGHT
    }

    data class CurrentStepInformation(
        val currentCoordinate: Coordinate,
        val currentDirection: Direction,
        val consecutiveDirectionSteps: Int,
        val heatLoss: Int
    ) {
    }

    data class Coordinate(val x: Int, val y: Int)

    fun part1(input: List<String>): String {
        val endCoordinate = Coordinate(input[0].length - 1, input.size - 1)
        return minimumHeatLoss(input, endCoordinate, maxConsecutiveSteps = 3).toString()
    }

    private fun minimumHeatLoss(
        grid: List<String>,
        endCoordinate: Coordinate,
        maxConsecutiveSteps: Int,
        minConsecutiveSteps: Int = 0
    ): Int {
        val heap = PriorityQueue<CurrentStepInformation> { o1, o2 ->
            o1.heatLoss.compareTo(o2.heatLoss)
        }
        heap.add(
            CurrentStepInformation(
                Coordinate(1, 0),
                Direction.RIGHT,
                1,
                0
            )
        )
        heap.add(
            CurrentStepInformation(
                Coordinate(0, 1),
                Direction.DOWN,
                1,
                0
            )
        )
        var minValue = Int.MAX_VALUE
        val memo = mutableMapOf<CurrentStepInformation, Int>()
        while (heap.isNotEmpty()) {
            val currentStepInformation = heap.poll()
            val currentCoordinate = currentStepInformation.currentCoordinate
            val heatLoss =
                grid[currentCoordinate.y][currentCoordinate.x].digitToInt()
            val memoKey = currentStepInformation.copy(heatLoss = 0)
            // If we have already been here with less heat loss, we can skip this
            // Especially if we have already been here with the same heat loss but less consecutive steps, because
            // if a path had more possibilites and a smaller heat loss it makes no sense to search the space
            val tooExpensive =
                (minConsecutiveSteps..memoKey.consecutiveDirectionSteps - 1).map {
                    memoKey.copy(
                        consecutiveDirectionSteps = it
                    )
                }
                    .any {
                        memo.containsKey(it) && memo[it]!! <= currentStepInformation.heatLoss + heatLoss
                    } || (memo[memoKey] ?: Int.MAX_VALUE) <= currentStepInformation.heatLoss + heatLoss
            if (tooExpensive) {
                continue
            }

            memo.put(memoKey, currentStepInformation.heatLoss + heatLoss)

            if (currentCoordinate == endCoordinate) {
                if (currentStepInformation.consecutiveDirectionSteps < minConsecutiveSteps) {
                    continue
                }
                minValue = min(minValue, currentStepInformation.heatLoss + heatLoss)
                continue
            }

            val nextCoordinates = listOf(
                currentCoordinate.copy(x = currentCoordinate.x + 1) to Direction.RIGHT,
                currentCoordinate.copy(y = currentCoordinate.y + 1) to Direction.DOWN,
                currentCoordinate.copy(x = currentCoordinate.x - 1) to Direction.LEFT,
                currentCoordinate.copy(y = currentCoordinate.y - 1) to Direction.UP
            ).filter { (_, direction) ->
                // We cannot reverse directions
                when (direction) {
                    Direction.UP -> currentStepInformation.currentDirection != Direction.DOWN
                    Direction.DOWN -> currentStepInformation.currentDirection != Direction.UP
                    Direction.LEFT -> currentStepInformation.currentDirection != Direction.RIGHT
                    Direction.RIGHT -> currentStepInformation.currentDirection != Direction.LEFT
                }
            }.map { (coordinate, direction) ->
                CurrentStepInformation(
                    coordinate,
                    direction,
                    if (direction == currentStepInformation.currentDirection) currentStepInformation.consecutiveDirectionSteps + 1 else 1,
                    currentStepInformation.heatLoss + heatLoss
                )
            }.filter {
                // We must move a minimum number of steps in the same direction
                it.currentDirection == currentStepInformation.currentDirection || currentStepInformation.consecutiveDirectionSteps >= minConsecutiveSteps
            }.filter {
                // We cannot move in the same direction more than maxConsecutiveSteps
                it.consecutiveDirectionSteps <= maxConsecutiveSteps
            }.filter {
                // We cannot move out of bounds
                it.currentCoordinate.x >= 0 && it.currentCoordinate.y >= 0 && it.currentCoordinate.y < grid.size && it.currentCoordinate.x < grid[it.currentCoordinate.y].length
            }
            heap.addAll(nextCoordinates)
        }
        return minValue
    }

    fun part2(input: List<String>): String {
        val endCoordinate = Coordinate(input[0].length - 1, input.size - 1)
        return minimumHeatLoss(
            input, endCoordinate, maxConsecutiveSteps = 10, minConsecutiveSteps = 4
        ).toString()
    }
}

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

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

  public final java.lang.String part1(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #16                 // String input
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #24                 // class Day17$Coordinate
       9: dup
      10: aload_1
      11: iconst_0
      12: invokeinterface #30,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      17: checkcast     #32                 // class java/lang/String
      20: invokevirtual #36                 // Method java/lang/String.length:()I
      23: iconst_1
      24: isub
      25: aload_1
      26: invokeinterface #39,  1           // InterfaceMethod java/util/List.size:()I
      31: iconst_1
      32: isub
      33: invokespecial #42                 // Method Day17$Coordinate."<init>":(II)V
      36: astore_2
      37: aload_0
      38: aload_1
      39: aload_2
      40: iconst_3
      41: iconst_0
      42: bipush        8
      44: aconst_null
      45: invokestatic  #46                 // Method minimumHeatLoss$default:(LDay17;Ljava/util/List;LDay17$Coordinate;IIILjava/lang/Object;)I
      48: invokestatic  #50                 // Method java/lang/String.valueOf:(I)Ljava/lang/String;
      51: areturn

  private final int minimumHeatLoss(java.util.List<java.lang.String>, Day17$Coordinate, int, int);
    Code:
       0: new           #58                 // class java/util/PriorityQueue
       3: dup
       4: invokedynamic #78,  0             // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function2;
       9: invokedynamic #89,  0             // InvokeDynamic #1:compare:(Lkotlin/jvm/functions/Function2;)Ljava/util/Comparator;
      14: invokespecial #92                 // Method java/util/PriorityQueue."<init>":(Ljava/util/Comparator;)V
      17: astore        5
      19: aload         5
      21: new           #94                 // class Day17$CurrentStepInformation
      24: dup
      25: new           #24                 // class Day17$Coordinate
      28: dup
      29: iconst_1
      30: iconst_0
      31: invokespecial #42                 // Method Day17$Coordinate."<init>":(II)V
      34: getstatic     #100                // Field Day17$Direction.RIGHT:LDay17$Direction;
      37: iconst_1
      38: iconst_0
      39: invokespecial #103                // Method Day17$CurrentStepInformation."<init>":(LDay17$Coordinate;LDay17$Direction;II)V
      42: invokevirtual #107                // Method java/util/PriorityQueue.add:(Ljava/lang/Object;)Z
      45: pop
      46: aload         5
      48: new           #94                 // class Day17$CurrentStepInformation
      51: dup
      52: new           #24                 // class Day17$Coordinate
      55: dup
      56: iconst_0
      57: iconst_1
      58: invokespecial #42                 // Method Day17$Coordinate."<init>":(II)V
      61: getstatic     #110                // Field Day17$Direction.DOWN:LDay17$Direction;
      64: iconst_1
      65: iconst_0
      66: invokespecial #103                // Method Day17$CurrentStepInformation."<init>":(LDay17$Coordinate;LDay17$Direction;II)V
      69: invokevirtual #107                // Method java/util/PriorityQueue.add:(Ljava/lang/Object;)Z
      72: pop
      73: ldc           #111                // int 2147483647
      75: istore        6
      77: new           #113                // class java/util/LinkedHashMap
      80: dup
      81: invokespecial #114                // Method java/util/LinkedHashMap."<init>":()V
      84: checkcast     #116                // class java/util/Map
      87: astore        7
      89: aload         5
      91: checkcast     #118                // class java/util/Collection
      94: invokeinterface #122,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
      99: ifne          106
     102: iconst_1
     103: goto          107
     106: iconst_0
     107: ifeq          1420
     110: aload         5
     112: invokevirtual #126                // Method java/util/PriorityQueue.poll:()Ljava/lang/Object;
     115: checkcast     #94                 // class Day17$CurrentStepInformation
     118: astore        8
     120: aload         8
     122: invokevirtual #130                // Method Day17$CurrentStepInformation.getCurrentCoordinate:()LDay17$Coordinate;
     125: astore        9
     127: aload_1
     128: aload         9
     130: invokevirtual #133                // Method Day17$Coordinate.getY:()I
     133: invokeinterface #30,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     138: checkcast     #32                 // class java/lang/String
     141: aload         9
     143: invokevirtual #136                // Method Day17$Coordinate.getX:()I
     146: invokevirtual #140                // Method java/lang/String.charAt:(I)C
     149: invokestatic  #146                // Method kotlin/text/CharsKt.digitToInt:(C)I
     152: istore        10
     154: aload         8
     156: aconst_null
     157: aconst_null
     158: iconst_0
     159: iconst_0
     160: bipush        7
     162: aconst_null
     163: invokestatic  #150                // Method Day17$CurrentStepInformation.copy$default:(LDay17$CurrentStepInformation;LDay17$Coordinate;LDay17$Direction;IIILjava/lang/Object;)LDay17$CurrentStepInformation;
     166: astore        11
     168: new           #152                // class kotlin/ranges/IntRange
     171: dup
     172: iload         4
     174: aload         11
     176: invokevirtual #155                // Method Day17$CurrentStepInformation.getConsecutiveDirectionSteps:()I
     179: iconst_1
     180: isub
     181: invokespecial #156                // Method kotlin/ranges/IntRange."<init>":(II)V
     184: checkcast     #158                // class java/lang/Iterable
     187: astore        13
     189: iconst_0
     190: istore        14
     192: aload         13
     194: astore        15
     196: new           #160                // class java/util/ArrayList
     199: dup
     200: aload         13
     202: bipush        10
     204: invokestatic  #166                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     207: invokespecial #169                // Method java/util/ArrayList."<init>":(I)V
     210: checkcast     #118                // class java/util/Collection
     213: astore        16
     215: iconst_0
     216: istore        17
     218: aload         15
     220: invokeinterface #173,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     225: astore        18
     227: aload         18
     229: invokeinterface #178,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     234: ifeq          284
     237: aload         18
     239: checkcast     #180                // class kotlin/collections/IntIterator
     242: invokevirtual #183                // Method kotlin/collections/IntIterator.nextInt:()I
     245: istore        19
     247: aload         16
     249: iload         19
     251: istore        20
     253: astore        25
     255: iconst_0
     256: istore        21
     258: aload         11
     260: aconst_null
     261: aconst_null
     262: iload         20
     264: iconst_0
     265: bipush        11
     267: aconst_null
     268: invokestatic  #150                // Method Day17$CurrentStepInformation.copy$default:(LDay17$CurrentStepInformation;LDay17$Coordinate;LDay17$Direction;IIILjava/lang/Object;)LDay17$CurrentStepInformation;
     271: nop
     272: aload         25
     274: swap
     275: invokeinterface #184,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     280: pop
     281: goto          227
     284: aload         16
     286: checkcast     #26                 // class java/util/List
     289: nop
     290: checkcast     #158                // class java/lang/Iterable
     293: astore        13
     295: nop
     296: iconst_0
     297: istore        14
     299: aload         13
     301: instanceof    #118                // class java/util/Collection
     304: ifeq          324
     307: aload         13
     309: checkcast     #118                // class java/util/Collection
     312: invokeinterface #122,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     317: ifeq          324
     320: iconst_0
     321: goto          417
     324: aload         13
     326: invokeinterface #173,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     331: astore        15
     333: aload         15
     335: invokeinterface #178,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     340: ifeq          416
     343: aload         15
     345: invokeinterface #187,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     350: astore        16
     352: aload         16
     354: checkcast     #94                 // class Day17$CurrentStepInformation
     357: astore        17
     359: iconst_0
     360: istore        18
     362: aload         7
     364: aload         17
     366: invokeinterface #190,  2          // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
     371: ifeq          408
     374: aload         7
     376: aload         17
     378: invokeinterface #193,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     383: dup
     384: invokestatic  #197                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     387: checkcast     #199                // class java/lang/Number
     390: invokevirtual #202                // Method java/lang/Number.intValue:()I
     393: aload         8
     395: invokevirtual #205                // Method Day17$CurrentStepInformation.getHeatLoss:()I
     398: iload         10
     400: iadd
     401: if_icmpgt     408
     404: iconst_1
     405: goto          409
     408: iconst_0
     409: ifeq          333
     412: iconst_1
     413: goto          417
     416: iconst_0
     417: ifne          456
     420: aload         7
     422: aload         11
     424: invokeinterface #193,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     429: checkcast     #207                // class java/lang/Integer
     432: dup
     433: ifnull        442
     436: invokevirtual #208                // Method java/lang/Integer.intValue:()I
     439: goto          445
     442: pop
     443: ldc           #111                // int 2147483647
     445: aload         8
     447: invokevirtual #205                // Method Day17$CurrentStepInformation.getHeatLoss:()I
     450: iload         10
     452: iadd
     453: if_icmpgt     460
     456: iconst_1
     457: goto          461
     460: iconst_0
     461: istore        12
     463: iload         12
     465: ifeq          471
     468: goto          89
     471: aload         7
     473: aload         11
     475: aload         8
     477: invokevirtual #205                // Method Day17$CurrentStepInformation.getHeatLoss:()I
     480: iload         10
     482: iadd
     483: invokestatic  #211                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     486: invokeinterface #214,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     491: pop
     492: aload         9
     494: aload_2
     495: invokestatic  #218                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     498: ifeq          532
     501: aload         8
     503: invokevirtual #155                // Method Day17$CurrentStepInformation.getConsecutiveDirectionSteps:()I
     506: iload         4
     508: if_icmpge     514
     511: goto          89
     514: iload         6
     516: aload         8
     518: invokevirtual #205                // Method Day17$CurrentStepInformation.getHeatLoss:()I
     521: iload         10
     523: iadd
     524: invokestatic  #224                // Method java/lang/Math.min:(II)I
     527: istore        6
     529: goto          89
     532: iconst_4
     533: anewarray     #226                // class kotlin/Pair
     536: astore        14
     538: aload         14
     540: iconst_0
     541: aload         9
     543: aload         9
     545: invokevirtual #136                // Method Day17$Coordinate.getX:()I
     548: iconst_1
     549: iadd
     550: iconst_0
     551: iconst_2
     552: aconst_null
     553: invokestatic  #229                // Method Day17$Coordinate.copy$default:(LDay17$Coordinate;IIILjava/lang/Object;)LDay17$Coordinate;
     556: getstatic     #100                // Field Day17$Direction.RIGHT:LDay17$Direction;
     559: invokestatic  #235                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     562: aastore
     563: aload         14
     565: iconst_1
     566: aload         9
     568: iconst_0
     569: aload         9
     571: invokevirtual #133                // Method Day17$Coordinate.getY:()I
     574: iconst_1
     575: iadd
     576: iconst_1
     577: aconst_null
     578: invokestatic  #229                // Method Day17$Coordinate.copy$default:(LDay17$Coordinate;IIILjava/lang/Object;)LDay17$Coordinate;
     581: getstatic     #110                // Field Day17$Direction.DOWN:LDay17$Direction;
     584: invokestatic  #235                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     587: aastore
     588: aload         14
     590: iconst_2
     591: aload         9
     593: aload         9
     595: invokevirtual #136                // Method Day17$Coordinate.getX:()I
     598: iconst_1
     599: isub
     600: iconst_0
     601: iconst_2
     602: aconst_null
     603: invokestatic  #229                // Method Day17$Coordinate.copy$default:(LDay17$Coordinate;IIILjava/lang/Object;)LDay17$Coordinate;
     606: getstatic     #238                // Field Day17$Direction.LEFT:LDay17$Direction;
     609: invokestatic  #235                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     612: aastore
     613: aload         14
     615: iconst_3
     616: aload         9
     618: iconst_0
     619: aload         9
     621: invokevirtual #133                // Method Day17$Coordinate.getY:()I
     624: iconst_1
     625: isub
     626: iconst_1
     627: aconst_null
     628: invokestatic  #229                // Method Day17$Coordinate.copy$default:(LDay17$Coordinate;IIILjava/lang/Object;)LDay17$Coordinate;
     631: getstatic     #241                // Field Day17$Direction.UP:LDay17$Direction;
     634: invokestatic  #235                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     637: aastore
     638: aload         14
     640: invokestatic  #245                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     643: checkcast     #158                // class java/lang/Iterable
     646: astore        14
     648: nop
     649: iconst_0
     650: istore        15
     652: aload         14
     654: astore        16
     656: new           #160                // class java/util/ArrayList
     659: dup
     660: invokespecial #246                // Method java/util/ArrayList."<init>":()V
     663: checkcast     #118                // class java/util/Collection
     666: astore        17
     668: iconst_0
     669: istore        18
     671: aload         16
     673: invokeinterface #173,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     678: astore        19
     680: aload         19
     682: invokeinterface #178,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     687: ifeq          861
     690: aload         19
     692: invokeinterface #187,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     697: astore        20
     699: aload         20
     701: checkcast     #226                // class kotlin/Pair
     704: astore        21
     706: iconst_0
     707: istore        22
     709: aload         21
     711: invokevirtual #249                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     714: checkcast     #96                 // class Day17$Direction
     717: astore        23
     719: aload         23
     721: getstatic     #255                // Field Day17$WhenMappings.$EnumSwitchMapping$0:[I
     724: swap
     725: invokevirtual #258                // Method Day17$Direction.ordinal:()I
     728: iaload
     729: tableswitch   { // 1 to 4
                     1: 760
                     2: 779
                     3: 798
                     4: 817
               default: 836
          }
     760: aload         8
     762: invokevirtual #262                // Method Day17$CurrentStepInformation.getCurrentDirection:()LDay17$Direction;
     765: getstatic     #110                // Field Day17$Direction.DOWN:LDay17$Direction;
     768: if_acmpeq     775
     771: iconst_1
     772: goto          844
     775: iconst_0
     776: goto          844
     779: aload         8
     781: invokevirtual #262                // Method Day17$CurrentStepInformation.getCurrentDirection:()LDay17$Direction;
     784: getstatic     #241                // Field Day17$Direction.UP:LDay17$Direction;
     787: if_acmpeq     794
     790: iconst_1
     791: goto          844
     794: iconst_0
     795: goto          844
     798: aload         8
     800: invokevirtual #262                // Method Day17$CurrentStepInformation.getCurrentDirection:()LDay17$Direction;
     803: getstatic     #100                // Field Day17$Direction.RIGHT:LDay17$Direction;
     806: if_acmpeq     813
     809: iconst_1
     810: goto          844
     813: iconst_0
     814: goto          844
     817: aload         8
     819: invokevirtual #262                // Method Day17$CurrentStepInformation.getCurrentDirection:()LDay17$Direction;
     822: getstatic     #238                // Field Day17$Direction.LEFT:LDay17$Direction;
     825: if_acmpeq     832
     828: iconst_1
     829: goto          844
     832: iconst_0
     833: goto          844
     836: new           #264                // class kotlin/NoWhenBranchMatchedException
     839: dup
     840: invokespecial #265                // Method kotlin/NoWhenBranchMatchedException."<init>":()V
     843: athrow
     844: nop
     845: ifeq          680
     848: aload         17
     850: aload         20
     852: invokeinterface #184,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     857: pop
     858: goto          680
     861: aload         17
     863: checkcast     #26                 // class java/util/List
     866: nop
     867: checkcast     #158                // class java/lang/Iterable
     870: astore        14
     872: nop
     873: iconst_0
     874: istore        15
     876: aload         14
     878: astore        16
     880: new           #160                // class java/util/ArrayList
     883: dup
     884: aload         14
     886: bipush        10
     888: invokestatic  #166                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     891: invokespecial #169                // Method java/util/ArrayList."<init>":(I)V
     894: checkcast     #118                // class java/util/Collection
     897: astore        17
     899: iconst_0
     900: istore        18
     902: aload         16
     904: invokeinterface #173,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     909: astore        19
     911: aload         19
     913: invokeinterface #178,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     918: ifeq          1017
     921: aload         19
     923: invokeinterface #187,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     928: astore        20
     930: aload         17
     932: aload         20
     934: checkcast     #226                // class kotlin/Pair
     937: astore        21
     939: astore        25
     941: iconst_0
     942: istore        22
     944: aload         21
     946: invokevirtual #268                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     949: checkcast     #24                 // class Day17$Coordinate
     952: astore        23
     954: aload         21
     956: invokevirtual #249                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     959: checkcast     #96                 // class Day17$Direction
     962: astore        24
     964: new           #94                 // class Day17$CurrentStepInformation
     967: dup
     968: aload         23
     970: aload         24
     972: aload         24
     974: aload         8
     976: invokevirtual #262                // Method Day17$CurrentStepInformation.getCurrentDirection:()LDay17$Direction;
     979: if_acmpne     992
     982: aload         8
     984: invokevirtual #155                // Method Day17$CurrentStepInformation.getConsecutiveDirectionSteps:()I
     987: iconst_1
     988: iadd
     989: goto          993
     992: iconst_1
     993: aload         8
     995: invokevirtual #205                // Method Day17$CurrentStepInformation.getHeatLoss:()I
     998: iload         10
    1000: iadd
    1001: invokespecial #103                // Method Day17$CurrentStepInformation."<init>":(LDay17$Coordinate;LDay17$Direction;II)V
    1004: nop
    1005: aload         25
    1007: swap
    1008: invokeinterface #184,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1013: pop
    1014: goto          911
    1017: aload         17
    1019: checkcast     #26                 // class java/util/List
    1022: nop
    1023: checkcast     #158                // class java/lang/Iterable
    1026: astore        14
    1028: nop
    1029: iconst_0
    1030: istore        15
    1032: aload         14
    1034: astore        16
    1036: new           #160                // class java/util/ArrayList
    1039: dup
    1040: invokespecial #246                // Method java/util/ArrayList."<init>":()V
    1043: checkcast     #118                // class java/util/Collection
    1046: astore        17
    1048: iconst_0
    1049: istore        18
    1051: aload         16
    1053: invokeinterface #173,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1058: astore        19
    1060: aload         19
    1062: invokeinterface #178,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
    1067: ifeq          1133
    1070: aload         19
    1072: invokeinterface #187,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1077: astore        20
    1079: aload         20
    1081: checkcast     #94                 // class Day17$CurrentStepInformation
    1084: astore        21
    1086: iconst_0
    1087: istore        22
    1089: aload         21
    1091: invokevirtual #262                // Method Day17$CurrentStepInformation.getCurrentDirection:()LDay17$Direction;
    1094: aload         8
    1096: invokevirtual #262                // Method Day17$CurrentStepInformation.getCurrentDirection:()LDay17$Direction;
    1099: if_acmpeq     1112
    1102: aload         8
    1104: invokevirtual #155                // Method Day17$CurrentStepInformation.getConsecutiveDirectionSteps:()I
    1107: iload         4
    1109: if_icmplt     1116
    1112: iconst_1
    1113: goto          1117
    1116: iconst_0
    1117: ifeq          1060
    1120: aload         17
    1122: aload         20
    1124: invokeinterface #184,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1129: pop
    1130: goto          1060
    1133: aload         17
    1135: checkcast     #26                 // class java/util/List
    1138: nop
    1139: checkcast     #158                // class java/lang/Iterable
    1142: astore        14
    1144: nop
    1145: iconst_0
    1146: istore        15
    1148: aload         14
    1150: astore        16
    1152: new           #160                // class java/util/ArrayList
    1155: dup
    1156: invokespecial #246                // Method java/util/ArrayList."<init>":()V
    1159: checkcast     #118                // class java/util/Collection
    1162: astore        17
    1164: iconst_0
    1165: istore        18
    1167: aload         16
    1169: invokeinterface #173,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1174: astore        19
    1176: aload         19
    1178: invokeinterface #178,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
    1183: ifeq          1235
    1186: aload         19
    1188: invokeinterface #187,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1193: astore        20
    1195: aload         20
    1197: checkcast     #94                 // class Day17$CurrentStepInformation
    1200: astore        21
    1202: iconst_0
    1203: istore        22
    1205: aload         21
    1207: invokevirtual #155                // Method Day17$CurrentStepInformation.getConsecutiveDirectionSteps:()I
    1210: iload_3
    1211: if_icmpgt     1218
    1214: iconst_1
    1215: goto          1219
    1218: iconst_0
    1219: ifeq          1176
    1222: aload         17
    1224: aload         20
    1226: invokeinterface #184,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1231: pop
    1232: goto          1176
    1235: aload         17
    1237: checkcast     #26                 // class java/util/List
    1240: nop
    1241: checkcast     #158                // class java/lang/Iterable
    1244: astore        14
    1246: nop
    1247: iconst_0
    1248: istore        15
    1250: aload         14
    1252: astore        16
    1254: new           #160                // class java/util/ArrayList
    1257: dup
    1258: invokespecial #246                // Method java/util/ArrayList."<init>":()V
    1261: checkcast     #118                // class java/util/Collection
    1264: astore        17
    1266: iconst_0
    1267: istore        18
    1269: aload         16
    1271: invokeinterface #173,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1276: astore        19
    1278: aload         19
    1280: invokeinterface #178,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
    1285: ifeq          1398
    1288: aload         19
    1290: invokeinterface #187,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1295: astore        20
    1297: aload         20
    1299: checkcast     #94                 // class Day17$CurrentStepInformation
    1302: astore        21
    1304: iconst_0
    1305: istore        22
    1307: aload         21
    1309: invokevirtual #130                // Method Day17$CurrentStepInformation.getCurrentCoordinate:()LDay17$Coordinate;
    1312: invokevirtual #136                // Method Day17$Coordinate.getX:()I
    1315: iflt          1381
    1318: aload         21
    1320: invokevirtual #130                // Method Day17$CurrentStepInformation.getCurrentCoordinate:()LDay17$Coordinate;
    1323: invokevirtual #133                // Method Day17$Coordinate.getY:()I
    1326: iflt          1381
    1329: aload         21
    1331: invokevirtual #130                // Method Day17$CurrentStepInformation.getCurrentCoordinate:()LDay17$Coordinate;
    1334: invokevirtual #133                // Method Day17$Coordinate.getY:()I
    1337: aload_1
    1338: invokeinterface #39,  1           // InterfaceMethod java/util/List.size:()I
    1343: if_icmpge     1381
    1346: aload         21
    1348: invokevirtual #130                // Method Day17$CurrentStepInformation.getCurrentCoordinate:()LDay17$Coordinate;
    1351: invokevirtual #136                // Method Day17$Coordinate.getX:()I
    1354: aload_1
    1355: aload         21
    1357: invokevirtual #130                // Method Day17$CurrentStepInformation.getCurrentCoordinate:()LDay17$Coordinate;
    1360: invokevirtual #133                // Method Day17$Coordinate.getY:()I
    1363: invokeinterface #30,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
    1368: checkcast     #32                 // class java/lang/String
    1371: invokevirtual #36                 // Method java/lang/String.length:()I
    1374: if_icmpge     1381
    1377: iconst_1
    1378: goto          1382
    1381: iconst_0
    1382: ifeq          1278
    1385: aload         17
    1387: aload         20
    1389: invokeinterface #184,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1394: pop
    1395: goto          1278
    1398: aload         17
    1400: checkcast     #26                 // class java/util/List
    1403: nop
    1404: astore        13
    1406: aload         5
    1408: aload         13
    1410: checkcast     #118                // class java/util/Collection
    1413: invokevirtual #272                // Method java/util/PriorityQueue.addAll:(Ljava/util/Collection;)Z
    1416: pop
    1417: goto          89
    1420: iload         6
    1422: ireturn

  static int minimumHeatLoss$default(Day17, java.util.List, Day17$Coordinate, int, int, int, java.lang.Object);
    Code:
       0: iload         5
       2: bipush        8
       4: iand
       5: ifeq          11
       8: iconst_0
       9: istore        4
      11: aload_0
      12: aload_1
      13: aload_2
      14: iload_3
      15: iload         4
      17: invokespecial #318                // Method minimumHeatLoss:(Ljava/util/List;LDay17$Coordinate;II)I
      20: ireturn

  public final java.lang.String part2(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #16                 // String input
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #24                 // class Day17$Coordinate
       9: dup
      10: aload_1
      11: iconst_0
      12: invokeinterface #30,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      17: checkcast     #32                 // class java/lang/String
      20: invokevirtual #36                 // Method java/lang/String.length:()I
      23: iconst_1
      24: isub
      25: aload_1
      26: invokeinterface #39,  1           // InterfaceMethod java/util/List.size:()I
      31: iconst_1
      32: isub
      33: invokespecial #42                 // Method Day17$Coordinate."<init>":(II)V
      36: astore_2
      37: aload_0
      38: aload_1
      39: aload_2
      40: bipush        10
      42: iconst_4
      43: invokespecial #318                // Method minimumHeatLoss:(Ljava/util/List;LDay17$Coordinate;II)I
      46: invokestatic  #50                 // Method java/lang/String.valueOf:(I)Ljava/lang/String;
      49: areturn

  private static final int minimumHeatLoss$lambda$0(Day17$CurrentStepInformation, Day17$CurrentStepInformation);
    Code:
       0: aload_0
       1: invokevirtual #205                // Method Day17$CurrentStepInformation.getHeatLoss:()I
       4: aload_1
       5: invokevirtual #205                // Method Day17$CurrentStepInformation.getHeatLoss:()I
       8: invokestatic  #321                // Method kotlin/jvm/internal/Intrinsics.compare:(II)I
      11: ireturn

  private static final int minimumHeatLoss$lambda$1(kotlin.jvm.functions.Function2, java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: aload_2
       3: invokeinterface #327,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
       8: checkcast     #199                // class java/lang/Number
      11: invokevirtual #202                // Method java/lang/Number.intValue:()I
      14: ireturn

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

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

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

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

  private final int y;

  public Day17$Coordinate(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 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$Coordinate copy(int, int);
    Code:
       0: new           #2                  // class Day17$Coordinate
       3: dup
       4: iload_1
       5: iload_2
       6: invokespecial #28                 // Method "<init>":(II)V
       9: areturn

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

  public java.lang.String toString();
    Code:
       0: new           #36                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #37                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #39                 // String Coordinate(x=
       9: invokevirtual #43                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field x:I
      16: invokevirtual #46                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #48                 // String , y=
      21: invokevirtual #43                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #16                 // Field y:I
      28: invokevirtual #46                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #51                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #53                 // 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  #59                 // 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  #59                 // 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$Coordinate
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day17$Coordinate
      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$Direction extends java.lang.Enum<Day17$Direction> {
  public static final Day17$Direction UP;

  public static final Day17$Direction DOWN;

  public static final Day17$Direction LEFT;

  public static final Day17$Direction RIGHT;

  private static final Day17$Direction[] $VALUES;

  private static final kotlin.enums.EnumEntries $ENTRIES;

  private Day17$Direction();
    Code:
       0: aload_0
       1: aload_1
       2: iload_2
       3: invokespecial #10                 // Method java/lang/Enum."<init>":(Ljava/lang/String;I)V
       6: return

  public static Day17$Direction[] values();
    Code:
       0: getstatic     #22                 // Field $VALUES:[LDay17$Direction;
       3: invokevirtual #28                 // Method java/lang/Object.clone:()Ljava/lang/Object;
       6: checkcast     #29                 // class "[LDay17$Direction;"
       9: areturn

  public static Day17$Direction valueOf(java.lang.String);
    Code:
       0: ldc           #2                  // class Day17$Direction
       2: aload_0
       3: invokestatic  #34                 // Method java/lang/Enum.valueOf:(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
       6: checkcast     #2                  // class Day17$Direction
       9: areturn

  public static kotlin.enums.EnumEntries<Day17$Direction> getEntries();
    Code:
       0: getstatic     #43                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
       3: areturn

  private static final Day17$Direction[] $values();
    Code:
       0: iconst_4
       1: anewarray     #2                  // class Day17$Direction
       4: astore_0
       5: aload_0
       6: iconst_0
       7: getstatic     #47                 // Field UP:LDay17$Direction;
      10: aastore
      11: aload_0
      12: iconst_1
      13: getstatic     #50                 // Field DOWN:LDay17$Direction;
      16: aastore
      17: aload_0
      18: iconst_2
      19: getstatic     #53                 // Field LEFT:LDay17$Direction;
      22: aastore
      23: aload_0
      24: iconst_3
      25: getstatic     #56                 // Field RIGHT:LDay17$Direction;
      28: aastore
      29: aload_0
      30: areturn

  static {};
    Code:
       0: new           #2                  // class Day17$Direction
       3: dup
       4: ldc           #58                 // String UP
       6: iconst_0
       7: invokespecial #59                 // Method "<init>":(Ljava/lang/String;I)V
      10: putstatic     #47                 // Field UP:LDay17$Direction;
      13: new           #2                  // class Day17$Direction
      16: dup
      17: ldc           #60                 // String DOWN
      19: iconst_1
      20: invokespecial #59                 // Method "<init>":(Ljava/lang/String;I)V
      23: putstatic     #50                 // Field DOWN:LDay17$Direction;
      26: new           #2                  // class Day17$Direction
      29: dup
      30: ldc           #61                 // String LEFT
      32: iconst_2
      33: invokespecial #59                 // Method "<init>":(Ljava/lang/String;I)V
      36: putstatic     #53                 // Field LEFT:LDay17$Direction;
      39: new           #2                  // class Day17$Direction
      42: dup
      43: ldc           #62                 // String RIGHT
      45: iconst_3
      46: invokespecial #59                 // Method "<init>":(Ljava/lang/String;I)V
      49: putstatic     #56                 // Field RIGHT:LDay17$Direction;
      52: invokestatic  #64                 // Method $values:()[LDay17$Direction;
      55: putstatic     #22                 // Field $VALUES:[LDay17$Direction;
      58: getstatic     #22                 // Field $VALUES:[LDay17$Direction;
      61: checkcast     #66                 // class "[Ljava/lang/Enum;"
      64: invokestatic  #72                 // Method kotlin/enums/EnumEntriesKt.enumEntries:([Ljava/lang/Enum;)Lkotlin/enums/EnumEntries;
      67: putstatic     #43                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
      70: return
}

Compiled from "Day17.kt"
public final class Day17$CurrentStepInformation {
  private final Day17$Coordinate currentCoordinate;

  private final Day17$Direction currentDirection;

  private final int consecutiveDirectionSteps;

  private final int heatLoss;

  public Day17$CurrentStepInformation(Day17$Coordinate, Day17$Direction, int, int);
    Code:
       0: aload_1
       1: ldc           #9                  // String currentCoordinate
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #17                 // String currentDirection
       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 currentCoordinate:LDay17$Coordinate;
      21: aload_0
      22: aload_2
      23: putfield      #26                 // Field currentDirection:LDay17$Direction;
      26: aload_0
      27: iload_3
      28: putfield      #30                 // Field consecutiveDirectionSteps:I
      31: aload_0
      32: iload         4
      34: putfield      #33                 // Field heatLoss:I
      37: return

  public final Day17$Coordinate getCurrentCoordinate();
    Code:
       0: aload_0
       1: getfield      #23                 // Field currentCoordinate:LDay17$Coordinate;
       4: areturn

  public final Day17$Direction getCurrentDirection();
    Code:
       0: aload_0
       1: getfield      #26                 // Field currentDirection:LDay17$Direction;
       4: areturn

  public final int getConsecutiveDirectionSteps();
    Code:
       0: aload_0
       1: getfield      #30                 // Field consecutiveDirectionSteps:I
       4: ireturn

  public final int getHeatLoss();
    Code:
       0: aload_0
       1: getfield      #33                 // Field heatLoss:I
       4: ireturn

  public final Day17$Coordinate component1();
    Code:
       0: aload_0
       1: getfield      #23                 // Field currentCoordinate:LDay17$Coordinate;
       4: areturn

  public final Day17$Direction component2();
    Code:
       0: aload_0
       1: getfield      #26                 // Field currentDirection:LDay17$Direction;
       4: areturn

  public final int component3();
    Code:
       0: aload_0
       1: getfield      #30                 // Field consecutiveDirectionSteps:I
       4: ireturn

  public final int component4();
    Code:
       0: aload_0
       1: getfield      #33                 // Field heatLoss:I
       4: ireturn

  public final Day17$CurrentStepInformation copy(Day17$Coordinate, Day17$Direction, int, int);
    Code:
       0: aload_1
       1: ldc           #9                  // String currentCoordinate
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #17                 // String currentDirection
       9: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: new           #2                  // class Day17$CurrentStepInformation
      15: dup
      16: aload_1
      17: aload_2
      18: iload_3
      19: iload         4
      21: invokespecial #50                 // Method "<init>":(LDay17$Coordinate;LDay17$Direction;II)V
      24: areturn

  public static Day17$CurrentStepInformation copy$default(Day17$CurrentStepInformation, Day17$Coordinate, Day17$Direction, int, int, int, java.lang.Object);
    Code:
       0: iload         5
       2: iconst_1
       3: iand
       4: ifeq          12
       7: aload_0
       8: getfield      #23                 // Field currentCoordinate:LDay17$Coordinate;
      11: astore_1
      12: iload         5
      14: iconst_2
      15: iand
      16: ifeq          24
      19: aload_0
      20: getfield      #26                 // Field currentDirection:LDay17$Direction;
      23: astore_2
      24: iload         5
      26: iconst_4
      27: iand
      28: ifeq          36
      31: aload_0
      32: getfield      #30                 // Field consecutiveDirectionSteps:I
      35: istore_3
      36: iload         5
      38: bipush        8
      40: iand
      41: ifeq          50
      44: aload_0
      45: getfield      #33                 // Field heatLoss:I
      48: istore        4
      50: aload_0
      51: aload_1
      52: aload_2
      53: iload_3
      54: iload         4
      56: invokevirtual #54                 // Method copy:(LDay17$Coordinate;LDay17$Direction;II)LDay17$CurrentStepInformation;
      59: areturn

  public java.lang.String toString();
    Code:
       0: new           #58                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #59                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #61                 // String CurrentStepInformation(currentCoordinate=
       9: invokevirtual #65                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #23                 // Field currentCoordinate:LDay17$Coordinate;
      16: invokevirtual #68                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      19: ldc           #70                 // String , currentDirection=
      21: invokevirtual #65                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #26                 // Field currentDirection:LDay17$Direction;
      28: invokevirtual #68                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      31: ldc           #72                 // String , consecutiveDirectionSteps=
      33: invokevirtual #65                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      36: aload_0
      37: getfield      #30                 // Field consecutiveDirectionSteps:I
      40: invokevirtual #75                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      43: ldc           #77                 // String , heatLoss=
      45: invokevirtual #65                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      48: aload_0
      49: getfield      #33                 // Field heatLoss:I
      52: invokevirtual #75                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      55: bipush        41
      57: invokevirtual #80                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      60: invokevirtual #82                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      63: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #23                 // Field currentCoordinate:LDay17$Coordinate;
       4: invokevirtual #87                 // Method Day17$Coordinate.hashCode:()I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #26                 // Field currentDirection:LDay17$Direction;
      16: invokevirtual #90                 // Method Day17$Direction.hashCode:()I
      19: iadd
      20: istore_1
      21: iload_1
      22: bipush        31
      24: imul
      25: aload_0
      26: getfield      #30                 // Field consecutiveDirectionSteps:I
      29: invokestatic  #95                 // Method java/lang/Integer.hashCode:(I)I
      32: iadd
      33: istore_1
      34: iload_1
      35: bipush        31
      37: imul
      38: aload_0
      39: getfield      #33                 // Field heatLoss:I
      42: invokestatic  #95                 // Method java/lang/Integer.hashCode:(I)I
      45: iadd
      46: istore_1
      47: iload_1
      48: 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$CurrentStepInformation
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day17$CurrentStepInformation
      20: astore_2
      21: aload_0
      22: getfield      #23                 // Field currentCoordinate:LDay17$Coordinate;
      25: aload_2
      26: getfield      #23                 // Field currentCoordinate:LDay17$Coordinate;
      29: invokestatic  #103                // 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      #26                 // Field currentDirection:LDay17$Direction;
      41: aload_2
      42: getfield      #26                 // Field currentDirection:LDay17$Direction;
      45: if_acmpeq     50
      48: iconst_0
      49: ireturn
      50: aload_0
      51: getfield      #30                 // Field consecutiveDirectionSteps:I
      54: aload_2
      55: getfield      #30                 // Field consecutiveDirectionSteps:I
      58: if_icmpeq     63
      61: iconst_0
      62: ireturn
      63: aload_0
      64: getfield      #33                 // Field heatLoss:I
      67: aload_2
      68: getfield      #33                 // Field heatLoss:I
      71: if_icmpeq     76
      74: iconst_0
      75: ireturn
      76: iconst_1
      77: ireturn
}