package com.github.brpeterman.advent2022

import java.util.LinkedList

class HillClimber(input: String) {
    data class HeightMap(val startPos: Coords, val endPos: Coords, val elevations: Map<Coords, Int>)
    data class Coords(val row: Int, val col: Int) {
        operator fun plus(other: Coords): Coords {
            return Coords(row + other.row, col + other.col)
        }
    }

    val map = parseInput(input)

    fun climb(): Int {
        return climbFrom(map.startPos)!!
    }

    fun findBestTrail(): Int {
        return map.elevations.filter { it.value == 1 }
            .map { climbFrom(it.key) }
            .filter { it != null }
            .map { it!! }
            .min()
    }

    fun climbFrom(start: Coords): Int? {
        var current = start
        val toVisit = LinkedList(getNeighbors(current))
        val bestPathLength = mutableMapOf(current to 0)
        toVisit.forEach { bestPathLength[it] = 1 }
        while (toVisit.isNotEmpty()) {
            current = toVisit.pop()
            val pathLength = bestPathLength[current]!!
            val neighbors = getNeighbors(current)
            neighbors.forEach { neighbor ->
                if (bestPathLength[neighbor] == null || bestPathLength[neighbor]!! > pathLength + 1) {
                    bestPathLength[neighbor] = pathLength + 1
                    toVisit.add(neighbor)
                }
            }
        }
        return bestPathLength[map.endPos]
    }

    fun getNeighbors(location: Coords): List<Coords> {
        return listOf(
            Coords(location.row - 1, location.col),
            Coords(location.row + 1, location.col),
            Coords(location.row, location.col - 1),
            Coords(location.row, location.col + 1))
            .filter { neighbor ->
                map.elevations[neighbor] != null && (map.elevations[neighbor]!! - map.elevations[location]!! <= 1)
            }
    }

    companion object {
        fun parseInput(input: String): HeightMap {
            val map = HashMap<Coords, Int>()
            var startPos = Coords(0, 0)
            var endPos = Coords(0, 0)
            input.split("\n")
                .filter { it.isNotBlank() }
                .withIndex()
                .forEach { (row, line) ->
                    line.toCharArray()
                        .withIndex()
                        .forEach { (column, char) ->
                            val elevation = when (char) {
                                'S' -> {
                                    startPos = Coords(row, column)
                                    1
                                }
                                'E' ->  {
                                    endPos = Coords(row, column)
                                    26
                                }
                                else -> char.code - 96
                            }
                            map[Coords(row, column)] = elevation
                        }
                }
            return HeightMap(startPos, endPos, map)
        }
    }
}

