import java.io.File

typealias CrateStacks = Array<ArrayDeque<Char>>
typealias CraneProcedure = List<Triple<Int, Int, Int>>

fun main() {
    fun readInput(name: String) = File("src/day05", name)
        .readLines()

    fun processInput(input: List<String>): Pair<CrateStacks, CraneProcedure> {
        val craneProcedureStrs = input.takeLastWhile { it.isNotEmpty() }
        val craneProcedure: CraneProcedure = craneProcedureStrs.map { procedure ->
            Regex("\\d+")
                .findAll(procedure)
                .map(MatchResult::value)
                .map(String::toInt)
                .toList()
                .let { (num, from, to, _) -> Triple(num, from-1, to-1) }
        }

        val (crateStacksStrs, stackNumbersStr) = input
            .takeWhile { it.isNotEmpty() }
            .let { Pair(it.dropLast(1).reversed(), it.last()) }
        val numStacks = Regex("\\d+")
            .findAll(stackNumbersStr)
            .count()
        val crateStacks = Array(numStacks) { ArrayDeque<Char>() }
        for (line in crateStacksStrs) {
            val cratesAtLevel = line.chunked(4) { it.filter(Char::isLetter) }
            cratesAtLevel.forEachIndexed { i, crate ->
                if (crate.isNotEmpty()) {
                    crateStacks[i].addLast(crate.first())
                }
            }
        }

        return Pair(crateStacks, craneProcedure)
    }

    fun part1(input: List<String>): String {
        val (crateStacks, craneProcedure) = processInput(input)

        for ((num, from, to) in craneProcedure) {
            repeat(num) {
                val crate = crateStacks[from].removeLast()
                crateStacks[to].addLast(crate)
            }
        }

        return crateStacks.map { it.last() }.joinToString("")
    }

    fun part2(input: List<String>): String {
        val (crateStacks, craneProcedure) = processInput(input)

        for ((num, from, to) in craneProcedure) {
            val crates = crateStacks[from].takeLast(num)
            repeat(num) {
                crateStacks[from].removeLast()
            }
            crateStacks[to].addAll(crates)
        }

        return crateStacks.map { it.last() }.joinToString("")
    }

    val input = readInput("input")
    println(part1(input))
    println(part2(input))
}

Compiled from "Day05.kt"
final class Day05Kt$main$processInput$craneProcedure$1$2 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<java.lang.String, java.lang.Integer> {
  public static final Day05Kt$main$processInput$craneProcedure$1$2 INSTANCE;

  Day05Kt$main$processInput$craneProcedure$1$2();
    Code:
       0: aload_0
       1: iconst_1
       2: ldc           #11                 // class kotlin/text/StringsKt
       4: ldc           #13                 // String toInt
       6: ldc           #15                 // String toInt(Ljava/lang/String;)I
       8: iconst_1
       9: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      12: return

  public final java.lang.Integer invoke(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #24                 // String p0
       3: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokestatic  #36                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      10: invokestatic  #40                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      13: areturn

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #44                 // class java/lang/String
       5: invokevirtual #46                 // Method invoke:(Ljava/lang/String;)Ljava/lang/Integer;
       8: areturn

  static {};
    Code:
       0: new           #2                  // class Day05Kt$main$processInput$craneProcedure$1$2
       3: dup
       4: invokespecial #51                 // Method "<init>":()V
       7: putstatic     #54                 // Field INSTANCE:LDay05Kt$main$processInput$craneProcedure$1$2;
      10: return
}

Compiled from "Day05.kt"
public final class Day05Kt {
  public static final void main();
    Code:
       0: ldc           #8                  // String input
       2: invokestatic  #12                 // Method main$readInput:(Ljava/lang/String;)Ljava/util/List;
       5: astore_0
       6: aload_0
       7: invokestatic  #16                 // Method main$part1:(Ljava/util/List;)Ljava/lang/String;
      10: getstatic     #22                 // Field java/lang/System.out:Ljava/io/PrintStream;
      13: swap
      14: invokevirtual #28                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      17: aload_0
      18: invokestatic  #31                 // Method main$part2:(Ljava/util/List;)Ljava/lang/String;
      21: getstatic     #22                 // Field java/lang/System.out:Ljava/io/PrintStream;
      24: swap
      25: invokevirtual #28                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      28: return

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

  private static final java.util.List<java.lang.String> main$readInput(java.lang.String);
    Code:
       0: new           #40                 // class java/io/File
       3: dup
       4: ldc           #42                 // String src/day05
       6: aload_0
       7: invokespecial #46                 // Method java/io/File."<init>":(Ljava/lang/String;Ljava/lang/String;)V
      10: aconst_null
      11: iconst_1
      12: aconst_null
      13: invokestatic  #52                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      16: areturn

  private static final java.lang.CharSequence main$processInput$lambda$5(java.lang.CharSequence);
    Code:
       0: aload_0
       1: ldc           #58                 // String it
       3: invokestatic  #64                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: astore_1
       8: iconst_0
       9: istore_2
      10: aload_1
      11: astore_3
      12: new           #66                 // class java/lang/StringBuilder
      15: dup
      16: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
      19: checkcast     #70                 // class java/lang/Appendable
      22: astore        4
      24: iconst_0
      25: istore        5
      27: iconst_0
      28: istore        6
      30: aload_3
      31: invokeinterface #76,  1           // InterfaceMethod java/lang/CharSequence.length:()I
      36: istore        7
      38: iload         6
      40: iload         7
      42: if_icmpge     87
      45: aload_3
      46: iload         6
      48: invokeinterface #80,  2           // InterfaceMethod java/lang/CharSequence.charAt:(I)C
      53: istore        8
      55: iload         8
      57: istore        9
      59: iconst_0
      60: istore        10
      62: iload         9
      64: invokestatic  #86                 // Method java/lang/Character.isLetter:(C)Z
      67: nop
      68: ifeq          81
      71: aload         4
      73: iload         8
      75: invokeinterface #90,  2           // InterfaceMethod java/lang/Appendable.append:(C)Ljava/lang/Appendable;
      80: pop
      81: iinc          6, 1
      84: goto          38
      87: aload         4
      89: checkcast     #72                 // class java/lang/CharSequence
      92: nop
      93: areturn

