fun main() {

    fun buildFileSystem(input: List<String>): Directory {
        val root = Directory(null, "/")
        var currentDir: Directory = root
        val iter = input.iterator()
        while (iter.hasNext()) {
            val line = iter.next()
            when {
                line == "$ cd /" -> currentDir = root
                line == "$ ls" -> continue
                line == "$ cd .." -> currentDir = currentDir.parent!!
                line.startsWith("$ cd") -> currentDir = currentDir.cd(line)
                else -> currentDir.new(line)
            }
        }
        return root
    }

    fun part1(input: Directory): Long {
        return input.sumOfUnderSize(100_000)
    }

    fun part2(input: Directory): Long? {
        // 70M: available, free 30M required
        val missingSpace = 30_000_000 - 70_000_000L + input.size
        return input.smallestDirBigger(missingSpace)
    }

    val input = buildFileSystem(readInput("Day07"))

    println(part1(input))
    println(part2(input))
}

interface FileSystem {
    fun sumOfUnderSize(sizeLimit: Long): Long
    fun smallestDirBigger(minimum: Long): Long?

    val parent: Directory?
    val name: String
    val size: Long
}

class Day07File(override val parent: Directory, override val name: String, override val size: Long) : FileSystem {
    override fun sumOfUnderSize(sizeLimit: Long): Long = 0L
    override fun smallestDirBigger(minimum: Long) = null // we don't want a file

}

class Directory(override val parent: Directory?, override val name: String) : FileSystem {
    override val size: Long
        get() = content.values.sumOf { it.size }

    private val content: MutableMap<String, FileSystem> = mutableMapOf()

    operator fun get(line: String): FileSystem {
        return content[line.removePrefix("$ cd ")] ?: error("$name has no such file: $line")
    }

    fun cd(line: String): Directory {
        val file = this[line]
        return if (file is Directory) file else error("$name has no such dir: $line")
    }

    fun new(line: String) {
        when {
            line.startsWith("dir") -> {
                val newName = line.removePrefix("dir ")
                content.putIfAbsent(newName, Directory(this, newName))
            }

            line.startsWith('$') -> error("bad new file $line")
            else -> {
                val (size, newName) = line.split(' ', limit = 2)
                content.putIfAbsent(newName, Day07File(this, newName, size.toLong()))
            }
        }
    }

    override fun sumOfUnderSize(sizeLimit: Long): Long {
        return content.values.sumOf { it.sumOfUnderSize(sizeLimit) } + if (size <= sizeLimit) size else 0
    }

    override fun smallestDirBigger(minimum: Long): Long? {
        if (this.size < minimum) return null // we could filter it instead using null, but that's good enough
        return content.values
            .mapNotNull { it.smallestDirBigger(minimum) }
            .minOrNull()
            ?: this.size
    }
}

Compiled from "Day07.kt"
public final class Day07Kt {
  public static final void main();
    Code:
       0: ldc           #8                  // String Day07
       2: invokestatic  #14                 // Method UtilsKt.readInput:(Ljava/lang/String;)Ljava/util/List;
       5: invokestatic  #18                 // Method main$buildFileSystem:(Ljava/util/List;)LDirectory;
       8: astore_0
       9: aload_0
      10: invokestatic  #22                 // Method main$part1:(LDirectory;)J
      13: lstore_1
      14: getstatic     #28                 // Field java/lang/System.out:Ljava/io/PrintStream;
      17: lload_1
      18: invokevirtual #34                 // Method java/io/PrintStream.println:(J)V
      21: aload_0
      22: invokestatic  #38                 // Method main$part2:(LDirectory;)Ljava/lang/Long;
      25: getstatic     #28                 // Field java/lang/System.out:Ljava/io/PrintStream;
      28: swap
      29: invokevirtual #41                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      32: return

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

  private static final Directory main$buildFileSystem(java.util.List<java.lang.String>);
    Code:
       0: new           #51                 // class Directory
       3: dup
       4: aconst_null
       5: ldc           #53                 // String /
       7: invokespecial #57                 // Method Directory."<init>":(LDirectory;Ljava/lang/String;)V
      10: astore_1
      11: aload_1
      12: astore_2
      13: aload_0
      14: invokeinterface #63,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      19: astore_3
      20: aload_3
      21: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      26: ifeq          120
      29: aload_3
      30: invokeinterface #73,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      35: checkcast     #75                 // class java/lang/String
      38: astore        4
      40: nop
      41: aload         4
      43: ldc           #77                 // String $ cd /
      45: invokestatic  #83                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      48: ifeq          56
      51: aload_1
      52: astore_2
      53: goto          20
      56: aload         4
      58: ldc           #85                 // String $ ls
      60: invokestatic  #83                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      63: ifne          20
      66: aload         4
      68: ldc           #87                 // String $ cd ..
      70: invokestatic  #83                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      73: ifeq          88
      76: aload_2
      77: invokevirtual #91                 // Method Directory.getParent:()LDirectory;
      80: dup
      81: invokestatic  #94                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      84: astore_2
      85: goto          20
      88: aload         4
      90: ldc           #96                 // String $ cd
      92: iconst_0
      93: iconst_2
      94: aconst_null
      95: invokestatic  #102                // Method kotlin/text/StringsKt.startsWith$default:(Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Z
      98: ifeq          111
     101: aload_2
     102: aload         4
     104: invokevirtual #106                // Method Directory.cd:(Ljava/lang/String;)LDirectory;
     107: astore_2
     108: goto          20
     111: aload_2
     112: aload         4
     114: invokevirtual #110                // Method Directory.new:(Ljava/lang/String;)V
     117: goto          20
     120: aload_1
     121: areturn

  private static final long main$part1(Directory);
    Code:
       0: aload_0
       1: ldc2_w        #118                // long 100000l
       4: invokevirtual #123                // Method Directory.sumOfUnderSize:(J)J
       7: lreturn

  private static final java.lang.Long main$part2(Directory);
    Code:
       0: ldc2_w        #124                // long -40000000l
       3: aload_0
       4: invokevirtual #129                // Method Directory.getSize:()J
       7: ladd
       8: lstore_1
       9: aload_0
      10: lload_1
      11: invokevirtual #133                // Method Directory.smallestDirBigger:(J)Ljava/lang/Long;
      14: areturn
}


fun main() {

    fun Char.priority(): Int {
        return this.code - if (this.isLowerCase()) 96 else 38
    }

    fun part1(input: List<String>): Int {
        var prioSum = 0
        input.forEach { line ->
            val chunked = line.chunked(line.length / 2)
            val duplicate = chunked[0].toSet().intersect(chunked[1].toSet()).first()
            prioSum += duplicate.priority()
        }
        return prioSum
    }

    fun part2(input: List<String>): Int {
        return input.asSequence()
            .map { it.toSet() }
            .chunked(3)
            .map { it.reduce { intersection, prev -> intersection.intersect(prev) } }
            .map { it.first().priority() }
            .sum()
    }

    val input = readInput("Day03")

    println(part1(input))
    println(part2(input))
}

Compiled from "Day03.kt"
public final class Day03Kt {
  public static final void main();
    Code:
       0: ldc           #8                  // String Day03
       2: invokestatic  #14                 // Method UtilsKt.readInput:(Ljava/lang/String;)Ljava/util/List;
       5: astore_0
       6: aload_0
       7: invokestatic  #18                 // Method main$part1:(Ljava/util/List;)I
      10: istore_1
      11: getstatic     #24                 // Field java/lang/System.out:Ljava/io/PrintStream;
      14: iload_1
      15: invokevirtual #30                 // Method java/io/PrintStream.println:(I)V
      18: aload_0
      19: invokestatic  #33                 // Method main$part2:(Ljava/util/List;)I
      22: istore_1
      23: getstatic     #24                 // Field java/lang/System.out:Ljava/io/PrintStream;
      26: iload_1
      27: invokevirtual #30                 // Method java/io/PrintStream.println:(I)V
      30: return

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

