import java.io.*
fun print_day_12() {
    val yellow = "\u001B[33m"
    val reset = "\u001b[0m"
    val green = "\u001B[32m"
    println(yellow + "-".repeat(25) + "Advent of Code - Day 12" + "-".repeat(25) + reset)
    println(green)
    val process = Runtime.getRuntime().exec("figlet Passage Pathing -c -f small")
    val reader = BufferedReader(InputStreamReader(process.inputStream))
    reader.forEachLine { println(it) }
    println(reset)
    println(yellow + "-".repeat(33) + "Output" + "-".repeat(33) + reset + "\n")
}
fun main() {
    print_day_12()
    Day12().part_1()
    Day12().part_2()
    println("\n" + "\u001B[33m" + "=".repeat(72) + "\u001b[0m" + "\n")
}

class Day12 {

    data class Node(val name: String, val isLarge: Boolean = false, var connections: List<Node> = mutableListOf())

    fun part_1() {
        val nodes = mutableMapOf<String, Node>()

        fun followPaths(node: Node, path: List<Node>): List<List<Node>> {
            val newPath = path+node
            return if (node.name == "end" || (path.contains(node) && !node.isLarge)) {
                listOf(newPath)
            } else {
                node.connections.flatMap {
                    followPaths(it, newPath)
                }
            }
        }

        File("../Input/day12.txt").readLines().forEach {
            val pathway = it.split("-").map { node ->
                if (!nodes.containsKey(node)) {
                    nodes[node] = Node(node, node.isUpperCase())
                }
                nodes[node]!!
            }

            pathway[0].connections += pathway[1]
            pathway[1].connections += pathway[0]
        }

        val start = nodes["start"]!!
        val paths = followPaths(start, listOf()).filter { it.last().name == "end" } // only keep nodes that actually end
        println("Puzzle 1: ${paths.size}")

    }
    fun part_2() {
        val nodes = HashMap<String, HashSet<String>>()

        File("../Input/day12.txt").readLines().forEach {
            val (a,b) = it.split("-")
            nodes.getOrPut(a) { HashSet() }.add(b)
            nodes.getOrPut(b) { HashSet() }.add(a)
        }

        fun canVisit(name: String, path: List<String>): Boolean =
            when {
                name.isUpperCase() -> true
                name == "start" -> false
                name !in path -> true
                else -> path.filterNot { it.isUpperCase() }.groupBy { it }.none { it.value.size == 2 }
            }

        fun followPaths(path: List<String> = listOf("start")): List<List<String>> =
            if (path.last() == "end") listOf(path)
            else nodes.getValue(path.last())
                .filter  { canVisit(it, path) }
                .flatMap { followPaths( path + it) }

        println("Puzzle 2: ${followPaths().size}")
    }
}

private fun String.isUpperCase(): Boolean = this == this.uppercase()

Compiled from "day12.kt"
public final class Day12$Node {
  private final java.lang.String name;

  private final boolean isLarge;

  private java.util.List<Day12$Node> connections;

  public Day12$Node(java.lang.String, boolean, java.util.List<Day12$Node>);
    Code:
       0: aload_1
       1: ldc           #10                 // String name
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_3
       7: ldc           #18                 // String connections
       9: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_0
      13: invokespecial #21                 // Method java/lang/Object."<init>":()V
      16: aload_0
      17: aload_1
      18: putfield      #24                 // Field name:Ljava/lang/String;
      21: aload_0
      22: iload_2
      23: putfield      #28                 // Field isLarge:Z
      26: aload_0
      27: aload_3
      28: putfield      #31                 // Field connections:Ljava/util/List;
      31: return

  public Day12$Node(java.lang.String, boolean, java.util.List, int, kotlin.jvm.internal.DefaultConstructorMarker);
    Code:
       0: iload         4
       2: iconst_2
       3: iand
       4: ifeq          9
       7: iconst_0
       8: istore_2
       9: iload         4
      11: iconst_4
      12: iand
      13: ifeq          27
      16: new           #36                 // class java/util/ArrayList
      19: dup
      20: invokespecial #37                 // Method java/util/ArrayList."<init>":()V
      23: checkcast     #39                 // class java/util/List
      26: astore_3
      27: aload_0
      28: aload_1
      29: iload_2
      30: aload_3
      31: invokespecial #41                 // Method "<init>":(Ljava/lang/String;ZLjava/util/List;)V
      34: return

  public final java.lang.String getName();
    Code:
       0: aload_0
       1: getfield      #24                 // Field name:Ljava/lang/String;
       4: areturn

  public final boolean isLarge();
    Code:
       0: aload_0
       1: getfield      #28                 // Field isLarge:Z
       4: ireturn

  public final java.util.List<Day12$Node> getConnections();
    Code:
       0: aload_0
       1: getfield      #31                 // Field connections:Ljava/util/List;
       4: areturn

  public final void setConnections(java.util.List<Day12$Node>);
    Code:
       0: aload_1
       1: ldc           #52                 // String <set-?>
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: putfield      #31                 // Field connections:Ljava/util/List;
      11: return

  public final java.lang.String component1();
    Code:
       0: aload_0
       1: getfield      #24                 // Field name:Ljava/lang/String;
       4: areturn

  public final boolean component2();
    Code:
       0: aload_0
       1: getfield      #28                 // Field isLarge:Z
       4: ireturn

  public final java.util.List<Day12$Node> component3();
    Code:
       0: aload_0
       1: getfield      #31                 // Field connections:Ljava/util/List;
       4: areturn

  public final Day12$Node copy(java.lang.String, boolean, java.util.List<Day12$Node>);
    Code:
       0: aload_1
       1: ldc           #10                 // String name
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_3
       7: ldc           #18                 // String connections
       9: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: new           #2                  // class Day12$Node
      15: dup
      16: aload_1
      17: iload_2
      18: aload_3
      19: invokespecial #41                 // Method "<init>":(Ljava/lang/String;ZLjava/util/List;)V
      22: areturn

