fun main() {

    data class Node(val name: String, var size: Int = 0, val dir: Boolean = false, val parent: Node? = null) {
        fun propagateSize() {
            var curr = parent
            while (curr != null) {
                curr.size += size
                curr = curr.parent
            }
        }
    }

    data class Common(val input: List<String>) {

        val nodes = mutableListOf<Node>()
        val root = Node(name = "/")

        init {
            var currentDir = root

            input
                .map { it.split(" ") }
                .forEach {
                    val (first, second) = it

                    if (first == "$" && second == "cd") {
                        when (val dirName = it[2]) {
                            ".." -> currentDir = currentDir.parent!!
                            "/" -> currentDir = root
                            else -> {
                                currentDir = Node(name = dirName, dir = true, parent = currentDir)
                                nodes.add(currentDir)
                            }
                        }
                    } else if (first.isNumber()) {
                        nodes.add(Node(name = second, size = first.toInt(), parent = currentDir))
                    }
                }

            nodes.filterNot { it.dir }
                 .forEach { it.propagateSize() }
        }
    }

    fun part1(input: List<String>): Int {
        val common = Common(input)

        return common.nodes
            .filter { it.dir && it.size <= 100000 }
            .sumOf { it.size }
    }

    fun part2(input: List<String>): Int {
        val common = Common(input)
        val freeSpace = 70000000 - common.root.size

        return common.nodes
            .filter { it.dir }
            .fold(70000000) { acc, item ->
                if (freeSpace + item.size >= 30000000 && acc > item.size) {
                    item.size
                } else {
                    acc
                }
        }
    }

    val input = readInput("inputs/Day07")
    println(part1(input))
    println(part2(input))
}

private fun String.isNumber(): Boolean {
    return toIntOrNull() != null
}

Compiled from "Day07.kt"
public final class Day07Kt$main$Common {
  private final java.util.List<java.lang.String> input;

  private final java.util.List<Day07Kt$main$Node> nodes;

  private final Day07Kt$main$Node root;