Compiled from "HillClimber.kt"
public final class com.github.brpeterman.advent2022.HillClimber$Companion {
  private com.github.brpeterman.advent2022.HillClimber$Companion();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final com.github.brpeterman.advent2022.HillClimber$HeightMap parseInput(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #15                 // String input
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #23                 // class java/util/HashMap
       9: dup
      10: invokespecial #24                 // Method java/util/HashMap."<init>":()V
      13: astore_2
      14: aconst_null
      15: astore_3
      16: new           #26                 // class com/github/brpeterman/advent2022/HillClimber$Coords
      19: dup
      20: iconst_0
      21: iconst_0
      22: invokespecial #29                 // Method com/github/brpeterman/advent2022/HillClimber$Coords."<init>":(II)V
      25: astore_3
      26: aconst_null
      27: astore        4
      29: new           #26                 // class com/github/brpeterman/advent2022/HillClimber$Coords
      32: dup
      33: iconst_0
      34: iconst_0
      35: invokespecial #29                 // Method com/github/brpeterman/advent2022/HillClimber$Coords."<init>":(II)V
      38: astore        4
      40: aload_1
      41: checkcast     #31                 // class java/lang/CharSequence
      44: iconst_1
      45: anewarray     #33                 // class java/lang/String
      48: astore        5
      50: aload         5
      52: iconst_0
      53: ldc           #35                 // String \n
      55: aastore
      56: aload         5
      58: iconst_0
      59: iconst_0
      60: bipush        6
      62: aconst_null
      63: invokestatic  #41                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      66: checkcast     #43                 // class java/lang/Iterable
      69: astore        5
      71: nop
      72: iconst_0
      73: istore        6
      75: aload         5
      77: astore        7
      79: new           #45                 // class java/util/ArrayList
      82: dup
      83: invokespecial #46                 // Method java/util/ArrayList."<init>":()V
      86: checkcast     #48                 // class java/util/Collection
      89: astore        8
      91: iconst_0
      92: istore        9
      94: aload         7
      96: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     101: astore        10
     103: aload         10
     105: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     110: ifeq          165
     113: aload         10
     115: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     120: astore        11
     122: aload         11
     124: checkcast     #33                 // class java/lang/String
     127: astore        12
     129: iconst_0
     130: istore        13
     132: aload         12
     134: checkcast     #31                 // class java/lang/CharSequence
     137: invokestatic  #66                 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
     140: ifne          147
     143: iconst_1
     144: goto          148
     147: iconst_0
     148: nop
     149: ifeq          103
     152: aload         8
     154: aload         11
     156: invokeinterface #70,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     161: pop
     162: goto          103
     165: aload         8
     167: checkcast     #72                 // class java/util/List
     170: nop
     171: checkcast     #43                 // class java/lang/Iterable
     174: invokestatic  #78                 // Method kotlin/collections/CollectionsKt.withIndex:(Ljava/lang/Iterable;)Ljava/lang/Iterable;
     177: astore        5
     179: nop
     180: iconst_0
     181: istore        6
     183: aload         5
     185: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     190: astore        7
     192: aload         7
     194: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     199: ifeq          426
     202: aload         7
     204: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     209: astore        8
     211: aload         8
     213: checkcast     #80                 // class kotlin/collections/IndexedValue
     216: astore        9
     218: iconst_0
     219: istore        10
     221: aload         9
     223: invokevirtual #84                 // Method kotlin/collections/IndexedValue.component1:()I
     226: istore        11
     228: aload         9
     230: invokevirtual #87                 // Method kotlin/collections/IndexedValue.component2:()Ljava/lang/Object;
     233: checkcast     #33                 // class java/lang/String
     236: astore        12
     238: aload         12
     240: invokevirtual #91                 // Method java/lang/String.toCharArray:()[C
     243: dup
     244: ldc           #93                 // String toCharArray(...)
     246: invokestatic  #96                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     249: invokestatic  #101                // Method kotlin/collections/ArraysKt.withIndex:([C)Ljava/lang/Iterable;
     252: astore        13
     254: nop
     255: iconst_0
     256: istore        14
     258: aload         13
     260: invokeinterface #52,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     265: astore        15
     267: aload         15
     269: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     274: ifeq          420
     277: aload         15
     279: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     284: astore        16
     286: aload         16
     288: checkcast     #80                 // class kotlin/collections/IndexedValue
     291: astore        17
     293: iconst_0
     294: istore        18
     296: aload         17
     298: invokevirtual #84                 // Method kotlin/collections/IndexedValue.component1:()I
     301: istore        19
     303: aload         17
     305: invokevirtual #87                 // Method kotlin/collections/IndexedValue.component2:()Ljava/lang/Object;
     308: checkcast     #103                // class java/lang/Character
     311: invokevirtual #107                // Method java/lang/Character.charValue:()C
     314: istore        20
     316: iload         20
     318: lookupswitch  { // 2
                    69: 360
                    83: 344
               default: 378
          }
     344: new           #26                 // class com/github/brpeterman/advent2022/HillClimber$Coords
     347: dup
     348: iload         11
     350: iload         19
     352: invokespecial #29                 // Method com/github/brpeterman/advent2022/HillClimber$Coords."<init>":(II)V
     355: astore_3
     356: iconst_1
     357: goto          383
     360: new           #26                 // class com/github/brpeterman/advent2022/HillClimber$Coords
     363: dup
     364: iload         11
     366: iload         19
     368: invokespecial #29                 // Method com/github/brpeterman/advent2022/HillClimber$Coords."<init>":(II)V
     371: astore        4
     373: bipush        26
     375: goto          383
     378: iload         20
     380: bipush        96
     382: isub
     383: istore        21
     385: iload         21
     387: invokestatic  #113                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     390: astore        22
     392: aload_2
     393: checkcast     #115                // class java/util/Map
     396: new           #26                 // class com/github/brpeterman/advent2022/HillClimber$Coords
     399: dup
     400: iload         11
     402: iload         19
     404: invokespecial #29                 // Method com/github/brpeterman/advent2022/HillClimber$Coords."<init>":(II)V
     407: aload         22
     409: invokeinterface #119,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     414: pop
     415: nop
     416: nop
     417: goto          267
     420: nop
     421: nop
     422: nop
     423: goto          192
     426: nop
     427: new           #121                // class com/github/brpeterman/advent2022/HillClimber$HeightMap
     430: dup
     431: aload_3
     432: aload         4
     434: aload_2
     435: checkcast     #115                // class java/util/Map
     438: invokespecial #124                // Method com/github/brpeterman/advent2022/HillClimber$HeightMap."<init>":(Lcom/github/brpeterman/advent2022/HillClimber$Coords;Lcom/github/brpeterman/advent2022/HillClimber$Coords;Ljava/util/Map;)V
     441: areturn

  public com.github.brpeterman.advent2022.HillClimber$Companion(kotlin.jvm.internal.DefaultConstructorMarker);
    Code:
       0: aload_0
       1: invokespecial #154                // Method "<init>":()V
       4: return
}

Compiled from "HillClimber.kt"
public final class com.github.brpeterman.advent2022.HillClimber$Coords {
  private final int row;