  public static Day12$Node copy$default(Day12$Node, java.lang.String, boolean, java.util.List, int, java.lang.Object);
    Code:
       0: iload         4
       2: iconst_1
       3: iand
       4: ifeq          12
       7: aload_0
       8: getfield      #24                 // Field name:Ljava/lang/String;
      11: astore_1
      12: iload         4
      14: iconst_2
      15: iand
      16: ifeq          24
      19: aload_0
      20: getfield      #28                 // Field isLarge:Z
      23: istore_2
      24: iload         4
      26: iconst_4
      27: iand
      28: ifeq          36
      31: aload_0
      32: getfield      #31                 // Field connections:Ljava/util/List;
      35: astore_3
      36: aload_0
      37: aload_1
      38: iload_2
      39: aload_3
      40: invokevirtual #62                 // Method copy:(Ljava/lang/String;ZLjava/util/List;)LDay12$Node;
      43: areturn

  public java.lang.String toString();
    Code:
       0: new           #65                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #66                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #68                 // String Node(name=
       9: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #24                 // Field name:Ljava/lang/String;
      16: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      19: ldc           #74                 // String , isLarge=
      21: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #28                 // Field isLarge:Z
      28: invokevirtual #77                 // Method java/lang/StringBuilder.append:(Z)Ljava/lang/StringBuilder;
      31: ldc           #79                 // String , connections=
      33: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      36: aload_0
      37: getfield      #31                 // Field connections:Ljava/util/List;
      40: invokevirtual #82                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      43: bipush        41
      45: invokevirtual #85                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      48: invokevirtual #87                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      51: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #24                 // Field name:Ljava/lang/String;
       4: invokevirtual #93                 // Method java/lang/String.hashCode:()I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #28                 // Field isLarge:Z
      16: invokestatic  #98                 // Method java/lang/Boolean.hashCode:(Z)I
      19: iadd
      20: istore_1
      21: iload_1
      22: bipush        31
      24: imul
      25: aload_0
      26: getfield      #31                 // Field connections:Ljava/util/List;
      29: invokevirtual #99                 // 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 Day12$Node
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day12$Node
      20: astore_2
      21: aload_0
      22: getfield      #24                 // Field name:Ljava/lang/String;
      25: aload_2
      26: getfield      #24                 // Field name:Ljava/lang/String;
      29: invokestatic  #108                // 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 isLarge:Z
      41: aload_2
      42: getfield      #28                 // Field isLarge:Z
      45: if_icmpeq     50
      48: iconst_0
      49: ireturn
      50: aload_0
      51: getfield      #31                 // Field connections:Ljava/util/List;
      54: aload_2
      55: getfield      #31                 // Field connections:Ljava/util/List;
      58: invokestatic  #108                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      61: ifne          66
      64: iconst_0
      65: ireturn
      66: iconst_1
      67: ireturn
}

Compiled from "day12.kt"
public final class Day12 {
  public Day12();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final void part_1();
    Code:
       0: new           #13                 // class java/util/LinkedHashMap
       3: dup
       4: invokespecial #14                 // Method java/util/LinkedHashMap."<init>":()V
       7: checkcast     #16                 // class java/util/Map
      10: astore_1
      11: new           #18                 // class java/io/File
      14: dup
      15: ldc           #20                 // String ../Input/day12.txt
      17: invokespecial #23                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      20: aconst_null
      21: iconst_1
      22: aconst_null
      23: invokestatic  #29                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      26: checkcast     #31                 // class java/lang/Iterable
      29: astore_2
      30: iconst_0
      31: istore_3
      32: aload_2
      33: invokeinterface #35,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      38: astore        4
      40: aload         4
      42: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      47: ifeq          323
      50: aload         4
      52: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: astore        5
      59: aload         5
      61: checkcast     #47                 // class java/lang/String
      64: astore        6
      66: iconst_0
      67: istore        7
      69: aload         6
      71: checkcast     #49                 // class java/lang/CharSequence
      74: iconst_1
      75: anewarray     #47                 // class java/lang/String
      78: astore        8
      80: aload         8
      82: iconst_0
      83: ldc           #51                 // String -
      85: aastore
      86: aload         8
      88: iconst_0
      89: iconst_0
      90: bipush        6
      92: aconst_null
      93: invokestatic  #57                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      96: checkcast     #31                 // class java/lang/Iterable
      99: astore        8
     101: iconst_0
     102: istore        9
     104: aload         8
     106: astore        10
     108: new           #59                 // class java/util/ArrayList
     111: dup
     112: aload         8
     114: bipush        10
     116: invokestatic  #65                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     119: invokespecial #68                 // Method java/util/ArrayList."<init>":(I)V
     122: checkcast     #70                 // class java/util/Collection
     125: astore        11
     127: iconst_0
     128: istore        12
     130: aload         10
     132: invokeinterface #35,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     137: astore        13
     139: aload         13
     141: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     146: ifeq          236
     149: aload         13
     151: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     156: astore        14
     158: aload         11
     160: aload         14
     162: checkcast     #47                 // class java/lang/String
     165: astore        15
     167: astore        16
     169: iconst_0
     170: istore        17
     172: aload_1
     173: aload         15
     175: invokeinterface #74,  2           // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
     180: ifne          209
     183: aload_1
     184: aload         15
     186: new           #76                 // class Day12$Node
     189: dup
     190: aload         15
     192: aload         15
     194: invokestatic  #82                 // Method Day12Kt.access$isUpperCase:(Ljava/lang/String;)Z
     197: aconst_null
     198: iconst_4
     199: aconst_null
     200: invokespecial #85                 // Method Day12$Node."<init>":(Ljava/lang/String;ZLjava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
     203: invokeinterface #89,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     208: pop
     209: aload_1
     210: aload         15
     212: invokeinterface #93,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     217: dup
     218: invokestatic  #99                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     221: checkcast     #76                 // class Day12$Node
     224: aload         16
     226: swap
     227: invokeinterface #102,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     232: pop
     233: goto          139
     236: aload         11
     238: checkcast     #104                // class java/util/List
     241: nop
     242: astore        18
     244: aload         18
     246: iconst_0
     247: invokeinterface #107,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     252: checkcast     #76                 // class Day12$Node
     255: astore        8
     257: aload         8
     259: aload         8
     261: invokevirtual #111                // Method Day12$Node.getConnections:()Ljava/util/List;
     264: checkcast     #70                 // class java/util/Collection
     267: aload         18
     269: iconst_1
     270: invokeinterface #107,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     275: invokestatic  #115                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/List;
     278: invokevirtual #119                // Method Day12$Node.setConnections:(Ljava/util/List;)V
     281: aload         18
     283: iconst_1
     284: invokeinterface #107,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     289: checkcast     #76                 // class Day12$Node
     292: astore        8
     294: aload         8
     296: aload         8
     298: invokevirtual #111                // Method Day12$Node.getConnections:()Ljava/util/List;
     301: checkcast     #70                 // class java/util/Collection
     304: aload         18
     306: iconst_0
     307: invokeinterface #107,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     312: invokestatic  #115                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/List;
     315: invokevirtual #119                // Method Day12$Node.setConnections:(Ljava/util/List;)V
     318: nop
     319: nop
     320: goto          40
     323: nop
     324: aload_1
     325: ldc           #121                // String start
     327: invokeinterface #93,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     332: dup
     333: invokestatic  #99                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     336: checkcast     #76                 // class Day12$Node
     339: astore_2
     340: aload_2
     341: invokestatic  #124                // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
     344: invokestatic  #128                // Method part_1$followPaths:(LDay12$Node;Ljava/util/List;)Ljava/util/List;
     347: checkcast     #31                 // class java/lang/Iterable
     350: astore        4
     352: iconst_0
     353: istore        5
     355: aload         4
     357: astore        6
     359: new           #59                 // class java/util/ArrayList
     362: dup
     363: invokespecial #129                // Method java/util/ArrayList."<init>":()V
     366: checkcast     #70                 // class java/util/Collection
     369: astore        7
     371: iconst_0
     372: istore        8
     374: aload         6
     376: invokeinterface #35,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     381: astore        9
     383: aload         9
     385: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     390: ifeq          444
     393: aload         9
     395: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     400: astore        10
     402: aload         10
     404: checkcast     #104                // class java/util/List
     407: astore        11
     409: iconst_0
     410: istore        12
     412: aload         11
     414: invokestatic  #133                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     417: checkcast     #76                 // class Day12$Node
     420: invokevirtual #137                // Method Day12$Node.getName:()Ljava/lang/String;
     423: ldc           #139                // String end
     425: invokestatic  #143                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     428: ifeq          383
     431: aload         7
     433: aload         10
     435: invokeinterface #102,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     440: pop
     441: goto          383
     444: aload         7
     446: checkcast     #104                // class java/util/List
     449: nop
     450: astore_3
     451: new           #145                // class java/lang/StringBuilder
     454: dup
     455: invokespecial #146                // Method java/lang/StringBuilder."<init>":()V
     458: ldc           #148                // String Puzzle 1:
     460: invokevirtual #152                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     463: aload_3
     464: invokeinterface #156,  1          // InterfaceMethod java/util/List.size:()I
     469: invokevirtual #159                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     472: invokevirtual #162                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     475: getstatic     #168                // Field java/lang/System.out:Ljava/io/PrintStream;
     478: swap
     479: invokevirtual #173                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     482: return