  private static final kotlin.Pair<kotlin.collections.ArrayDeque<java.lang.Character>[], java.util.List<kotlin.Triple<java.lang.Integer, java.lang.Integer, java.lang.Integer>>> main$processInput(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: astore_2
       2: iconst_0
       3: istore_3
       4: aload_2
       5: invokeinterface #112,  1          // InterfaceMethod java/util/List.isEmpty:()Z
      10: ifeq          19
      13: invokestatic  #118                // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
      16: goto          175
      19: aload_2
      20: aload_2
      21: invokeinterface #121,  1          // InterfaceMethod java/util/List.size:()I
      26: invokeinterface #125,  2          // InterfaceMethod java/util/List.listIterator:(I)Ljava/util/ListIterator;
      31: astore        4
      33: aload         4
      35: invokeinterface #130,  1          // InterfaceMethod java/util/ListIterator.hasPrevious:()Z
      40: ifeq          168
      43: aload         4
      45: invokeinterface #134,  1          // InterfaceMethod java/util/ListIterator.previous:()Ljava/lang/Object;
      50: checkcast     #136                // class java/lang/String
      53: astore        5
      55: iconst_0
      56: istore        6
      58: aload         5
      60: checkcast     #72                 // class java/lang/CharSequence
      63: invokeinterface #76,  1           // InterfaceMethod java/lang/CharSequence.length:()I
      68: ifle          75
      71: iconst_1
      72: goto          76
      75: iconst_0
      76: nop
      77: ifne          33
      80: aload         4
      82: invokeinterface #139,  1          // InterfaceMethod java/util/ListIterator.next:()Ljava/lang/Object;
      87: pop
      88: aload_2
      89: invokeinterface #121,  1          // InterfaceMethod java/util/List.size:()I
      94: aload         4
      96: invokeinterface #142,  1          // InterfaceMethod java/util/ListIterator.nextIndex:()I
     101: isub
     102: istore        7
     104: iload         7
     106: ifne          115
     109: invokestatic  #118                // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
     112: goto          175
     115: new           #144                // class java/util/ArrayList
     118: dup
     119: iload         7
     121: invokespecial #147                // Method java/util/ArrayList."<init>":(I)V
     124: astore        8
     126: aload         8
     128: astore        9
     130: iconst_0
     131: istore        10
     133: aload         4
     135: invokeinterface #150,  1          // InterfaceMethod java/util/ListIterator.hasNext:()Z
     140: ifeq          159
     143: aload         9
     145: aload         4
     147: invokeinterface #139,  1          // InterfaceMethod java/util/ListIterator.next:()Ljava/lang/Object;
     152: invokevirtual #154                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     155: pop
     156: goto          133
     159: nop
     160: aload         8
     162: checkcast     #108                // class java/util/List
     165: goto          175
     168: aload_2
     169: checkcast     #156                // class java/lang/Iterable
     172: invokestatic  #160                // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;
     175: astore_1
     176: aload_1
     177: checkcast     #156                // class java/lang/Iterable
     180: astore_3
     181: iconst_0
     182: istore        4
     184: aload_3
     185: astore        5
     187: new           #144                // class java/util/ArrayList
     190: dup
     191: aload_3
     192: bipush        10
     194: invokestatic  #164                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     197: invokespecial #147                // Method java/util/ArrayList."<init>":(I)V
     200: checkcast     #166                // class java/util/Collection
     203: astore        6
     205: iconst_0
     206: istore        7
     208: aload         5
     210: invokeinterface #170,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     215: astore        8
     217: aload         8
     219: invokeinterface #173,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     224: ifeq          384
     227: aload         8
     229: invokeinterface #174,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     234: astore        9
     236: aload         6
     238: aload         9
     240: checkcast     #136                // class java/lang/String
     243: astore        10
     245: astore        20
     247: iconst_0
     248: istore        11
     250: new           #176                // class kotlin/text/Regex
     253: dup
     254: ldc           #178                // String \\d+
     256: invokespecial #181                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
     259: aload         10
     261: checkcast     #72                 // class java/lang/CharSequence
     264: iconst_0
     265: iconst_2
     266: aconst_null
     267: invokestatic  #185                // Method kotlin/text/Regex.findAll$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/sequences/Sequence;
     270: getstatic     #191                // Field Day05Kt$main$processInput$craneProcedure$1$1.INSTANCE:LDay05Kt$main$processInput$craneProcedure$1$1;
     273: checkcast     #193                // class kotlin/jvm/functions/Function1
     276: invokestatic  #199                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
     279: getstatic     #204                // Field Day05Kt$main$processInput$craneProcedure$1$2.INSTANCE:LDay05Kt$main$processInput$craneProcedure$1$2;
     282: checkcast     #193                // class kotlin/jvm/functions/Function1
     285: invokestatic  #199                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
     288: invokestatic  #207                // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;
     291: astore        12
     293: iconst_0
     294: istore        13
     296: aload         12
     298: iconst_0
     299: invokeinterface #211,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     304: checkcast     #213                // class java/lang/Number
     307: invokevirtual #216                // Method java/lang/Number.intValue:()I
     310: istore        14
     312: aload         12
     314: iconst_1
     315: invokeinterface #211,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     320: checkcast     #213                // class java/lang/Number
     323: invokevirtual #216                // Method java/lang/Number.intValue:()I
     326: istore        15
     328: aload         12
     330: iconst_2
     331: invokeinterface #211,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     336: checkcast     #213                // class java/lang/Number
     339: invokevirtual #216                // Method java/lang/Number.intValue:()I
     342: istore        16
     344: new           #218                // class kotlin/Triple
     347: dup
     348: iload         14
     350: invokestatic  #224                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     353: iload         15
     355: iconst_1
     356: isub
     357: invokestatic  #224                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     360: iload         16
     362: iconst_1
     363: isub
     364: invokestatic  #224                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     367: invokespecial #227                // Method kotlin/Triple."<init>":(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
     370: nop
     371: nop
     372: aload         20
     374: swap
     375: invokeinterface #228,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     380: pop
     381: goto          217
     384: aload         6
     386: checkcast     #108                // class java/util/List
     389: nop
     390: astore_2
     391: aload_0
     392: checkcast     #156                // class java/lang/Iterable
     395: astore        4
     397: nop
     398: iconst_0
     399: istore        5
     401: new           #144                // class java/util/ArrayList
     404: dup
     405: invokespecial #229                // Method java/util/ArrayList."<init>":()V
     408: astore        6
     410: aload         4
     412: invokeinterface #170,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     417: astore        7
     419: aload         7
     421: invokeinterface #173,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     426: ifeq          484
     429: aload         7
     431: invokeinterface #174,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     436: astore        8
     438: aload         8
     440: checkcast     #136                // class java/lang/String
     443: astore        9
     445: iconst_0
     446: istore        10
     448: aload         9
     450: checkcast     #72                 // class java/lang/CharSequence
     453: invokeinterface #76,  1           // InterfaceMethod java/lang/CharSequence.length:()I
     458: ifle          465
     461: iconst_1
     462: goto          466
     465: iconst_0
     466: nop
     467: ifne          473
     470: goto          484
     473: aload         6
     475: aload         8
     477: invokevirtual #154                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     480: pop
     481: goto          419
     484: aload         6
     486: checkcast     #108                // class java/util/List
     489: astore        5
     491: iconst_0
     492: istore        6
     494: new           #231                // class kotlin/Pair
     497: dup
     498: aload         5
     500: iconst_1
     501: invokestatic  #235                // Method kotlin/collections/CollectionsKt.dropLast:(Ljava/util/List;I)Ljava/util/List;
     504: checkcast     #156                // class java/lang/Iterable
     507: invokestatic  #238                // Method kotlin/collections/CollectionsKt.reversed:(Ljava/lang/Iterable;)Ljava/util/List;
     510: aload         5
     512: invokestatic  #242                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     515: invokespecial #245                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     518: nop
     519: astore_3
     520: aload_3
     521: invokevirtual #248                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     524: checkcast     #108                // class java/util/List
     527: astore        4
     529: aload_3
     530: invokevirtual #251                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     533: checkcast     #136                // class java/lang/String
     536: astore        5
     538: new           #176                // class kotlin/text/Regex
     541: dup
     542: ldc           #178                // String \\d+
     544: invokespecial #181                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
     547: aload         5
     549: checkcast     #72                 // class java/lang/CharSequence
     552: iconst_0
     553: iconst_2
     554: aconst_null
     555: invokestatic  #185                // Method kotlin/text/Regex.findAll$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/sequences/Sequence;
     558: invokestatic  #255                // Method kotlin/sequences/SequencesKt.count:(Lkotlin/sequences/Sequence;)I
     561: istore        6
     563: iconst_0
     564: istore        8
     566: iload         6
     568: anewarray     #257                // class kotlin/collections/ArrayDeque
     571: astore        9
     573: iload         8
     575: iload         6
     577: if_icmpge     602
     580: iload         8
     582: istore        10
     584: aload         9
     586: iload         10
     588: new           #257                // class kotlin/collections/ArrayDeque
     591: dup
     592: invokespecial #258                // Method kotlin/collections/ArrayDeque."<init>":()V
     595: aastore
     596: iinc          8, 1
     599: goto          573
     602: aload         9
     604: astore        7
     606: aload         4
     608: invokeinterface #259,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     613: astore        8
     615: aload         8
     617: invokeinterface #173,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     622: ifeq          766
     625: aload         8
     627: invokeinterface #174,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     632: checkcast     #136                // class java/lang/String
     635: astore        9
     637: aload         9
     639: checkcast     #72                 // class java/lang/CharSequence
     642: iconst_4
     643: invokedynamic #276,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
     648: invokestatic  #282                // Method kotlin/text/StringsKt.chunked:(Ljava/lang/CharSequence;ILkotlin/jvm/functions/Function1;)Ljava/util/List;
     651: astore        10
     653: aload         10
     655: checkcast     #156                // class java/lang/Iterable
     658: astore        11
     660: iconst_0
     661: istore        12
     663: iconst_0
     664: istore        13
     666: aload         11
     668: invokeinterface #170,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     673: astore        14
     675: aload         14
     677: invokeinterface #173,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     682: ifeq          762
     685: aload         14
     687: invokeinterface #174,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     692: astore        15
     694: iload         13
     696: iinc          13, 1
     699: istore        16
     701: iload         16
     703: ifge          709
     706: invokestatic  #285                // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
     709: iload         16
     711: aload         15
     713: checkcast     #72                 // class java/lang/CharSequence
     716: astore        17
     718: istore        18
     720: iconst_0
     721: istore        19
     723: aload         17
     725: invokeinterface #76,  1           // InterfaceMethod java/lang/CharSequence.length:()I
     730: ifle          737
     733: iconst_1
     734: goto          738
     737: iconst_0
     738: ifeq          757
     741: aload         7
     743: iload         18
     745: aaload
     746: aload         17
     748: invokestatic  #289                // Method kotlin/text/StringsKt.first:(Ljava/lang/CharSequence;)C
     751: invokestatic  #292                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     754: invokevirtual #295                // Method kotlin/collections/ArrayDeque.addLast:(Ljava/lang/Object;)V
     757: nop
     758: nop
     759: goto          675
     762: nop
     763: goto          615
     766: new           #231                // class kotlin/Pair
     769: dup
     770: aload         7
     772: aload_2
     773: invokespecial #245                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     776: areturn

  private static final java.lang.String main$part1(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: invokestatic  #343                // Method main$processInput:(Ljava/util/List;)Lkotlin/Pair;
       4: astore_1
       5: aload_1
       6: invokevirtual #248                // Method kotlin/Pair.component1:()Ljava/lang/Object;
       9: checkcast     #340                // class "[Lkotlin/collections/ArrayDeque;"
      12: astore_2
      13: aload_1
      14: invokevirtual #251                // Method kotlin/Pair.component2:()Ljava/lang/Object;
      17: checkcast     #108                // class java/util/List
      20: astore_3
      21: aload_3
      22: invokeinterface #259,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      27: astore        4
      29: aload         4
      31: invokeinterface #173,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      36: ifeq          141
      39: aload         4
      41: invokeinterface #174,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      46: checkcast     #218                // class kotlin/Triple
      49: astore        5
      51: aload         5
      53: invokevirtual #344                // Method kotlin/Triple.component1:()Ljava/lang/Object;
      56: checkcast     #213                // class java/lang/Number
      59: invokevirtual #216                // Method java/lang/Number.intValue:()I
      62: istore        6
      64: aload         5
      66: invokevirtual #345                // Method kotlin/Triple.component2:()Ljava/lang/Object;
      69: checkcast     #213                // class java/lang/Number
      72: invokevirtual #216                // Method java/lang/Number.intValue:()I
      75: istore        7
      77: aload         5
      79: invokevirtual #348                // Method kotlin/Triple.component3:()Ljava/lang/Object;
      82: checkcast     #213                // class java/lang/Number
      85: invokevirtual #216                // Method java/lang/Number.intValue:()I
      88: istore        8
      90: iconst_0
      91: istore        9
      93: iload         9
      95: iload         6
      97: if_icmpge     29
     100: iload         9
     102: istore        10
     104: iconst_0
     105: istore        11
     107: aload_2
     108: iload         7
     110: aaload
     111: invokevirtual #351                // Method kotlin/collections/ArrayDeque.removeLast:()Ljava/lang/Object;
     114: checkcast     #82                 // class java/lang/Character
     117: invokevirtual #355                // Method java/lang/Character.charValue:()C
     120: istore        12
     122: aload_2
     123: iload         8
     125: aaload
     126: iload         12
     128: invokestatic  #292                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     131: invokevirtual #295                // Method kotlin/collections/ArrayDeque.addLast:(Ljava/lang/Object;)V
     134: nop
     135: iinc          9, 1
     138: goto          93
     141: aload_2
     142: astore        4
     144: iconst_0
     145: istore        5
     147: aload         4
     149: astore        6
     151: new           #144                // class java/util/ArrayList
     154: dup
     155: aload         4
     157: arraylength
     158: invokespecial #147                // Method java/util/ArrayList."<init>":(I)V
     161: checkcast     #166                // class java/util/Collection
     164: astore        7
     166: iconst_0
     167: istore        8
     169: iconst_0
     170: istore        9
     172: aload         6
     174: arraylength
     175: istore        10
     177: iload         9
     179: iload         10
     181: if_icmpge     231
     184: aload         6
     186: iload         9
     188: aaload
     189: astore        11
     191: aload         7
     193: aload         11
     195: astore        12
     197: astore        14
     199: iconst_0
     200: istore        13
     202: aload         12
     204: invokevirtual #357                // Method kotlin/collections/ArrayDeque.last:()Ljava/lang/Object;
     207: checkcast     #82                 // class java/lang/Character
     210: invokevirtual #355                // Method java/lang/Character.charValue:()C
     213: invokestatic  #292                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     216: aload         14
     218: swap
     219: invokeinterface #228,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     224: pop
     225: iinc          9, 1
     228: goto          177
     231: aload         7
     233: checkcast     #108                // class java/util/List
     236: nop
     237: checkcast     #156                // class java/lang/Iterable
     240: ldc_w         #359                // String
     243: checkcast     #72                 // class java/lang/CharSequence
     246: aconst_null
     247: aconst_null
     248: iconst_0
     249: aconst_null
     250: aconst_null
     251: bipush        62
     253: aconst_null
     254: invokestatic  #363                // 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;
     257: areturn

  private static final java.lang.String main$part2(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: invokestatic  #343                // Method main$processInput:(Ljava/util/List;)Lkotlin/Pair;
       4: astore_1
       5: aload_1
       6: invokevirtual #248                // Method kotlin/Pair.component1:()Ljava/lang/Object;
       9: checkcast     #340                // class "[Lkotlin/collections/ArrayDeque;"
      12: astore_2
      13: aload_1
      14: invokevirtual #251                // Method kotlin/Pair.component2:()Ljava/lang/Object;
      17: checkcast     #108                // class java/util/List
      20: astore_3
      21: aload_3
      22: invokeinterface #259,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      27: astore        4
      29: aload         4
      31: invokeinterface #173,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      36: ifeq          152
      39: aload         4
      41: invokeinterface #174,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      46: checkcast     #218                // class kotlin/Triple
      49: astore        5
      51: aload         5
      53: invokevirtual #344                // Method kotlin/Triple.component1:()Ljava/lang/Object;
      56: checkcast     #213                // class java/lang/Number
      59: invokevirtual #216                // Method java/lang/Number.intValue:()I
      62: istore        6
      64: aload         5
      66: invokevirtual #345                // Method kotlin/Triple.component2:()Ljava/lang/Object;
      69: checkcast     #213                // class java/lang/Number
      72: invokevirtual #216                // Method java/lang/Number.intValue:()I
      75: istore        7
      77: aload         5
      79: invokevirtual #348                // Method kotlin/Triple.component3:()Ljava/lang/Object;
      82: checkcast     #213                // class java/lang/Number
      85: invokevirtual #216                // Method java/lang/Number.intValue:()I
      88: istore        8
      90: aload_2
      91: iload         7
      93: aaload
      94: checkcast     #108                // class java/util/List
      97: iload         6
      99: invokestatic  #370                // Method kotlin/collections/CollectionsKt.takeLast:(Ljava/util/List;I)Ljava/util/List;
     102: astore        9
     104: iconst_0
     105: istore        10
     107: iload         10
     109: iload         6
     111: if_icmpge     136
     114: iload         10
     116: istore        11
     118: iconst_0
     119: istore        12
     121: aload_2
     122: iload         7
     124: aaload
     125: invokevirtual #351                // Method kotlin/collections/ArrayDeque.removeLast:()Ljava/lang/Object;
     128: pop
     129: nop
     130: iinc          10, 1
     133: goto          107
     136: aload_2
     137: iload         8
     139: aaload
     140: aload         9
     142: checkcast     #166                // class java/util/Collection
     145: invokevirtual #374                // Method kotlin/collections/ArrayDeque.addAll:(Ljava/util/Collection;)Z
     148: pop
     149: goto          29
     152: aload_2
     153: astore        4
     155: iconst_0
     156: istore        5
     158: aload         4
     160: astore        6
     162: new           #144                // class java/util/ArrayList
     165: dup
     166: aload         4
     168: arraylength
     169: invokespecial #147                // Method java/util/ArrayList."<init>":(I)V
     172: checkcast     #166                // class java/util/Collection
     175: astore        7
     177: iconst_0
     178: istore        8
     180: iconst_0
     181: istore        9
     183: aload         6
     185: arraylength
     186: istore        10
     188: iload         9
     190: iload         10
     192: if_icmpge     242
     195: aload         6
     197: iload         9
     199: aaload
     200: astore        11
     202: aload         7
     204: aload         11
     206: astore        12
     208: astore        14
     210: iconst_0
     211: istore        13
     213: aload         12
     215: invokevirtual #357                // Method kotlin/collections/ArrayDeque.last:()Ljava/lang/Object;
     218: checkcast     #82                 // class java/lang/Character
     221: invokevirtual #355                // Method java/lang/Character.charValue:()C
     224: invokestatic  #292                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     227: aload         14
     229: swap
     230: invokeinterface #228,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     235: pop
     236: iinc          9, 1
     239: goto          188
     242: aload         7
     244: checkcast     #108                // class java/util/List
     247: nop
     248: checkcast     #156                // class java/lang/Iterable
     251: ldc_w         #359                // String
     254: checkcast     #72                 // class java/lang/CharSequence
     257: aconst_null
     258: aconst_null
     259: iconst_0
     260: aconst_null
     261: aconst_null
     262: bipush        62
     264: aconst_null
     265: invokestatic  #363                // 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;
     268: areturn
}

Compiled from "Day05.kt"
final class Day05Kt$main$processInput$craneProcedure$1$1 extends kotlin.jvm.internal.PropertyReference1Impl {
  public static final Day05Kt$main$processInput$craneProcedure$1$1 INSTANCE;

  Day05Kt$main$processInput$craneProcedure$1$1();
    Code:
       0: aload_0
       1: ldc           #8                  // class kotlin/text/MatchResult
       3: ldc           #10                 // String value
       5: ldc           #12                 // String getValue()Ljava/lang/String;
       7: iconst_0
       8: invokespecial #15                 // Method kotlin/jvm/internal/PropertyReference1Impl."<init>":(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      11: return

  public java.lang.Object get(java.lang.Object);
    Code:
       0: aload_1
       1: checkcast     #8                  // class kotlin/text/MatchResult
       4: invokeinterface #23,  1           // InterfaceMethod kotlin/text/MatchResult.getValue:()Ljava/lang/String;
       9: areturn

  static {};
    Code:
       0: new           #2                  // class Day05Kt$main$processInput$craneProcedure$1$1
       3: dup
       4: invokespecial #28                 // Method "<init>":()V
       7: putstatic     #31                 // Field INSTANCE:LDay05Kt$main$processInput$craneProcedure$1$1;
      10: return
}


import java.io.File
import java.lang.IllegalArgumentException
import java.math.BigInteger
import java.util.PriorityQueue

class Monkey(
    val heldItems: MutableList<Int>,
    val applyOperation: (Int) -> BigInteger,
    val decide: (Int) -> Int
) {
    var inspectedItems: BigInteger = BigInteger.ZERO

    fun inspect() { ++inspectedItems }
}

fun main() {
    fun readInput(name: String) = File("src/day11", name)
        .readLines()

    fun iterateInput(input: List<String>) = sequence {
        var currMonkey = input.takeWhile { it.isNotBlank() }.drop(1)
        var rest = input.dropWhile { it.isNotBlank() }.drop(1)

        while (currMonkey.isNotEmpty()) {
            yield(currMonkey)

            currMonkey = rest.takeWhile { it.isNotBlank() }
                .let { if (it.isNotEmpty()) { it.drop(1) } else { it } }
            rest = rest.dropWhile { it.isNotBlank() }
                .let { if (it.isNotEmpty()) { it.drop(1) } else { it } }
        }
    }

    fun processOperation(
        opStr: String,
        leftArg: String,
        rightArg: String
    ): (Int) -> BigInteger {
        val operation: (BigInteger, BigInteger) -> BigInteger = when (opStr) {
            "+"  -> { m, n -> m + n }
            "*"  -> { m, n -> m * n }
            else -> throw IllegalArgumentException("We should never get here")
        }

        return if ((leftArg == "old") and (rightArg == "old")) {
            { n -> operation(n.toBigInteger(), n.toBigInteger()) }
        } else if (leftArg == "old") {
            { n -> operation(n.toBigInteger(), rightArg.toBigInteger()) }
        } else if (rightArg == "old") {
            { n -> operation(leftArg.toBigInteger(), n.toBigInteger()) }
        } else {
            { _ -> operation(leftArg.toBigInteger(), rightArg.toBigInteger()) }
        }
    }

    fun gcd(m: Int, n: Int): Int {
        var a = m
        var b = n
        while (b > 0) {
            val temp = b
            b = a % b
            a = temp
        }

        return a
    }

    fun lcm(m: Int, n: Int): Int = (m * n) / gcd(m, n)

    fun processInput(input: List<String>): Pair<Array<Monkey>, Int> {
        val monkeys = mutableListOf<Monkey>()
        val testValues = mutableListOf<Int>()
        for (monkeyStr in iterateInput(input)) {
            val initItems = monkeyStr[0].substring(18).split(", ").map(String::toInt)
            val (leftArg, op, rightArg, _) = monkeyStr[1].substring(19).split(" ")
            val testValue = monkeyStr[2].substring(21).toInt()
            val trueResult = monkeyStr[3].substring(29).toInt()
            val falseResult = monkeyStr[4].substring(30).toInt()

            val monkey = Monkey(
                initItems.toMutableList(),
                processOperation(op, leftArg, rightArg)
            ) { n -> if (n % testValue == 0) { trueResult } else { falseResult } }
            monkeys.add(monkey)
            testValues.add(testValue)
        }

        return Pair(monkeys.toTypedArray(), testValues.reduce { acc, value -> lcm(acc, value) })
    }

    fun doRound(monkeys: Array<Monkey>, spiraling: Boolean = false, lcm: Int = 1) {
        for (monkey in monkeys) {
            while (monkey.heldItems.isNotEmpty()) {
                val currItem = monkey.heldItems.removeFirst()
                monkey.inspect()

                val worryLevel = monkey.applyOperation(currItem)
                    .let { if (spiraling) { it % lcm.toBigInteger() } else { it.div(3.toBigInteger()) } }
                    .toInt()
                val monkeyToCatch = monkey.decide(worryLevel)

                monkeys[monkeyToCatch].heldItems.add(worryLevel)
            }
        }
    }

    fun multiplyTwoLargest(monkeys: Array<Monkey>): BigInteger {
        val monkeysByInspectedElements = PriorityQueue(monkeys.map { -it.inspectedItems })  // Induce max-queue

        return monkeysByInspectedElements.poll() * monkeysByInspectedElements.poll()
    }

    fun part1(input: List<String>): BigInteger {
        val (monkeys, _) = processInput(input)

        repeat(20) {
            doRound(monkeys)
        }

        return multiplyTwoLargest(monkeys)
    }

    fun part2(input: List<String>): BigInteger {
        val (monkeys, lcm) = processInput(input)

        repeat(10000) {
            doRound(monkeys, spiraling=true, lcm=lcm)
        }

        return multiplyTwoLargest(monkeys)
    }

    val input = readInput("input")
    println(part1(input))
    println(part2(input))
}

Compiled from "Day11.kt"
final class Day11Kt$main$iterateInput$1 extends kotlin.coroutines.jvm.internal.RestrictedSuspendLambda implements kotlin.jvm.functions.Function2<kotlin.sequences.SequenceScope<? super java.util.List<? extends java.lang.String>>, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {
  java.lang.Object L$1;

  int label;

  private java.lang.Object L$0;

  final java.util.List<java.lang.String> $input;

  Day11Kt$main$iterateInput$1(java.util.List<java.lang.String>, kotlin.coroutines.Continuation<? super Day11Kt$main$iterateInput$1>);
    Code:
       0: aload_0
       1: aload_1
       2: putfield      #14                 // Field $input:Ljava/util/List;
       5: aload_0
       6: iconst_2
       7: aload_2
       8: invokespecial #17                 // Method kotlin/coroutines/jvm/internal/RestrictedSuspendLambda."<init>":(ILkotlin/coroutines/Continuation;)V
      11: return

  public final java.lang.Object invokeSuspend(java.lang.Object);
    Code:
       0: invokestatic  #45                 // Method kotlin/coroutines/intrinsics/IntrinsicsKt.getCOROUTINE_SUSPENDED:()Ljava/lang/Object;
       3: astore        13
       5: aload_0
       6: getfield      #49                 // Field label:I
       9: tableswitch   { // 0 to 1
                     0: 32
                     1: 330
               default: 656
          }
      32: aload_1
      33: invokestatic  #55                 // Method kotlin/ResultKt.throwOnFailure:(Ljava/lang/Object;)V
      36: aload_0
      37: getfield      #57                 // Field L$0:Ljava/lang/Object;
      40: checkcast     #59                 // class kotlin/sequences/SequenceScope
      43: astore_2
      44: aload_0
      45: getfield      #14                 // Field $input:Ljava/util/List;
      48: checkcast     #61                 // class java/lang/Iterable
      51: astore        4
      53: iconst_0
      54: istore        5
      56: new           #63                 // class java/util/ArrayList
      59: dup
      60: invokespecial #66                 // Method java/util/ArrayList."<init>":()V
      63: astore        6
      65: aload         4
      67: invokeinterface #70,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      72: astore        7
      74: aload         7
      76: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      81: ifeq          137
      84: aload         7
      86: invokeinterface #79,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      91: astore        8
      93: aload         8
      95: checkcast     #81                 // class java/lang/String
      98: astore        9
     100: iconst_0
     101: istore        10
     103: aload         9
     105: checkcast     #83                 // class java/lang/CharSequence
     108: invokestatic  #89                 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
     111: ifne          118
     114: iconst_1
     115: goto          119
     118: iconst_0
     119: nop
     120: ifne          126
     123: goto          137
     126: aload         6
     128: aload         8
     130: invokevirtual #93                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     133: pop
     134: goto          74
     137: aload         6
     139: checkcast     #95                 // class java/util/List
     142: checkcast     #61                 // class java/lang/Iterable
     145: iconst_1
     146: invokestatic  #101                // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
     149: astore_3
     150: aload_0
     151: getfield      #14                 // Field $input:Ljava/util/List;
     154: checkcast     #61                 // class java/lang/Iterable
     157: astore        5
     159: iconst_0
     160: istore        6
     162: iconst_0
     163: istore        7
     165: new           #63                 // class java/util/ArrayList
     168: dup
     169: invokespecial #66                 // Method java/util/ArrayList."<init>":()V
     172: astore        8
     174: aload         5
     176: invokeinterface #70,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     181: astore        9
     183: aload         9
     185: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     190: ifeq          262
     193: aload         9
     195: invokeinterface #79,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     200: astore        10
     202: iload         7
     204: ifeq          218
     207: aload         8
     209: aload         10
     211: invokevirtual #93                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     214: pop
     215: goto          183
     218: aload         10
     220: checkcast     #81                 // class java/lang/String
     223: astore        11
     225: iconst_0
     226: istore        12
     228: aload         11
     230: checkcast     #83                 // class java/lang/CharSequence
     233: invokestatic  #89                 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
     236: ifne          243
     239: iconst_1
     240: goto          244
     243: iconst_0
     244: nop
     245: ifne          183
     248: aload         8
     250: aload         10
     252: invokevirtual #93                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     255: pop
     256: iconst_1
     257: istore        7
     259: goto          183
     262: aload         8
     264: checkcast     #95                 // class java/util/List
     267: checkcast     #61                 // class java/lang/Iterable
     270: iconst_1
     271: invokestatic  #101                // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
     274: astore        4
     276: aload_3
     277: checkcast     #103                // class java/util/Collection
     280: invokeinterface #106,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     285: ifne          292
     288: iconst_1
     289: goto          293
     292: iconst_0
     293: ifeq          652
     296: aload_2
     297: aload_3
     298: aload_0
     299: checkcast     #108                // class kotlin/coroutines/Continuation
     302: aload_0
     303: aload_2
     304: putfield      #57                 // Field L$0:Ljava/lang/Object;
     307: aload_0
     308: aload         4
     310: putfield      #110                // Field L$1:Ljava/lang/Object;
     313: aload_0
     314: iconst_1
     315: putfield      #49                 // Field label:I
     318: invokevirtual #114                // Method kotlin/sequences/SequenceScope.yield:(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
     321: dup
     322: aload         13
     324: if_acmpne     352
     327: aload         13
     329: areturn
     330: aload_0
     331: getfield      #110                // Field L$1:Ljava/lang/Object;
     334: checkcast     #95                 // class java/util/List
     337: astore        4
     339: aload_0
     340: getfield      #57                 // Field L$0:Ljava/lang/Object;
     343: checkcast     #59                 // class kotlin/sequences/SequenceScope
     346: astore_2
     347: aload_1
     348: invokestatic  #55                 // Method kotlin/ResultKt.throwOnFailure:(Ljava/lang/Object;)V
     351: aload_1
     352: pop
     353: aload         4
     355: checkcast     #61                 // class java/lang/Iterable
     358: astore        5
     360: iconst_0
     361: istore        6
     363: new           #63                 // class java/util/ArrayList
     366: dup
     367: invokespecial #66                 // Method java/util/ArrayList."<init>":()V
     370: astore        7
     372: aload         5
     374: invokeinterface #70,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     379: astore        8
     381: aload         8
     383: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     388: ifeq          444
     391: aload         8
     393: invokeinterface #79,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     398: astore        9
     400: aload         9
     402: checkcast     #81                 // class java/lang/String
     405: astore        10
     407: iconst_0
     408: istore        11
     410: aload         10
     412: checkcast     #83                 // class java/lang/CharSequence
     415: invokestatic  #89                 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
     418: ifne          425
     421: iconst_1
     422: goto          426
     425: iconst_0
     426: nop
     427: ifne          433
     430: goto          444
     433: aload         7
     435: aload         9
     437: invokevirtual #93                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     440: pop
     441: goto          381
     444: aload         7
     446: checkcast     #95                 // class java/util/List
     449: astore        6
     451: iconst_0
     452: istore        7
     454: aload         6
     456: checkcast     #103                // class java/util/Collection
     459: invokeinterface #106,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     464: ifne          471
     467: iconst_1
     468: goto          472
     471: iconst_0
     472: ifeq          487
     475: aload         6
     477: checkcast     #61                 // class java/lang/Iterable
     480: iconst_1
     481: invokestatic  #101                // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
     484: goto          489
     487: aload         6
     489: nop
     490: astore_3
     491: aload         4
     493: checkcast     #61                 // class java/lang/Iterable
     496: astore        5
     498: iconst_0
     499: istore        6
     501: iconst_0
     502: istore        7
     504: new           #63                 // class java/util/ArrayList
     507: dup
     508: invokespecial #66                 // Method java/util/ArrayList."<init>":()V
     511: astore        8
     513: aload         5
     515: invokeinterface #70,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     520: astore        9
     522: aload         9
     524: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     529: ifeq          601
     532: aload         9
     534: invokeinterface #79,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     539: astore        10
     541: iload         7
     543: ifeq          557
     546: aload         8
     548: aload         10
     550: invokevirtual #93                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     553: pop
     554: goto          522
     557: aload         10
     559: checkcast     #81                 // class java/lang/String
     562: astore        11
     564: iconst_0
     565: istore        12
     567: aload         11
     569: checkcast     #83                 // class java/lang/CharSequence
     572: invokestatic  #89                 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
     575: ifne          582
     578: iconst_1
     579: goto          583
     582: iconst_0
     583: nop
     584: ifne          522
     587: aload         8
     589: aload         10
     591: invokevirtual #93                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     594: pop
     595: iconst_1
     596: istore        7
     598: goto          522
     601: aload         8
     603: checkcast     #95                 // class java/util/List
     606: astore        6
     608: iconst_0
     609: istore        7
     611: aload         6
     613: checkcast     #103                // class java/util/Collection
     616: invokeinterface #106,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     621: ifne          628
     624: iconst_1
     625: goto          629
     628: iconst_0
     629: ifeq          644
     632: aload         6
     634: checkcast     #61                 // class java/lang/Iterable
     637: iconst_1
     638: invokestatic  #101                // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
     641: goto          646
     644: aload         6
     646: nop
     647: astore        4
     649: goto          276
     652: getstatic     #120                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
     655: areturn
     656: new           #122                // class java/lang/IllegalStateException
     659: dup
     660: ldc           #124                // String call to \'resume\' before \'invoke\' with coroutine
     662: invokespecial #127                // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     665: athrow

  public final kotlin.coroutines.Continuation<kotlin.Unit> create(java.lang.Object, kotlin.coroutines.Continuation<?>);
    Code:
       0: new           #2                  // class Day11Kt$main$iterateInput$1
       3: dup
       4: aload_0
       5: getfield      #14                 // Field $input:Ljava/util/List;
       8: aload_2
       9: invokespecial #155                // Method "<init>":(Ljava/util/List;Lkotlin/coroutines/Continuation;)V
      12: astore_3
      13: aload_3
      14: aload_1
      15: putfield      #57                 // Field L$0:Ljava/lang/Object;
      18: aload_3
      19: checkcast     #108                // class kotlin/coroutines/Continuation
      22: areturn

  public final java.lang.Object invoke(kotlin.sequences.SequenceScope<? super java.util.List<java.lang.String>>, kotlin.coroutines.Continuation<? super kotlin.Unit>);
    Code:
       0: aload_0
       1: aload_1
       2: aload_2
       3: invokevirtual #161                // Method create:(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation;
       6: checkcast     #2                  // class Day11Kt$main$iterateInput$1
       9: getstatic     #120                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      12: invokevirtual #163                // Method invokeSuspend:(Ljava/lang/Object;)Ljava/lang/Object;
      15: areturn

  public java.lang.Object invoke(java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #59                 // class kotlin/sequences/SequenceScope
       5: aload_2
       6: checkcast     #108                // class kotlin/coroutines/Continuation
       9: invokevirtual #168                // Method invoke:(Lkotlin/sequences/SequenceScope;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
      12: areturn
}

Compiled from "Day11.kt"
public final class Day11Kt {
  public static final void main();
    Code:
       0: ldc           #8                  // String input
       2: invokestatic  #12                 // Method main$readInput:(Ljava/lang/String;)Ljava/util/List;
       5: astore_0
       6: aload_0
       7: invokestatic  #16                 // Method main$part1:(Ljava/util/List;)Ljava/math/BigInteger;
      10: getstatic     #22                 // Field java/lang/System.out:Ljava/io/PrintStream;
      13: swap
      14: invokevirtual #28                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      17: aload_0
      18: invokestatic  #31                 // Method main$part2:(Ljava/util/List;)Ljava/math/BigInteger;
      21: getstatic     #22                 // Field java/lang/System.out:Ljava/io/PrintStream;
      24: swap
      25: invokevirtual #28                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      28: return

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

  private static final java.util.List<java.lang.String> main$readInput(java.lang.String);
    Code:
       0: new           #40                 // class java/io/File
       3: dup
       4: ldc           #42                 // String src/day11
       6: aload_0
       7: invokespecial #46                 // Method java/io/File."<init>":(Ljava/lang/String;Ljava/lang/String;)V
      10: aconst_null
      11: iconst_1
      12: aconst_null
      13: invokestatic  #52                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      16: areturn

  private static final kotlin.sequences.Sequence<java.util.List<java.lang.String>> main$iterateInput(java.util.List<java.lang.String>);
    Code:
       0: new           #59                 // class Day11Kt$main$iterateInput$1
       3: dup
       4: aload_0
       5: aconst_null
       6: invokespecial #62                 // Method Day11Kt$main$iterateInput$1."<init>":(Ljava/util/List;Lkotlin/coroutines/Continuation;)V
       9: checkcast     #64                 // class kotlin/jvm/functions/Function2
      12: invokestatic  #70                 // Method kotlin/sequences/SequencesKt.sequence:(Lkotlin/jvm/functions/Function2;)Lkotlin/sequences/Sequence;
      15: areturn

  private static final java.math.BigInteger main$processOperation$lambda$0(java.math.BigInteger, java.math.BigInteger);
    Code:
       0: aload_0
       1: ldc           #74                 // String m
       3: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #82                 // String n
       9: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_0
      13: aload_1
      14: invokevirtual #88                 // Method java/math/BigInteger.add:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
      17: dup
      18: ldc           #90                 // String add(...)
      20: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      23: areturn

  private static final java.math.BigInteger main$processOperation$lambda$1(java.math.BigInteger, java.math.BigInteger);
    Code:
       0: aload_0
       1: ldc           #74                 // String m
       3: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #82                 // String n
       9: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_0
      13: aload_1
      14: invokevirtual #98                 // Method java/math/BigInteger.multiply:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
      17: dup
      18: ldc           #100                // String multiply(...)
      20: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      23: areturn

  private static final java.math.BigInteger main$processOperation$lambda$2(kotlin.jvm.functions.Function2, int);
    Code:
       0: aload_0
       1: iload_1
       2: i2l
       3: invokestatic  #106                // Method java/math/BigInteger.valueOf:(J)Ljava/math/BigInteger;
       6: dup
       7: ldc           #108                // String valueOf(...)
       9: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      12: iload_1
      13: i2l
      14: invokestatic  #106                // Method java/math/BigInteger.valueOf:(J)Ljava/math/BigInteger;
      17: dup
      18: ldc           #108                // String valueOf(...)
      20: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      23: invokeinterface #112,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      28: checkcast     #84                 // class java/math/BigInteger
      31: areturn

  private static final java.math.BigInteger main$processOperation$lambda$3(kotlin.jvm.functions.Function2, java.lang.String, int);
    Code:
       0: aload_0
       1: iload_2
       2: i2l
       3: invokestatic  #106                // Method java/math/BigInteger.valueOf:(J)Ljava/math/BigInteger;
       6: dup
       7: ldc           #108                // String valueOf(...)
       9: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      12: new           #84                 // class java/math/BigInteger
      15: dup
      16: aload_1
      17: invokespecial #120                // Method java/math/BigInteger."<init>":(Ljava/lang/String;)V
      20: invokeinterface #112,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      25: checkcast     #84                 // class java/math/BigInteger
      28: areturn

  private static final java.math.BigInteger main$processOperation$lambda$4(kotlin.jvm.functions.Function2, java.lang.String, int);
    Code:
       0: aload_0
       1: new           #84                 // class java/math/BigInteger
       4: dup
       5: aload_1
       6: invokespecial #120                // Method java/math/BigInteger."<init>":(Ljava/lang/String;)V
       9: iload_2
      10: i2l
      11: invokestatic  #106                // Method java/math/BigInteger.valueOf:(J)Ljava/math/BigInteger;
      14: dup
      15: ldc           #108                // String valueOf(...)
      17: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      20: invokeinterface #112,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      25: checkcast     #84                 // class java/math/BigInteger
      28: areturn

  private static final java.math.BigInteger main$processOperation$lambda$5(kotlin.jvm.functions.Function2, java.lang.String, java.lang.String, int);
    Code:
       0: aload_0
       1: new           #84                 // class java/math/BigInteger
       4: dup
       5: aload_1
       6: invokespecial #120                // Method java/math/BigInteger."<init>":(Ljava/lang/String;)V
       9: new           #84                 // class java/math/BigInteger
      12: dup
      13: aload_2
      14: invokespecial #120                // Method java/math/BigInteger."<init>":(Ljava/lang/String;)V
      17: invokeinterface #112,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      22: checkcast     #84                 // class java/math/BigInteger
      25: areturn

  private static final kotlin.jvm.functions.Function1<java.lang.Integer, java.math.BigInteger> main$processOperation(java.lang.String, java.lang.String, java.lang.String);
    Code:
       0: aload_0
       1: astore        4
       3: aload         4
       5: ldc           #130                // String +
       7: invokestatic  #134                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      10: ifeq          21
      13: invokedynamic #149,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function2;
      18: goto          49
      21: aload         4
      23: ldc           #151                // String *
      25: invokestatic  #134                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      28: ifeq          39
      31: invokedynamic #155,  0            // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function2;
      36: goto          49
      39: new           #157                // class java/lang/IllegalArgumentException
      42: dup
      43: ldc           #159                // String We should never get here
      45: invokespecial #160                // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
      48: athrow
      49: astore_3
      50: aload_1
      51: ldc           #162                // String old
      53: invokestatic  #134                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      56: aload_2
      57: ldc           #162                // String old
      59: invokestatic  #134                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      62: iand
      63: ifeq          75
      66: aload_3
      67: invokedynamic #172,  0            // InvokeDynamic #2:invoke:(Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function1;
      72: goto          121
      75: aload_1
      76: ldc           #162                // String old
      78: invokestatic  #134                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      81: ifeq          94
      84: aload_3
      85: aload_2
      86: invokedynamic #178,  0            // InvokeDynamic #3:invoke:(Lkotlin/jvm/functions/Function2;Ljava/lang/String;)Lkotlin/jvm/functions/Function1;
      91: goto          121
      94: aload_2
      95: ldc           #162                // String old
      97: invokestatic  #134                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     100: ifeq          113
     103: aload_3
     104: aload_1
     105: invokedynamic #182,  0            // InvokeDynamic #4:invoke:(Lkotlin/jvm/functions/Function2;Ljava/lang/String;)Lkotlin/jvm/functions/Function1;
     110: goto          121
     113: aload_3
     114: aload_1
     115: aload_2
     116: invokedynamic #188,  0            // InvokeDynamic #5:invoke:(Lkotlin/jvm/functions/Function2;Ljava/lang/String;Ljava/lang/String;)Lkotlin/jvm/functions/Function1;
     121: areturn

  private static final int main$gcd(int, int);
    Code:
       0: iload_0
       1: istore_2
       2: iload_1
       3: istore_3
       4: iload_3
       5: ifle          21
       8: iload_3
       9: istore        4
      11: iload_2
      12: iload_3
      13: irem
      14: istore_3
      15: iload         4
      17: istore_2
      18: goto          4
      21: iload_2
      22: ireturn

  private static final int main$lcm(int, int);
    Code:
       0: iload_0
       1: iload_1
       2: imul
       3: iload_0
       4: iload_1
       5: invokestatic  #204                // Method main$gcd:(II)I
       8: idiv
       9: ireturn

  private static final int main$processInput$lambda$6(int, int, int, int);
    Code:
       0: iload_3
       1: iload_0
       2: irem
       3: ifne          10
       6: iload_1
       7: goto          11
      10: iload_2
      11: ireturn

  private static final kotlin.Pair<Monkey[], java.lang.Integer> main$processInput(java.util.List<java.lang.String>);
    Code:
       0: new           #214                // class java/util/ArrayList
       3: dup
       4: invokespecial #216                // Method java/util/ArrayList."<init>":()V
       7: checkcast     #218                // class java/util/List
      10: astore_1
      11: new           #214                // class java/util/ArrayList
      14: dup
      15: invokespecial #216                // Method java/util/ArrayList."<init>":()V
      18: checkcast     #218                // class java/util/List
      21: astore_2
      22: aload_0
      23: invokestatic  #220                // Method main$iterateInput:(Ljava/util/List;)Lkotlin/sequences/Sequence;
      26: invokeinterface #226,  1          // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
      31: astore_3
      32: aload_3
      33: invokeinterface #232,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      38: ifeq          438
      41: aload_3
      42: invokeinterface #236,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      47: checkcast     #218                // class java/util/List
      50: astore        4
      52: aload         4
      54: iconst_0
      55: invokeinterface #240,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      60: checkcast     #194                // class java/lang/String
      63: bipush        18
      65: invokevirtual #244                // Method java/lang/String.substring:(I)Ljava/lang/String;
      68: dup
      69: ldc           #246                // String substring(...)
      71: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      74: checkcast     #248                // class java/lang/CharSequence
      77: iconst_1
      78: anewarray     #194                // class java/lang/String
      81: astore        6
      83: aload         6
      85: iconst_0
      86: ldc           #250                // String ,
      88: aastore
      89: aload         6
      91: iconst_0
      92: iconst_0
      93: bipush        6
      95: aconst_null
      96: invokestatic  #256                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      99: checkcast     #258                // class java/lang/Iterable
     102: astore        6
     104: iconst_0
     105: istore        7
     107: aload         6
     109: astore        8
     111: new           #214                // class java/util/ArrayList
     114: dup
     115: aload         6
     117: bipush        10
     119: invokestatic  #264                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     122: invokespecial #267                // Method java/util/ArrayList."<init>":(I)V
     125: checkcast     #269                // class java/util/Collection
     128: astore        9
     130: iconst_0
     131: istore        10
     133: aload         8
     135: invokeinterface #270,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     140: astore        11
     142: aload         11
     144: invokeinterface #232,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     149: ifeq          196
     152: aload         11
     154: invokeinterface #236,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     159: astore        12
     161: aload         9
     163: aload         12
     165: checkcast     #194                // class java/lang/String
     168: astore        13
     170: astore        15
     172: iconst_0
     173: istore        14
     175: aload         13
     177: invokestatic  #276                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     180: nop
     181: invokestatic  #279                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     184: aload         15
     186: swap
     187: invokeinterface #282,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     192: pop
     193: goto          142
     196: aload         9
     198: checkcast     #218                // class java/util/List
     201: nop
     202: astore        5
     204: aload         4
     206: iconst_1
     207: invokeinterface #240,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     212: checkcast     #194                // class java/lang/String
     215: bipush        19
     217: invokevirtual #244                // Method java/lang/String.substring:(I)Ljava/lang/String;
     220: dup
     221: ldc           #246                // String substring(...)
     223: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     226: checkcast     #248                // class java/lang/CharSequence
     229: iconst_1
     230: anewarray     #194                // class java/lang/String
     233: astore        7
     235: aload         7
     237: iconst_0
     238: ldc_w         #284                // String
     241: aastore
     242: aload         7
     244: iconst_0
     245: iconst_0
     246: bipush        6
     248: aconst_null
     249: invokestatic  #256                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     252: astore        6
     254: aload         6
     256: iconst_0
     257: invokeinterface #240,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     262: checkcast     #194                // class java/lang/String
     265: astore        7
     267: aload         6
     269: iconst_1
     270: invokeinterface #240,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     275: checkcast     #194                // class java/lang/String
     278: astore        8
     280: aload         6
     282: iconst_2
     283: invokeinterface #240,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     288: checkcast     #194                // class java/lang/String
     291: astore        9
     293: nop
     294: aload         4
     296: iconst_2
     297: invokeinterface #240,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     302: checkcast     #194                // class java/lang/String
     305: bipush        21
     307: invokevirtual #244                // Method java/lang/String.substring:(I)Ljava/lang/String;
     310: dup
     311: ldc           #246                // String substring(...)
     313: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     316: invokestatic  #276                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     319: istore        10
     321: nop
     322: aload         4
     324: iconst_3
     325: invokeinterface #240,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     330: checkcast     #194                // class java/lang/String
     333: bipush        29
     335: invokevirtual #244                // Method java/lang/String.substring:(I)Ljava/lang/String;
     338: dup
     339: ldc           #246                // String substring(...)
     341: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     344: invokestatic  #276                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     347: istore        11
     349: nop
     350: aload         4
     352: iconst_4
     353: invokeinterface #240,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     358: checkcast     #194                // class java/lang/String
     361: bipush        30
     363: invokevirtual #244                // Method java/lang/String.substring:(I)Ljava/lang/String;
     366: dup
     367: ldc           #246                // String substring(...)
     369: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     372: invokestatic  #276                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     375: istore        12
     377: new           #286                // class Monkey
     380: dup
     381: aload         5
     383: checkcast     #269                // class java/util/Collection
     386: invokestatic  #290                // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;
     389: aload         8
     391: aload         7
     393: aload         9
     395: invokestatic  #292                // Method main$processOperation:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lkotlin/jvm/functions/Function1;
     398: iload         10
     400: iload         11
     402: iload         12
     404: invokedynamic #300,  0            // InvokeDynamic #6:invoke:(III)Lkotlin/jvm/functions/Function1;
     409: invokespecial #303                // Method Monkey."<init>":(Ljava/util/List;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
     412: astore        13
     414: aload_1
     415: aload         13
     417: invokeinterface #304,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     422: pop
     423: aload_2
     424: iload         10
     426: invokestatic  #279                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     429: invokeinterface #304,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     434: pop
     435: goto          32
     438: aload_1
     439: checkcast     #269                // class java/util/Collection
     442: astore_3
     443: iconst_0
     444: istore        4
     446: aload_3
     447: astore        5
     449: aload         5
     451: iconst_0
     452: anewarray     #286                // class Monkey
     455: invokeinterface #308,  2          // InterfaceMethod java/util/Collection.toArray:([Ljava/lang/Object;)[Ljava/lang/Object;
     460: aload_2
     461: checkcast     #258                // class java/lang/Iterable
     464: astore_3
     465: astore        16
     467: iconst_0
     468: istore        4
     470: aload_3
     471: invokeinterface #270,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     476: astore        5
     478: aload         5
     480: invokeinterface #232,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     485: ifne          499
     488: new           #310                // class java/lang/UnsupportedOperationException
     491: dup
     492: ldc_w         #312                // String Empty collection can\'t be reduced.
     495: invokespecial #313                // Method java/lang/UnsupportedOperationException."<init>":(Ljava/lang/String;)V
     498: athrow
     499: aload         5
     501: invokeinterface #236,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     506: astore        6
     508: aload         5
     510: invokeinterface #232,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     515: ifeq          561
     518: aload         6
     520: aload         5
     522: invokeinterface #236,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     527: checkcast     #315                // class java/lang/Number
     530: invokevirtual #319                // Method java/lang/Number.intValue:()I
     533: istore        7
     535: checkcast     #315                // class java/lang/Number
     538: invokevirtual #319                // Method java/lang/Number.intValue:()I
     541: istore        8
     543: iconst_0
     544: istore        9
     546: iload         8
     548: iload         7
     550: invokestatic  #321                // Method main$lcm:(II)I
     553: invokestatic  #279                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     556: astore        6
     558: goto          508
     561: aload         6
     563: aload         16
     565: swap
     566: astore        17
     568: astore        18
     570: new           #323                // class kotlin/Pair
     573: dup
     574: aload         18
     576: aload         17
     578: invokespecial #326                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     581: areturn

  private static final void main$doRound(Monkey[], boolean, int);
    Code:
       0: iconst_0
       1: istore_3
       2: aload_0
       3: arraylength
       4: istore        4
       6: iload_3
       7: iload         4
       9: if_icmpge     205
      12: aload_0
      13: iload_3
      14: aaload
      15: astore        5
      17: aload         5
      19: invokevirtual #366                // Method Monkey.getHeldItems:()Ljava/util/List;
      22: checkcast     #269                // class java/util/Collection
      25: invokeinterface #369,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
      30: ifne          37
      33: iconst_1
      34: goto          38
      37: iconst_0
      38: ifeq          199
      41: aload         5
      43: invokevirtual #366                // Method Monkey.getHeldItems:()Ljava/util/List;
      46: invokeinterface #372,  1          // InterfaceMethod java/util/List.removeFirst:()Ljava/lang/Object;
      51: dup
      52: ldc_w         #374                // String removeFirst(...)
      55: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      58: checkcast     #315                // class java/lang/Number
      61: invokevirtual #319                // Method java/lang/Number.intValue:()I
      64: istore        6
      66: aload         5
      68: invokevirtual #377                // Method Monkey.inspect:()V
      71: aload         5
      73: invokevirtual #381                // Method Monkey.getApplyOperation:()Lkotlin/jvm/functions/Function1;
      76: iload         6
      78: invokestatic  #279                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      81: invokeinterface #383,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
      86: checkcast     #84                 // class java/math/BigInteger
      89: astore        9
      91: iconst_0
      92: istore        10
      94: iload_1
      95: ifeq          124
      98: aload         9
     100: iload_2
     101: i2l
     102: invokestatic  #106                // Method java/math/BigInteger.valueOf:(J)Ljava/math/BigInteger;
     105: dup
     106: ldc           #108                // String valueOf(...)
     108: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     111: invokevirtual #386                // Method java/math/BigInteger.remainder:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
     114: dup
     115: ldc_w         #388                // String remainder(...)
     118: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     121: goto          148
     124: nop
     125: aload         9
     127: iconst_3
     128: i2l
     129: invokestatic  #106                // Method java/math/BigInteger.valueOf:(J)Ljava/math/BigInteger;
     132: dup
     133: ldc           #108                // String valueOf(...)
     135: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     138: invokevirtual #391                // Method java/math/BigInteger.divide:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
     141: dup
     142: ldc_w         #393                // String divide(...)
     145: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     148: nop
     149: nop
     150: invokevirtual #394                // Method java/math/BigInteger.intValue:()I
     153: istore        7
     155: aload         5
     157: invokevirtual #397                // Method Monkey.getDecide:()Lkotlin/jvm/functions/Function1;
     160: iload         7
     162: invokestatic  #279                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     165: invokeinterface #383,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
     170: checkcast     #315                // class java/lang/Number
     173: invokevirtual #319                // Method java/lang/Number.intValue:()I
     176: istore        8
     178: aload_0
     179: iload         8
     181: aaload
     182: invokevirtual #366                // Method Monkey.getHeldItems:()Ljava/util/List;
     185: iload         7
     187: invokestatic  #279                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     190: invokeinterface #304,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     195: pop
     196: goto          17
     199: iinc          3, 1
     202: goto          6
     205: return

  static void main$doRound$default(Monkey[], boolean, int, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_2
       2: iand
       3: ifeq          8
       6: iconst_0
       7: istore_1
       8: iload_3
       9: iconst_4
      10: iand
      11: ifeq          16
      14: iconst_1
      15: istore_2
      16: aload_0
      17: iload_1
      18: iload_2
      19: invokestatic  #411                // Method main$doRound:([LMonkey;ZI)V
      22: return

  private static final java.math.BigInteger main$multiplyTwoLargest(Monkey[]);
    Code:
       0: aload_0
       1: astore_2
       2: iconst_0
       3: istore_3
       4: aload_2
       5: astore        4
       7: new           #214                // class java/util/ArrayList
      10: dup
      11: aload_2
      12: arraylength
      13: invokespecial #267                // Method java/util/ArrayList."<init>":(I)V
      16: checkcast     #269                // class java/util/Collection
      19: astore        5
      21: iconst_0
      22: istore        6
      24: iconst_0
      25: istore        7
      27: aload         4
      29: arraylength
      30: istore        8
      32: iload         7
      34: iload         8
      36: if_icmpge     88
      39: aload         4
      41: iload         7
      43: aaload
      44: astore        9
      46: aload         5
      48: aload         9
      50: astore        10
      52: astore        12
      54: iconst_0
      55: istore        11
      57: aload         10
      59: invokevirtual #417                // Method Monkey.getInspectedItems:()Ljava/math/BigInteger;
      62: invokevirtual #420                // Method java/math/BigInteger.negate:()Ljava/math/BigInteger;
      65: dup
      66: ldc_w         #422                // String negate(...)
      69: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      72: nop
      73: aload         12
      75: swap
      76: invokeinterface #282,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      81: pop
      82: iinc          7, 1
      85: goto          32
      88: aload         5
      90: checkcast     #218                // class java/util/List
      93: nop
      94: checkcast     #269                // class java/util/Collection
      97: astore        13
      99: new           #424                // class java/util/PriorityQueue
     102: dup
     103: aload         13
     105: invokespecial #427                // Method java/util/PriorityQueue."<init>":(Ljava/util/Collection;)V
     108: astore_1
     109: aload_1
     110: invokevirtual #430                // Method java/util/PriorityQueue.poll:()Ljava/lang/Object;
     113: dup
     114: ldc_w         #432                // String poll(...)
     117: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     120: checkcast     #84                 // class java/math/BigInteger
     123: astore_2
     124: aload_1
     125: invokevirtual #430                // Method java/util/PriorityQueue.poll:()Ljava/lang/Object;
     128: dup
     129: ldc_w         #432                // String poll(...)
     132: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     135: checkcast     #84                 // class java/math/BigInteger
     138: aload_2
     139: swap
     140: invokevirtual #98                 // Method java/math/BigInteger.multiply:(Ljava/math/BigInteger;)Ljava/math/BigInteger;
     143: dup
     144: ldc           #100                // String multiply(...)
     146: invokestatic  #93                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     149: areturn

  private static final java.math.BigInteger main$part1(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: invokestatic  #438                // Method main$processInput:(Ljava/util/List;)Lkotlin/Pair;
       4: invokevirtual #441                // Method kotlin/Pair.component1:()Ljava/lang/Object;
       7: checkcast     #407                // class "[LMonkey;"
      10: astore_1
      11: bipush        20
      13: istore_2
      14: iconst_0
      15: istore_3
      16: iload_3
      17: iload_2
      18: if_icmpge     43
      21: iload_3
      22: istore        4
      24: iconst_0
      25: istore        5
      27: aload_1
      28: iconst_0
      29: iconst_0
      30: bipush        6
      32: aconst_null
      33: invokestatic  #443                // Method main$doRound$default:([LMonkey;ZIILjava/lang/Object;)V
      36: nop
      37: iinc          3, 1
      40: goto          16
      43: aload_1
      44: invokestatic  #445                // Method main$multiplyTwoLargest:([LMonkey;)Ljava/math/BigInteger;
      47: areturn

  private static final java.math.BigInteger main$part2(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: invokestatic  #438                // Method main$processInput:(Ljava/util/List;)Lkotlin/Pair;
       4: astore_1
       5: aload_1
       6: invokevirtual #441                // Method kotlin/Pair.component1:()Ljava/lang/Object;
       9: checkcast     #407                // class "[LMonkey;"
      12: astore_2
      13: aload_1
      14: invokevirtual #449                // Method kotlin/Pair.component2:()Ljava/lang/Object;
      17: checkcast     #315                // class java/lang/Number
      20: invokevirtual #319                // Method java/lang/Number.intValue:()I
      23: istore_3
      24: sipush        10000
      27: istore        4
      29: iconst_0
      30: istore        5
      32: iload         5
      34: iload         4
      36: if_icmpge     59
      39: iload         5
      41: istore        6
      43: iconst_0
      44: istore        7
      46: aload_2
      47: iconst_1
      48: iload_3
      49: invokestatic  #411                // Method main$doRound:([LMonkey;ZI)V
      52: nop
      53: iinc          5, 1
      56: goto          32
      59: aload_2
      60: invokestatic  #445                // Method main$multiplyTwoLargest:([LMonkey;)Ljava/math/BigInteger;
      63: areturn
}