  public Day07Kt$main$Common(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #9                  // String input
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokespecial #18                 // Method java/lang/Object."<init>":()V
      10: aload_0
      11: aload_1
      12: putfield      #21                 // Field input:Ljava/util/List;
      15: aload_0
      16: new           #23                 // class java/util/ArrayList
      19: dup
      20: invokespecial #24                 // Method java/util/ArrayList."<init>":()V
      23: checkcast     #26                 // class java/util/List
      26: putfield      #29                 // Field nodes:Ljava/util/List;
      29: aload_0
      30: new           #31                 // class Day07Kt$main$Node
      33: dup
      34: ldc           #33                 // String /
      36: iconst_0
      37: iconst_0
      38: aconst_null
      39: bipush        14
      41: aconst_null
      42: invokespecial #36                 // Method Day07Kt$main$Node."<init>":(Ljava/lang/String;IZLDay07Kt$main$Node;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
      45: putfield      #40                 // Field root:LDay07Kt$main$Node;
      48: nop
      49: aconst_null
      50: astore_2
      51: aload_0
      52: getfield      #40                 // Field root:LDay07Kt$main$Node;
      55: astore_2
      56: aload_0
      57: getfield      #21                 // Field input:Ljava/util/List;
      60: checkcast     #42                 // class java/lang/Iterable
      63: astore_3
      64: nop
      65: iconst_0
      66: istore        4
      68: aload_3
      69: astore        5
      71: new           #23                 // class java/util/ArrayList
      74: dup
      75: aload_3
      76: bipush        10
      78: invokestatic  #48                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      81: invokespecial #51                 // Method java/util/ArrayList."<init>":(I)V
      84: checkcast     #53                 // class java/util/Collection
      87: astore        6
      89: iconst_0
      90: istore        7
      92: aload         5
      94: invokeinterface #57,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      99: astore        8
     101: aload         8
     103: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     108: ifeq          173
     111: aload         8
     113: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     118: astore        9
     120: aload         6
     122: aload         9
     124: checkcast     #69                 // class java/lang/String
     127: astore        10
     129: astore        13
     131: iconst_0
     132: istore        11
     134: aload         10
     136: checkcast     #71                 // class java/lang/CharSequence
     139: iconst_1
     140: anewarray     #69                 // class java/lang/String
     143: astore        12
     145: aload         12
     147: iconst_0
     148: ldc           #73                 // String
     150: aastore
     151: aload         12
     153: iconst_0
     154: iconst_0
     155: bipush        6
     157: aconst_null
     158: invokestatic  #79                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     161: aload         13
     163: swap
     164: invokeinterface #83,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     169: pop
     170: goto          101
     173: aload         6
     175: checkcast     #26                 // class java/util/List
     178: nop
     179: checkcast     #42                 // class java/lang/Iterable
     182: astore_3
     183: nop
     184: iconst_0
     185: istore        4
     187: aload_3
     188: invokeinterface #57,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     193: astore        5
     195: aload         5
     197: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     202: ifeq          393
     205: aload         5
     207: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     212: astore        6
     214: aload         6
     216: checkcast     #26                 // class java/util/List
     219: astore        7
     221: iconst_0
     222: istore        8
     224: aload         7
     226: iconst_0
     227: invokeinterface #87,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     232: checkcast     #69                 // class java/lang/String
     235: astore        9
     237: aload         7
     239: iconst_1
     240: invokeinterface #87,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     245: checkcast     #69                 // class java/lang/String
     248: astore        10
     250: aload         9
     252: ldc           #89                 // String $
     254: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     257: ifeq          352
     260: aload         10
     262: ldc           #95                 // String cd
     264: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     267: ifeq          352
     270: aload         7
     272: iconst_2
     273: invokeinterface #87,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     278: checkcast     #69                 // class java/lang/String
     281: astore        11
     283: aload         11
     285: ldc           #97                 // String ..
     287: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     290: ifeq          305
     293: aload_2
     294: invokevirtual #101                // Method Day07Kt$main$Node.getParent:()LDay07Kt$main$Node;
     297: dup
     298: invokestatic  #105                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     301: astore_2
     302: goto          388
     305: aload         11
     307: ldc           #33                 // String /
     309: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     312: ifeq          323
     315: aload_0
     316: getfield      #40                 // Field root:LDay07Kt$main$Node;
     319: astore_2
     320: goto          388
     323: new           #31                 // class Day07Kt$main$Node
     326: dup
     327: aload         11
     329: iconst_0
     330: iconst_1
     331: aload_2
     332: iconst_2
     333: aconst_null
     334: invokespecial #36                 // Method Day07Kt$main$Node."<init>":(Ljava/lang/String;IZLDay07Kt$main$Node;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
     337: astore_2
     338: aload_0
     339: getfield      #29                 // Field nodes:Ljava/util/List;
     342: aload_2
     343: invokeinterface #106,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     348: pop
     349: goto          388
     352: aload         9
     354: invokestatic  #112                // Method Day07Kt.access$isNumber:(Ljava/lang/String;)Z
     357: ifeq          388
     360: aload_0
     361: getfield      #29                 // Field nodes:Ljava/util/List;
     364: new           #31                 // class Day07Kt$main$Node
     367: dup
     368: aload         10
     370: aload         9
     372: invokestatic  #118                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     375: iconst_0
     376: aload_2
     377: iconst_4
     378: aconst_null
     379: invokespecial #36                 // Method Day07Kt$main$Node."<init>":(Ljava/lang/String;IZLDay07Kt$main$Node;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
     382: invokeinterface #106,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     387: pop
     388: nop
     389: nop
     390: goto          195
     393: nop
     394: aload_0
     395: getfield      #29                 // Field nodes:Ljava/util/List;
     398: checkcast     #42                 // class java/lang/Iterable
     401: astore_3
     402: iconst_0
     403: istore        4
     405: aload_3
     406: astore        5
     408: new           #23                 // class java/util/ArrayList
     411: dup
     412: invokespecial #24                 // Method java/util/ArrayList."<init>":()V
     415: checkcast     #53                 // class java/util/Collection
     418: astore        6
     420: iconst_0
     421: istore        7
     423: aload         5
     425: invokeinterface #57,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     430: astore        8
     432: aload         8
     434: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     439: ifeq          482
     442: aload         8
     444: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     449: astore        9
     451: aload         9
     453: checkcast     #31                 // class Day07Kt$main$Node
     456: astore        10
     458: iconst_0
     459: istore        11
     461: aload         10
     463: invokevirtual #121                // Method Day07Kt$main$Node.getDir:()Z
     466: ifne          432
     469: aload         6
     471: aload         9
     473: invokeinterface #83,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     478: pop
     479: goto          432
     482: aload         6
     484: checkcast     #26                 // class java/util/List
     487: nop
     488: checkcast     #42                 // class java/lang/Iterable
     491: astore_3
     492: nop
     493: iconst_0
     494: istore        4
     496: aload_3
     497: invokeinterface #57,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     502: astore        5
     504: aload         5
     506: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     511: ifeq          542
     514: aload         5
     516: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     521: astore        6
     523: aload         6
     525: checkcast     #31                 // class Day07Kt$main$Node
     528: astore        7
     530: iconst_0
     531: istore        8
     533: aload         7
     535: invokevirtual #124                // Method Day07Kt$main$Node.propagateSize:()V
     538: nop
     539: goto          504
     542: nop
     543: nop
     544: return

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

  public final java.util.List<Day07Kt$main$Node> getNodes();
    Code:
       0: aload_0
       1: getfield      #29                 // Field nodes:Ljava/util/List;
       4: areturn

  public final Day07Kt$main$Node getRoot();
    Code:
       0: aload_0
       1: getfield      #40                 // Field root:LDay07Kt$main$Node;
       4: areturn

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

  public final Day07Kt$main$Common copy(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #9                  // String input
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #2                  // class Day07Kt$main$Common
       9: dup
      10: aload_1
      11: invokespecial #166                // Method "<init>":(Ljava/util/List;)V
      14: areturn

  public static Day07Kt$main$Common copy$default(Day07Kt$main$Common, java.util.List, int, java.lang.Object);
    Code:
       0: iload_2
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #21                 // Field input:Ljava/util/List;
      10: astore_1
      11: aload_0
      12: aload_1
      13: invokevirtual #170                // Method copy:(Ljava/util/List;)LDay07Kt$main$Common;
      16: areturn

  public java.lang.String toString();
    Code:
       0: new           #174                // class java/lang/StringBuilder
       3: dup
       4: invokespecial #175                // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #177                // String Common(input=
       9: invokevirtual #181                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #21                 // Field input:Ljava/util/List;
      16: invokevirtual #184                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      19: bipush        41
      21: invokevirtual #187                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      24: invokevirtual #189                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      27: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #21                 // Field input:Ljava/util/List;
       4: invokevirtual #193                // Method java/lang/Object.hashCode:()I
       7: 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 Day07Kt$main$Common
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day07Kt$main$Common
      20: astore_2
      21: aload_0
      22: getfield      #21                 // Field input:Ljava/util/List;
      25: aload_2
      26: getfield      #21                 // Field input:Ljava/util/List;
      29: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      32: ifne          37
      35: iconst_0
      36: ireturn
      37: iconst_1
      38: ireturn
}

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

  private static final boolean isNumber(java.lang.String);
    Code:
       0: aload_0
       1: invokestatic  #43                 // Method kotlin/text/StringsKt.toIntOrNull:(Ljava/lang/String;)Ljava/lang/Integer;
       4: ifnull        11
       7: iconst_1
       8: goto          12
      11: iconst_0
      12: ireturn

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

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: new           #53                 // class Day07Kt$main$Common
       3: dup
       4: aload_0
       5: invokespecial #57                 // Method Day07Kt$main$Common."<init>":(Ljava/util/List;)V
       8: astore_1
       9: aload_1
      10: invokevirtual #61                 // Method Day07Kt$main$Common.getNodes:()Ljava/util/List;
      13: checkcast     #63                 // class java/lang/Iterable
      16: astore_2
      17: nop
      18: iconst_0
      19: istore_3
      20: aload_2
      21: astore        4
      23: new           #65                 // class java/util/ArrayList
      26: dup
      27: invokespecial #67                 // Method java/util/ArrayList."<init>":()V
      30: checkcast     #69                 // class java/util/Collection
      33: astore        5
      35: iconst_0
      36: istore        6
      38: aload         4
      40: invokeinterface #73,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      45: astore        7
      47: aload         7
      49: invokeinterface #79,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      54: ifeq          115
      57: aload         7
      59: invokeinterface #83,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      64: astore        8
      66: aload         8
      68: checkcast     #85                 // class Day07Kt$main$Node
      71: astore        9
      73: iconst_0
      74: istore        10
      76: aload         9
      78: invokevirtual #88                 // Method Day07Kt$main$Node.getDir:()Z
      81: ifeq          98
      84: aload         9
      86: invokevirtual #92                 // Method Day07Kt$main$Node.getSize:()I
      89: ldc           #93                 // int 100000
      91: if_icmpgt     98
      94: iconst_1
      95: goto          99
      98: iconst_0
      99: ifeq          47
     102: aload         5
     104: aload         8
     106: invokeinterface #97,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     111: pop
     112: goto          47
     115: aload         5
     117: checkcast     #99                 // class java/util/List
     120: nop
     121: checkcast     #63                 // class java/lang/Iterable
     124: astore_2
     125: iconst_0
     126: istore_3
     127: aload_2
     128: invokeinterface #73,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     133: astore        4
     135: aload         4
     137: invokeinterface #79,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     142: ifeq          183
     145: aload         4
     147: invokeinterface #83,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     152: astore        5
     154: iload_3
     155: aload         5
     157: checkcast     #85                 // class Day07Kt$main$Node
     160: astore        6
     162: istore        11
     164: iconst_0
     165: istore        7
     167: aload         6
     169: invokevirtual #92                 // Method Day07Kt$main$Node.getSize:()I
     172: istore        12
     174: iload         11
     176: iload         12
     178: iadd
     179: istore_3
     180: goto          135
     183: iload_3
     184: ireturn

  private static final int main$part2(java.util.List<java.lang.String>);
    Code:
       0: new           #53                 // class Day07Kt$main$Common
       3: dup
       4: aload_0
       5: invokespecial #57                 // Method Day07Kt$main$Common."<init>":(Ljava/util/List;)V
       8: astore_1
       9: ldc           #116                // int 70000000
      11: aload_1
      12: invokevirtual #120                // Method Day07Kt$main$Common.getRoot:()LDay07Kt$main$Node;
      15: invokevirtual #92                 // Method Day07Kt$main$Node.getSize:()I
      18: isub
      19: istore_2
      20: aload_1
      21: invokevirtual #61                 // Method Day07Kt$main$Common.getNodes:()Ljava/util/List;
      24: checkcast     #63                 // class java/lang/Iterable
      27: astore_3
      28: nop
      29: iconst_0
      30: istore        4
      32: aload_3
      33: astore        5
      35: new           #65                 // class java/util/ArrayList
      38: dup
      39: invokespecial #67                 // Method java/util/ArrayList."<init>":()V
      42: checkcast     #69                 // class java/util/Collection
      45: astore        6
      47: iconst_0
      48: istore        7
      50: aload         5
      52: invokeinterface #73,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      57: astore        8
      59: aload         8
      61: invokeinterface #79,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      66: ifeq          109
      69: aload         8
      71: invokeinterface #83,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      76: astore        9
      78: aload         9
      80: checkcast     #85                 // class Day07Kt$main$Node
      83: astore        10
      85: iconst_0
      86: istore        11
      88: aload         10
      90: invokevirtual #88                 // Method Day07Kt$main$Node.getDir:()Z
      93: ifeq          59
      96: aload         6
      98: aload         9
     100: invokeinterface #97,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     105: pop
     106: goto          59
     109: aload         6
     111: checkcast     #99                 // class java/util/List
     114: nop
     115: checkcast     #63                 // class java/lang/Iterable
     118: astore_3
     119: ldc           #116                // int 70000000
     121: istore        4
     123: iconst_0
     124: istore        5
     126: iload         4
     128: istore        6
     130: aload_3
     131: invokeinterface #73,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     136: astore        7
     138: aload         7
     140: invokeinterface #79,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     145: ifeq          209
     148: aload         7
     150: invokeinterface #83,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     155: astore        8
     157: iload         6
     159: aload         8
     161: checkcast     #85                 // class Day07Kt$main$Node
     164: astore        9
     166: istore        10
     168: iconst_0
     169: istore        11
     171: iload_2
     172: aload         9
     174: invokevirtual #92                 // Method Day07Kt$main$Node.getSize:()I
     177: iadd
     178: ldc           #121                // int 30000000
     180: if_icmplt     201
     183: iload         10
     185: aload         9
     187: invokevirtual #92                 // Method Day07Kt$main$Node.getSize:()I
     190: if_icmple     201
     193: aload         9
     195: invokevirtual #92                 // Method Day07Kt$main$Node.getSize:()I
     198: goto          203
     201: iload         10
     203: nop
     204: istore        6
     206: goto          138
     209: iload         6
     211: ireturn

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

Compiled from "Day07.kt"
public final class Day07Kt$main$Node {
  private final java.lang.String name;

  private int size;

  private final boolean dir;

  private final Day07Kt$main$Node parent;

  public Day07Kt$main$Node(java.lang.String, int, boolean, Day07Kt$main$Node);
    Code:
       0: aload_1
       1: ldc           #8                  // String name
       3: invokestatic  #14                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokespecial #17                 // Method java/lang/Object."<init>":()V
      10: aload_0
      11: aload_1
      12: putfield      #20                 // Field name:Ljava/lang/String;
      15: aload_0
      16: iload_2
      17: putfield      #24                 // Field size:I
      20: aload_0
      21: iload_3
      22: putfield      #28                 // Field dir:Z
      25: aload_0
      26: aload         4
      28: putfield      #32                 // Field parent:LDay07Kt$main$Node;
      31: return

  public Day07Kt$main$Node(java.lang.String, int, boolean, Day07Kt$main$Node, int, kotlin.jvm.internal.DefaultConstructorMarker);
    Code:
       0: iload         5
       2: iconst_2
       3: iand
       4: ifeq          9
       7: iconst_0
       8: istore_2
       9: iload         5
      11: iconst_4
      12: iand
      13: ifeq          18
      16: iconst_0
      17: istore_3
      18: iload         5
      20: bipush        8
      22: iand
      23: ifeq          29
      26: aconst_null
      27: astore        4
      29: aload_0
      30: aload_1
      31: iload_2
      32: iload_3
      33: aload         4
      35: invokespecial #36                 // Method "<init>":(Ljava/lang/String;IZLDay07Kt$main$Node;)V
      38: return

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

  public final int getSize();
    Code:
       0: aload_0
       1: getfield      #24                 // Field size:I
       4: ireturn

  public final void setSize(int);
    Code:
       0: aload_0
       1: iload_1
       2: putfield      #24                 // Field size:I
       5: return

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

  public final Day07Kt$main$Node getParent();
    Code:
       0: aload_0
       1: getfield      #32                 // Field parent:LDay07Kt$main$Node;
       4: areturn

  public final void propagateSize();
    Code:
       0: aload_0
       1: getfield      #32                 // Field parent:LDay07Kt$main$Node;
       4: astore_1
       5: aload_1
       6: ifnull        32
       9: aload_1
      10: astore_2
      11: aload_2
      12: aload_2
      13: getfield      #24                 // Field size:I
      16: aload_0
      17: getfield      #24                 // Field size:I
      20: iadd
      21: putfield      #24                 // Field size:I
      24: aload_1
      25: getfield      #32                 // Field parent:LDay07Kt$main$Node;
      28: astore_1
      29: goto          5
      32: return

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

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

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

  public final Day07Kt$main$Node component4();
    Code:
       0: aload_0
       1: getfield      #32                 // Field parent:LDay07Kt$main$Node;
       4: areturn

  public final Day07Kt$main$Node copy(java.lang.String, int, boolean, Day07Kt$main$Node);
    Code:
       0: aload_1
       1: ldc           #8                  // String name
       3: invokestatic  #14                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #2                  // class Day07Kt$main$Node
       9: dup
      10: aload_1
      11: iload_2
      12: iload_3
      13: aload         4
      15: invokespecial #36                 // Method "<init>":(Ljava/lang/String;IZLDay07Kt$main$Node;)V
      18: areturn

  public static Day07Kt$main$Node copy$default(Day07Kt$main$Node, java.lang.String, int, boolean, Day07Kt$main$Node, int, java.lang.Object);
    Code:
       0: iload         5
       2: iconst_1
       3: iand
       4: ifeq          12
       7: aload_0
       8: getfield      #20                 // Field name:Ljava/lang/String;
      11: astore_1
      12: iload         5
      14: iconst_2
      15: iand
      16: ifeq          24
      19: aload_0
      20: getfield      #24                 // Field size:I
      23: istore_2
      24: iload         5
      26: iconst_4
      27: iand
      28: ifeq          36
      31: aload_0
      32: getfield      #28                 // Field dir:Z
      35: istore_3
      36: iload         5
      38: bipush        8
      40: iand
      41: ifeq          50
      44: aload_0
      45: getfield      #32                 // Field parent:LDay07Kt$main$Node;
      48: astore        4
      50: aload_0
      51: aload_1
      52: iload_2
      53: iload_3
      54: aload         4
      56: invokevirtual #59                 // Method copy:(Ljava/lang/String;IZLDay07Kt$main$Node;)LDay07Kt$main$Node;
      59: areturn

  public java.lang.String toString();
    Code:
       0: new           #62                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #63                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #65                 // String Node(name=
       9: invokevirtual #69                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #20                 // Field name:Ljava/lang/String;
      16: invokevirtual #69                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      19: ldc           #71                 // String , size=
      21: invokevirtual #69                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #24                 // Field size:I
      28: invokevirtual #74                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: ldc           #76                 // String , dir=
      33: invokevirtual #69                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      36: aload_0
      37: getfield      #28                 // Field dir:Z
      40: invokevirtual #79                 // Method java/lang/StringBuilder.append:(Z)Ljava/lang/StringBuilder;
      43: ldc           #81                 // String , parent=
      45: invokevirtual #69                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      48: aload_0
      49: getfield      #32                 // Field parent:LDay07Kt$main$Node;
      52: invokevirtual #84                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      55: bipush        41
      57: invokevirtual #87                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      60: invokevirtual #89                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      63: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #20                 // Field name:Ljava/lang/String;
       4: invokevirtual #94                 // Method java/lang/String.hashCode:()I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #24                 // Field size:I
      16: invokestatic  #99                 // Method java/lang/Integer.hashCode:(I)I
      19: iadd
      20: istore_1
      21: iload_1
      22: bipush        31
      24: imul
      25: aload_0
      26: getfield      #28                 // Field dir:Z
      29: invokestatic  #104                // Method java/lang/Boolean.hashCode:(Z)I
      32: iadd
      33: istore_1
      34: iload_1
      35: bipush        31
      37: imul
      38: aload_0
      39: getfield      #32                 // Field parent:LDay07Kt$main$Node;
      42: ifnonnull     49
      45: iconst_0
      46: goto          56
      49: aload_0
      50: getfield      #32                 // Field parent:LDay07Kt$main$Node;
      53: invokevirtual #105                // Method hashCode:()I
      56: iadd
      57: istore_1
      58: iload_1
      59: 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 Day07Kt$main$Node
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day07Kt$main$Node
      20: astore_2
      21: aload_0
      22: getfield      #20                 // Field name:Ljava/lang/String;
      25: aload_2
      26: getfield      #20                 // Field name:Ljava/lang/String;
      29: invokestatic  #112                // 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      #24                 // Field size:I
      41: aload_2
      42: getfield      #24                 // Field size:I
      45: if_icmpeq     50
      48: iconst_0
      49: ireturn
      50: aload_0
      51: getfield      #28                 // Field dir:Z
      54: aload_2
      55: getfield      #28                 // Field dir:Z
      58: if_icmpeq     63
      61: iconst_0
      62: ireturn
      63: aload_0
      64: getfield      #32                 // Field parent:LDay07Kt$main$Node;
      67: aload_2
      68: getfield      #32                 // Field parent:LDay07Kt$main$Node;
      71: invokestatic  #112                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      74: ifne          79
      77: iconst_0
      78: ireturn
      79: iconst_1
      80: ireturn
}


fun main() {

    data class Step(val cycle: Int, val sum: Int)

    fun run(input: List<String>): MutableList<Step>{
        var cycle = 1
        var sum = 1
        val steps = mutableListOf<Step>()

        input.forEach {
            when (it) {
                "noop" -> steps.add(Step(cycle++, sum))
                else -> {
                    val (_, amount) = it.split(" ")
                    steps += Step(cycle++, sum)
                    steps += Step(cycle++, sum)
                    sum += amount.toInt()
                }
            }
        }

        return steps
    }

    fun part1(input: List<String>): Int {
        val cycles = List(6) { i -> 20 + i * 40 }
        return run(input)
            .filter { it.cycle in cycles }
            .sumOf { it.cycle * it.sum }
    }

    fun part2(input: List<String>) {
        run(input)
            .map {
                val sprite = it.sum - 1..it.sum + 1
                if ((it.cycle - 1) % 40 in sprite) "🟨" else "⬛"
            }
            .chunked(40)
            .forEach { println(it.joinToString("")) }
    }

    val input = readInput("inputs/Day10")
    println(part1(input))
    part2(input)
}

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

  private final int sum;

  public Day10Kt$main$Step(int, int);
    Code:
       0: aload_0
       1: invokespecial #9                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: iload_1
       6: putfield      #13                 // Field cycle:I
       9: aload_0
      10: iload_2
      11: putfield      #16                 // Field sum:I
      14: return

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

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

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

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

  public final Day10Kt$main$Step copy(int, int);
    Code:
       0: new           #2                  // class Day10Kt$main$Step
       3: dup
       4: iload_1
       5: iload_2
       6: invokespecial #27                 // Method "<init>":(II)V
       9: areturn

  public static Day10Kt$main$Step copy$default(Day10Kt$main$Step, int, int, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #13                 // Field cycle:I
      10: istore_1
      11: iload_3
      12: iconst_2
      13: iand
      14: ifeq          22
      17: aload_0
      18: getfield      #16                 // Field sum:I
      21: istore_2
      22: aload_0
      23: iload_1
      24: iload_2
      25: invokevirtual #31                 // Method copy:(II)LDay10Kt$main$Step;
      28: areturn

  public java.lang.String toString();
    Code:
       0: new           #35                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #36                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #38                 // String Step(cycle=
       9: invokevirtual #42                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field cycle:I
      16: invokevirtual #45                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #47                 // String , sum=
      21: invokevirtual #42                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #16                 // Field sum:I
      28: invokevirtual #45                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #50                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #52                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      39: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #13                 // Field cycle:I
       4: invokestatic  #58                 // Method java/lang/Integer.hashCode:(I)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #16                 // Field sum:I
      16: invokestatic  #58                 // Method java/lang/Integer.hashCode:(I)I
      19: iadd
      20: istore_1
      21: iload_1
      22: ireturn

  public boolean equals(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: if_acmpne     7
       5: iconst_1
       6: ireturn
       7: aload_1
       8: instanceof    #2                  // class Day10Kt$main$Step
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day10Kt$main$Step
      20: astore_2
      21: aload_0
      22: getfield      #13                 // Field cycle:I
      25: aload_2
      26: getfield      #13                 // Field cycle:I
      29: if_icmpeq     34
      32: iconst_0
      33: ireturn
      34: aload_0
      35: getfield      #16                 // Field sum:I
      38: aload_2
      39: getfield      #16                 // Field sum:I
      42: if_icmpeq     47
      45: iconst_0
      46: ireturn
      47: iconst_1
      48: ireturn
}

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

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

  private static final java.util.List<Day10Kt$main$Step> main$run(java.util.List<java.lang.String>);
    Code:
       0: iconst_0
       1: istore_1
       2: iconst_1
       3: istore_1
       4: iconst_0
       5: istore_2
       6: iconst_1
       7: istore_2
       8: new           #46                 // class java/util/ArrayList
      11: dup
      12: invokespecial #49                 // Method java/util/ArrayList."<init>":()V
      15: checkcast     #51                 // class java/util/List
      18: astore_3
      19: aload_0
      20: checkcast     #53                 // class java/lang/Iterable
      23: astore        4
      25: iconst_0
      26: istore        5
      28: aload         4
      30: invokeinterface #57,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      35: astore        6
      37: aload         6
      39: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      44: ifeq          221
      47: aload         6
      49: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      54: astore        7
      56: aload         7
      58: checkcast     #69                 // class java/lang/String
      61: astore        8
      63: iconst_0
      64: istore        9
      66: aload         8
      68: ldc           #71                 // String noop
      70: invokestatic  #77                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      73: ifeq          104
      76: aload_3
      77: new           #79                 // class Day10Kt$main$Step
      80: dup
      81: iload_1
      82: istore        10
      84: iload         10
      86: iconst_1
      87: iadd
      88: istore_1
      89: iload         10
      91: iload_2
      92: invokespecial #82                 // Method Day10Kt$main$Step."<init>":(II)V
      95: invokeinterface #86,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     100: pop
     101: goto          216
     104: aload         8
     106: checkcast     #88                 // class java/lang/CharSequence
     109: iconst_1
     110: anewarray     #69                 // class java/lang/String
     113: astore        11
     115: aload         11
     117: iconst_0
     118: ldc           #90                 // String
     120: aastore
     121: aload         11
     123: iconst_0
     124: iconst_0
     125: bipush        6
     127: aconst_null
     128: invokestatic  #96                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     131: iconst_1
     132: invokeinterface #100,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     137: checkcast     #69                 // class java/lang/String
     140: astore        11
     142: aload_3
     143: checkcast     #102                // class java/util/Collection
     146: astore        12
     148: new           #79                 // class Day10Kt$main$Step
     151: dup
     152: iload_1
     153: istore        13
     155: iload         13
     157: iconst_1
     158: iadd
     159: istore_1
     160: iload         13
     162: iload_2
     163: invokespecial #82                 // Method Day10Kt$main$Step."<init>":(II)V
     166: aload         12
     168: swap
     169: invokeinterface #103,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     174: pop
     175: aload_3
     176: checkcast     #102                // class java/util/Collection
     179: astore        12
     181: new           #79                 // class Day10Kt$main$Step
     184: dup
     185: iload_1
     186: istore        13
     188: iload         13
     190: iconst_1
     191: iadd
     192: istore_1
     193: iload         13
     195: iload_2
     196: invokespecial #82                 // Method Day10Kt$main$Step."<init>":(II)V
     199: aload         12
     201: swap
     202: invokeinterface #103,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     207: pop
     208: iload_2
     209: aload         11
     211: invokestatic  #109                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     214: iadd
     215: istore_2
     216: nop
     217: nop
     218: goto          37
     221: nop
     222: aload_3
     223: areturn

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: bipush        6
       2: istore_2
       3: new           #46                 // class java/util/ArrayList
       6: dup
       7: iload_2
       8: invokespecial #125                // Method java/util/ArrayList."<init>":(I)V
      11: astore_3
      12: iconst_0
      13: istore        4
      15: iload         4
      17: iload_2
      18: if_icmpge     59
      21: iload         4
      23: istore        5
      25: aload_3
      26: iload         5
      28: istore        6
      30: astore        11
      32: iconst_0
      33: istore        7
      35: bipush        20
      37: iload         6
      39: bipush        40
      41: imul
      42: iadd
      43: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      46: aload         11
      48: swap
      49: invokevirtual #130                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      52: pop
      53: iinc          4, 1
      56: goto          15
      59: aload_3
      60: checkcast     #51                 // class java/util/List
      63: astore_1
      64: aload_0
      65: invokestatic  #132                // Method main$run:(Ljava/util/List;)Ljava/util/List;
      68: checkcast     #53                 // class java/lang/Iterable
      71: astore_2
      72: nop
      73: iconst_0
      74: istore_3
      75: aload_2
      76: astore        4
      78: new           #46                 // class java/util/ArrayList
      81: dup
      82: invokespecial #49                 // Method java/util/ArrayList."<init>":()V
      85: checkcast     #102                // class java/util/Collection
      88: astore        5
      90: iconst_0
      91: istore        6
      93: aload         4
      95: invokeinterface #57,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     100: astore        7
     102: aload         7
     104: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     109: ifeq          161
     112: aload         7
     114: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     119: astore        8
     121: aload         8
     123: checkcast     #79                 // class Day10Kt$main$Step
     126: astore        9
     128: iconst_0
     129: istore        10
     131: aload_1
     132: aload         9
     134: invokevirtual #136                // Method Day10Kt$main$Step.getCycle:()I
     137: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     140: invokeinterface #139,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
     145: ifeq          102
     148: aload         5
     150: aload         8
     152: invokeinterface #103,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     157: pop
     158: goto          102
     161: aload         5
     163: checkcast     #51                 // class java/util/List
     166: nop
     167: checkcast     #53                 // class java/lang/Iterable
     170: astore_2
     171: iconst_0
     172: istore_3
     173: aload_2
     174: invokeinterface #57,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     179: astore        4
     181: aload         4
     183: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     188: ifeq          235
     191: aload         4
     193: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     198: astore        5
     200: iload_3
     201: aload         5
     203: checkcast     #79                 // class Day10Kt$main$Step
     206: astore        6
     208: istore        11
     210: iconst_0
     211: istore        7
     213: aload         6
     215: invokevirtual #136                // Method Day10Kt$main$Step.getCycle:()I
     218: aload         6
     220: invokevirtual #142                // Method Day10Kt$main$Step.getSum:()I
     223: imul
     224: istore        12
     226: iload         11
     228: iload         12
     230: iadd
     231: istore_3
     232: goto          181
     235: iload_3
     236: ireturn

  private static final void main$part2(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: invokestatic  #132                // Method main$run:(Ljava/util/List;)Ljava/util/List;
       4: checkcast     #53                 // class java/lang/Iterable
       7: astore_1
       8: nop
       9: iconst_0
      10: istore_2
      11: aload_1
      12: astore_3
      13: new           #46                 // class java/util/ArrayList
      16: dup
      17: aload_1
      18: bipush        10
      20: invokestatic  #162                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      23: invokespecial #125                // Method java/util/ArrayList."<init>":(I)V
      26: checkcast     #102                // class java/util/Collection
      29: astore        4
      31: iconst_0
      32: istore        5
      34: aload_3
      35: invokeinterface #57,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      40: astore        6
      42: aload         6
      44: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      49: ifeq          169
      52: aload         6
      54: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      59: astore        7
      61: aload         4
      63: aload         7
      65: checkcast     #79                 // class Day10Kt$main$Step
      68: astore        8
      70: astore        14
      72: iconst_0
      73: istore        9
      75: new           #164                // class kotlin/ranges/IntRange
      78: dup
      79: aload         8
      81: invokevirtual #142                // Method Day10Kt$main$Step.getSum:()I
      84: iconst_1
      85: isub
      86: aload         8
      88: invokevirtual #142                // Method Day10Kt$main$Step.getSum:()I
      91: iconst_1
      92: iadd
      93: invokespecial #165                // Method kotlin/ranges/IntRange."<init>":(II)V
      96: astore        10
      98: aload         10
     100: invokevirtual #168                // Method kotlin/ranges/IntRange.getFirst:()I
     103: istore        11
     105: aload         10
     107: invokevirtual #171                // Method kotlin/ranges/IntRange.getLast:()I
     110: istore        12
     112: aload         8
     114: invokevirtual #136                // Method Day10Kt$main$Step.getCycle:()I
     117: iconst_1
     118: isub
     119: bipush        40
     121: irem
     122: istore        13
     124: iload         11
     126: iload         13
     128: if_icmpgt     146
     131: iload         13
     133: iload         12
     135: if_icmpgt     142
     138: iconst_1
     139: goto          147
     142: iconst_0
     143: goto          147
     146: iconst_0
     147: ifeq          155
     150: ldc           #173                // String 🟨
     152: goto          157
     155: ldc           #175                // String ⬛
     157: aload         14
     159: swap
     160: invokeinterface #103,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     165: pop
     166: goto          42
     169: aload         4
     171: checkcast     #51                 // class java/util/List
     174: nop
     175: checkcast     #53                 // class java/lang/Iterable
     178: bipush        40
     180: invokestatic  #179                // Method kotlin/collections/CollectionsKt.chunked:(Ljava/lang/Iterable;I)Ljava/util/List;
     183: checkcast     #53                 // class java/lang/Iterable
     186: astore_1
     187: nop
     188: iconst_0
     189: istore_2
     190: aload_1
     191: invokeinterface #57,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     196: astore_3
     197: aload_3
     198: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     203: ifeq          257
     206: aload_3
     207: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     212: astore        4
     214: aload         4
     216: checkcast     #51                 // class java/util/List
     219: astore        5
     221: iconst_0
     222: istore        6
     224: aload         5
     226: checkcast     #53                 // class java/lang/Iterable
     229: ldc           #181                // String
     231: checkcast     #88                 // class java/lang/CharSequence
     234: aconst_null
     235: aconst_null
     236: iconst_0
     237: aconst_null
     238: aconst_null
     239: bipush        62
     241: aconst_null
     242: invokestatic  #185                // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
     245: getstatic     #24                 // Field java/lang/System.out:Ljava/io/PrintStream;
     248: swap
     249: invokevirtual #188                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     252: nop
     253: nop
     254: goto          197
     257: nop
     258: return
}


fun main() {

    data class Cube(val x: Int, val y: Int, val z: Int)
    fun Cube.adjacents(): List<Cube> {
        return listOf(
            Cube(x+1, y, z), Cube(x-1, y, z),
            Cube(x, y+1, z), Cube(x, y-1, z),
            Cube(x, y, z+1), Cube(x, y, z-1),
        )
    }

    fun parse(input: List<String>): Set<Cube> {
        return input.map {
            it.split(",").map { n -> n.toInt() }
        }
        .map { (x, y, z) -> Cube(x, y, z) }
        .toSet()
    }

    fun part1(input: List<String>): Int {
        val cubes = parse(input)
        return cubes.sumOf { (it.adjacents() - cubes).size }
    }

    fun part2(input: List<String>): Int {
        val cubes = parse(input)

        val xRange = cubes.minOf { it.x } - 1..cubes.maxOf { it.x } + 1
        val yRange = cubes.minOf { it.y } - 1..cubes.maxOf { it.y } + 1
        val zRange = cubes.minOf { it.z } - 1..cubes.maxOf { it.z } + 1

        val queue = ArrayDeque<Cube>().apply { add(Cube(xRange.first, yRange.first, zRange.first)) }
        val seen = mutableSetOf<Cube>()
        var sides = 0

        queue.forEach { current ->
            if (current !in seen) {
                seen += current

                current.adjacents()
                    .filter { it.x in xRange && it.y in yRange && it.z in zRange }
                    .forEach { adj -> if (adj in cubes) sides++ else queue.add(adj) }
            }
        }

        return sides
    }

    val input = readInput("inputs/Day18")
    println(part1(input))
    println(part2(input))
}

Compiled from "Day18.kt"
public final class Day18Kt$main$Cube {
  private final int x;

  private final int y;

  private final int z;

  public Day18Kt$main$Cube(int, int, int);
    Code:
       0: aload_0
       1: invokespecial #9                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: iload_1
       6: putfield      #13                 // Field x:I
       9: aload_0
      10: iload_2
      11: putfield      #16                 // Field y:I
      14: aload_0
      15: iload_3
      16: putfield      #19                 // Field z:I
      19: return

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

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

  public final int getZ();
    Code:
       0: aload_0
       1: getfield      #19                 // Field z:I
       4: ireturn

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

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

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

  public final Day18Kt$main$Cube copy(int, int, int);
    Code:
       0: new           #2                  // class Day18Kt$main$Cube
       3: dup
       4: iload_1
       5: iload_2
       6: iload_3
       7: invokespecial #32                 // Method "<init>":(III)V
      10: areturn

  public static Day18Kt$main$Cube copy$default(Day18Kt$main$Cube, int, int, int, int, java.lang.Object);
    Code:
       0: iload         4
       2: iconst_1
       3: iand
       4: ifeq          12
       7: aload_0
       8: getfield      #13                 // Field x:I
      11: istore_1
      12: iload         4
      14: iconst_2
      15: iand
      16: ifeq          24
      19: aload_0
      20: getfield      #16                 // Field y:I
      23: istore_2
      24: iload         4
      26: iconst_4
      27: iand
      28: ifeq          36
      31: aload_0
      32: getfield      #19                 // Field z:I
      35: istore_3
      36: aload_0
      37: iload_1
      38: iload_2
      39: iload_3
      40: invokevirtual #36                 // Method copy:(III)LDay18Kt$main$Cube;
      43: areturn

  public java.lang.String toString();
    Code:
       0: new           #40                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #41                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #43                 // String Cube(x=
       9: invokevirtual #47                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field x:I
      16: invokevirtual #50                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #52                 // String , y=
      21: invokevirtual #47                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #16                 // Field y:I
      28: invokevirtual #50                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: ldc           #54                 // String , z=
      33: invokevirtual #47                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      36: aload_0
      37: getfield      #19                 // Field z:I
      40: invokevirtual #50                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      43: bipush        41
      45: invokevirtual #57                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      48: invokevirtual #59                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      51: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #13                 // Field x:I
       4: invokestatic  #65                 // Method java/lang/Integer.hashCode:(I)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #16                 // Field y:I
      16: invokestatic  #65                 // Method java/lang/Integer.hashCode:(I)I
      19: iadd
      20: istore_1
      21: iload_1
      22: bipush        31
      24: imul
      25: aload_0
      26: getfield      #19                 // Field z:I
      29: invokestatic  #65                 // Method java/lang/Integer.hashCode:(I)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 Day18Kt$main$Cube
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day18Kt$main$Cube
      20: astore_2
      21: aload_0
      22: getfield      #13                 // Field x:I
      25: aload_2
      26: getfield      #13                 // Field x:I
      29: if_icmpeq     34
      32: iconst_0
      33: ireturn
      34: aload_0
      35: getfield      #16                 // Field y:I
      38: aload_2
      39: getfield      #16                 // Field y:I
      42: if_icmpeq     47
      45: iconst_0
      46: ireturn
      47: aload_0
      48: getfield      #19                 // Field z:I
      51: aload_2
      52: getfield      #19                 // Field z:I
      55: if_icmpeq     60
      58: iconst_0
      59: ireturn
      60: iconst_1
      61: ireturn
}

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

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

  private static final java.util.List<Day18Kt$main$Cube> main$adjacents(Day18Kt$main$Cube);
    Code:
       0: bipush        6
       2: anewarray     #45                 // class Day18Kt$main$Cube
       5: astore_1
       6: aload_1
       7: iconst_0
       8: new           #45                 // class Day18Kt$main$Cube
      11: dup
      12: aload_0
      13: invokevirtual #49                 // Method Day18Kt$main$Cube.getX:()I
      16: iconst_1
      17: iadd
      18: aload_0
      19: invokevirtual #52                 // Method Day18Kt$main$Cube.getY:()I
      22: aload_0
      23: invokevirtual #55                 // Method Day18Kt$main$Cube.getZ:()I
      26: invokespecial #59                 // Method Day18Kt$main$Cube."<init>":(III)V
      29: aastore
      30: aload_1
      31: iconst_1
      32: new           #45                 // class Day18Kt$main$Cube
      35: dup
      36: aload_0
      37: invokevirtual #49                 // Method Day18Kt$main$Cube.getX:()I
      40: iconst_1
      41: isub
      42: aload_0
      43: invokevirtual #52                 // Method Day18Kt$main$Cube.getY:()I
      46: aload_0
      47: invokevirtual #55                 // Method Day18Kt$main$Cube.getZ:()I
      50: invokespecial #59                 // Method Day18Kt$main$Cube."<init>":(III)V
      53: aastore
      54: aload_1
      55: iconst_2
      56: new           #45                 // class Day18Kt$main$Cube
      59: dup
      60: aload_0
      61: invokevirtual #49                 // Method Day18Kt$main$Cube.getX:()I
      64: aload_0
      65: invokevirtual #52                 // Method Day18Kt$main$Cube.getY:()I
      68: iconst_1
      69: iadd
      70: aload_0
      71: invokevirtual #55                 // Method Day18Kt$main$Cube.getZ:()I
      74: invokespecial #59                 // Method Day18Kt$main$Cube."<init>":(III)V
      77: aastore
      78: aload_1
      79: iconst_3
      80: new           #45                 // class Day18Kt$main$Cube
      83: dup
      84: aload_0
      85: invokevirtual #49                 // Method Day18Kt$main$Cube.getX:()I
      88: aload_0
      89: invokevirtual #52                 // Method Day18Kt$main$Cube.getY:()I
      92: iconst_1
      93: isub
      94: aload_0
      95: invokevirtual #55                 // Method Day18Kt$main$Cube.getZ:()I
      98: invokespecial #59                 // Method Day18Kt$main$Cube."<init>":(III)V
     101: aastore
     102: aload_1
     103: iconst_4
     104: new           #45                 // class Day18Kt$main$Cube
     107: dup
     108: aload_0
     109: invokevirtual #49                 // Method Day18Kt$main$Cube.getX:()I
     112: aload_0
     113: invokevirtual #52                 // Method Day18Kt$main$Cube.getY:()I
     116: aload_0
     117: invokevirtual #55                 // Method Day18Kt$main$Cube.getZ:()I
     120: iconst_1
     121: iadd
     122: invokespecial #59                 // Method Day18Kt$main$Cube."<init>":(III)V
     125: aastore
     126: aload_1
     127: iconst_5
     128: new           #45                 // class Day18Kt$main$Cube
     131: dup
     132: aload_0
     133: invokevirtual #49                 // Method Day18Kt$main$Cube.getX:()I
     136: aload_0
     137: invokevirtual #52                 // Method Day18Kt$main$Cube.getY:()I
     140: aload_0
     141: invokevirtual #55                 // Method Day18Kt$main$Cube.getZ:()I
     144: iconst_1
     145: isub
     146: invokespecial #59                 // Method Day18Kt$main$Cube."<init>":(III)V
     149: aastore
     150: aload_1
     151: invokestatic  #65                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     154: areturn

  private static final java.util.Set<Day18Kt$main$Cube> main$parse(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: checkcast     #72                 // class java/lang/Iterable
       4: astore_1
       5: iconst_0
       6: istore_2
       7: aload_1
       8: astore_3
       9: new           #74                 // class java/util/ArrayList
      12: dup
      13: aload_1
      14: bipush        10
      16: invokestatic  #78                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      19: invokespecial #80                 // Method java/util/ArrayList."<init>":(I)V
      22: checkcast     #82                 // class java/util/Collection
      25: astore        4
      27: iconst_0
      28: istore        5
      30: aload_3
      31: invokeinterface #86,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      36: astore        6
      38: aload         6
      40: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      45: ifeq          214
      48: aload         6
      50: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      55: astore        7
      57: aload         4
      59: aload         7
      61: checkcast     #98                 // class java/lang/String
      64: astore        8
      66: astore        20
      68: iconst_0
      69: istore        9
      71: aload         8
      73: checkcast     #100                // class java/lang/CharSequence
      76: iconst_1
      77: anewarray     #98                 // class java/lang/String
      80: astore        10
      82: aload         10
      84: iconst_0
      85: ldc           #102                // String ,
      87: aastore
      88: aload         10
      90: iconst_0
      91: iconst_0
      92: bipush        6
      94: aconst_null
      95: invokestatic  #108                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      98: checkcast     #72                 // class java/lang/Iterable
     101: astore        10
     103: iconst_0
     104: istore        11
     106: aload         10
     108: astore        12
     110: new           #74                 // class java/util/ArrayList
     113: dup
     114: aload         10
     116: bipush        10
     118: invokestatic  #78                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     121: invokespecial #80                 // Method java/util/ArrayList."<init>":(I)V
     124: checkcast     #82                 // class java/util/Collection
     127: astore        13
     129: iconst_0
     130: istore        14
     132: aload         12
     134: invokeinterface #86,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     139: astore        15
     141: aload         15
     143: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     148: ifeq          195
     151: aload         15
     153: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     158: astore        16
     160: aload         13
     162: aload         16
     164: checkcast     #98                 // class java/lang/String
     167: astore        17
     169: astore        18
     171: iconst_0
     172: istore        19
     174: aload         17
     176: invokestatic  #114                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     179: nop
     180: invokestatic  #118                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     183: aload         18
     185: swap
     186: invokeinterface #122,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     191: pop
     192: goto          141
     195: aload         13
     197: checkcast     #124                // class java/util/List
     200: nop
     201: nop
     202: aload         20
     204: swap
     205: invokeinterface #122,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     210: pop
     211: goto          38
     214: aload         4
     216: checkcast     #124                // class java/util/List
     219: nop
     220: checkcast     #72                 // class java/lang/Iterable
     223: astore_1
     224: nop
     225: iconst_0
     226: istore_2
     227: aload_1
     228: astore_3
     229: new           #74                 // class java/util/ArrayList
     232: dup
     233: aload_1
     234: bipush        10
     236: invokestatic  #78                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     239: invokespecial #80                 // Method java/util/ArrayList."<init>":(I)V
     242: checkcast     #82                 // class java/util/Collection
     245: astore        4
     247: iconst_0
     248: istore        5
     250: aload_3
     251: invokeinterface #86,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     256: astore        6
     258: aload         6
     260: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     265: ifeq          364
     268: aload         6
     270: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     275: astore        7
     277: aload         4
     279: aload         7
     281: checkcast     #124                // class java/util/List
     284: astore        8
     286: astore        20
     288: iconst_0
     289: istore        9
     291: aload         8
     293: iconst_0
     294: invokeinterface #128,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     299: checkcast     #130                // class java/lang/Number
     302: invokevirtual #133                // Method java/lang/Number.intValue:()I
     305: istore        10
     307: aload         8
     309: iconst_1
     310: invokeinterface #128,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     315: checkcast     #130                // class java/lang/Number
     318: invokevirtual #133                // Method java/lang/Number.intValue:()I
     321: istore        11
     323: aload         8
     325: iconst_2
     326: invokeinterface #128,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     331: checkcast     #130                // class java/lang/Number
     334: invokevirtual #133                // Method java/lang/Number.intValue:()I
     337: istore        12
     339: new           #45                 // class Day18Kt$main$Cube
     342: dup
     343: iload         10
     345: iload         11
     347: iload         12
     349: invokespecial #59                 // Method Day18Kt$main$Cube."<init>":(III)V
     352: aload         20
     354: swap
     355: invokeinterface #122,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     360: pop
     361: goto          258
     364: aload         4
     366: checkcast     #124                // class java/util/List
     369: nop
     370: checkcast     #72                 // class java/lang/Iterable
     373: invokestatic  #137                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
     376: areturn

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: invokestatic  #159                // Method main$parse:(Ljava/util/List;)Ljava/util/Set;
       4: astore_1
       5: aload_1
       6: checkcast     #72                 // class java/lang/Iterable
       9: astore_2
      10: iconst_0
      11: istore_3
      12: aload_2
      13: invokeinterface #86,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      18: astore        4
      20: aload         4
      22: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      27: ifeq          83
      30: aload         4
      32: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      37: astore        5
      39: iload_3
      40: aload         5
      42: checkcast     #45                 // class Day18Kt$main$Cube
      45: astore        6
      47: istore        8
      49: iconst_0
      50: istore        7
      52: aload         6
      54: invokestatic  #161                // Method main$adjacents:(LDay18Kt$main$Cube;)Ljava/util/List;
      57: checkcast     #72                 // class java/lang/Iterable
      60: aload_1
      61: checkcast     #72                 // class java/lang/Iterable
      64: invokestatic  #165                // Method kotlin/collections/CollectionsKt.minus:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;
      67: invokeinterface #168,  1          // InterfaceMethod java/util/List.size:()I
      72: istore        9
      74: iload         8
      76: iload         9
      78: iadd
      79: istore_3
      80: goto          20
      83: iload_3
      84: ireturn

  private static final int main$part2(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: invokestatic  #159                // Method main$parse:(Ljava/util/List;)Ljava/util/Set;
       4: astore_1
       5: aload_1
       6: checkcast     #72                 // class java/lang/Iterable
       9: invokeinterface #86,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      14: astore        4
      16: aload         4
      18: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      23: ifne          34
      26: new           #175                // class java/util/NoSuchElementException
      29: dup
      30: invokespecial #177                // Method java/util/NoSuchElementException."<init>":()V
      33: athrow
      34: aload         4
      36: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      41: checkcast     #45                 // class Day18Kt$main$Cube
      44: astore        5
      46: iconst_0
      47: istore        6
      49: aload         5
      51: invokevirtual #49                 // Method Day18Kt$main$Cube.getX:()I
      54: istore        5
      56: aload         4
      58: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      63: ifeq          102
      66: aload         4
      68: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      73: checkcast     #45                 // class Day18Kt$main$Cube
      76: astore        6
      78: iconst_0
      79: istore        7
      81: aload         6
      83: invokevirtual #49                 // Method Day18Kt$main$Cube.getX:()I
      86: istore        6
      88: iload         5
      90: iload         6
      92: if_icmple     56
      95: iload         6
      97: istore        5
      99: goto          56
     102: iload         5
     104: iconst_1
     105: isub
     106: aload_1
     107: checkcast     #72                 // class java/lang/Iterable
     110: astore_3
     111: istore        26
     113: aload_3
     114: invokeinterface #86,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     119: astore        4
     121: aload         4
     123: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     128: ifne          139
     131: new           #175                // class java/util/NoSuchElementException
     134: dup
     135: invokespecial #177                // Method java/util/NoSuchElementException."<init>":()V
     138: athrow
     139: aload         4
     141: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     146: checkcast     #45                 // class Day18Kt$main$Cube
     149: astore        5
     151: iconst_0
     152: istore        6
     154: aload         5
     156: invokevirtual #49                 // Method Day18Kt$main$Cube.getX:()I
     159: istore        5
     161: aload         4
     163: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     168: ifeq          207
     171: aload         4
     173: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     178: checkcast     #45                 // class Day18Kt$main$Cube
     181: astore        6
     183: iconst_0
     184: istore        7
     186: aload         6
     188: invokevirtual #49                 // Method Day18Kt$main$Cube.getX:()I
     191: istore        6
     193: iload         5
     195: iload         6
     197: if_icmpge     161
     200: iload         6
     202: istore        5
     204: goto          161
     207: iload         5
     209: istore        27
     211: iload         26
     213: iload         27
     215: iconst_1
     216: iadd
     217: istore        28
     219: istore        29
     221: new           #179                // class kotlin/ranges/IntRange
     224: dup
     225: iload         29
     227: iload         28
     229: invokespecial #182                // Method kotlin/ranges/IntRange."<init>":(II)V
     232: astore_2
     233: aload_1
     234: checkcast     #72                 // class java/lang/Iterable
     237: invokeinterface #86,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     242: astore        5
     244: aload         5
     246: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     251: ifne          262
     254: new           #175                // class java/util/NoSuchElementException
     257: dup
     258: invokespecial #177                // Method java/util/NoSuchElementException."<init>":()V
     261: athrow
     262: aload         5
     264: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     269: checkcast     #45                 // class Day18Kt$main$Cube
     272: astore        6
     274: iconst_0
     275: istore        7
     277: aload         6
     279: invokevirtual #52                 // Method Day18Kt$main$Cube.getY:()I
     282: istore        6
     284: aload         5
     286: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     291: ifeq          330
     294: aload         5
     296: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     301: checkcast     #45                 // class Day18Kt$main$Cube
     304: astore        7
     306: iconst_0
     307: istore        8
     309: aload         7
     311: invokevirtual #52                 // Method Day18Kt$main$Cube.getY:()I
     314: istore        7
     316: iload         6
     318: iload         7
     320: if_icmple     284
     323: iload         7
     325: istore        6
     327: goto          284
     330: iload         6
     332: iconst_1
     333: isub
     334: aload_1
     335: checkcast     #72                 // class java/lang/Iterable
     338: astore        4
     340: istore        26
     342: aload         4
     344: invokeinterface #86,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     349: astore        5
     351: aload         5
     353: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     358: ifne          369
     361: new           #175                // class java/util/NoSuchElementException
     364: dup
     365: invokespecial #177                // Method java/util/NoSuchElementException."<init>":()V
     368: athrow
     369: aload         5
     371: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     376: checkcast     #45                 // class Day18Kt$main$Cube
     379: astore        6
     381: iconst_0
     382: istore        7
     384: aload         6
     386: invokevirtual #52                 // Method Day18Kt$main$Cube.getY:()I
     389: istore        6
     391: aload         5
     393: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     398: ifeq          437
     401: aload         5
     403: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     408: checkcast     #45                 // class Day18Kt$main$Cube
     411: astore        7
     413: iconst_0
     414: istore        8
     416: aload         7
     418: invokevirtual #52                 // Method Day18Kt$main$Cube.getY:()I
     421: istore        7
     423: iload         6
     425: iload         7
     427: if_icmpge     391
     430: iload         7
     432: istore        6
     434: goto          391
     437: iload         6
     439: istore        27
     441: iload         26
     443: iload         27
     445: iconst_1
     446: iadd
     447: istore        30
     449: istore        31
     451: new           #179                // class kotlin/ranges/IntRange
     454: dup
     455: iload         31
     457: iload         30
     459: invokespecial #182                // Method kotlin/ranges/IntRange."<init>":(II)V
     462: astore_3
     463: aload_1
     464: checkcast     #72                 // class java/lang/Iterable
     467: invokeinterface #86,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     472: astore        6
     474: aload         6
     476: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     481: ifne          492
     484: new           #175                // class java/util/NoSuchElementException
     487: dup
     488: invokespecial #177                // Method java/util/NoSuchElementException."<init>":()V
     491: athrow
     492: aload         6
     494: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     499: checkcast     #45                 // class Day18Kt$main$Cube
     502: astore        7
     504: iconst_0
     505: istore        8
     507: aload         7
     509: invokevirtual #55                 // Method Day18Kt$main$Cube.getZ:()I
     512: istore        7
     514: aload         6
     516: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     521: ifeq          560
     524: aload         6
     526: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     531: checkcast     #45                 // class Day18Kt$main$Cube
     534: astore        8
     536: iconst_0
     537: istore        9
     539: aload         8
     541: invokevirtual #55                 // Method Day18Kt$main$Cube.getZ:()I
     544: istore        8
     546: iload         7
     548: iload         8
     550: if_icmple     514
     553: iload         8
     555: istore        7
     557: goto          514
     560: iload         7
     562: iconst_1
     563: isub
     564: aload_1
     565: checkcast     #72                 // class java/lang/Iterable
     568: astore        5
     570: istore        26
     572: aload         5
     574: invokeinterface #86,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     579: astore        6
     581: aload         6
     583: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     588: ifne          599
     591: new           #175                // class java/util/NoSuchElementException
     594: dup
     595: invokespecial #177                // Method java/util/NoSuchElementException."<init>":()V
     598: athrow
     599: aload         6
     601: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     606: checkcast     #45                 // class Day18Kt$main$Cube
     609: astore        7
     611: iconst_0
     612: istore        8
     614: aload         7
     616: invokevirtual #55                 // Method Day18Kt$main$Cube.getZ:()I
     619: istore        7
     621: aload         6
     623: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     628: ifeq          667
     631: aload         6
     633: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     638: checkcast     #45                 // class Day18Kt$main$Cube
     641: astore        8
     643: iconst_0
     644: istore        9
     646: aload         8
     648: invokevirtual #55                 // Method Day18Kt$main$Cube.getZ:()I
     651: istore        8
     653: iload         7
     655: iload         8
     657: if_icmpge     621
     660: iload         8
     662: istore        7
     664: goto          621
     667: iload         7
     669: istore        27
     671: iload         26
     673: iload         27
     675: iconst_1
     676: iadd
     677: istore        32
     679: istore        33
     681: new           #179                // class kotlin/ranges/IntRange
     684: dup
     685: iload         33
     687: iload         32
     689: invokespecial #182                // Method kotlin/ranges/IntRange."<init>":(II)V
     692: astore        4
     694: new           #184                // class kotlin/collections/ArrayDeque
     697: dup
     698: invokespecial #185                // Method kotlin/collections/ArrayDeque."<init>":()V
     701: astore        6
     703: aload         6
     705: astore        7
     707: iconst_0
     708: istore        8
     710: aload         7
     712: new           #45                 // class Day18Kt$main$Cube
     715: dup
     716: aload_2
     717: invokevirtual #188                // Method kotlin/ranges/IntRange.getFirst:()I
     720: aload_3
     721: invokevirtual #188                // Method kotlin/ranges/IntRange.getFirst:()I
     724: aload         4
     726: invokevirtual #188                // Method kotlin/ranges/IntRange.getFirst:()I
     729: invokespecial #59                 // Method Day18Kt$main$Cube."<init>":(III)V
     732: invokevirtual #189                // Method kotlin/collections/ArrayDeque.add:(Ljava/lang/Object;)Z
     735: pop
     736: aload         6
     738: astore        5
     740: new           #191                // class java/util/LinkedHashSet
     743: dup
     744: invokespecial #192                // Method java/util/LinkedHashSet."<init>":()V
     747: checkcast     #173                // class java/util/Set
     750: astore        6
     752: iconst_0
     753: istore        7
     755: aload         5
     757: checkcast     #72                 // class java/lang/Iterable
     760: astore        8
     762: iconst_0
     763: istore        9
     765: aload         8
     767: invokeinterface #86,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     772: astore        10
     774: aload         10
     776: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     781: ifeq          1155
     784: aload         10
     786: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     791: astore        11
     793: aload         11
     795: checkcast     #45                 // class Day18Kt$main$Cube
     798: astore        12
     800: iconst_0
     801: istore        13
     803: aload         6
     805: aload         12
     807: invokeinterface #195,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
     812: ifne          1150
     815: aload         6
     817: checkcast     #82                 // class java/util/Collection
     820: aload         12
     822: invokeinterface #122,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     827: pop
     828: aload         12
     830: invokestatic  #161                // Method main$adjacents:(LDay18Kt$main$Cube;)Ljava/util/List;
     833: checkcast     #72                 // class java/lang/Iterable
     836: astore        14
     838: nop
     839: iconst_0
     840: istore        15
     842: aload         14
     844: astore        16
     846: new           #74                 // class java/util/ArrayList
     849: dup
     850: invokespecial #196                // Method java/util/ArrayList."<init>":()V
     853: checkcast     #82                 // class java/util/Collection
     856: astore        17
     858: iconst_0
     859: istore        18
     861: aload         16
     863: invokeinterface #86,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     868: astore        19
     870: aload         19
     872: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     877: ifeq          1057
     880: aload         19
     882: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     887: astore        20
     889: aload         20
     891: checkcast     #45                 // class Day18Kt$main$Cube
     894: astore        21
     896: iconst_0
     897: istore        22
     899: aload_2
     900: invokevirtual #188                // Method kotlin/ranges/IntRange.getFirst:()I
     903: istore        23
     905: aload_2
     906: invokevirtual #199                // Method kotlin/ranges/IntRange.getLast:()I
     909: istore        24
     911: aload         21
     913: invokevirtual #49                 // Method Day18Kt$main$Cube.getX:()I
     916: istore        25
     918: iload         23
     920: iload         25
     922: if_icmpgt     940
     925: iload         25
     927: iload         24
     929: if_icmpgt     936
     932: iconst_1
     933: goto          941
     936: iconst_0
     937: goto          941
     940: iconst_0
     941: ifeq          1040
     944: aload_3
     945: invokevirtual #188                // Method kotlin/ranges/IntRange.getFirst:()I
     948: istore        23
     950: aload_3
     951: invokevirtual #199                // Method kotlin/ranges/IntRange.getLast:()I
     954: istore        24
     956: aload         21
     958: invokevirtual #52                 // Method Day18Kt$main$Cube.getY:()I
     961: istore        25
     963: iload         23
     965: iload         25
     967: if_icmpgt     985
     970: iload         25
     972: iload         24
     974: if_icmpgt     981
     977: iconst_1
     978: goto          986
     981: iconst_0
     982: goto          986
     985: iconst_0
     986: ifeq          1040
     989: aload         4
     991: invokevirtual #188                // Method kotlin/ranges/IntRange.getFirst:()I
     994: istore        23
     996: aload         4
     998: invokevirtual #199                // Method kotlin/ranges/IntRange.getLast:()I
    1001: istore        24
    1003: aload         21
    1005: invokevirtual #55                 // Method Day18Kt$main$Cube.getZ:()I
    1008: istore        25
    1010: iload         23
    1012: iload         25
    1014: if_icmpgt     1032
    1017: iload         25
    1019: iload         24
    1021: if_icmpgt     1028
    1024: iconst_1
    1025: goto          1033
    1028: iconst_0
    1029: goto          1033
    1032: iconst_0
    1033: ifeq          1040
    1036: iconst_1
    1037: goto          1041
    1040: iconst_0
    1041: ifeq          870
    1044: aload         17
    1046: aload         20
    1048: invokeinterface #122,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1053: pop
    1054: goto          870
    1057: aload         17
    1059: checkcast     #124                // class java/util/List
    1062: nop
    1063: checkcast     #72                 // class java/lang/Iterable
    1066: astore        14
    1068: nop
    1069: iconst_0
    1070: istore        15
    1072: aload         14
    1074: invokeinterface #86,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1079: astore        16
    1081: aload         16
    1083: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1088: ifeq          1149
    1091: aload         16
    1093: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1098: astore        17
    1100: aload         17
    1102: checkcast     #45                 // class Day18Kt$main$Cube
    1105: astore        18
    1107: iconst_0
    1108: istore        19
    1110: aload_1
    1111: aload         18
    1113: invokeinterface #195,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
    1118: ifeq          1137
    1121: iload         7
    1123: istore        20
    1125: iload         20
    1127: iconst_1
    1128: iadd
    1129: istore        7
    1131: iload         20
    1133: pop
    1134: goto          1145
    1137: aload         5
    1139: aload         18
    1141: invokevirtual #189                // Method kotlin/collections/ArrayDeque.add:(Ljava/lang/Object;)Z
    1144: pop
    1145: nop
    1146: goto          1081
    1149: nop
    1150: nop
    1151: nop
    1152: goto          774
    1155: nop
    1156: iload         7
    1158: ireturn
}