  public final void part_2();
    Code:
       0: new           #206                // class java/util/HashMap
       3: dup
       4: invokespecial #207                // Method java/util/HashMap."<init>":()V
       7: astore_1
       8: new           #18                 // class java/io/File
      11: dup
      12: ldc           #20                 // String ../Input/day12.txt
      14: invokespecial #23                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      17: aconst_null
      18: iconst_1
      19: aconst_null
      20: invokestatic  #29                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      23: checkcast     #31                 // class java/lang/Iterable
      26: astore_2
      27: iconst_0
      28: istore_3
      29: aload_2
      30: invokeinterface #35,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      35: astore        4
      37: aload         4
      39: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      44: ifeq          258
      47: aload         4
      49: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      54: astore        5
      56: aload         5
      58: checkcast     #47                 // class java/lang/String
      61: astore        6
      63: iconst_0
      64: istore        7
      66: aload         6
      68: checkcast     #49                 // class java/lang/CharSequence
      71: iconst_1
      72: anewarray     #47                 // class java/lang/String
      75: astore        8
      77: aload         8
      79: iconst_0
      80: ldc           #51                 // String -
      82: aastore
      83: aload         8
      85: iconst_0
      86: iconst_0
      87: bipush        6
      89: aconst_null
      90: invokestatic  #57                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      93: astore        9
      95: aload         9
      97: iconst_0
      98: invokeinterface #107,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     103: checkcast     #47                 // class java/lang/String
     106: astore        8
     108: aload         9
     110: iconst_1
     111: invokeinterface #107,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     116: checkcast     #47                 // class java/lang/String
     119: astore        10
     121: aload_1
     122: checkcast     #16                 // class java/util/Map
     125: astore        11
     127: iconst_0
     128: istore        12
     130: aload         11
     132: aload         8
     134: invokeinterface #93,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     139: astore        13
     141: aload         13
     143: ifnonnull     175
     146: iconst_0
     147: istore        14
     149: new           #209                // class java/util/HashSet
     152: dup
     153: invokespecial #210                // Method java/util/HashSet."<init>":()V
     156: astore        14
     158: aload         11
     160: aload         8
     162: aload         14
     164: invokeinterface #89,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     169: pop
     170: aload         14
     172: goto          177
     175: aload         13
     177: nop
     178: checkcast     #209                // class java/util/HashSet
     181: aload         10
     183: invokevirtual #211                // Method java/util/HashSet.add:(Ljava/lang/Object;)Z
     186: pop
     187: aload_1
     188: checkcast     #16                 // class java/util/Map
     191: astore        11
     193: iconst_0
     194: istore        12
     196: aload         11
     198: aload         10
     200: invokeinterface #93,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     205: astore        13
     207: aload         13
     209: ifnonnull     241
     212: iconst_0
     213: istore        14
     215: new           #209                // class java/util/HashSet
     218: dup
     219: invokespecial #210                // Method java/util/HashSet."<init>":()V
     222: astore        14
     224: aload         11
     226: aload         10
     228: aload         14
     230: invokeinterface #89,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     235: pop
     236: aload         14
     238: goto          243
     241: aload         13
     243: nop
     244: checkcast     #209                // class java/util/HashSet
     247: aload         8
     249: invokevirtual #211                // Method java/util/HashSet.add:(Ljava/lang/Object;)Z
     252: pop
     253: nop
     254: nop
     255: goto          37
     258: nop
     259: new           #145                // class java/lang/StringBuilder
     262: dup
     263: invokespecial #146                // Method java/lang/StringBuilder."<init>":()V
     266: ldc           #213                // String Puzzle 2:
     268: invokevirtual #152                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     271: aload_1
     272: aconst_null
     273: iconst_2
     274: aconst_null
     275: invokestatic  #217                // Method part_2$followPaths$12$default:(Ljava/util/HashMap;Ljava/util/List;ILjava/lang/Object;)Ljava/util/List;
     278: invokeinterface #156,  1          // InterfaceMethod java/util/List.size:()I
     283: invokevirtual #159                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     286: invokevirtual #162                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     289: getstatic     #168                // Field java/lang/System.out:Ljava/io/PrintStream;
     292: swap
     293: invokevirtual #173                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     296: return