  private static final int main$priority(char);
    Code:
       0: iload_0
       1: iload_0
       2: invokestatic  #48                 // Method java/lang/Character.isLowerCase:(C)Z
       5: ifeq          13
       8: bipush        96
      10: goto          15
      13: bipush        38
      15: isub
      16: ireturn

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: iconst_0
       1: istore_1
       2: aload_0
       3: checkcast     #53                 // class java/lang/Iterable
       6: astore_2
       7: iconst_0
       8: istore_3
       9: aload_2
      10: invokeinterface #57,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      15: astore        4
      17: aload         4
      19: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      24: ifeq          127
      27: aload         4
      29: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      34: astore        5
      36: aload         5
      38: checkcast     #69                 // class java/lang/String
      41: astore        6
      43: iconst_0
      44: istore        7
      46: aload         6
      48: checkcast     #71                 // class java/lang/CharSequence
      51: aload         6
      53: invokevirtual #75                 // Method java/lang/String.length:()I
      56: iconst_2
      57: idiv
      58: invokestatic  #81                 // Method kotlin/text/StringsKt.chunked:(Ljava/lang/CharSequence;I)Ljava/util/List;
      61: astore        8
      63: aload         8
      65: iconst_0
      66: invokeinterface #87,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      71: checkcast     #71                 // class java/lang/CharSequence
      74: invokestatic  #91                 // Method kotlin/text/StringsKt.toSet:(Ljava/lang/CharSequence;)Ljava/util/Set;
      77: checkcast     #53                 // class java/lang/Iterable
      80: aload         8
      82: iconst_1
      83: invokeinterface #87,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      88: checkcast     #71                 // class java/lang/CharSequence
      91: invokestatic  #91                 // Method kotlin/text/StringsKt.toSet:(Ljava/lang/CharSequence;)Ljava/util/Set;
      94: checkcast     #53                 // class java/lang/Iterable
      97: invokestatic  #97                 // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;
     100: checkcast     #53                 // class java/lang/Iterable
     103: invokestatic  #101                // Method kotlin/collections/CollectionsKt.first:(Ljava/lang/Iterable;)Ljava/lang/Object;
     106: checkcast     #44                 // class java/lang/Character
     109: invokevirtual #105                // Method java/lang/Character.charValue:()C
     112: istore        9
     114: iload_1
     115: iload         9
     117: invokestatic  #107                // Method main$priority:(C)I
     120: iadd
     121: istore_1
     122: nop
     123: nop
     124: goto          17
     127: nop
     128: iload_1
     129: ireturn