  private final int col;

  public com.github.brpeterman.advent2022.HillClimber$Coords(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 row:I
       9: aload_0
      10: iload_2
      11: putfield      #16                 // Field col:I
      14: return

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

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

  public final com.github.brpeterman.advent2022.HillClimber$Coords plus(com.github.brpeterman.advent2022.HillClimber$Coords);
    Code:
       0: aload_1
       1: ldc           #26                 // String other
       3: invokestatic  #32                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #2                  // class com/github/brpeterman/advent2022/HillClimber$Coords
       9: dup
      10: aload_0
      11: getfield      #13                 // Field row:I
      14: aload_1
      15: getfield      #13                 // Field row:I
      18: iadd
      19: aload_0
      20: getfield      #16                 // Field col:I
      23: aload_1
      24: getfield      #16                 // Field col:I
      27: iadd
      28: invokespecial #34                 // Method "<init>":(II)V
      31: areturn

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

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

  public final com.github.brpeterman.advent2022.HillClimber$Coords copy(int, int);
    Code:
       0: new           #2                  // class com/github/brpeterman/advent2022/HillClimber$Coords
       3: dup
       4: iload_1
       5: iload_2
       6: invokespecial #34                 // Method "<init>":(II)V
       9: areturn

  public static com.github.brpeterman.advent2022.HillClimber$Coords copy$default(com.github.brpeterman.advent2022.HillClimber$Coords, 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 row:I
      10: istore_1
      11: iload_3
      12: iconst_2
      13: iand
      14: ifeq          22
      17: aload_0
      18: getfield      #16                 // Field col:I
      21: istore_2
      22: aload_0
      23: iload_1
      24: iload_2
      25: invokevirtual #42                 // Method copy:(II)Lcom/github/brpeterman/advent2022/HillClimber$Coords;
      28: areturn

  public java.lang.String toString();
    Code:
       0: new           #46                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #47                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #49                 // String Coords(row=
       9: invokevirtual #53                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field row:I
      16: invokevirtual #56                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #58                 // String , col=
      21: invokevirtual #53                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #16                 // Field col:I
      28: invokevirtual #56                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #61                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #63                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      39: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #13                 // Field row:I
       4: invokestatic  #69                 // 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 col:I
      16: invokestatic  #69                 // 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 com/github/brpeterman/advent2022/HillClimber$Coords
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class com/github/brpeterman/advent2022/HillClimber$Coords
      20: astore_2
      21: aload_0
      22: getfield      #13                 // Field row:I
      25: aload_2
      26: getfield      #13                 // Field row:I
      29: if_icmpeq     34
      32: iconst_0
      33: ireturn
      34: aload_0
      35: getfield      #16                 // Field col:I
      38: aload_2
      39: getfield      #16                 // Field col:I
      42: if_icmpeq     47
      45: iconst_0
      46: ireturn
      47: iconst_1
      48: ireturn
}

Compiled from "HillClimber.kt"
public final class com.github.brpeterman.advent2022.HillClimber$HeightMap {
  private final com.github.brpeterman.advent2022.HillClimber$Coords startPos;

  private final com.github.brpeterman.advent2022.HillClimber$Coords endPos;

  private final java.util.Map<com.github.brpeterman.advent2022.HillClimber$Coords, java.lang.Integer> elevations;

  public com.github.brpeterman.advent2022.HillClimber$HeightMap(com.github.brpeterman.advent2022.HillClimber$Coords, com.github.brpeterman.advent2022.HillClimber$Coords, java.util.Map<com.github.brpeterman.advent2022.HillClimber$Coords, java.lang.Integer>);
    Code:
       0: aload_1
       1: ldc           #10                 // String startPos
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #18                 // String endPos
       9: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_3
      13: ldc           #20                 // String elevations
      15: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      18: aload_0
      19: invokespecial #23                 // Method java/lang/Object."<init>":()V
      22: aload_0
      23: aload_1
      24: putfield      #26                 // Field startPos:Lcom/github/brpeterman/advent2022/HillClimber$Coords;
      27: aload_0
      28: aload_2
      29: putfield      #28                 // Field endPos:Lcom/github/brpeterman/advent2022/HillClimber$Coords;
      32: aload_0
      33: aload_3
      34: putfield      #31                 // Field elevations:Ljava/util/Map;
      37: return

  public final com.github.brpeterman.advent2022.HillClimber$Coords getStartPos();
    Code:
       0: aload_0
       1: getfield      #26                 // Field startPos:Lcom/github/brpeterman/advent2022/HillClimber$Coords;
       4: areturn

  public final com.github.brpeterman.advent2022.HillClimber$Coords getEndPos();
    Code:
       0: aload_0
       1: getfield      #28                 // Field endPos:Lcom/github/brpeterman/advent2022/HillClimber$Coords;
       4: areturn

  public final java.util.Map<com.github.brpeterman.advent2022.HillClimber$Coords, java.lang.Integer> getElevations();
    Code:
       0: aload_0
       1: getfield      #31                 // Field elevations:Ljava/util/Map;
       4: areturn

  public final com.github.brpeterman.advent2022.HillClimber$Coords component1();
    Code:
       0: aload_0
       1: getfield      #26                 // Field startPos:Lcom/github/brpeterman/advent2022/HillClimber$Coords;
       4: areturn

  public final com.github.brpeterman.advent2022.HillClimber$Coords component2();
    Code:
       0: aload_0
       1: getfield      #28                 // Field endPos:Lcom/github/brpeterman/advent2022/HillClimber$Coords;
       4: areturn

  public final java.util.Map<com.github.brpeterman.advent2022.HillClimber$Coords, java.lang.Integer> component3();
    Code:
       0: aload_0
       1: getfield      #31                 // Field elevations:Ljava/util/Map;
       4: areturn

  public final com.github.brpeterman.advent2022.HillClimber$HeightMap copy(com.github.brpeterman.advent2022.HillClimber$Coords, com.github.brpeterman.advent2022.HillClimber$Coords, java.util.Map<com.github.brpeterman.advent2022.HillClimber$Coords, java.lang.Integer>);
    Code:
       0: aload_1
       1: ldc           #10                 // String startPos
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #18                 // String endPos
       9: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_3
      13: ldc           #20                 // String elevations
      15: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      18: new           #2                  // class com/github/brpeterman/advent2022/HillClimber$HeightMap
      21: dup
      22: aload_1
      23: aload_2
      24: aload_3
      25: invokespecial #47                 // Method "<init>":(Lcom/github/brpeterman/advent2022/HillClimber$Coords;Lcom/github/brpeterman/advent2022/HillClimber$Coords;Ljava/util/Map;)V
      28: areturn

  public static com.github.brpeterman.advent2022.HillClimber$HeightMap copy$default(com.github.brpeterman.advent2022.HillClimber$HeightMap, com.github.brpeterman.advent2022.HillClimber$Coords, com.github.brpeterman.advent2022.HillClimber$Coords, java.util.Map, int, java.lang.Object);
    Code:
       0: iload         4
       2: iconst_1
       3: iand
       4: ifeq          12
       7: aload_0
       8: getfield      #26                 // Field startPos:Lcom/github/brpeterman/advent2022/HillClimber$Coords;
      11: astore_1
      12: iload         4
      14: iconst_2
      15: iand
      16: ifeq          24
      19: aload_0
      20: getfield      #28                 // Field endPos:Lcom/github/brpeterman/advent2022/HillClimber$Coords;
      23: astore_2
      24: iload         4
      26: iconst_4
      27: iand
      28: ifeq          36
      31: aload_0
      32: getfield      #31                 // Field elevations:Ljava/util/Map;
      35: astore_3
      36: aload_0
      37: aload_1
      38: aload_2
      39: aload_3
      40: invokevirtual #51                 // Method copy:(Lcom/github/brpeterman/advent2022/HillClimber$Coords;Lcom/github/brpeterman/advent2022/HillClimber$Coords;Ljava/util/Map;)Lcom/github/brpeterman/advent2022/HillClimber$HeightMap;
      43: areturn

  public java.lang.String toString();
    Code:
       0: new           #55                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #56                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #58                 // String HeightMap(startPos=
       9: invokevirtual #62                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #26                 // Field startPos:Lcom/github/brpeterman/advent2022/HillClimber$Coords;
      16: invokevirtual #65                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      19: ldc           #67                 // String , endPos=
      21: invokevirtual #62                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #28                 // Field endPos:Lcom/github/brpeterman/advent2022/HillClimber$Coords;
      28: invokevirtual #65                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      31: ldc           #69                 // String , elevations=
      33: invokevirtual #62                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      36: aload_0
      37: getfield      #31                 // Field elevations:Ljava/util/Map;
      40: invokevirtual #65                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      43: bipush        41
      45: invokevirtual #72                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      48: invokevirtual #74                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      51: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #26                 // Field startPos:Lcom/github/brpeterman/advent2022/HillClimber$Coords;
       4: invokevirtual #80                 // Method com/github/brpeterman/advent2022/HillClimber$Coords.hashCode:()I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #28                 // Field endPos:Lcom/github/brpeterman/advent2022/HillClimber$Coords;
      16: invokevirtual #80                 // Method com/github/brpeterman/advent2022/HillClimber$Coords.hashCode:()I
      19: iadd
      20: istore_1
      21: iload_1
      22: bipush        31
      24: imul
      25: aload_0
      26: getfield      #31                 // Field elevations:Ljava/util/Map;
      29: invokevirtual #81                 // Method java/lang/Object.hashCode:()I
      32: iadd
      33: istore_1
      34: iload_1
      35: 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 com/github/brpeterman/advent2022/HillClimber$HeightMap
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class com/github/brpeterman/advent2022/HillClimber$HeightMap
      20: astore_2
      21: aload_0
      22: getfield      #26                 // Field startPos:Lcom/github/brpeterman/advent2022/HillClimber$Coords;
      25: aload_2
      26: getfield      #26                 // Field startPos:Lcom/github/brpeterman/advent2022/HillClimber$Coords;
      29: invokestatic  #90                 // 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      #28                 // Field endPos:Lcom/github/brpeterman/advent2022/HillClimber$Coords;
      41: aload_2
      42: getfield      #28                 // Field endPos:Lcom/github/brpeterman/advent2022/HillClimber$Coords;
      45: invokestatic  #90                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      48: ifne          53
      51: iconst_0
      52: ireturn
      53: aload_0
      54: getfield      #31                 // Field elevations:Ljava/util/Map;
      57: aload_2
      58: getfield      #31                 // Field elevations:Ljava/util/Map;
      61: invokestatic  #90                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      64: ifne          69
      67: iconst_0
      68: ireturn
      69: iconst_1
      70: ireturn
}

Compiled from "HillClimber.kt"
public final class com.github.brpeterman.advent2022.HillClimber {
  public static final com.github.brpeterman.advent2022.HillClimber$Companion Companion;

  private final com.github.brpeterman.advent2022.HillClimber$HeightMap map;

  public com.github.brpeterman.advent2022.HillClimber(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #9                  // String input
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokespecial #18                 // Method java/lang/Object."<init>":()V
      10: aload_0
      11: getstatic     #22                 // Field Companion:Lcom/github/brpeterman/advent2022/HillClimber$Companion;
      14: aload_1
      15: invokevirtual #28                 // Method com/github/brpeterman/advent2022/HillClimber$Companion.parseInput:(Ljava/lang/String;)Lcom/github/brpeterman/advent2022/HillClimber$HeightMap;
      18: putfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/HillClimber$HeightMap;
      21: return

  public final com.github.brpeterman.advent2022.HillClimber$HeightMap getMap();
    Code:
       0: aload_0
       1: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/HillClimber$HeightMap;
       4: areturn

  public final int climb();
    Code:
       0: aload_0
       1: aload_0
       2: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/HillClimber$HeightMap;
       5: invokevirtual #45                 // Method com/github/brpeterman/advent2022/HillClimber$HeightMap.getStartPos:()Lcom/github/brpeterman/advent2022/HillClimber$Coords;
       8: invokevirtual #49                 // Method climbFrom:(Lcom/github/brpeterman/advent2022/HillClimber$Coords;)Ljava/lang/Integer;
      11: dup
      12: invokestatic  #53                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      15: invokevirtual #58                 // Method java/lang/Integer.intValue:()I
      18: ireturn

  public final int findBestTrail();
    Code:
       0: aload_0
       1: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/HillClimber$HeightMap;
       4: invokevirtual #63                 // Method com/github/brpeterman/advent2022/HillClimber$HeightMap.getElevations:()Ljava/util/Map;
       7: astore_1
       8: iconst_0
       9: istore_2
      10: aload_1
      11: astore_3
      12: new           #65                 // class java/util/LinkedHashMap
      15: dup
      16: invokespecial #66                 // Method java/util/LinkedHashMap."<init>":()V
      19: checkcast     #68                 // class java/util/Map
      22: astore        4
      24: iconst_0
      25: istore        5
      27: aload_3
      28: invokeinterface #72,  1           // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
      33: invokeinterface #78,  1           // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
      38: astore        6
      40: aload         6
      42: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      47: ifeq          119
      50: aload         6
      52: invokeinterface #88,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: checkcast     #90                 // class java/util/Map$Entry
      60: astore        7
      62: aload         7
      64: astore        8
      66: iconst_0
      67: istore        9
      69: aload         8
      71: invokeinterface #93,  1           // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
      76: checkcast     #95                 // class java/lang/Number
      79: invokevirtual #96                 // Method java/lang/Number.intValue:()I
      82: iconst_1
      83: if_icmpne     90
      86: iconst_1
      87: goto          91
      90: iconst_0
      91: ifeq          40
      94: aload         4
      96: aload         7
      98: invokeinterface #99,  1           // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     103: aload         7
     105: invokeinterface #93,  1           // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     110: invokeinterface #103,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     115: pop
     116: goto          40
     119: aload         4
     121: nop
     122: astore_1
     123: nop
     124: iconst_0
     125: istore_2
     126: aload_1
     127: astore_3
     128: new           #105                // class java/util/ArrayList
     131: dup
     132: aload_1
     133: invokeinterface #108,  1          // InterfaceMethod java/util/Map.size:()I
     138: invokespecial #111                // Method java/util/ArrayList."<init>":(I)V
     141: checkcast     #113                // class java/util/Collection
     144: astore        4
     146: iconst_0
     147: istore        5
     149: aload_3
     150: invokeinterface #72,  1           // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     155: invokeinterface #78,  1           // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     160: astore        6
     162: aload         6
     164: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     169: ifeq          221
     172: aload         6
     174: invokeinterface #88,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     179: checkcast     #90                 // class java/util/Map$Entry
     182: astore        7
     184: aload         4
     186: aload         7
     188: astore        8
     190: astore        10
     192: iconst_0
     193: istore        9
     195: aload_0
     196: aload         8
     198: invokeinterface #99,  1           // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     203: checkcast     #115                // class com/github/brpeterman/advent2022/HillClimber$Coords
     206: invokevirtual #49                 // Method climbFrom:(Lcom/github/brpeterman/advent2022/HillClimber$Coords;)Ljava/lang/Integer;
     209: aload         10
     211: swap
     212: invokeinterface #119,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     217: pop
     218: goto          162
     221: aload         4
     223: checkcast     #121                // class java/util/List
     226: nop
     227: checkcast     #123                // class java/lang/Iterable
     230: astore_1
     231: nop
     232: iconst_0
     233: istore_2
     234: aload_1
     235: astore_3
     236: new           #105                // class java/util/ArrayList
     239: dup
     240: invokespecial #124                // Method java/util/ArrayList."<init>":()V
     243: checkcast     #113                // class java/util/Collection
     246: astore        4
     248: iconst_0
     249: istore        5
     251: aload_3
     252: invokeinterface #125,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     257: astore        6
     259: aload         6
     261: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     266: ifeq          314
     269: aload         6
     271: invokeinterface #88,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     276: astore        7
     278: aload         7
     280: checkcast     #55                 // class java/lang/Integer
     283: astore        8
     285: iconst_0
     286: istore        9
     288: aload         8
     290: ifnull        297
     293: iconst_1
     294: goto          298
     297: iconst_0
     298: ifeq          259
     301: aload         4
     303: aload         7
     305: invokeinterface #119,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     310: pop
     311: goto          259
     314: aload         4
     316: checkcast     #121                // class java/util/List
     319: nop
     320: checkcast     #123                // class java/lang/Iterable
     323: astore_1
     324: nop
     325: iconst_0
     326: istore_2
     327: aload_1
     328: astore_3
     329: new           #105                // class java/util/ArrayList
     332: dup
     333: aload_1
     334: bipush        10
     336: invokestatic  #131                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     339: invokespecial #111                // Method java/util/ArrayList."<init>":(I)V
     342: checkcast     #113                // class java/util/Collection
     345: astore        4
     347: iconst_0
     348: istore        5
     350: aload_3
     351: invokeinterface #125,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     356: astore        6
     358: aload         6
     360: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     365: ifeq          415
     368: aload         6
     370: invokeinterface #88,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     375: astore        7
     377: aload         4
     379: aload         7
     381: checkcast     #55                 // class java/lang/Integer
     384: astore        8
     386: astore        10
     388: iconst_0
     389: istore        9
     391: aload         8
     393: dup
     394: invokestatic  #53                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     397: invokevirtual #58                 // Method java/lang/Integer.intValue:()I
     400: invokestatic  #135                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     403: aload         10
     405: swap
     406: invokeinterface #119,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     411: pop
     412: goto          358
     415: aload         4
     417: checkcast     #121                // class java/util/List
     420: nop
     421: checkcast     #123                // class java/lang/Iterable
     424: invokestatic  #139                // Method kotlin/collections/CollectionsKt.minOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;
     427: checkcast     #95                 // class java/lang/Number
     430: invokevirtual #96                 // Method java/lang/Number.intValue:()I
     433: ireturn

  public final java.lang.Integer climbFrom(com.github.brpeterman.advent2022.HillClimber$Coords);
    Code:
       0: aload_1
       1: ldc           #165                // String start
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: astore_2
       8: new           #167                // class java/util/LinkedList
      11: dup
      12: aload_0
      13: aload_2
      14: invokevirtual #171                // Method getNeighbors:(Lcom/github/brpeterman/advent2022/HillClimber$Coords;)Ljava/util/List;
      17: checkcast     #113                // class java/util/Collection
      20: invokespecial #174                // Method java/util/LinkedList."<init>":(Ljava/util/Collection;)V
      23: astore_3
      24: iconst_1
      25: anewarray     #176                // class kotlin/Pair
      28: astore        5
      30: aload         5
      32: iconst_0
      33: aload_2
      34: iconst_0
      35: invokestatic  #135                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      38: invokestatic  #182                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      41: aastore
      42: aload         5
      44: invokestatic  #188                // Method kotlin/collections/MapsKt.mutableMapOf:([Lkotlin/Pair;)Ljava/util/Map;
      47: astore        4
      49: aload_3
      50: checkcast     #123                // class java/lang/Iterable
      53: astore        5
      55: iconst_0
      56: istore        6
      58: aload         5
      60: invokeinterface #125,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      65: astore        7
      67: aload         7
      69: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      74: ifeq          115
      77: aload         7
      79: invokeinterface #88,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      84: astore        8
      86: aload         8
      88: checkcast     #115                // class com/github/brpeterman/advent2022/HillClimber$Coords
      91: astore        9
      93: iconst_0
      94: istore        10
      96: aload         4
      98: aload         9
     100: iconst_1
     101: invokestatic  #135                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     104: invokeinterface #103,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     109: pop
     110: nop
     111: nop
     112: goto          67
     115: nop
     116: aload_3
     117: checkcast     #113                // class java/util/Collection
     120: invokeinterface #191,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     125: ifne          132
     128: iconst_1
     129: goto          133
     132: iconst_0
     133: ifeq          296
     136: aload_3
     137: invokevirtual #194                // Method java/util/LinkedList.pop:()Ljava/lang/Object;
     140: dup
     141: ldc           #196                // String pop(...)
     143: invokestatic  #199                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     146: checkcast     #115                // class com/github/brpeterman/advent2022/HillClimber$Coords
     149: astore_2
     150: aload         4
     152: aload_2
     153: invokeinterface #203,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     158: dup
     159: invokestatic  #53                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     162: checkcast     #95                 // class java/lang/Number
     165: invokevirtual #96                 // Method java/lang/Number.intValue:()I
     168: istore        5
     170: aload_0
     171: aload_2
     172: invokevirtual #171                // Method getNeighbors:(Lcom/github/brpeterman/advent2022/HillClimber$Coords;)Ljava/util/List;
     175: astore        6
     177: aload         6
     179: checkcast     #123                // class java/lang/Iterable
     182: astore        7
     184: iconst_0
     185: istore        8
     187: aload         7
     189: invokeinterface #125,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     194: astore        9
     196: aload         9
     198: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     203: ifeq          292
     206: aload         9
     208: invokeinterface #88,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     213: astore        10
     215: aload         10
     217: checkcast     #115                // class com/github/brpeterman/advent2022/HillClimber$Coords
     220: astore        11
     222: iconst_0
     223: istore        12
     225: aload         4
     227: aload         11
     229: invokeinterface #203,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     234: ifnull        263
     237: aload         4
     239: aload         11
     241: invokeinterface #203,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     246: dup
     247: invokestatic  #53                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     250: checkcast     #95                 // class java/lang/Number
     253: invokevirtual #96                 // Method java/lang/Number.intValue:()I
     256: iload         5
     258: iconst_1
     259: iadd
     260: if_icmple     287
     263: aload         4
     265: aload         11
     267: iload         5
     269: iconst_1
     270: iadd
     271: invokestatic  #135                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     274: invokeinterface #103,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     279: pop
     280: aload_3
     281: aload         11
     283: invokevirtual #204                // Method java/util/LinkedList.add:(Ljava/lang/Object;)Z
     286: pop
     287: nop
     288: nop
     289: goto          196
     292: nop
     293: goto          116
     296: aload         4
     298: aload_0
     299: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/HillClimber$HeightMap;
     302: invokevirtual #207                // Method com/github/brpeterman/advent2022/HillClimber$HeightMap.getEndPos:()Lcom/github/brpeterman/advent2022/HillClimber$Coords;
     305: invokeinterface #203,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     310: checkcast     #55                 // class java/lang/Integer
     313: areturn

  public final java.util.List<com.github.brpeterman.advent2022.HillClimber$Coords> getNeighbors(com.github.brpeterman.advent2022.HillClimber$Coords);
    Code:
       0: aload_1
       1: ldc           #224                // String location
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: iconst_4
       7: anewarray     #115                // class com/github/brpeterman/advent2022/HillClimber$Coords
      10: astore_2
      11: aload_2
      12: iconst_0
      13: new           #115                // class com/github/brpeterman/advent2022/HillClimber$Coords
      16: dup
      17: aload_1
      18: invokevirtual #227                // Method com/github/brpeterman/advent2022/HillClimber$Coords.getRow:()I
      21: iconst_1
      22: isub
      23: aload_1
      24: invokevirtual #230                // Method com/github/brpeterman/advent2022/HillClimber$Coords.getCol:()I
      27: invokespecial #233                // Method com/github/brpeterman/advent2022/HillClimber$Coords."<init>":(II)V
      30: aastore
      31: aload_2
      32: iconst_1
      33: new           #115                // class com/github/brpeterman/advent2022/HillClimber$Coords
      36: dup
      37: aload_1
      38: invokevirtual #227                // Method com/github/brpeterman/advent2022/HillClimber$Coords.getRow:()I
      41: iconst_1
      42: iadd
      43: aload_1
      44: invokevirtual #230                // Method com/github/brpeterman/advent2022/HillClimber$Coords.getCol:()I
      47: invokespecial #233                // Method com/github/brpeterman/advent2022/HillClimber$Coords."<init>":(II)V
      50: aastore
      51: aload_2
      52: iconst_2
      53: new           #115                // class com/github/brpeterman/advent2022/HillClimber$Coords
      56: dup
      57: aload_1
      58: invokevirtual #227                // Method com/github/brpeterman/advent2022/HillClimber$Coords.getRow:()I
      61: aload_1
      62: invokevirtual #230                // Method com/github/brpeterman/advent2022/HillClimber$Coords.getCol:()I
      65: iconst_1
      66: isub
      67: invokespecial #233                // Method com/github/brpeterman/advent2022/HillClimber$Coords."<init>":(II)V
      70: aastore
      71: aload_2
      72: iconst_3
      73: new           #115                // class com/github/brpeterman/advent2022/HillClimber$Coords
      76: dup
      77: aload_1
      78: invokevirtual #227                // Method com/github/brpeterman/advent2022/HillClimber$Coords.getRow:()I
      81: aload_1
      82: invokevirtual #230                // Method com/github/brpeterman/advent2022/HillClimber$Coords.getCol:()I
      85: iconst_1
      86: iadd
      87: invokespecial #233                // Method com/github/brpeterman/advent2022/HillClimber$Coords."<init>":(II)V
      90: aastore
      91: aload_2
      92: invokestatic  #237                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
      95: checkcast     #123                // class java/lang/Iterable
      98: astore_2
      99: nop
     100: iconst_0
     101: istore_3
     102: aload_2
     103: astore        4
     105: new           #105                // class java/util/ArrayList
     108: dup
     109: invokespecial #124                // Method java/util/ArrayList."<init>":()V
     112: checkcast     #113                // class java/util/Collection
     115: astore        5
     117: iconst_0
     118: istore        6
     120: aload         4
     122: invokeinterface #125,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     127: astore        7
     129: aload         7
     131: invokeinterface #84,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     136: ifeq          248
     139: aload         7
     141: invokeinterface #88,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     146: astore        8
     148: aload         8
     150: checkcast     #115                // class com/github/brpeterman/advent2022/HillClimber$Coords
     153: astore        9
     155: iconst_0
     156: istore        10
     158: aload_0
     159: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/HillClimber$HeightMap;
     162: invokevirtual #63                 // Method com/github/brpeterman/advent2022/HillClimber$HeightMap.getElevations:()Ljava/util/Map;
     165: aload         9
     167: invokeinterface #203,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     172: ifnull        231
     175: aload_0
     176: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/HillClimber$HeightMap;
     179: invokevirtual #63                 // Method com/github/brpeterman/advent2022/HillClimber$HeightMap.getElevations:()Ljava/util/Map;
     182: aload         9
     184: invokeinterface #203,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     189: dup
     190: invokestatic  #53                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     193: checkcast     #95                 // class java/lang/Number
     196: invokevirtual #96                 // Method java/lang/Number.intValue:()I
     199: aload_0
     200: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/HillClimber$HeightMap;
     203: invokevirtual #63                 // Method com/github/brpeterman/advent2022/HillClimber$HeightMap.getElevations:()Ljava/util/Map;
     206: aload_1
     207: invokeinterface #203,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     212: dup
     213: invokestatic  #53                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     216: checkcast     #95                 // class java/lang/Number
     219: invokevirtual #96                 // Method java/lang/Number.intValue:()I
     222: isub
     223: iconst_1
     224: if_icmpgt     231
     227: iconst_1
     228: goto          232
     231: iconst_0
     232: ifeq          129
     235: aload         5
     237: aload         8
     239: invokeinterface #119,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     244: pop
     245: goto          129
     248: aload         5
     250: checkcast     #121                // class java/util/List
     253: nop
     254: areturn

  static {};
    Code:
       0: new           #24                 // class com/github/brpeterman/advent2022/HillClimber$Companion
       3: dup
       4: aconst_null
       5: invokespecial #242                // Method com/github/brpeterman/advent2022/HillClimber$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #22                 // Field Companion:Lcom/github/brpeterman/advent2022/HillClimber$Companion;
      11: return
}