  private static final java.util.List<java.util.List<Day12$Node>> part_1$followPaths(Day12$Node, java.util.List<Day12$Node>);
    Code:
       0: aload_1
       1: checkcast     #70                 // class java/util/Collection
       4: aload_0
       5: invokestatic  #115                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/List;
       8: astore_2
       9: aload_0
      10: invokevirtual #137                // Method Day12$Node.getName:()Ljava/lang/String;
      13: ldc           #139                // String end
      15: invokestatic  #143                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      18: ifne          38
      21: aload_1
      22: aload_0
      23: invokeinterface #231,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
      28: ifeq          45
      31: aload_0
      32: invokevirtual #234                // Method Day12$Node.isLarge:()Z
      35: ifne          45
      38: aload_2
      39: invokestatic  #238                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
      42: goto          140
      45: aload_0
      46: invokevirtual #111                // Method Day12$Node.getConnections:()Ljava/util/List;
      49: checkcast     #31                 // class java/lang/Iterable
      52: astore_3
      53: iconst_0
      54: istore        4
      56: aload_3
      57: astore        5
      59: new           #59                 // class java/util/ArrayList
      62: dup
      63: invokespecial #129                // Method java/util/ArrayList."<init>":()V
      66: checkcast     #70                 // class java/util/Collection
      69: astore        6
      71: iconst_0
      72: istore        7
      74: aload         5
      76: invokeinterface #35,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      81: astore        8
      83: aload         8
      85: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      90: ifeq          134
      93: aload         8
      95: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     100: astore        9
     102: aload         9
     104: checkcast     #76                 // class Day12$Node
     107: astore        10
     109: iconst_0
     110: istore        11
     112: aload         10
     114: aload_2
     115: invokestatic  #128                // Method part_1$followPaths:(LDay12$Node;Ljava/util/List;)Ljava/util/List;
     118: checkcast     #31                 // class java/lang/Iterable
     121: astore        10
     123: aload         6
     125: aload         10
     127: invokestatic  #242                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     130: pop
     131: goto          83
     134: aload         6
     136: checkcast     #104                // class java/util/List
     139: nop
     140: areturn

  private static final boolean part_2$canVisit(java.lang.String, java.util.List<java.lang.String>);
    Code:
       0: nop
       1: aload_0
       2: invokestatic  #82                 // Method Day12Kt.access$isUpperCase:(Ljava/lang/String;)Z
       5: ifeq          12
       8: iconst_1
       9: goto          366
      12: aload_0
      13: ldc           #121                // String start
      15: invokestatic  #143                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      18: ifeq          25
      21: iconst_0
      22: goto          366
      25: aload_1
      26: aload_0
      27: invokeinterface #231,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
      32: ifne          39
      35: iconst_1
      36: goto          366
      39: aload_1
      40: checkcast     #31                 // class java/lang/Iterable
      43: astore_2
      44: iconst_0
      45: istore_3
      46: aload_2
      47: astore        4
      49: new           #59                 // class java/util/ArrayList
      52: dup
      53: invokespecial #129                // Method java/util/ArrayList."<init>":()V
      56: checkcast     #70                 // class java/util/Collection
      59: astore        5
      61: iconst_0
      62: istore        6
      64: aload         4
      66: invokeinterface #35,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      71: astore        7
      73: aload         7
      75: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      80: ifeq          123
      83: aload         7
      85: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      90: astore        8
      92: aload         8
      94: checkcast     #47                 // class java/lang/String
      97: astore        9
      99: iconst_0
     100: istore        10
     102: aload         9
     104: invokestatic  #82                 // Method Day12Kt.access$isUpperCase:(Ljava/lang/String;)Z
     107: ifne          73
     110: aload         5
     112: aload         8
     114: invokeinterface #102,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     119: pop
     120: goto          73
     123: aload         5
     125: checkcast     #104                // class java/util/List
     128: nop
     129: checkcast     #31                 // class java/lang/Iterable
     132: astore_2
     133: nop
     134: iconst_0
     135: istore_3
     136: aload_2
     137: astore        4
     139: new           #13                 // class java/util/LinkedHashMap
     142: dup
     143: invokespecial #14                 // Method java/util/LinkedHashMap."<init>":()V
     146: checkcast     #16                 // class java/util/Map
     149: astore        5
     151: iconst_0
     152: istore        6
     154: aload         4
     156: invokeinterface #35,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     161: astore        7
     163: aload         7
     165: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     170: ifeq          272
     173: aload         7
     175: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     180: astore        8
     182: aload         8
     184: checkcast     #47                 // class java/lang/String
     187: astore        9
     189: iconst_0
     190: istore        10
     192: aload         9
     194: astore        11
     196: aload         5
     198: astore        12
     200: iconst_0
     201: istore        13
     203: aload         12
     205: aload         11
     207: invokeinterface #93,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     212: astore        14
     214: aload         14
     216: ifnonnull     251
     219: iconst_0
     220: istore        15
     222: new           #59                 // class java/util/ArrayList
     225: dup
     226: invokespecial #129                // Method java/util/ArrayList."<init>":()V
     229: checkcast     #104                // class java/util/List
     232: astore        15
     234: aload         12
     236: aload         11
     238: aload         15
     240: invokeinterface #89,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     245: pop
     246: aload         15
     248: goto          253
     251: aload         14
     253: nop
     254: checkcast     #104                // class java/util/List
     257: astore        9
     259: aload         9
     261: aload         8
     263: invokeinterface #254,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     268: pop
     269: goto          163
     272: aload         5
     274: nop
     275: astore_2
     276: nop
     277: iconst_0
     278: istore_3
     279: aload_2
     280: invokeinterface #257,  1          // InterfaceMethod java/util/Map.isEmpty:()Z
     285: ifeq          292
     288: iconst_1
     289: goto          366
     292: aload_2
     293: invokeinterface #261,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     298: invokeinterface #264,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     303: astore        4
     305: aload         4
     307: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     312: ifeq          365
     315: aload         4
     317: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     322: checkcast     #266                // class java/util/Map$Entry
     325: astore        5
     327: aload         5
     329: astore        6
     331: iconst_0
     332: istore        7
     334: aload         6
     336: invokeinterface #269,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     341: checkcast     #104                // class java/util/List
     344: invokeinterface #156,  1          // InterfaceMethod java/util/List.size:()I
     349: iconst_2
     350: if_icmpne     357
     353: iconst_1
     354: goto          358
     357: iconst_0
     358: ifeq          305
     361: iconst_0
     362: goto          366
     365: iconst_1
     366: ireturn