  private static final java.util.Set main$part2$lambda$1(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #122                // String it
       3: invokestatic  #128                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: checkcast     #71                 // class java/lang/CharSequence
      10: invokestatic  #91                 // Method kotlin/text/StringsKt.toSet:(Ljava/lang/CharSequence;)Ljava/util/Set;
      13: areturn

  private static final java.util.Set main$part2$lambda$3(java.util.List);
    Code:
       0: aload_0
       1: ldc           #122                // String it
       3: invokestatic  #128                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: checkcast     #53                 // class java/lang/Iterable
      10: astore_1
      11: iconst_0
      12: istore_2
      13: aload_1
      14: invokeinterface #57,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      19: astore_3
      20: aload_3
      21: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      26: ifne          39
      29: new           #132                // class java/lang/UnsupportedOperationException
      32: dup
      33: ldc           #134                // String Empty collection can\'t be reduced.
      35: invokespecial #138                // Method java/lang/UnsupportedOperationException."<init>":(Ljava/lang/String;)V
      38: athrow
      39: aload_3
      40: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      45: astore        4
      47: aload_3
      48: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      53: ifeq          95
      56: aload         4
      58: aload_3
      59: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      64: checkcast     #140                // class java/util/Set
      67: astore        5
      69: checkcast     #140                // class java/util/Set
      72: astore        6
      74: iconst_0
      75: istore        7
      77: aload         6
      79: checkcast     #53                 // class java/lang/Iterable
      82: aload         5
      84: checkcast     #53                 // class java/lang/Iterable
      87: invokestatic  #97                 // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;
      90: astore        4
      92: goto          47
      95: aload         4
      97: checkcast     #140                // class java/util/Set
     100: areturn

  private static final int main$part2$lambda$4(java.util.Set);
    Code:
       0: aload_0
       1: ldc           #122                // String it
       3: invokestatic  #128                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: checkcast     #53                 // class java/lang/Iterable
      10: invokestatic  #101                // Method kotlin/collections/CollectionsKt.first:(Ljava/lang/Iterable;)Ljava/lang/Object;
      13: checkcast     #44                 // class java/lang/Character
      16: invokevirtual #105                // Method java/lang/Character.charValue:()C
      19: invokestatic  #107                // Method main$priority:(C)I
      22: ireturn

  private static final int main$part2(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: checkcast     #53                 // class java/lang/Iterable
       4: invokestatic  #155                // Method kotlin/collections/CollectionsKt.asSequence:(Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;
       7: invokedynamic #172,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      12: invokestatic  #178                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      15: iconst_3
      16: invokestatic  #181                // Method kotlin/sequences/SequencesKt.chunked:(Lkotlin/sequences/Sequence;I)Lkotlin/sequences/Sequence;
      19: invokedynamic #186,  0            // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function1;
      24: invokestatic  #178                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      27: invokedynamic #192,  0            // InvokeDynamic #2:invoke:()Lkotlin/jvm/functions/Function1;
      32: invokestatic  #178                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      35: invokestatic  #196                // Method kotlin/sequences/SequencesKt.sumOfInt:(Lkotlin/sequences/Sequence;)I
      38: ireturn
}


fun main() {
    /**
     * cathode-ray tube screen and simple CPU
     */
    class CRT {
        var cycle = 0
        var register = 1
        var row = mutableListOf<Char>()

        fun exec(op: String) {
            doCycle()
            if ("noop" == op) return
            doCycle()
            register += op.split(" ")[1].toInt()
        }

        private fun doCycle() {
            cycle++
            drawPixel()
        }

        private fun drawPixel() {
            val idx = row.size
            if (idx >= register - 1 && idx <= register + 1)
                row.add('#')
            else
                row.add('.')
            if (cycle % 40 == 0) {
                println(row.joinToString(" ")) // a bit easier to read with spaces
                row.clear()
            }
        }
    }

    fun part1(input: List<String>): Int {
        val signals = mutableListOf<Int>()
        var register = 1
        var cycle = 0
        input.forEach { line ->
            if ("noop" == line) {
                cycle++
                if ((cycle - 20) % 40 == 0) signals.add(cycle * register)
                return@forEach
            }
            cycle++
            if ((cycle - 20) % 40 == 0) signals.add(cycle * register)
            cycle++
            if ((cycle - 20) % 40 == 0) signals.add(cycle * register)
            register += line.split(" ")[1].toInt()
        }
        return signals.sum()
    }

    fun part2(input: List<String>): Int {
        val crt = CRT()
        input.forEach { line ->
            crt.exec(line)
        }
        return 0
    }

    val input = readInput("Day10")

    println(part1(input))
    println(part2(input))
}

Compiled from "Day10.kt"
public final class Day10Kt$main$CRT {
  private int cycle;

  private int register;

  private java.util.List<java.lang.Character> row;

  public Day10Kt$main$CRT();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: iconst_1
       6: putfield      #12                 // Field register:I
       9: aload_0
      10: new           #14                 // class java/util/ArrayList
      13: dup
      14: invokespecial #15                 // Method java/util/ArrayList."<init>":()V
      17: checkcast     #17                 // class java/util/List
      20: putfield      #21                 // Field row:Ljava/util/List;
      23: return

  public final int getCycle();
    Code:
       0: aload_0
       1: getfield      #28                 // Field cycle:I
       4: ireturn

  public final void setCycle(int);
    Code:
       0: aload_0
       1: iload_1
       2: putfield      #28                 // Field cycle:I
       5: return

  public final int getRegister();
    Code:
       0: aload_0
       1: getfield      #12                 // Field register:I
       4: ireturn

  public final void setRegister(int);
    Code:
       0: aload_0
       1: iload_1
       2: putfield      #12                 // Field register:I
       5: return

  public final java.util.List<java.lang.Character> getRow();
    Code:
       0: aload_0
       1: getfield      #21                 // Field row:Ljava/util/List;
       4: areturn

  public final void setRow(java.util.List<java.lang.Character>);
    Code:
       0: aload_1
       1: ldc           #40                 // String <set-?>
       3: invokestatic  #46                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: putfield      #21                 // Field row:Ljava/util/List;
      11: return

  public final void exec(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #50                 // String op
       3: invokestatic  #46                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokespecial #53                 // Method doCycle:()V
      10: ldc           #55                 // String noop
      12: aload_1
      13: invokestatic  #59                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      16: ifeq          20
      19: return
      20: aload_0
      21: invokespecial #53                 // Method doCycle:()V
      24: aload_0
      25: aload_0
      26: getfield      #12                 // Field register:I
      29: aload_1
      30: checkcast     #61                 // class java/lang/CharSequence
      33: iconst_1
      34: anewarray     #63                 // class java/lang/String
      37: astore_2
      38: aload_2
      39: iconst_0
      40: ldc           #65                 // String
      42: aastore
      43: aload_2
      44: iconst_0
      45: iconst_0
      46: bipush        6
      48: aconst_null
      49: invokestatic  #71                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      52: iconst_1
      53: invokeinterface #75,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      58: checkcast     #63                 // class java/lang/String
      61: invokestatic  #81                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      64: iadd
      65: putfield      #12                 // Field register:I
      68: return

  private final void doCycle();
    Code:
       0: aload_0
       1: getfield      #28                 // Field cycle:I
       4: istore_1
       5: aload_0
       6: iload_1
       7: iconst_1
       8: iadd
       9: putfield      #28                 // Field cycle:I
      12: aload_0
      13: invokespecial #85                 // Method drawPixel:()V
      16: return

  private final void drawPixel();
    Code:
       0: aload_0
       1: getfield      #21                 // Field row:Ljava/util/List;
       4: invokeinterface #88,  1           // InterfaceMethod java/util/List.size:()I
       9: istore_1
      10: iload_1
      11: aload_0
      12: getfield      #12                 // Field register:I
      15: iconst_1
      16: isub
      17: if_icmplt     47
      20: iload_1
      21: aload_0
      22: getfield      #12                 // Field register:I
      25: iconst_1
      26: iadd
      27: if_icmpgt     47
      30: aload_0
      31: getfield      #21                 // Field row:Ljava/util/List;
      34: bipush        35
      36: invokestatic  #94                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      39: invokeinterface #98,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      44: goto          61
      47: aload_0
      48: getfield      #21                 // Field row:Ljava/util/List;
      51: bipush        46
      53: invokestatic  #94                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      56: invokeinterface #98,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      61: pop
      62: aload_0
      63: getfield      #28                 // Field cycle:I
      66: bipush        40
      68: irem
      69: ifne          111
      72: aload_0
      73: getfield      #21                 // Field row:Ljava/util/List;
      76: checkcast     #100                // class java/lang/Iterable
      79: ldc           #65                 // String
      81: checkcast     #61                 // class java/lang/CharSequence
      84: aconst_null
      85: aconst_null
      86: iconst_0
      87: aconst_null
      88: aconst_null
      89: bipush        62
      91: aconst_null
      92: invokestatic  #106                // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
      95: getstatic     #112                // Field java/lang/System.out:Ljava/io/PrintStream;
      98: swap
      99: invokevirtual #118                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     102: aload_0
     103: getfield      #21                 // Field row:Ljava/util/List;
     106: invokeinterface #121,  1          // InterfaceMethod java/util/List.clear:()V
     111: return
}

Compiled from "Day10.kt"
public final class Day10Kt {
  public static final void main();
    Code:
       0: ldc           #8                  // String Day10
       2: invokestatic  #14                 // Method UtilsKt.readInput:(Ljava/lang/String;)Ljava/util/List;
       5: astore_0
       6: aload_0
       7: invokestatic  #18                 // Method main$part1:(Ljava/util/List;)I
      10: istore_1
      11: getstatic     #24                 // Field java/lang/System.out:Ljava/io/PrintStream;
      14: iload_1
      15: invokevirtual #30                 // Method java/io/PrintStream.println:(I)V
      18: aload_0
      19: invokestatic  #33                 // Method main$part2:(Ljava/util/List;)I
      22: istore_1
      23: getstatic     #24                 // Field java/lang/System.out:Ljava/io/PrintStream;
      26: iload_1
      27: invokevirtual #30                 // Method java/io/PrintStream.println:(I)V
      30: return

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

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: new           #43                 // class java/util/ArrayList
       3: dup
       4: invokespecial #46                 // Method java/util/ArrayList."<init>":()V
       7: checkcast     #48                 // class java/util/List
      10: astore_1
      11: iconst_0
      12: istore_2
      13: iconst_1
      14: istore_2
      15: iconst_0
      16: istore_3
      17: aload_0
      18: checkcast     #50                 // class java/lang/Iterable
      21: astore        4
      23: iconst_0
      24: istore        5
      26: aload         4
      28: invokeinterface #54,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      33: astore        6
      35: aload         6
      37: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      42: ifeq          205
      45: aload         6
      47: invokeinterface #64,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      52: astore        7
      54: aload         7
      56: checkcast     #66                 // class java/lang/String
      59: astore        8
      61: iconst_0
      62: istore        9
      64: ldc           #68                 // String noop
      66: aload         8
      68: invokestatic  #74                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      71: ifeq          104
      74: iload_3
      75: iconst_1
      76: iadd
      77: istore_3
      78: iload_3
      79: bipush        20
      81: isub
      82: bipush        40
      84: irem
      85: ifne          101
      88: aload_1
      89: iload_3
      90: iload_2
      91: imul
      92: invokestatic  #80                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      95: invokeinterface #84,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     100: pop
     101: goto          201
     104: iload_3
     105: iconst_1
     106: iadd
     107: istore_3
     108: iload_3
     109: bipush        20
     111: isub
     112: bipush        40
     114: irem
     115: ifne          131
     118: aload_1
     119: iload_3
     120: iload_2
     121: imul
     122: invokestatic  #80                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     125: invokeinterface #84,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     130: pop
     131: iload_3
     132: iconst_1
     133: iadd
     134: istore_3
     135: iload_3
     136: bipush        20
     138: isub
     139: bipush        40
     141: irem
     142: ifne          158
     145: aload_1
     146: iload_3
     147: iload_2
     148: imul
     149: invokestatic  #80                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     152: invokeinterface #84,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     157: pop
     158: iload_2
     159: aload         8
     161: checkcast     #86                 // class java/lang/CharSequence
     164: iconst_1
     165: anewarray     #66                 // class java/lang/String
     168: astore        10
     170: aload         10
     172: iconst_0
     173: ldc           #88                 // String
     175: aastore
     176: aload         10
     178: iconst_0
     179: iconst_0
     180: bipush        6
     182: aconst_null
     183: invokestatic  #94                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     186: iconst_1
     187: invokeinterface #98,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     192: checkcast     #66                 // class java/lang/String
     195: invokestatic  #102                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     198: iadd
     199: istore_2
     200: nop
     201: nop
     202: goto          35
     205: nop
     206: aload_1
     207: checkcast     #50                 // class java/lang/Iterable
     210: invokestatic  #108                // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
     213: ireturn

  private static final int main$part2(java.util.List<java.lang.String>);
    Code:
       0: new           #122                // class Day10Kt$main$CRT
       3: dup
       4: invokespecial #123                // Method Day10Kt$main$CRT."<init>":()V
       7: astore_1
       8: aload_0
       9: checkcast     #50                 // class java/lang/Iterable
      12: astore_2
      13: iconst_0
      14: istore_3
      15: aload_2
      16: invokeinterface #54,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      21: astore        4
      23: aload         4
      25: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      30: ifeq          63
      33: aload         4
      35: invokeinterface #64,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      40: astore        5
      42: aload         5
      44: checkcast     #66                 // class java/lang/String
      47: astore        6
      49: iconst_0
      50: istore        7
      52: aload_1
      53: aload         6
      55: invokevirtual #127                // Method Day10Kt$main$CRT.exec:(Ljava/lang/String;)V
      58: nop
      59: nop
      60: goto          23
      63: nop
      64: iconst_0
      65: ireturn
}


fun main() {
    fun myScore(strategy: String): Int {
        return when {
            strategy.contains('X') -> 1
            strategy.contains('Y') -> 2
            strategy.contains('Z') -> 3
            else -> throw IllegalArgumentException()
        }
    }

    fun part1(input: List<String>): Int {
        val wins = listOf("A Y", "B Z", "C X")
        val draws = listOf("A X", "B Y", "C Z")
        var score = 0
        input.forEach {
            score += myScore(it)
            when {
                wins.contains(it) -> score += 6
                draws.contains(it) -> score += 3
            }
        }
        return score
    }

    fun lose(theirs: Char): Int {
        return when (theirs) {
            'A' -> myScore("Z")
            'B' -> myScore("X")
            'C' -> myScore("Y")
            else -> throw IllegalArgumentException()
        }
    }

    fun draw(theirs: Char): Int {
        return 3 + when (theirs) {
            'A' -> myScore("X")
            'B' -> myScore("Y")
            'C' -> myScore("Z")
            else -> throw IllegalArgumentException()
        }
    }

    fun win(theirs: Char): Int {
        return 6 + when (theirs) {
            'A' -> myScore("Y")
            'B' -> myScore("Z")
            'C' -> myScore("X")
            else -> throw IllegalArgumentException()
        }
    }

    fun part2(input: List<String>): Int {
        var score = 0
        input.forEach {
            when (it[2]) {
                'X' -> {
                    score += lose(it[0])
                }

                'Y' -> {
                    score += draw(it[0])
                }

                'Z' -> {
                    score += win(it[0])
                }
            }
        }
        return score
    }

    val input = readInput("Day02")

    println(part1(input))
    println(part2(input))
}

Compiled from "Day02.kt"
public final class Day02Kt {
  public static final void main();
    Code:
       0: ldc           #8                  // String Day02
       2: invokestatic  #14                 // Method UtilsKt.readInput:(Ljava/lang/String;)Ljava/util/List;
       5: astore_0
       6: aload_0
       7: invokestatic  #18                 // Method main$part1:(Ljava/util/List;)I
      10: istore_1
      11: getstatic     #24                 // Field java/lang/System.out:Ljava/io/PrintStream;
      14: iload_1
      15: invokevirtual #30                 // Method java/io/PrintStream.println:(I)V
      18: aload_0
      19: invokestatic  #33                 // Method main$part2:(Ljava/util/List;)I
      22: istore_1
      23: getstatic     #24                 // Field java/lang/System.out:Ljava/io/PrintStream;
      26: iload_1
      27: invokevirtual #30                 // Method java/io/PrintStream.println:(I)V
      30: return

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

  private static final int main$myScore(java.lang.String);
    Code:
       0: nop
       1: aload_0
       2: checkcast     #44                 // class java/lang/CharSequence
       5: bipush        88
       7: iconst_0
       8: iconst_2
       9: aconst_null
      10: invokestatic  #50                 // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;CZILjava/lang/Object;)Z
      13: ifeq          20
      16: iconst_1
      17: goto          66
      20: aload_0
      21: checkcast     #44                 // class java/lang/CharSequence
      24: bipush        89
      26: iconst_0
      27: iconst_2
      28: aconst_null
      29: invokestatic  #50                 // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;CZILjava/lang/Object;)Z
      32: ifeq          39
      35: iconst_2
      36: goto          66
      39: aload_0
      40: checkcast     #44                 // class java/lang/CharSequence
      43: bipush        90
      45: iconst_0
      46: iconst_2
      47: aconst_null
      48: invokestatic  #50                 // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;CZILjava/lang/Object;)Z
      51: ifeq          58
      54: iconst_3
      55: goto          66
      58: new           #52                 // class java/lang/IllegalArgumentException
      61: dup
      62: invokespecial #55                 // Method java/lang/IllegalArgumentException."<init>":()V
      65: athrow
      66: ireturn

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: iconst_3
       1: anewarray     #60                 // class java/lang/String
       4: astore_2
       5: aload_2
       6: iconst_0
       7: ldc           #62                 // String A Y
       9: aastore
      10: aload_2
      11: iconst_1
      12: ldc           #64                 // String B Z
      14: aastore
      15: aload_2
      16: iconst_2
      17: ldc           #66                 // String C X
      19: aastore
      20: aload_2
      21: invokestatic  #72                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
      24: astore_1
      25: iconst_3
      26: anewarray     #60                 // class java/lang/String
      29: astore_3
      30: aload_3
      31: iconst_0
      32: ldc           #74                 // String A X
      34: aastore
      35: aload_3
      36: iconst_1
      37: ldc           #76                 // String B Y
      39: aastore
      40: aload_3
      41: iconst_2
      42: ldc           #78                 // String C Z
      44: aastore
      45: aload_3
      46: invokestatic  #72                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
      49: astore_2
      50: iconst_0
      51: istore_3
      52: aload_0
      53: checkcast     #80                 // class java/lang/Iterable
      56: astore        4
      58: iconst_0
      59: istore        5
      61: aload         4
      63: invokeinterface #84,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      68: astore        6
      70: aload         6
      72: invokeinterface #90,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      77: ifeq          147
      80: aload         6
      82: invokeinterface #94,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      87: astore        7
      89: aload         7
      91: checkcast     #60                 // class java/lang/String
      94: astore        8
      96: iconst_0
      97: istore        9
      99: iload_3
     100: aload         8
     102: invokestatic  #96                 // Method main$myScore:(Ljava/lang/String;)I
     105: iadd
     106: istore_3
     107: nop
     108: aload_1
     109: aload         8
     111: invokeinterface #102,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
     116: ifeq          127
     119: iload_3
     120: bipush        6
     122: iadd
     123: istore_3
     124: goto          142
     127: aload_2
     128: aload         8
     130: invokeinterface #102,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
     135: ifeq          142
     138: iload_3
     139: iconst_3
     140: iadd
     141: istore_3
     142: nop
     143: nop
     144: goto          70
     147: nop
     148: iload_3
     149: ireturn

  private static final int main$lose(char);
    Code:
       0: iload_0
       1: tableswitch   { // 65 to 67
                    65: 28
                    66: 36
                    67: 44
               default: 52
          }
      28: ldc           #117                // String Z
      30: invokestatic  #96                 // Method main$myScore:(Ljava/lang/String;)I
      33: goto          60
      36: ldc           #119                // String X
      38: invokestatic  #96                 // Method main$myScore:(Ljava/lang/String;)I
      41: goto          60
      44: ldc           #121                // String Y
      46: invokestatic  #96                 // Method main$myScore:(Ljava/lang/String;)I
      49: goto          60
      52: new           #52                 // class java/lang/IllegalArgumentException
      55: dup
      56: invokespecial #55                 // Method java/lang/IllegalArgumentException."<init>":()V
      59: athrow
      60: ireturn

  private static final int main$draw(char);
    Code:
       0: iconst_3
       1: iload_0
       2: tableswitch   { // 65 to 67
                    65: 28
                    66: 36
                    67: 44
               default: 52
          }
      28: ldc           #119                // String X
      30: invokestatic  #96                 // Method main$myScore:(Ljava/lang/String;)I
      33: goto          60
      36: ldc           #121                // String Y
      38: invokestatic  #96                 // Method main$myScore:(Ljava/lang/String;)I
      41: goto          60
      44: ldc           #117                // String Z
      46: invokestatic  #96                 // Method main$myScore:(Ljava/lang/String;)I
      49: goto          60
      52: new           #52                 // class java/lang/IllegalArgumentException
      55: dup
      56: invokespecial #55                 // Method java/lang/IllegalArgumentException."<init>":()V
      59: athrow
      60: iadd
      61: ireturn

  private static final int main$win(char);
    Code:
       0: bipush        6
       2: iload_0
       3: tableswitch   { // 65 to 67
                    65: 28
                    66: 36
                    67: 44
               default: 52
          }
      28: ldc           #121                // String Y
      30: invokestatic  #96                 // Method main$myScore:(Ljava/lang/String;)I
      33: goto          60
      36: ldc           #117                // String Z
      38: invokestatic  #96                 // Method main$myScore:(Ljava/lang/String;)I
      41: goto          60
      44: ldc           #119                // String X
      46: invokestatic  #96                 // Method main$myScore:(Ljava/lang/String;)I
      49: goto          60
      52: new           #52                 // class java/lang/IllegalArgumentException
      55: dup
      56: invokespecial #55                 // Method java/lang/IllegalArgumentException."<init>":()V
      59: athrow
      60: iadd
      61: ireturn

  private static final int main$part2(java.util.List<java.lang.String>);
    Code:
       0: iconst_0
       1: istore_1
       2: aload_0
       3: checkcast     #80                 // class java/lang/Iterable
       6: astore_2
       7: iconst_0
       8: istore_3
       9: aload_2
      10: invokeinterface #84,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      15: astore        4
      17: aload         4
      19: invokeinterface #90,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      24: ifeq          127
      27: aload         4
      29: invokeinterface #94,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      34: astore        5
      36: aload         5
      38: checkcast     #60                 // class java/lang/String
      41: astore        6
      43: iconst_0
      44: istore        7
      46: aload         6
      48: iconst_2
      49: invokevirtual #129                // Method java/lang/String.charAt:(I)C
      52: tableswitch   { // 88 to 90
                    88: 80
                    89: 95
                    90: 110
               default: 122
          }
      80: iload_1
      81: aload         6
      83: iconst_0
      84: invokevirtual #129                // Method java/lang/String.charAt:(I)C
      87: invokestatic  #131                // Method main$lose:(C)I
      90: iadd
      91: istore_1
      92: goto          122
      95: iload_1
      96: aload         6
      98: iconst_0
      99: invokevirtual #129                // Method java/lang/String.charAt:(I)C
     102: invokestatic  #133                // Method main$draw:(C)I
     105: iadd
     106: istore_1
     107: goto          122
     110: iload_1
     111: aload         6
     113: iconst_0
     114: invokevirtual #129                // Method java/lang/String.charAt:(I)C
     117: invokestatic  #135                // Method main$win:(C)I
     120: iadd
     121: istore_1
     122: nop
     123: nop
     124: goto          17
     127: nop
     128: iload_1
     129: ireturn
}


fun main() {

    fun neighborsOf(coord: Coord2D, map: Map<Coord2D, Int>): List<Coord2D> {
        val neighbors = mutableListOf<Coord2D>()
        if (coord.x > 0) {
            val newCoord = coord.moved(-1, 0)
            if (map[newCoord]!! - map[coord]!! <= 1) neighbors.add(newCoord)
        }
        if (coord.y > 0) {
            val newCoord = coord.moved(0, -1)
            if (map[newCoord]!! - map[coord]!! <= 1) neighbors.add(newCoord)
        }
        val newCoordX = coord.moved(1, 0)
        if (map.containsKey(newCoordX) && map[newCoordX]!! - map[coord]!! <= 1) neighbors.add(newCoordX)
        val newCoordY = coord.moved(0, 1)
        if (map.containsKey(newCoordY) && map[newCoordY]!! - map[coord]!! <= 1) neighbors.add(newCoordY)

        return neighbors
    }

    fun printDistanceMap(distances: Map<Coord2D, Int>) {
        val minX = distances.keys.minOf { it.x }
        val maxX = distances.keys.maxOf { it.x }
        val minY = distances.keys.minOf { it.y }
        val maxY = distances.keys.maxOf { it.y }
        for (x in minX..maxX) {
            for (y in minY..maxY) {
                val dStr = distances.getOrDefault(Coord2D(x, y), -1).toString().padStart(2, ' ')
                print("$dStr | ")
            }
            println()
        }
    }

    fun shortestPath(heights: Map<Coord2D, Int>, start: Coord2D, end: Coord2D): Int {
        val distances = mutableMapOf(start to 0)
        val queue = mutableListOf(start)
        while (queue.isNotEmpty()) {
            val current = queue.removeFirst()
            val distance = distances[current]!!
            if (current == end) {
//                printDistanceMap(distances)
                return distance
            }
            val newEntries = neighborsOf(current, heights).filter { !distances.containsKey(it) }
            queue.addAll(newEntries)
            distances.putAll(newEntries.map { it to distance + 1 })
        }
        return -1
    }

    fun buildHeightMap(input: List<String>): Triple<Coord2D, Coord2D, Map<Coord2D, Int>> {
        lateinit var start: Coord2D
        lateinit var end: Coord2D
        val heights = input.flatMapIndexed { x, line ->
            line.mapIndexed { y, c ->
                Coord2D(x, y) to when (c) {
                    'E' -> {
                        end = Coord2D(x, y)
                        'z'.code - 97
                    }

                    'S' -> {
                        start = Coord2D(x, y)
                        'a'.code - 97
                    }

                    else -> c.code - 97
                }
            }
        }.toMap()
        return Triple(start, end, heights)
    }

    fun part1(input: List<String>): Int {
        val (start, end, heights) = buildHeightMap(input)
        return shortestPath(heights, start, end)
    }

    fun part2(input: List<String>): Int {
        val (_, end, heights) = buildHeightMap(input)
        return heights.filterValues { it == 0 }.keys.map { shortestPath(heights, it, end) }.filter { it > 0 }.min()
    }

//    val testinput = readInput("Day12_test")
//    println(part1(testinput))

    val input = readInput("Day12")

    println(part1(input))
    println(part2(input))
}

Compiled from "Day12.kt"
public final class Day12Kt {
  public static final void main();
    Code:
       0: ldc           #8                  // String Day12
       2: invokestatic  #14                 // Method UtilsKt.readInput:(Ljava/lang/String;)Ljava/util/List;
       5: astore_0
       6: aload_0
       7: invokestatic  #18                 // Method main$part1:(Ljava/util/List;)I
      10: istore_1
      11: getstatic     #24                 // Field java/lang/System.out:Ljava/io/PrintStream;
      14: iload_1
      15: invokevirtual #30                 // Method java/io/PrintStream.println:(I)V
      18: aload_0
      19: invokestatic  #33                 // Method main$part2:(Ljava/util/List;)I
      22: istore_1
      23: getstatic     #24                 // Field java/lang/System.out:Ljava/io/PrintStream;
      26: iload_1
      27: invokevirtual #30                 // Method java/io/PrintStream.println:(I)V
      30: return

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

  private static final java.util.List<Coord2D> main$neighborsOf(Coord2D, java.util.Map<Coord2D, java.lang.Integer>);
    Code:
       0: new           #45                 // class java/util/ArrayList
       3: dup
       4: invokespecial #48                 // Method java/util/ArrayList."<init>":()V
       7: checkcast     #50                 // class java/util/List
      10: astore_2
      11: aload_0
      12: invokevirtual #56                 // Method Coord2D.getX:()I
      15: ifle          72
      18: aload_0
      19: iconst_m1
      20: iconst_0
      21: invokevirtual #60                 // Method Coord2D.moved:(II)LCoord2D;
      24: astore_3
      25: aload_1
      26: aload_3
      27: invokeinterface #66,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      32: dup
      33: invokestatic  #72                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      36: checkcast     #74                 // class java/lang/Number
      39: invokevirtual #77                 // Method java/lang/Number.intValue:()I
      42: aload_1
      43: aload_0
      44: invokeinterface #66,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      49: dup
      50: invokestatic  #72                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      53: checkcast     #74                 // class java/lang/Number
      56: invokevirtual #77                 // Method java/lang/Number.intValue:()I
      59: isub
      60: iconst_1
      61: if_icmpgt     72
      64: aload_2
      65: aload_3
      66: invokeinterface #81,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      71: pop
      72: aload_0
      73: invokevirtual #84                 // Method Coord2D.getY:()I
      76: ifle          133
      79: aload_0
      80: iconst_0
      81: iconst_m1
      82: invokevirtual #60                 // Method Coord2D.moved:(II)LCoord2D;
      85: astore_3
      86: aload_1
      87: aload_3
      88: invokeinterface #66,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      93: dup
      94: invokestatic  #72                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      97: checkcast     #74                 // class java/lang/Number
     100: invokevirtual #77                 // Method java/lang/Number.intValue:()I
     103: aload_1
     104: aload_0
     105: invokeinterface #66,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     110: dup
     111: invokestatic  #72                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     114: checkcast     #74                 // class java/lang/Number
     117: invokevirtual #77                 // Method java/lang/Number.intValue:()I
     120: isub
     121: iconst_1
     122: if_icmpgt     133
     125: aload_2
     126: aload_3
     127: invokeinterface #81,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     132: pop
     133: aload_0
     134: iconst_1
     135: iconst_0
     136: invokevirtual #60                 // Method Coord2D.moved:(II)LCoord2D;
     139: astore_3
     140: aload_1
     141: aload_3
     142: invokeinterface #87,  2           // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
     147: ifeq          197
     150: aload_1
     151: aload_3
     152: invokeinterface #66,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     157: dup
     158: invokestatic  #72                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     161: checkcast     #74                 // class java/lang/Number
     164: invokevirtual #77                 // Method java/lang/Number.intValue:()I
     167: aload_1
     168: aload_0
     169: invokeinterface #66,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     174: dup
     175: invokestatic  #72                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     178: checkcast     #74                 // class java/lang/Number
     181: invokevirtual #77                 // Method java/lang/Number.intValue:()I
     184: isub
     185: iconst_1
     186: if_icmpgt     197
     189: aload_2
     190: aload_3
     191: invokeinterface #81,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     196: pop
     197: aload_0
     198: iconst_0
     199: iconst_1
     200: invokevirtual #60                 // Method Coord2D.moved:(II)LCoord2D;
     203: astore        4
     205: aload_1
     206: aload         4
     208: invokeinterface #87,  2           // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
     213: ifeq          265
     216: aload_1
     217: aload         4
     219: invokeinterface #66,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     224: dup
     225: invokestatic  #72                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     228: checkcast     #74                 // class java/lang/Number
     231: invokevirtual #77                 // Method java/lang/Number.intValue:()I
     234: aload_1
     235: aload_0
     236: invokeinterface #66,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     241: dup
     242: invokestatic  #72                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     245: checkcast     #74                 // class java/lang/Number
     248: invokevirtual #77                 // Method java/lang/Number.intValue:()I
     251: isub
     252: iconst_1
     253: if_icmpgt     265
     256: aload_2
     257: aload         4
     259: invokeinterface #81,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     264: pop
     265: aload_2
     266: areturn

  private static final void main$printDistanceMap(java.util.Map<Coord2D, java.lang.Integer>);
    Code:
       0: aload_0
       1: invokeinterface #102,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
       6: checkcast     #104                // class java/lang/Iterable
       9: invokeinterface #108,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      14: astore_3
      15: aload_3
      16: invokeinterface #114,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      21: ifne          32
      24: new           #116                // class java/util/NoSuchElementException
      27: dup
      28: invokespecial #117                // Method java/util/NoSuchElementException."<init>":()V
      31: athrow
      32: aload_3
      33: invokeinterface #121,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      38: checkcast     #52                 // class Coord2D
      41: astore        4
      43: iconst_0
      44: istore        5
      46: aload         4
      48: invokevirtual #56                 // Method Coord2D.getX:()I
      51: istore        4
      53: aload_3
      54: invokeinterface #114,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      59: ifeq          97
      62: aload_3
      63: invokeinterface #121,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      68: checkcast     #52                 // class Coord2D
      71: astore        5
      73: iconst_0
      74: istore        6
      76: aload         5
      78: invokevirtual #56                 // Method Coord2D.getX:()I
      81: istore        5
      83: iload         4
      85: iload         5
      87: if_icmple     53
      90: iload         5
      92: istore        4
      94: goto          53
      97: iload         4
      99: istore_1
     100: aload_0
     101: invokeinterface #102,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
     106: checkcast     #104                // class java/lang/Iterable
     109: invokeinterface #108,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     114: astore        4
     116: aload         4
     118: invokeinterface #114,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     123: ifne          134
     126: new           #116                // class java/util/NoSuchElementException
     129: dup
     130: invokespecial #117                // Method java/util/NoSuchElementException."<init>":()V
     133: athrow
     134: aload         4
     136: invokeinterface #121,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     141: checkcast     #52                 // class Coord2D
     144: astore        5
     146: iconst_0
     147: istore        6
     149: aload         5
     151: invokevirtual #56                 // Method Coord2D.getX:()I
     154: istore        5
     156: aload         4
     158: invokeinterface #114,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     163: ifeq          202
     166: aload         4
     168: invokeinterface #121,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     173: checkcast     #52                 // class Coord2D
     176: astore        6
     178: iconst_0
     179: istore        7
     181: aload         6
     183: invokevirtual #56                 // Method Coord2D.getX:()I
     186: istore        6
     188: iload         5
     190: iload         6
     192: if_icmpge     156
     195: iload         6
     197: istore        5
     199: goto          156
     202: iload         5
     204: istore_2
     205: aload_0
     206: invokeinterface #102,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
     211: checkcast     #104                // class java/lang/Iterable
     214: invokeinterface #108,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     219: astore        5
     221: aload         5
     223: invokeinterface #114,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     228: ifne          239
     231: new           #116                // class java/util/NoSuchElementException
     234: dup
     235: invokespecial #117                // Method java/util/NoSuchElementException."<init>":()V
     238: athrow
     239: aload         5
     241: invokeinterface #121,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     246: checkcast     #52                 // class Coord2D
     249: astore        6
     251: iconst_0
     252: istore        7
     254: aload         6
     256: invokevirtual #84                 // Method Coord2D.getY:()I
     259: istore        6
     261: aload         5
     263: invokeinterface #114,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     268: ifeq          307
     271: aload         5
     273: invokeinterface #121,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     278: checkcast     #52                 // class Coord2D
     281: astore        7
     283: iconst_0
     284: istore        8
     286: aload         7
     288: invokevirtual #84                 // Method Coord2D.getY:()I
     291: istore        7
     293: iload         6
     295: iload         7
     297: if_icmple     261
     300: iload         7
     302: istore        6
     304: goto          261
     307: iload         6
     309: istore_3
     310: aload_0
     311: invokeinterface #102,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
     316: checkcast     #104                // class java/lang/Iterable
     319: invokeinterface #108,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     324: astore        6
     326: aload         6
     328: invokeinterface #114,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     333: ifne          344
     336: new           #116                // class java/util/NoSuchElementException
     339: dup
     340: invokespecial #117                // Method java/util/NoSuchElementException."<init>":()V
     343: athrow
     344: aload         6
     346: invokeinterface #121,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     351: checkcast     #52                 // class Coord2D
     354: astore        7
     356: iconst_0
     357: istore        8
     359: aload         7
     361: invokevirtual #84                 // Method Coord2D.getY:()I
     364: istore        7
     366: aload         6
     368: invokeinterface #114,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     373: ifeq          412
     376: aload         6
     378: invokeinterface #121,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     383: checkcast     #52                 // class Coord2D
     386: astore        8
     388: iconst_0
     389: istore        9
     391: aload         8
     393: invokevirtual #84                 // Method Coord2D.getY:()I
     396: istore        8
     398: iload         7
     400: iload         8
     402: if_icmpge     366
     405: iload         8
     407: istore        7
     409: goto          366
     412: iload         7
     414: istore        4
     416: iload_1
     417: istore        5
     419: iload         5
     421: iload_2
     422: if_icmpgt     531
     425: iload_3
     426: istore        6
     428: iload         6
     430: iload         4
     432: if_icmpgt     513
     435: aload_0
     436: new           #52                 // class Coord2D
     439: dup
     440: iload         5
     442: iload         6
     444: invokespecial #124                // Method Coord2D."<init>":(II)V
     447: iconst_m1
     448: invokestatic  #130                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     451: invokeinterface #134,  3          // InterfaceMethod java/util/Map.getOrDefault:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     456: checkcast     #74                 // class java/lang/Number
     459: invokevirtual #77                 // Method java/lang/Number.intValue:()I
     462: invokestatic  #139                // Method java/lang/String.valueOf:(I)Ljava/lang/String;
     465: iconst_2
     466: bipush        32
     468: invokestatic  #145                // Method kotlin/text/StringsKt.padStart:(Ljava/lang/String;IC)Ljava/lang/String;
     471: astore        7
     473: new           #147                // class java/lang/StringBuilder
     476: dup
     477: invokespecial #148                // Method java/lang/StringBuilder."<init>":()V
     480: aload         7
     482: invokevirtual #152                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     485: ldc           #154                // String  |
     487: invokevirtual #152                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     490: invokevirtual #158                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     493: getstatic     #24                 // Field java/lang/System.out:Ljava/io/PrintStream;
     496: swap
     497: invokevirtual #161                // Method java/io/PrintStream.print:(Ljava/lang/Object;)V
     500: iload         6
     502: iload         4
     504: if_icmpeq     513
     507: iinc          6, 1
     510: goto          435
     513: getstatic     #24                 // Field java/lang/System.out:Ljava/io/PrintStream;
     516: invokevirtual #163                // Method java/io/PrintStream.println:()V
     519: iload         5
     521: iload_2
     522: if_icmpeq     531
     525: iinc          5, 1
     528: goto          425
     531: return

  private static final int main$shortestPath(java.util.Map<Coord2D, java.lang.Integer>, Coord2D, Coord2D);
    Code:
       0: iconst_1
       1: anewarray     #183                // class kotlin/Pair
       4: astore        4
       6: aload         4
       8: iconst_0
       9: aload_1
      10: iconst_0
      11: invokestatic  #130                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      14: invokestatic  #189                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      17: aastore
      18: aload         4
      20: invokestatic  #195                // Method kotlin/collections/MapsKt.mutableMapOf:([Lkotlin/Pair;)Ljava/util/Map;
      23: astore_3
      24: iconst_1
      25: anewarray     #52                 // class Coord2D
      28: astore        5
      30: aload         5
      32: iconst_0
      33: aload_1
      34: aastore
      35: aload         5
      37: invokestatic  #201                // Method kotlin/collections/CollectionsKt.mutableListOf:([Ljava/lang/Object;)Ljava/util/List;
      40: astore        4
      42: aload         4
      44: checkcast     #203                // class java/util/Collection
      47: invokeinterface #206,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
      52: ifne          59
      55: iconst_1
      56: goto          60
      59: iconst_0
      60: ifeq          360
      63: aload         4
      65: invokeinterface #209,  1          // InterfaceMethod java/util/List.removeFirst:()Ljava/lang/Object;
      70: dup
      71: ldc           #211                // String removeFirst(...)
      73: invokestatic  #215                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      76: checkcast     #52                 // class Coord2D
      79: astore        5
      81: aload_3
      82: aload         5
      84: invokeinterface #66,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      89: dup
      90: invokestatic  #72                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      93: checkcast     #74                 // class java/lang/Number
      96: invokevirtual #77                 // Method java/lang/Number.intValue:()I
      99: istore        6
     101: aload         5
     103: aload_2
     104: invokestatic  #219                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     107: ifeq          113
     110: iload         6
     112: ireturn
     113: aload         5
     115: aload_0
     116: invokestatic  #221                // Method main$neighborsOf:(LCoord2D;Ljava/util/Map;)Ljava/util/List;
     119: checkcast     #104                // class java/lang/Iterable
     122: astore        8
     124: iconst_0
     125: istore        9
     127: aload         8
     129: astore        10
     131: new           #45                 // class java/util/ArrayList
     134: dup
     135: invokespecial #48                 // Method java/util/ArrayList."<init>":()V
     138: checkcast     #203                // class java/util/Collection
     141: astore        11
     143: iconst_0
     144: istore        12
     146: aload         10
     148: invokeinterface #108,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     153: astore        13
     155: aload         13
     157: invokeinterface #114,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     162: ifeq          216
     165: aload         13
     167: invokeinterface #121,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     172: astore        14
     174: aload         14
     176: checkcast     #52                 // class Coord2D
     179: astore        15
     181: iconst_0
     182: istore        16
     184: aload_3
     185: aload         15
     187: invokeinterface #87,  2           // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
     192: ifne          199
     195: iconst_1
     196: goto          200
     199: iconst_0
     200: ifeq          155
     203: aload         11
     205: aload         14
     207: invokeinterface #222,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     212: pop
     213: goto          155
     216: aload         11
     218: checkcast     #50                 // class java/util/List
     221: nop
     222: astore        7
     224: aload         4
     226: aload         7
     228: checkcast     #203                // class java/util/Collection
     231: invokeinterface #226,  2          // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z
     236: pop
     237: aload_3
     238: aload         7
     240: checkcast     #104                // class java/lang/Iterable
     243: astore        8
     245: astore        17
     247: iconst_0
     248: istore        9
     250: aload         8
     252: astore        10
     254: new           #45                 // class java/util/ArrayList
     257: dup
     258: aload         8
     260: bipush        10
     262: invokestatic  #230                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     265: invokespecial #232                // Method java/util/ArrayList."<init>":(I)V
     268: checkcast     #203                // class java/util/Collection
     271: astore        11
     273: iconst_0
     274: istore        12
     276: aload         10
     278: invokeinterface #108,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     283: astore        13
     285: aload         13
     287: invokeinterface #114,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     292: ifeq          342
     295: aload         13
     297: invokeinterface #121,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     302: astore        14
     304: aload         11
     306: aload         14
     308: checkcast     #52                 // class Coord2D
     311: astore        15
     313: astore        18
     315: iconst_0
     316: istore        16
     318: aload         15
     320: iload         6
     322: iconst_1
     323: iadd
     324: invokestatic  #130                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     327: invokestatic  #189                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     330: aload         18
     332: swap
     333: invokeinterface #222,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     338: pop
     339: goto          285
     342: aload         11
     344: checkcast     #50                 // class java/util/List
     347: nop
     348: aload         17
     350: swap
     351: checkcast     #104                // class java/lang/Iterable
     354: invokestatic  #236                // Method kotlin/collections/MapsKt.putAll:(Ljava/util/Map;Ljava/lang/Iterable;)V
     357: goto          42
     360: iconst_m1
     361: ireturn

  private static final kotlin.Triple<Coord2D, Coord2D, java.util.Map<Coord2D, java.lang.Integer>> main$buildHeightMap(java.util.List<java.lang.String>);
    Code:
       0: aconst_null
       1: astore_1
       2: aconst_null
       3: astore_2
       4: aload_0
       5: checkcast     #104                // class java/lang/Iterable
       8: astore        4
      10: new           #45                 // class java/util/ArrayList
      13: dup
      14: invokespecial #48                 // Method java/util/ArrayList."<init>":()V
      17: checkcast     #203                // class java/util/Collection
      20: astore        5
      22: iconst_0
      23: istore        6
      25: aload         4
      27: invokeinterface #108,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      32: astore        7
      34: aload         7
      36: invokeinterface #114,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      41: ifeq          284
      44: aload         7
      46: invokeinterface #121,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      51: astore        8
      53: iload         6
      55: iinc          6, 1
      58: istore        9
      60: iload         9
      62: ifge          68
      65: invokestatic  #265                // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
      68: iload         9
      70: aload         8
      72: checkcast     #136                // class java/lang/String
      75: astore        10
      77: istore        11
      79: iconst_0
      80: istore        12
      82: aload         10
      84: checkcast     #267                // class java/lang/CharSequence
      87: astore        13
      89: iconst_0
      90: istore        14
      92: aload         13
      94: astore        15
      96: new           #45                 // class java/util/ArrayList
      99: dup
     100: aload         13
     102: invokeinterface #270,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     107: invokespecial #232                // Method java/util/ArrayList."<init>":(I)V
     110: checkcast     #203                // class java/util/Collection
     113: astore        16
     115: iconst_0
     116: istore        17
     118: iconst_0
     119: istore        18
     121: iconst_0
     122: istore        19
     124: iload         19
     126: aload         15
     128: invokeinterface #270,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     133: if_icmpge     264
     136: aload         15
     138: iload         19
     140: invokeinterface #274,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     145: istore        20
     147: aload         16
     149: iload         18
     151: iinc          18, 1
     154: iload         20
     156: istore        21
     158: istore        22
     160: astore        23
     162: iconst_0
     163: istore        24
     165: new           #52                 // class Coord2D
     168: dup
     169: iload         11
     171: iload         22
     173: invokespecial #124                // Method Coord2D."<init>":(II)V
     176: iload         21
     178: lookupswitch  { // 2
                    69: 204
                    83: 221
               default: 237
          }
     204: new           #52                 // class Coord2D
     207: dup
     208: iload         11
     210: iload         22
     212: invokespecial #124                // Method Coord2D."<init>":(II)V
     215: astore_2
     216: bipush        25
     218: goto          242
     221: new           #52                 // class Coord2D
     224: dup
     225: iload         11
     227: iload         22
     229: invokespecial #124                // Method Coord2D."<init>":(II)V
     232: astore_1
     233: iconst_0
     234: goto          242
     237: iload         21
     239: bipush        97
     241: isub
     242: invokestatic  #130                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     245: invokestatic  #189                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     248: nop
     249: aload         23
     251: swap
     252: invokeinterface #222,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     257: pop
     258: iinc          19, 1
     261: goto          124
     264: aload         16
     266: checkcast     #50                 // class java/util/List
     269: nop
     270: checkcast     #104                // class java/lang/Iterable
     273: nop
     274: aload         5
     276: swap
     277: invokestatic  #277                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     280: pop
     281: goto          34
     284: aload         5
     286: checkcast     #50                 // class java/util/List
     289: checkcast     #104                // class java/lang/Iterable
     292: invokestatic  #281                // Method kotlin/collections/MapsKt.toMap:(Ljava/lang/Iterable;)Ljava/util/Map;
     295: astore_3
     296: new           #283                // class kotlin/Triple
     299: dup
     300: aload_1
     301: dup
     302: ifnonnull     313
     305: pop
     306: ldc_w         #284                // String start
     309: invokestatic  #288                // Method kotlin/jvm/internal/Intrinsics.throwUninitializedPropertyAccessException:(Ljava/lang/String;)V
     312: aconst_null
     313: aload_2
     314: dup
     315: ifnonnull     326
     318: pop
     319: ldc_w         #289                // String end
     322: invokestatic  #288                // Method kotlin/jvm/internal/Intrinsics.throwUninitializedPropertyAccessException:(Ljava/lang/String;)V
     325: aconst_null
     326: aload_3
     327: invokespecial #292                // Method kotlin/Triple."<init>":(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
     330: areturn

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: invokestatic  #306                // Method main$buildHeightMap:(Ljava/util/List;)Lkotlin/Triple;
       4: astore_1
       5: aload_1
       6: invokevirtual #309                // Method kotlin/Triple.component1:()Ljava/lang/Object;
       9: checkcast     #52                 // class Coord2D
      12: astore_2
      13: aload_1
      14: invokevirtual #312                // Method kotlin/Triple.component2:()Ljava/lang/Object;
      17: checkcast     #52                 // class Coord2D
      20: astore_3
      21: aload_1
      22: invokevirtual #315                // Method kotlin/Triple.component3:()Ljava/lang/Object;
      25: checkcast     #62                 // class java/util/Map
      28: astore        4
      30: aload         4
      32: aload_2
      33: aload_3
      34: invokestatic  #317                // Method main$shortestPath:(Ljava/util/Map;LCoord2D;LCoord2D;)I
      37: ireturn

  private static final int main$part2(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: invokestatic  #306                // Method main$buildHeightMap:(Ljava/util/List;)Lkotlin/Triple;
       4: astore_1
       5: aload_1
       6: invokevirtual #312                // Method kotlin/Triple.component2:()Ljava/lang/Object;
       9: checkcast     #52                 // class Coord2D
      12: astore_2
      13: aload_1
      14: invokevirtual #315                // Method kotlin/Triple.component3:()Ljava/lang/Object;
      17: checkcast     #62                 // class java/util/Map
      20: astore_3
      21: aload_3
      22: astore        4
      24: iconst_0
      25: istore        5
      27: new           #319                // class java/util/LinkedHashMap
      30: dup
      31: invokespecial #320                // Method java/util/LinkedHashMap."<init>":()V
      34: astore        6
      36: aload         4
      38: invokeinterface #323,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
      43: invokeinterface #326,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
      48: astore        7
      50: aload         7
      52: invokeinterface #114,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      57: ifeq          126
      60: aload         7
      62: invokeinterface #121,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      67: checkcast     #328                // class java/util/Map$Entry
      70: astore        8
      72: aload         8
      74: invokeinterface #331,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
      79: checkcast     #74                 // class java/lang/Number
      82: invokevirtual #77                 // Method java/lang/Number.intValue:()I
      85: istore        9
      87: iconst_0
      88: istore        10
      90: iload         9
      92: ifne          99
      95: iconst_1
      96: goto          100
      99: iconst_0
     100: ifeq          50
     103: aload         6
     105: aload         8
     107: invokeinterface #334,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     112: aload         8
     114: invokeinterface #331,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     119: invokevirtual #337                // Method java/util/LinkedHashMap.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     122: pop
     123: goto          50
     126: aload         6
     128: checkcast     #62                 // class java/util/Map
     131: invokeinterface #102,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
     136: checkcast     #104                // class java/lang/Iterable
     139: astore        4
     141: iconst_0
     142: istore        5
     144: aload         4
     146: astore        6
     148: new           #45                 // class java/util/ArrayList
     151: dup
     152: aload         4
     154: bipush        10
     156: invokestatic  #230                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     159: invokespecial #232                // Method java/util/ArrayList."<init>":(I)V
     162: checkcast     #203                // class java/util/Collection
     165: astore        7
     167: iconst_0
     168: istore        8
     170: aload         6
     172: invokeinterface #108,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     177: astore        9
     179: aload         9
     181: invokeinterface #114,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     186: ifeq          234
     189: aload         9
     191: invokeinterface #121,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     196: astore        10
     198: aload         7
     200: aload         10
     202: checkcast     #52                 // class Coord2D
     205: astore        11
     207: astore        13
     209: iconst_0
     210: istore        12
     212: aload_3
     213: aload         11
     215: aload_2
     216: invokestatic  #317                // Method main$shortestPath:(Ljava/util/Map;LCoord2D;LCoord2D;)I
     219: invokestatic  #130                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     222: aload         13
     224: swap
     225: invokeinterface #222,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     230: pop
     231: goto          179
     234: aload         7
     236: checkcast     #50                 // class java/util/List
     239: nop
     240: checkcast     #104                // class java/lang/Iterable
     243: astore        4
     245: nop
     246: iconst_0
     247: istore        5
     249: aload         4
     251: astore        6
     253: new           #45                 // class java/util/ArrayList
     256: dup
     257: invokespecial #48                 // Method java/util/ArrayList."<init>":()V
     260: checkcast     #203                // class java/util/Collection
     263: astore        7
     265: iconst_0
     266: istore        8
     268: aload         6
     270: invokeinterface #108,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     275: astore        9
     277: aload         9
     279: invokeinterface #114,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     284: ifeq          335
     287: aload         9
     289: invokeinterface #121,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     294: astore        10
     296: aload         10
     298: checkcast     #74                 // class java/lang/Number
     301: invokevirtual #77                 // Method java/lang/Number.intValue:()I
     304: istore        11
     306: iconst_0
     307: istore        12
     309: iload         11
     311: ifle          318
     314: iconst_1
     315: goto          319
     318: iconst_0
     319: ifeq          277
     322: aload         7
     324: aload         10
     326: invokeinterface #222,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     331: pop
     332: goto          277
     335: aload         7
     337: checkcast     #50                 // class java/util/List
     340: nop
     341: checkcast     #104                // class java/lang/Iterable
     344: invokestatic  #341                // Method kotlin/collections/CollectionsKt.minOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;
     347: checkcast     #74                 // class java/lang/Number
     350: invokevirtual #77                 // Method java/lang/Number.intValue:()I
     353: ireturn
}