  private static final java.util.List<java.util.List<java.lang.String>> part_2$followPaths$12(java.util.HashMap<java.lang.String, java.util.HashSet<java.lang.String>>, java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: invokestatic  #133                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
       4: ldc           #139                // String end
       6: invokestatic  #143                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
       9: ifeq          19
      12: aload_1
      13: invokestatic  #238                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
      16: goto          219
      19: aload_0
      20: checkcast     #16                 // class java/util/Map
      23: aload_1
      24: invokestatic  #133                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
      27: invokestatic  #297                // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;
      30: checkcast     #31                 // class java/lang/Iterable
      33: astore_2
      34: nop
      35: iconst_0
      36: istore_3
      37: aload_2
      38: astore        4
      40: new           #59                 // class java/util/ArrayList
      43: dup
      44: invokespecial #129                // Method java/util/ArrayList."<init>":()V
      47: checkcast     #70                 // class java/util/Collection
      50: astore        5
      52: iconst_0
      53: istore        6
      55: aload         4
      57: invokeinterface #35,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      62: astore        7
      64: aload         7
      66: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      71: ifeq          115
      74: aload         7
      76: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      81: astore        8
      83: aload         8
      85: checkcast     #47                 // class java/lang/String
      88: astore        9
      90: iconst_0
      91: istore        10
      93: aload         9
      95: aload_1
      96: invokestatic  #299                // Method part_2$canVisit:(Ljava/lang/String;Ljava/util/List;)Z
      99: ifeq          64
     102: aload         5
     104: aload         8
     106: invokeinterface #102,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     111: pop
     112: goto          64
     115: aload         5
     117: checkcast     #104                // class java/util/List
     120: nop
     121: checkcast     #31                 // class java/lang/Iterable
     124: astore_2
     125: nop
     126: iconst_0
     127: istore_3
     128: aload_2
     129: astore        4
     131: new           #59                 // class java/util/ArrayList
     134: dup
     135: invokespecial #129                // Method java/util/ArrayList."<init>":()V
     138: checkcast     #70                 // class java/util/Collection
     141: astore        5
     143: iconst_0
     144: istore        6
     146: aload         4
     148: invokeinterface #35,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     153: astore        7
     155: aload         7
     157: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     162: ifeq          213
     165: aload         7
     167: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     172: astore        8
     174: aload         8
     176: checkcast     #47                 // class java/lang/String
     179: astore        9
     181: iconst_0
     182: istore        10
     184: aload_0
     185: aload_1
     186: checkcast     #70                 // class java/util/Collection
     189: aload         9
     191: invokestatic  #115                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/List;
     194: invokestatic  #301                // Method part_2$followPaths$12:(Ljava/util/HashMap;Ljava/util/List;)Ljava/util/List;
     197: checkcast     #31                 // class java/lang/Iterable
     200: astore        9
     202: aload         5
     204: aload         9
     206: invokestatic  #242                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     209: pop
     210: goto          155
     213: aload         5
     215: checkcast     #104                // class java/util/List
     218: nop
     219: areturn

  static java.util.List part_2$followPaths$12$default(java.util.HashMap, java.util.List, int, java.lang.Object);
    Code:
       0: iload_2
       1: iconst_2
       2: iand
       3: ifeq          12
       6: ldc           #121                // String start
       8: invokestatic  #238                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
      11: astore_1
      12: aload_0
      13: aload_1
      14: invokestatic  #301                // Method part_2$followPaths$12:(Ljava/util/HashMap;Ljava/util/List;)Ljava/util/List;
      17: areturn
}

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

  public static final void main();
    Code:
       0: invokestatic  #120                // Method print_day_12:()V
       3: new           #122                // class Day12
       6: dup
       7: invokespecial #123                // Method Day12."<init>":()V
      10: invokevirtual #126                // Method Day12.part_1:()V
      13: new           #122                // class Day12
      16: dup
      17: invokespecial #123                // Method Day12."<init>":()V
      20: invokevirtual #129                // Method Day12.part_2:()V
      23: new           #14                 // class java/lang/StringBuilder
      26: dup
      27: invokespecial #17                 // Method java/lang/StringBuilder."<init>":()V
      30: ldc           #131                // String \n\u001b[33m
      32: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      35: ldc           #133                // String =
      37: checkcast     #25                 // class java/lang/CharSequence
      40: bipush        72
      42: invokestatic  #31                 // Method kotlin/text/StringsKt.repeat:(Ljava/lang/CharSequence;I)Ljava/lang/String;
      45: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      48: ldc           #135                // String \u001b[0m\n
      50: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      53: invokevirtual #37                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      56: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      59: swap
      60: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      63: return

  private static final boolean isUpperCase(java.lang.String);
    Code:
       0: aload_0
       1: aload_0
       2: getstatic     #143                // Field java/util/Locale.ROOT:Ljava/util/Locale;
       5: invokevirtual #149                // Method java/lang/String.toUpperCase:(Ljava/util/Locale;)Ljava/lang/String;
       8: dup
       9: ldc           #151                // String toUpperCase(...)
      11: invokestatic  #157                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      14: invokestatic  #161                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      17: ireturn

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

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

  public static final boolean access$isUpperCase(java.lang.String);
    Code:
       0: aload_0
       1: invokestatic  #181                // Method isUpperCase:(Ljava/lang/String;)Z
       4: ireturn
}


import java.io.*
import kotlin.math.abs
fun print_day_7() {

    val yellow = "\u001B[33m"
    val reset = "\u001b[0m"
    val green = "\u001B[32m"
    println(yellow + "-".repeat(25) + "Advent of Code - Day 7" + "-".repeat(25) + reset)
    println(green)
    val process = Runtime.getRuntime().exec("figlet The Treachery of Whales -c -f small")
    val reader = BufferedReader(InputStreamReader(process.inputStream))
    reader.forEachLine { println(it) }
    println(reset)

    println(yellow + "-".repeat(33) + "Output" + "-".repeat(33) + reset + "\n")
}
fun main() {
    print_day_7()
    Day7().part_1()
    Day7().part_2()
    println("\n" + "\u001B[33m" + "=".repeat(72) + "\u001b[0m" + "\n")
}

class Day7 {
    val crabs = File("../Input/day7.txt").readLines().first().split(",").map{it.toInt()}

    fun part_1() {
        val min = crabs.minOrNull()!!
        val max = crabs.maxOrNull()!!

        var lowest = Int.MAX_VALUE

        for(i in min .. max) {
            var fuelUsed = 0
            for(crab in crabs) { fuelUsed += abs(crab - i) }

            if (fuelUsed < lowest) {
                lowest = fuelUsed
            }
        }
        println("Puzzle 1: $lowest")
    }

    fun part_2() {

        val min = crabs.minOrNull()!!
        val max = crabs.maxOrNull()!!

        var lowest = Int.MAX_VALUE

        for(i in min .. max) {
            var fuelUsed = 0
            for(crab in crabs) { fuelUsed += calcFibIncrement(abs(crab - i)) }

            if (fuelUsed < lowest) {
                lowest = fuelUsed
            }
        }
        println("Puzzle 2: $lowest")
    }
    fun calcFibIncrement(increment: Int, incrementBy: Int = 0): Int {
        return if (increment == 0)
            incrementBy
        else
            calcFibIncrement(increment - 1, incrementBy + 1) + incrementBy
    }

}

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

  public static final void main();
    Code:
       0: invokestatic  #120                // Method print_day_7:()V
       3: new           #122                // class Day7
       6: dup
       7: invokespecial #123                // Method Day7."<init>":()V
      10: invokevirtual #126                // Method Day7.part_1:()V
      13: new           #122                // class Day7
      16: dup
      17: invokespecial #123                // Method Day7."<init>":()V
      20: invokevirtual #129                // Method Day7.part_2:()V
      23: new           #14                 // class java/lang/StringBuilder
      26: dup
      27: invokespecial #17                 // Method java/lang/StringBuilder."<init>":()V
      30: ldc           #131                // String \n\u001b[33m
      32: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      35: ldc           #133                // String =
      37: checkcast     #25                 // class java/lang/CharSequence
      40: bipush        72
      42: invokestatic  #31                 // Method kotlin/text/StringsKt.repeat:(Ljava/lang/CharSequence;I)Ljava/lang/String;
      45: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      48: ldc           #135                // String \u001b[0m\n
      50: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      53: invokevirtual #37                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      56: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      59: swap
      60: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      63: return

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

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


import java.io.*
import java.util.*
fun print_day_10() {

    val yellow = "\u001B[33m"
    val reset = "\u001b[0m"
    val green = "\u001B[32m"
    println(yellow + "-".repeat(25) + "Advent of Code - Day 10" + "-".repeat(25) + reset)
    println(green)
    val process = Runtime.getRuntime().exec("figlet Syntax Scoring -c -f small")
    val reader = BufferedReader(InputStreamReader(process.inputStream))
    reader.forEachLine { println(it) }
    println(reset)
    println(yellow + "-".repeat(33) + "Output" + "-".repeat(33) + reset + "\n")
}
fun main() {
    print_day_10()
    Day10().part_1()
    Day10().part_2()
    println("\n" + "\u001B[33m" + "=".repeat(72) + "\u001b[0m" + "\n")
}

class Day10 {
    private val lines = File("../Input/day10.txt").readLines()
    private val opening = arrayOf('{', '[', '(', '<')
    private val bracketPairs = mapOf('{' to '}', '[' to ']', '(' to ')', '<' to '>')

    private fun checkMatchingBrackets(stack: Stack<Char>, remainingChars: String): Int {
        if (remainingChars.isEmpty()) return 0

        val c = remainingChars.first()
        if (c in opening) {
            stack.push(c)
        }
        else {
            val matchTo = stack.pop()
            if (bracketPairs[matchTo] != c) {
                return when(c) {
                    ')' -> 3
                    ']' -> 57
                    '}' -> 1197
                    '>' -> 25137
                    else -> 0
                }
            }
        }
        return checkMatchingBrackets(stack, remainingChars.substring(1))
    }

    fun part_1() {
        val total = lines.sumOf {
            checkMatchingBrackets(Stack<Char>(), it)
        }
        println("Puzzle 1: " + total)
    }

    fun part_2() {
        val total = lines.map {
            val stack = Stack<Char>()
            if (checkMatchingBrackets(stack, it) == 0) {
                stack.foldRight(0L) { c, acc ->
                    acc * 5 + when(bracketPairs[c]) {
                        ')' -> 1
                        ']' -> 2
                        '}' -> 3
                        '>' -> 4
                        else -> 0
                    }
                }
            }
            else 0
        }
        .filterNot { it == 0L }
        .sorted()

        println("Puzzle 2: " + total[(total.size / 2)])
    }
}

Compiled from "day10.kt"
public final class Day10 {
  private final java.util.List<java.lang.String> lines;

  private final java.lang.Character[] opening;

  private final java.util.Map<java.lang.Character, java.lang.Character> bracketPairs;

  public Day10();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: new           #10                 // class java/io/File
       8: dup
       9: ldc           #12                 // String ../Input/day10.txt
      11: invokespecial #15                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      14: aconst_null
      15: iconst_1
      16: aconst_null
      17: invokestatic  #21                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      20: putfield      #25                 // Field lines:Ljava/util/List;
      23: aload_0
      24: iconst_4
      25: anewarray     #27                 // class java/lang/Character
      28: astore_1
      29: aload_1
      30: iconst_0
      31: bipush        123
      33: invokestatic  #31                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      36: aastore
      37: aload_1
      38: iconst_1
      39: bipush        91
      41: invokestatic  #31                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      44: aastore
      45: aload_1
      46: iconst_2
      47: bipush        40
      49: invokestatic  #31                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      52: aastore
      53: aload_1
      54: iconst_3
      55: bipush        60
      57: invokestatic  #31                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      60: aastore
      61: aload_1
      62: putfield      #35                 // Field opening:[Ljava/lang/Character;
      65: aload_0
      66: iconst_4
      67: anewarray     #37                 // class kotlin/Pair
      70: astore_1
      71: aload_1
      72: iconst_0
      73: bipush        123
      75: invokestatic  #31                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      78: bipush        125
      80: invokestatic  #31                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      83: invokestatic  #43                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      86: aastore
      87: aload_1
      88: iconst_1
      89: bipush        91
      91: invokestatic  #31                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      94: bipush        93
      96: invokestatic  #31                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      99: invokestatic  #43                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     102: aastore
     103: aload_1
     104: iconst_2
     105: bipush        40
     107: invokestatic  #31                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     110: bipush        41
     112: invokestatic  #31                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     115: invokestatic  #43                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     118: aastore
     119: aload_1
     120: iconst_3
     121: bipush        60
     123: invokestatic  #31                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     126: bipush        62
     128: invokestatic  #31                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     131: invokestatic  #43                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     134: aastore
     135: aload_1
     136: invokestatic  #49                 // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;
     139: putfield      #53                 // Field bracketPairs:Ljava/util/Map;
     142: return

  private final int checkMatchingBrackets(java.util.Stack<java.lang.Character>, java.lang.String);
    Code:
       0: aload_2
       1: checkcast     #60                 // class java/lang/CharSequence
       4: invokeinterface #64,  1           // InterfaceMethod java/lang/CharSequence.length:()I
       9: ifne          16
      12: iconst_1
      13: goto          17
      16: iconst_0
      17: ifeq          22
      20: iconst_0
      21: ireturn
      22: aload_2
      23: checkcast     #60                 // class java/lang/CharSequence
      26: invokestatic  #70                 // Method kotlin/text/StringsKt.first:(Ljava/lang/CharSequence;)C
      29: istore_3
      30: aload_0
      31: getfield      #35                 // Field opening:[Ljava/lang/Character;
      34: iload_3
      35: invokestatic  #31                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      38: invokestatic  #76                 // Method kotlin/collections/ArraysKt.contains:([Ljava/lang/Object;Ljava/lang/Object;)Z
      41: ifeq          56
      44: aload_1
      45: iload_3
      46: invokestatic  #31                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      49: invokevirtual #82                 // Method java/util/Stack.push:(Ljava/lang/Object;)Ljava/lang/Object;
      52: pop
      53: goto          163
      56: aload_1
      57: invokevirtual #86                 // Method java/util/Stack.pop:()Ljava/lang/Object;
      60: checkcast     #27                 // class java/lang/Character
      63: astore        4
      65: aload_0
      66: getfield      #53                 // Field bracketPairs:Ljava/util/Map;
      69: aload         4
      71: invokeinterface #91,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      76: checkcast     #27                 // class java/lang/Character
      79: iload_3
      80: istore        5
      82: dup
      83: ifnonnull     90
      86: pop
      87: goto          98
      90: invokevirtual #95                 // Method java/lang/Character.charValue:()C
      93: iload         5
      95: if_icmpeq     163
      98: iload_3
      99: lookupswitch  { // 4
                    41: 140
                    62: 155
                    93: 144
                   125: 149
               default: 161
          }
     140: iconst_3
     141: goto          162
     144: bipush        57
     146: goto          162
     149: sipush        1197
     152: goto          162
     155: sipush        25137
     158: goto          162
     161: iconst_0
     162: ireturn
     163: aload_0
     164: aload_1
     165: aload_2
     166: iconst_1
     167: invokevirtual #101                // Method java/lang/String.substring:(I)Ljava/lang/String;
     170: dup
     171: ldc           #103                // String substring(...)
     173: invokestatic  #109                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     176: invokespecial #111                // Method checkMatchingBrackets:(Ljava/util/Stack;Ljava/lang/String;)I
     179: ireturn

  public final void part_1();
    Code:
       0: aload_0
       1: getfield      #25                 // Field lines:Ljava/util/List;
       4: checkcast     #122                // class java/lang/Iterable
       7: astore_2
       8: iconst_0
       9: istore_3
      10: aload_2
      11: invokeinterface #126,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      16: astore        4
      18: aload         4
      20: invokeinterface #132,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      25: ifeq          74
      28: aload         4
      30: invokeinterface #135,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      35: astore        5
      37: iload_3
      38: aload         5
      40: checkcast     #97                 // class java/lang/String
      43: astore        6
      45: istore        8
      47: iconst_0
      48: istore        7
      50: aload_0
      51: new           #78                 // class java/util/Stack
      54: dup
      55: invokespecial #136                // Method java/util/Stack."<init>":()V
      58: aload         6
      60: invokespecial #111                // Method checkMatchingBrackets:(Ljava/util/Stack;Ljava/lang/String;)I
      63: istore        9
      65: iload         8
      67: iload         9
      69: iadd
      70: istore_3
      71: goto          18
      74: iload_3
      75: istore_1
      76: new           #138                // class java/lang/StringBuilder
      79: dup
      80: invokespecial #139                // Method java/lang/StringBuilder."<init>":()V
      83: ldc           #141                // String Puzzle 1:
      85: invokevirtual #145                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      88: iload_1
      89: invokevirtual #148                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      92: invokevirtual #152                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      95: getstatic     #158                // Field java/lang/System.out:Ljava/io/PrintStream;
      98: swap
      99: invokevirtual #164                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     102: return

  public final void part_2();
    Code:
       0: aload_0
       1: getfield      #25                 // Field lines:Ljava/util/List;
       4: checkcast     #122                // class java/lang/Iterable
       7: astore_2
       8: iconst_0
       9: istore_3
      10: aload_2
      11: astore        4
      13: new           #171                // class java/util/ArrayList
      16: dup
      17: aload_2
      18: bipush        10
      20: invokestatic  #177                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      23: invokespecial #180                // Method java/util/ArrayList."<init>":(I)V
      26: checkcast     #182                // class java/util/Collection
      29: astore        5
      31: iconst_0
      32: istore        6
      34: aload         4
      36: invokeinterface #126,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      41: astore        7
      43: aload         7
      45: invokeinterface #132,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      50: ifeq          323
      53: aload         7
      55: invokeinterface #135,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      60: astore        8
      62: aload         5
      64: aload         8
      66: checkcast     #97                 // class java/lang/String
      69: astore        9
      71: astore        25
      73: iconst_0
      74: istore        10
      76: new           #78                 // class java/util/Stack
      79: dup
      80: invokespecial #136                // Method java/util/Stack."<init>":()V
      83: astore        11
      85: aload_0
      86: aload         11
      88: aload         9
      90: invokespecial #111                // Method checkMatchingBrackets:(Ljava/util/Stack;Ljava/lang/String;)I
      93: ifne          307
      96: aload         11
      98: checkcast     #184                // class java/util/List
     101: astore        12
     103: lconst_0
     104: lstore        13
     106: iconst_0
     107: istore        15
     109: lload         13
     111: lstore        16
     113: aload         12
     115: invokeinterface #187,  1          // InterfaceMethod java/util/List.isEmpty:()Z
     120: ifne          302
     123: aload         12
     125: aload         12
     127: invokeinterface #190,  1          // InterfaceMethod java/util/List.size:()I
     132: invokeinterface #194,  2          // InterfaceMethod java/util/List.listIterator:(I)Ljava/util/ListIterator;
     137: astore        18
     139: aload         18
     141: invokeinterface #199,  1          // InterfaceMethod java/util/ListIterator.hasPrevious:()Z
     146: ifeq          302
     149: aload         18
     151: invokeinterface #202,  1          // InterfaceMethod java/util/ListIterator.previous:()Ljava/lang/Object;
     156: lload         16
     158: lstore        19
     160: checkcast     #27                 // class java/lang/Character
     163: astore        21
     165: iconst_0
     166: istore        22
     168: lload         19
     170: iconst_5
     171: i2l
     172: lmul
     173: aload_0
     174: getfield      #53                 // Field bracketPairs:Ljava/util/Map;
     177: aload         21
     179: invokeinterface #91,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     184: checkcast     #27                 // class java/lang/Character
     187: astore        23
     189: aload         23
     191: bipush        41
     193: istore        24
     195: dup
     196: ifnonnull     203
     199: pop
     200: goto          215
     203: invokevirtual #95                 // Method java/lang/Character.charValue:()C
     206: iload         24
     208: if_icmpne     215
     211: iconst_1
     212: goto          294
     215: aload         23
     217: bipush        93
     219: istore        24
     221: dup
     222: ifnonnull     229
     225: pop
     226: goto          241
     229: invokevirtual #95                 // Method java/lang/Character.charValue:()C
     232: iload         24
     234: if_icmpne     241
     237: iconst_2
     238: goto          294
     241: aload         23
     243: bipush        125
     245: istore        24
     247: dup
     248: ifnonnull     255
     251: pop
     252: goto          267
     255: invokevirtual #95                 // Method java/lang/Character.charValue:()C
     258: iload         24
     260: if_icmpne     267
     263: iconst_3
     264: goto          294
     267: aload         23
     269: bipush        62
     271: istore        24
     273: dup
     274: ifnonnull     281
     277: pop
     278: goto          293
     281: invokevirtual #95                 // Method java/lang/Character.charValue:()C
     284: iload         24
     286: if_icmpne     293
     289: iconst_4
     290: goto          294
     293: iconst_0
     294: i2l
     295: ladd
     296: nop
     297: lstore        16
     299: goto          139
     302: lload         16
     304: goto          308
     307: lconst_0
     308: invokestatic  #207                // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     311: aload         25
     313: swap
     314: invokeinterface #211,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     319: pop
     320: goto          43
     323: aload         5
     325: checkcast     #184                // class java/util/List
     328: nop
     329: checkcast     #122                // class java/lang/Iterable
     332: astore_2
     333: nop
     334: iconst_0
     335: istore_3
     336: aload_2
     337: astore        4
     339: new           #171                // class java/util/ArrayList
     342: dup
     343: invokespecial #212                // Method java/util/ArrayList."<init>":()V
     346: checkcast     #182                // class java/util/Collection
     349: astore        5
     351: iconst_0
     352: istore        6
     354: aload         4
     356: invokeinterface #126,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     361: astore        7
     363: aload         7
     365: invokeinterface #132,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     370: ifeq          423
     373: aload         7
     375: invokeinterface #135,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     380: astore        8
     382: aload         8
     384: checkcast     #214                // class java/lang/Number
     387: invokevirtual #218                // Method java/lang/Number.longValue:()J
     390: lstore        9
     392: iconst_0
     393: istore        11
     395: lload         9
     397: lconst_0
     398: lcmp
     399: ifne          406
     402: iconst_1
     403: goto          407
     406: iconst_0
     407: ifne          363
     410: aload         5
     412: aload         8
     414: invokeinterface #211,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     419: pop
     420: goto          363
     423: aload         5
     425: checkcast     #184                // class java/util/List
     428: nop
     429: checkcast     #122                // class java/lang/Iterable
     432: invokestatic  #222                // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;
     435: astore_1
     436: new           #138                // class java/lang/StringBuilder
     439: dup
     440: invokespecial #139                // Method java/lang/StringBuilder."<init>":()V
     443: ldc           #224                // String Puzzle 2:
     445: invokevirtual #145                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     448: aload_1
     449: aload_1
     450: invokeinterface #190,  1          // InterfaceMethod java/util/List.size:()I
     455: iconst_2
     456: idiv
     457: invokeinterface #227,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     462: checkcast     #214                // class java/lang/Number
     465: invokevirtual #218                // Method java/lang/Number.longValue:()J
     468: invokevirtual #230                // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
     471: invokevirtual #152                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     474: getstatic     #158                // Field java/lang/System.out:Ljava/io/PrintStream;
     477: swap
     478: invokevirtual #164                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     481: return
}

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

  public static final void main();
    Code:
       0: invokestatic  #120                // Method print_day_10:()V
       3: new           #122                // class Day10
       6: dup
       7: invokespecial #123                // Method Day10."<init>":()V
      10: invokevirtual #126                // Method Day10.part_1:()V
      13: new           #122                // class Day10
      16: dup
      17: invokespecial #123                // Method Day10."<init>":()V
      20: invokevirtual #129                // Method Day10.part_2:()V
      23: new           #14                 // class java/lang/StringBuilder
      26: dup
      27: invokespecial #17                 // Method java/lang/StringBuilder."<init>":()V
      30: ldc           #131                // String \n\u001b[33m
      32: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      35: ldc           #133                // String =
      37: checkcast     #25                 // class java/lang/CharSequence
      40: bipush        72
      42: invokestatic  #31                 // Method kotlin/text/StringsKt.repeat:(Ljava/lang/CharSequence;I)Ljava/lang/String;
      45: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      48: ldc           #135                // String \u001b[0m\n
      50: invokevirtual #21                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      53: invokevirtual #37                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      56: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      59: swap
      60: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      63: return

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

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