import java.io.File
import java.util.PriorityQueue

fun main() {
    fun parseInput(input: String) = input.split("\n\n").map { elf ->
        elf.lines().map { it.toInt() }
    }

    // O(size * log size) -> O(size * log n) -> O(size)
    fun List<List<Int>>.topNElves(n: Int): Int {
        fun findTopN(n: Int, element: List<Int>): List<Int> {
            if (element.size == n) return element
            val x = element.random()
            val small = element.filter { it < x }
            val equal = element.filter { it == x }
            val big = element.filter { it > x }
            if (big.size >= n) return findTopN(n, big)
            if (equal.size + big.size >= n) return (equal + big).takeLast(n)
            return findTopN(n - equal.size - big.size, small) + equal + big
        }
        return findTopN(n, this.map { it.sum() }).sum()
    }

    fun part1(input: String): Int {
        val data = parseInput(input)
        return data.topNElves(1)
    }

    fun part2(input: String) : Int {
        val data = parseInput(input)
        return data.topNElves(3)
    }

    // test if implementation meets criteria from the description, like:
    val testInput = File("src/Day01_test.txt").readText()
    check(part1(testInput) == 24000)

    val input = File("src/Day01.txt").readText()
    println(part1(input))
    println(part2(input))

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

Compiled from "Day01.kt"
public final class Day01Kt {
  public static final void main();
    Code:
       0: new           #8                  // class java/io/File
       3: dup
       4: ldc           #10                 // String src/Day01_test.txt
       6: invokespecial #14                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       9: aconst_null
      10: iconst_1
      11: aconst_null
      12: invokestatic  #20                 // Method kotlin/io/FilesKt.readText$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/lang/String;
      15: astore_0
      16: aload_0
      17: invokestatic  #24                 // Method main$part1:(Ljava/lang/String;)I
      20: sipush        24000
      23: if_icmpne     30
      26: iconst_1
      27: goto          31
      30: iconst_0
      31: ifne          44
      34: new           #26                 // class java/lang/IllegalStateException
      37: dup
      38: ldc           #28                 // String Check failed.
      40: invokespecial #29                 // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
      43: athrow
      44: new           #8                  // class java/io/File
      47: dup
      48: ldc           #31                 // String src/Day01.txt
      50: invokespecial #14                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      53: aconst_null
      54: iconst_1
      55: aconst_null
      56: invokestatic  #20                 // Method kotlin/io/FilesKt.readText$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/lang/String;
      59: astore_1
      60: aload_1
      61: invokestatic  #24                 // Method main$part1:(Ljava/lang/String;)I
      64: istore_2
      65: getstatic     #37                 // Field java/lang/System.out:Ljava/io/PrintStream;
      68: iload_2
      69: invokevirtual #43                 // Method java/io/PrintStream.println:(I)V
      72: aload_1
      73: invokestatic  #46                 // Method main$part2:(Ljava/lang/String;)I
      76: istore_2
      77: getstatic     #37                 // Field java/lang/System.out:Ljava/io/PrintStream;
      80: iload_2
      81: invokevirtual #43                 // Method java/io/PrintStream.println:(I)V
      84: return

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

  private static final java.util.List<java.util.List<java.lang.Integer>> main$parseInput(java.lang.String);
    Code:
       0: aload_0
       1: checkcast     #61                 // class java/lang/CharSequence
       4: iconst_1
       5: anewarray     #51                 // class java/lang/String
       8: astore_1
       9: aload_1
      10: iconst_0
      11: ldc           #63                 // String \n\n
      13: aastore
      14: aload_1
      15: iconst_0
      16: iconst_0
      17: bipush        6
      19: aconst_null
      20: invokestatic  #69                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      23: checkcast     #71                 // class java/lang/Iterable
      26: astore_1
      27: iconst_0
      28: istore_2
      29: aload_1
      30: astore_3
      31: new           #73                 // class java/util/ArrayList
      34: dup
      35: aload_1
      36: bipush        10
      38: invokestatic  #79                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      41: invokespecial #81                 // Method java/util/ArrayList."<init>":(I)V
      44: checkcast     #83                 // class java/util/Collection
      47: astore        4
      49: iconst_0
      50: istore        5
      52: aload_3
      53: invokeinterface #87,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      58: astore        6
      60: aload         6
      62: invokeinterface #93,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      67: ifeq          217
      70: aload         6
      72: invokeinterface #97,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      77: astore        7
      79: aload         4
      81: aload         7
      83: checkcast     #51                 // class java/lang/String
      86: astore        8
      88: astore        20
      90: iconst_0
      91: istore        9
      93: aload         8
      95: checkcast     #61                 // class java/lang/CharSequence
      98: invokestatic  #101                // Method kotlin/text/StringsKt.lines:(Ljava/lang/CharSequence;)Ljava/util/List;
     101: checkcast     #71                 // class java/lang/Iterable
     104: astore        10
     106: iconst_0
     107: istore        11
     109: aload         10
     111: astore        12
     113: new           #73                 // class java/util/ArrayList
     116: dup
     117: aload         10
     119: bipush        10
     121: invokestatic  #79                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     124: invokespecial #81                 // Method java/util/ArrayList."<init>":(I)V
     127: checkcast     #83                 // class java/util/Collection
     130: astore        13
     132: iconst_0
     133: istore        14
     135: aload         12
     137: invokeinterface #87,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     142: astore        15
     144: aload         15
     146: invokeinterface #93,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     151: ifeq          198
     154: aload         15
     156: invokeinterface #97,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     161: astore        16
     163: aload         13
     165: aload         16
     167: checkcast     #51                 // class java/lang/String
     170: astore        17
     172: astore        18
     174: iconst_0
     175: istore        19
     177: aload         17
     179: invokestatic  #106                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     182: nop
     183: invokestatic  #110                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     186: aload         18
     188: swap
     189: invokeinterface #114,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     194: pop
     195: goto          144
     198: aload         13
     200: checkcast     #116                // class java/util/List
     203: nop
     204: nop
     205: aload         20
     207: swap
     208: invokeinterface #114,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     213: pop
     214: goto          60
     217: aload         4
     219: checkcast     #116                // class java/util/List
     222: nop
     223: areturn

  private static final java.util.List<java.lang.Integer> main$topNElves$findTopN(int, java.util.List<java.lang.Integer>);
    Code:
       0: aload_1
       1: invokeinterface #137,  1          // InterfaceMethod java/util/List.size:()I
       6: iload_0
       7: if_icmpne     12
      10: aload_1
      11: areturn
      12: aload_1
      13: checkcast     #83                 // class java/util/Collection
      16: getstatic     #143                // Field kotlin/random/Random.Default:Lkotlin/random/Random$Default;
      19: checkcast     #139                // class kotlin/random/Random
      22: invokestatic  #147                // Method kotlin/collections/CollectionsKt.random:(Ljava/util/Collection;Lkotlin/random/Random;)Ljava/lang/Object;
      25: checkcast     #149                // class java/lang/Number
      28: invokevirtual #152                // Method java/lang/Number.intValue:()I
      31: istore_2
      32: aload_1
      33: checkcast     #71                 // class java/lang/Iterable
      36: astore        4
      38: iconst_0
      39: istore        5
      41: aload         4
      43: astore        6
      45: new           #73                 // class java/util/ArrayList
      48: dup
      49: invokespecial #154                // Method java/util/ArrayList."<init>":()V
      52: checkcast     #83                 // class java/util/Collection
      55: astore        7
      57: iconst_0
      58: istore        8
      60: aload         6
      62: invokeinterface #87,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      67: astore        9
      69: aload         9
      71: invokeinterface #93,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      76: ifeq          128
      79: aload         9
      81: invokeinterface #97,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      86: astore        10
      88: aload         10
      90: checkcast     #149                // class java/lang/Number
      93: invokevirtual #152                // Method java/lang/Number.intValue:()I
      96: istore        11
      98: iconst_0
      99: istore        12
     101: iload         11
     103: iload_2
     104: if_icmpge     111
     107: iconst_1
     108: goto          112
     111: iconst_0
     112: ifeq          69
     115: aload         7
     117: aload         10
     119: invokeinterface #114,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     124: pop
     125: goto          69
     128: aload         7
     130: checkcast     #116                // class java/util/List
     133: nop
     134: astore_3
     135: aload_1
     136: checkcast     #71                 // class java/lang/Iterable
     139: astore        5
     141: iconst_0
     142: istore        6
     144: aload         5
     146: astore        7
     148: new           #73                 // class java/util/ArrayList
     151: dup
     152: invokespecial #154                // Method java/util/ArrayList."<init>":()V
     155: checkcast     #83                 // class java/util/Collection
     158: astore        8
     160: iconst_0
     161: istore        9
     163: aload         7
     165: invokeinterface #87,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     170: astore        10
     172: aload         10
     174: invokeinterface #93,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     179: ifeq          231
     182: aload         10
     184: invokeinterface #97,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     189: astore        11
     191: aload         11
     193: checkcast     #149                // class java/lang/Number
     196: invokevirtual #152                // Method java/lang/Number.intValue:()I
     199: istore        12
     201: iconst_0
     202: istore        13
     204: iload         12
     206: iload_2
     207: if_icmpne     214
     210: iconst_1
     211: goto          215
     214: iconst_0
     215: ifeq          172
     218: aload         8
     220: aload         11
     222: invokeinterface #114,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     227: pop
     228: goto          172
     231: aload         8
     233: checkcast     #116                // class java/util/List
     236: nop
     237: astore        4
     239: aload_1
     240: checkcast     #71                 // class java/lang/Iterable
     243: astore        6
     245: iconst_0
     246: istore        7
     248: aload         6
     250: astore        8
     252: new           #73                 // class java/util/ArrayList
     255: dup
     256: invokespecial #154                // Method java/util/ArrayList."<init>":()V
     259: checkcast     #83                 // class java/util/Collection
     262: astore        9
     264: iconst_0
     265: istore        10
     267: aload         8
     269: invokeinterface #87,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     274: astore        11
     276: aload         11
     278: invokeinterface #93,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     283: ifeq          335
     286: aload         11
     288: invokeinterface #97,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     293: astore        12
     295: aload         12
     297: checkcast     #149                // class java/lang/Number
     300: invokevirtual #152                // Method java/lang/Number.intValue:()I
     303: istore        13
     305: iconst_0
     306: istore        14
     308: iload         13
     310: iload_2
     311: if_icmple     318
     314: iconst_1
     315: goto          319
     318: iconst_0
     319: ifeq          276
     322: aload         9
     324: aload         12
     326: invokeinterface #114,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     331: pop
     332: goto          276
     335: aload         9
     337: checkcast     #116                // class java/util/List
     340: nop
     341: astore        5
     343: aload         5
     345: invokeinterface #137,  1          // InterfaceMethod java/util/List.size:()I
     350: iload_0
     351: if_icmplt     361
     354: iload_0
     355: aload         5
     357: invokestatic  #156                // Method main$topNElves$findTopN:(ILjava/util/List;)Ljava/util/List;
     360: areturn
     361: aload         4
     363: invokeinterface #137,  1          // InterfaceMethod java/util/List.size:()I
     368: aload         5
     370: invokeinterface #137,  1          // InterfaceMethod java/util/List.size:()I
     375: iadd
     376: iload_0
     377: if_icmplt     398
     380: aload         4
     382: checkcast     #83                 // class java/util/Collection
     385: aload         5
     387: checkcast     #71                 // class java/lang/Iterable
     390: invokestatic  #160                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     393: iload_0
     394: invokestatic  #164                // Method kotlin/collections/CollectionsKt.takeLast:(Ljava/util/List;I)Ljava/util/List;
     397: areturn
     398: iload_0
     399: aload         4
     401: invokeinterface #137,  1          // InterfaceMethod java/util/List.size:()I
     406: isub
     407: aload         5
     409: invokeinterface #137,  1          // InterfaceMethod java/util/List.size:()I
     414: isub
     415: aload_3
     416: invokestatic  #156                // Method main$topNElves$findTopN:(ILjava/util/List;)Ljava/util/List;
     419: checkcast     #83                 // class java/util/Collection
     422: aload         4
     424: checkcast     #71                 // class java/lang/Iterable
     427: invokestatic  #160                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     430: checkcast     #83                 // class java/util/Collection
     433: aload         5
     435: checkcast     #71                 // class java/lang/Iterable
     438: invokestatic  #160                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     441: areturn

  private static final int main$topNElves(java.util.List<? extends java.util.List<java.lang.Integer>>, int);
    Code:
       0: iload_1
       1: aload_0
       2: checkcast     #71                 // class java/lang/Iterable
       5: astore_2
       6: istore        11
       8: iconst_0
       9: istore_3
      10: aload_2
      11: astore        4
      13: new           #73                 // class java/util/ArrayList
      16: dup
      17: aload_2
      18: bipush        10
      20: invokestatic  #79                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      23: invokespecial #81                 // Method java/util/ArrayList."<init>":(I)V
      26: checkcast     #83                 // class java/util/Collection
      29: astore        5
      31: iconst_0
      32: istore        6
      34: aload         4
      36: invokeinterface #87,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      41: astore        7
      43: aload         7
      45: invokeinterface #93,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      50: ifeq          99
      53: aload         7
      55: invokeinterface #97,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      60: astore        8
      62: aload         5
      64: aload         8
      66: checkcast     #116                // class java/util/List
      69: astore        9
      71: astore        12
      73: iconst_0
      74: istore        10
      76: aload         9
      78: checkcast     #71                 // class java/lang/Iterable
      81: invokestatic  #186                // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
      84: invokestatic  #110                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      87: aload         12
      89: swap
      90: invokeinterface #114,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      95: pop
      96: goto          43
      99: aload         5
     101: checkcast     #116                // class java/util/List
     104: nop
     105: astore        12
     107: iload         11
     109: aload         12
     111: invokestatic  #156                // Method main$topNElves$findTopN:(ILjava/util/List;)Ljava/util/List;
     114: checkcast     #71                 // class java/lang/Iterable
     117: invokestatic  #186                // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
     120: ireturn

  private static final int main$part1(java.lang.String);
    Code:
       0: aload_0
       1: invokestatic  #190                // Method main$parseInput:(Ljava/lang/String;)Ljava/util/List;
       4: astore_1
       5: aload_1
       6: iconst_1
       7: invokestatic  #192                // Method main$topNElves:(Ljava/util/List;I)I
      10: ireturn

  private static final int main$part2(java.lang.String);
    Code:
       0: aload_0
       1: invokestatic  #190                // Method main$parseInput:(Ljava/lang/String;)Ljava/util/List;
       4: astore_1
       5: aload_1
       6: iconst_3
       7: invokestatic  #192                // Method main$topNElves:(Ljava/util/List;I)I
      10: ireturn
}


import java.io.File
import java.nio.file.Path

fun main(args: Array<String>) {
    Day3Runner().run(Path.of("src/main/resources/day3/input.txt"))
}

class Day3Runner {

    fun run(input: Path) {
        File(input.toString()).useLines { lines ->
            val groups = mutableListOf<Group>()
            val rucksacks = mutableListOf<Rucksack>()

            lines.forEachIndexed { index, line ->
                rucksacks.add(Rucksack(line))

                if ((index + 1) % 3 == 0) {
                    groups.add(Group(rucksacks.toList()))
                    rucksacks.clear()
                }
            }

            val sumOfProrities = groups.map {
                it.determineBadgeItem().priority()
            }.toList().sum()

            println(sumOfProrities)
        }
    }

    data class Group(val rucksacks: List<Rucksack>) {
        fun determineBadgeItem(): Item {
            val itemsRucksack1 = rucksacks.get(0).getAllItems()
            val itemsRucksack2 = rucksacks.get(1).getAllItems()
            val itemsRucksack3 = rucksacks.get(2).getAllItems()

            return itemsRucksack1.intersect(itemsRucksack2).intersect(itemsRucksack3).first()
        }
    }

    class Rucksack(input: String) {
        val firstCompartment: MutableList<Item> = mutableListOf()
        val secondCompartment: MutableList<Item> = mutableListOf()

        init {
            val indexHalf = (input.length / 2 - 1)

            for (firstHalfChar in input.substring(IntRange(0, indexHalf)).toList())
                firstCompartment.add(Item(firstHalfChar))

            for (secondHalfChar in input.substring(IntRange(indexHalf + 1, input.length - 1)).toList())
                secondCompartment.add(Item(secondHalfChar))

            assert(firstCompartment.size == secondCompartment.size)
        }

        fun determineDuplicateItem(): Item {
            return firstCompartment.intersect(secondCompartment).first()
        }

        fun getAllItems(): Set<Item> {
            return firstCompartment.union(secondCompartment)
        }
    }

    data class Item(val value: Char) {
        fun priority(): Int = if (value.isUpperCase()) value.code - 38 else value.code - 96
    }
}

Compiled from "Day3Runner.kt"
public final class Day3Runner$Group {
  private final java.util.List<Day3Runner$Rucksack> rucksacks;

  public Day3Runner$Group(java.util.List<Day3Runner$Rucksack>);
    Code:
       0: aload_1
       1: ldc           #10                 // String rucksacks
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokespecial #19                 // Method java/lang/Object."<init>":()V
      10: aload_0
      11: aload_1
      12: putfield      #22                 // Field rucksacks:Ljava/util/List;
      15: return

  public final java.util.List<Day3Runner$Rucksack> getRucksacks();
    Code:
       0: aload_0
       1: getfield      #22                 // Field rucksacks:Ljava/util/List;
       4: areturn

  public final Day3Runner$Item determineBadgeItem();
    Code:
       0: aload_0
       1: getfield      #22                 // Field rucksacks:Ljava/util/List;
       4: iconst_0
       5: invokeinterface #35,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      10: checkcast     #37                 // class Day3Runner$Rucksack
      13: invokevirtual #41                 // Method Day3Runner$Rucksack.getAllItems:()Ljava/util/Set;
      16: astore_1
      17: aload_0
      18: getfield      #22                 // Field rucksacks:Ljava/util/List;
      21: iconst_1
      22: invokeinterface #35,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      27: checkcast     #37                 // class Day3Runner$Rucksack
      30: invokevirtual #41                 // Method Day3Runner$Rucksack.getAllItems:()Ljava/util/Set;
      33: astore_2
      34: aload_0
      35: getfield      #22                 // Field rucksacks:Ljava/util/List;
      38: iconst_2
      39: invokeinterface #35,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      44: checkcast     #37                 // class Day3Runner$Rucksack
      47: invokevirtual #41                 // Method Day3Runner$Rucksack.getAllItems:()Ljava/util/Set;
      50: astore_3
      51: aload_1
      52: checkcast     #43                 // class java/lang/Iterable
      55: aload_2
      56: checkcast     #43                 // class java/lang/Iterable
      59: invokestatic  #49                 // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;
      62: checkcast     #43                 // class java/lang/Iterable
      65: aload_3
      66: checkcast     #43                 // class java/lang/Iterable
      69: invokestatic  #49                 // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;
      72: checkcast     #43                 // class java/lang/Iterable
      75: invokestatic  #53                 // Method kotlin/collections/CollectionsKt.first:(Ljava/lang/Iterable;)Ljava/lang/Object;
      78: checkcast     #55                 // class Day3Runner$Item
      81: areturn

  public final java.util.List<Day3Runner$Rucksack> component1();
    Code:
       0: aload_0
       1: getfield      #22                 // Field rucksacks:Ljava/util/List;
       4: areturn

  public final Day3Runner$Group copy(java.util.List<Day3Runner$Rucksack>);
    Code:
       0: aload_1
       1: ldc           #10                 // String rucksacks
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #2                  // class Day3Runner$Group
       9: dup
      10: aload_1
      11: invokespecial #65                 // Method "<init>":(Ljava/util/List;)V
      14: areturn

  public static Day3Runner$Group copy$default(Day3Runner$Group, java.util.List, int, java.lang.Object);
    Code:
       0: iload_2
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #22                 // Field rucksacks:Ljava/util/List;
      10: astore_1
      11: aload_0
      12: aload_1
      13: invokevirtual #69                 // Method copy:(Ljava/util/List;)LDay3Runner$Group;
      16: areturn

  public java.lang.String toString();
    Code:
       0: new           #73                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #74                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #76                 // String Group(rucksacks=
       9: invokevirtual #80                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #22                 // Field rucksacks:Ljava/util/List;
      16: invokevirtual #83                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      19: bipush        41
      21: invokevirtual #86                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      24: invokevirtual #88                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      27: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #22                 // Field rucksacks:Ljava/util/List;
       4: invokevirtual #92                 // 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 Day3Runner$Group
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day3Runner$Group
      20: astore_2
      21: aload_0
      22: getfield      #22                 // Field rucksacks:Ljava/util/List;
      25: aload_2
      26: getfield      #22                 // Field rucksacks:Ljava/util/List;
      29: invokestatic  #99                 // 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 "Day3Runner.kt"
public final class Day3Runner$Rucksack {
  private final java.util.List<Day3Runner$Item> firstCompartment;

  private final java.util.List<Day3Runner$Item> secondCompartment;

  public Day3Runner$Rucksack(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: new           #20                 // class java/util/ArrayList
      14: dup
      15: invokespecial #21                 // Method java/util/ArrayList."<init>":()V
      18: checkcast     #23                 // class java/util/List
      21: putfield      #27                 // Field firstCompartment:Ljava/util/List;
      24: aload_0
      25: new           #20                 // class java/util/ArrayList
      28: dup
      29: invokespecial #21                 // Method java/util/ArrayList."<init>":()V
      32: checkcast     #23                 // class java/util/List
      35: putfield      #30                 // Field secondCompartment:Ljava/util/List;
      38: nop
      39: aload_1
      40: invokevirtual #36                 // Method java/lang/String.length:()I
      43: iconst_2
      44: idiv
      45: iconst_1
      46: isub
      47: istore_2
      48: aload_1
      49: new           #38                 // class kotlin/ranges/IntRange
      52: dup
      53: iconst_0
      54: iload_2
      55: invokespecial #41                 // Method kotlin/ranges/IntRange."<init>":(II)V
      58: invokestatic  #47                 // Method kotlin/text/StringsKt.substring:(Ljava/lang/String;Lkotlin/ranges/IntRange;)Ljava/lang/String;
      61: checkcast     #49                 // class java/lang/CharSequence
      64: invokestatic  #53                 // Method kotlin/text/StringsKt.toList:(Ljava/lang/CharSequence;)Ljava/util/List;
      67: invokeinterface #57,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      72: astore_3
      73: aload_3
      74: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      79: ifeq          118
      82: aload_3
      83: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      88: checkcast     #69                 // class java/lang/Character
      91: invokevirtual #73                 // Method java/lang/Character.charValue:()C
      94: istore        4
      96: aload_0
      97: getfield      #27                 // Field firstCompartment:Ljava/util/List;
     100: new           #75                 // class Day3Runner$Item
     103: dup
     104: iload         4
     106: invokespecial #78                 // Method Day3Runner$Item."<init>":(C)V
     109: invokeinterface #82,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     114: pop
     115: goto          73
     118: aload_1
     119: new           #38                 // class kotlin/ranges/IntRange
     122: dup
     123: iload_2
     124: iconst_1
     125: iadd
     126: aload_1
     127: invokevirtual #36                 // Method java/lang/String.length:()I
     130: iconst_1
     131: isub
     132: invokespecial #41                 // Method kotlin/ranges/IntRange."<init>":(II)V
     135: invokestatic  #47                 // Method kotlin/text/StringsKt.substring:(Ljava/lang/String;Lkotlin/ranges/IntRange;)Ljava/lang/String;
     138: checkcast     #49                 // class java/lang/CharSequence
     141: invokestatic  #53                 // Method kotlin/text/StringsKt.toList:(Ljava/lang/CharSequence;)Ljava/util/List;
     144: invokeinterface #57,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     149: astore_3
     150: aload_3
     151: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     156: ifeq          195
     159: aload_3
     160: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     165: checkcast     #69                 // class java/lang/Character
     168: invokevirtual #73                 // Method java/lang/Character.charValue:()C
     171: istore        4
     173: aload_0
     174: getfield      #30                 // Field secondCompartment:Ljava/util/List;
     177: new           #75                 // class Day3Runner$Item
     180: dup
     181: iload         4
     183: invokespecial #78                 // Method Day3Runner$Item."<init>":(C)V
     186: invokeinterface #82,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     191: pop
     192: goto          150
     195: aload_0
     196: getfield      #27                 // Field firstCompartment:Ljava/util/List;
     199: invokeinterface #85,  1           // InterfaceMethod java/util/List.size:()I
     204: aload_0
     205: getfield      #30                 // Field secondCompartment:Ljava/util/List;
     208: invokeinterface #85,  1           // InterfaceMethod java/util/List.size:()I
     213: if_icmpne     220
     216: iconst_1
     217: goto          221
     220: iconst_0
     221: istore_3
     222: getstatic     #91                 // Field kotlin/_Assertions.ENABLED:Z
     225: ifeq          246
     228: iload_3
     229: ifne          246
     232: ldc           #93                 // String Assertion failed
     234: astore        4
     236: new           #95                 // class java/lang/AssertionError
     239: dup
     240: aload         4
     242: invokespecial #98                 // Method java/lang/AssertionError."<init>":(Ljava/lang/Object;)V
     245: athrow
     246: nop
     247: return

  public final java.util.List<Day3Runner$Item> getFirstCompartment();
    Code:
       0: aload_0
       1: getfield      #27                 // Field firstCompartment:Ljava/util/List;
       4: areturn

  public final java.util.List<Day3Runner$Item> getSecondCompartment();
    Code:
       0: aload_0
       1: getfield      #30                 // Field secondCompartment:Ljava/util/List;
       4: areturn

  public final Day3Runner$Item determineDuplicateItem();
    Code:
       0: aload_0
       1: getfield      #27                 // Field firstCompartment:Ljava/util/List;
       4: checkcast     #114                // class java/lang/Iterable
       7: aload_0
       8: getfield      #30                 // Field secondCompartment:Ljava/util/List;
      11: checkcast     #114                // class java/lang/Iterable
      14: invokestatic  #120                // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;
      17: checkcast     #114                // class java/lang/Iterable
      20: invokestatic  #124                // Method kotlin/collections/CollectionsKt.first:(Ljava/lang/Iterable;)Ljava/lang/Object;
      23: checkcast     #75                 // class Day3Runner$Item
      26: areturn

  public final java.util.Set<Day3Runner$Item> getAllItems();
    Code:
       0: aload_0
       1: getfield      #27                 // Field firstCompartment:Ljava/util/List;
       4: checkcast     #114                // class java/lang/Iterable
       7: aload_0
       8: getfield      #30                 // Field secondCompartment:Ljava/util/List;
      11: checkcast     #114                // class java/lang/Iterable
      14: invokestatic  #130                // Method kotlin/collections/CollectionsKt.union:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;
      17: areturn
}

Compiled from "Day3Runner.kt"
public final class Day3Runner$Item {
  private final char value;

  public Day3Runner$Item(char);
    Code:
       0: aload_0
       1: invokespecial #9                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: iload_1
       6: putfield      #13                 // Field value:C
       9: return

  public final char getValue();
    Code:
       0: aload_0
       1: getfield      #13                 // Field value:C
       4: ireturn

  public final int priority();
    Code:
       0: aload_0
       1: getfield      #13                 // Field value:C
       4: invokestatic  #25                 // Method java/lang/Character.isUpperCase:(C)Z
       7: ifeq          20
      10: aload_0
      11: getfield      #13                 // Field value:C
      14: bipush        38
      16: isub
      17: goto          27
      20: aload_0
      21: getfield      #13                 // Field value:C
      24: bipush        96
      26: isub
      27: ireturn

  public final char component1();
    Code:
       0: aload_0
       1: getfield      #13                 // Field value:C
       4: ireturn

  public final Day3Runner$Item copy(char);
    Code:
       0: new           #2                  // class Day3Runner$Item
       3: dup
       4: iload_1
       5: invokespecial #31                 // Method "<init>":(C)V
       8: areturn

  public static Day3Runner$Item copy$default(Day3Runner$Item, char, int, java.lang.Object);
    Code:
       0: iload_2
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #13                 // Field value:C
      10: istore_1
      11: aload_0
      12: iload_1
      13: invokevirtual #35                 // Method copy:(C)LDay3Runner$Item;
      16: areturn

  public java.lang.String toString();
    Code:
       0: new           #39                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #40                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #42                 // String Item(value=
       9: invokevirtual #46                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field value:C
      16: invokevirtual #49                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      19: bipush        41
      21: invokevirtual #49                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      24: invokevirtual #51                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      27: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #13                 // Field value:C
       4: invokestatic  #55                 // Method java/lang/Character.hashCode:(C)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 Day3Runner$Item
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day3Runner$Item
      20: astore_2
      21: aload_0
      22: getfield      #13                 // Field value:C
      25: aload_2
      26: getfield      #13                 // Field value:C
      29: if_icmpeq     34
      32: iconst_0
      33: ireturn
      34: iconst_1
      35: ireturn
}

Compiled from "Day3Runner.kt"
public final class Day3RunnerKt {
  public static final void main(java.lang.String[]);
    Code:
       0: aload_0
       1: ldc           #9                  // String args
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #17                 // class Day3Runner
       9: dup
      10: invokespecial #21                 // Method Day3Runner."<init>":()V
      13: ldc           #23                 // String src/main/resources/day3/input.txt
      15: iconst_0
      16: anewarray     #25                 // class java/lang/String
      19: invokestatic  #31                 // InterfaceMethod java/nio/file/Path.of:(Ljava/lang/String;[Ljava/lang/String;)Ljava/nio/file/Path;
      22: dup
      23: ldc           #33                 // String of(...)
      25: invokestatic  #36                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      28: invokevirtual #40                 // Method Day3Runner.run:(Ljava/nio/file/Path;)V
      31: return
}

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

  public final void run(java.nio.file.Path);
    Code:
       0: aload_1
       1: ldc           #17                 // String input
       3: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #25                 // class java/io/File
       9: dup
      10: aload_1
      11: invokevirtual #29                 // Method java/lang/Object.toString:()Ljava/lang/String;
      14: invokespecial #32                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      17: astore_2
      18: getstatic     #38                 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      21: astore_3
      22: iconst_0
      23: istore        4
      25: aload_2
      26: astore        5
      28: sipush        8192
      31: istore        6
      33: aload         5
      35: astore        7
      37: new           #40                 // class java/io/InputStreamReader
      40: dup
      41: new           #42                 // class java/io/FileInputStream
      44: dup
      45: aload         7
      47: invokespecial #45                 // Method java/io/FileInputStream."<init>":(Ljava/io/File;)V
      50: checkcast     #47                 // class java/io/InputStream
      53: aload_3
      54: invokespecial #50                 // Method java/io/InputStreamReader."<init>":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
      57: checkcast     #52                 // class java/io/Reader
      60: astore        7
      62: aload         7
      64: instanceof    #54                 // class java/io/BufferedReader
      67: ifeq          78
      70: aload         7
      72: checkcast     #54                 // class java/io/BufferedReader
      75: goto          89
      78: new           #54                 // class java/io/BufferedReader
      81: dup
      82: aload         7
      84: iload         6
      86: invokespecial #57                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
      89: checkcast     #59                 // class java/io/Closeable
      92: astore        5
      94: aconst_null
      95: astore        6
      97: nop
      98: aload         5
     100: checkcast     #54                 // class java/io/BufferedReader
     103: astore        7
     105: iconst_0
     106: istore        8
     108: aload         7
     110: invokestatic  #65                 // Method kotlin/io/TextStreamsKt.lineSequence:(Ljava/io/BufferedReader;)Lkotlin/sequences/Sequence;
     113: astore        9
     115: iconst_0
     116: istore        10
     118: new           #67                 // class java/util/ArrayList
     121: dup
     122: invokespecial #68                 // Method java/util/ArrayList."<init>":()V
     125: checkcast     #70                 // class java/util/List
     128: astore        11
     130: new           #67                 // class java/util/ArrayList
     133: dup
     134: invokespecial #68                 // Method java/util/ArrayList."<init>":()V
     137: checkcast     #70                 // class java/util/List
     140: astore        12
     142: aload         9
     144: astore        13
     146: iconst_0
     147: istore        14
     149: iconst_0
     150: istore        15
     152: aload         13
     154: invokeinterface #76,  1           // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
     159: astore        16
     161: aload         16
     163: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     168: ifeq          270
     171: aload         16
     173: invokeinterface #86,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     178: astore        17
     180: iload         15
     182: iinc          15, 1
     185: istore        18
     187: iload         18
     189: ifge          195
     192: invokestatic  #91                 // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
     195: iload         18
     197: aload         17
     199: checkcast     #93                 // class java/lang/String
     202: astore        19
     204: istore        20
     206: iconst_0
     207: istore        21
     209: aload         12
     211: new           #95                 // class Day3Runner$Rucksack
     214: dup
     215: aload         19
     217: invokespecial #96                 // Method Day3Runner$Rucksack."<init>":(Ljava/lang/String;)V
     220: invokeinterface #100,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     225: pop
     226: iload         20
     228: iconst_1
     229: iadd
     230: iconst_3
     231: irem
     232: ifne          265
     235: aload         11
     237: new           #102                // class Day3Runner$Group
     240: dup
     241: aload         12
     243: checkcast     #104                // class java/lang/Iterable
     246: invokestatic  #108                // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;
     249: invokespecial #111                // Method Day3Runner$Group."<init>":(Ljava/util/List;)V
     252: invokeinterface #100,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     257: pop
     258: aload         12
     260: invokeinterface #114,  1          // InterfaceMethod java/util/List.clear:()V
     265: nop
     266: nop
     267: goto          161
     270: nop
     271: aload         11
     273: checkcast     #104                // class java/lang/Iterable
     276: astore        14
     278: iconst_0
     279: istore        15
     281: aload         14
     283: astore        16
     285: new           #67                 // class java/util/ArrayList
     288: dup
     289: aload         14
     291: bipush        10
     293: invokestatic  #118                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     296: invokespecial #121                // Method java/util/ArrayList."<init>":(I)V
     299: checkcast     #123                // class java/util/Collection
     302: astore        17
     304: iconst_0
     305: istore        18
     307: aload         16
     309: invokeinterface #124,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     314: astore        19
     316: aload         19
     318: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     323: ifeq          372
     326: aload         19
     328: invokeinterface #86,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     333: astore        20
     335: aload         17
     337: aload         20
     339: checkcast     #102                // class Day3Runner$Group
     342: astore        21
     344: astore        22
     346: iconst_0
     347: istore        23
     349: aload         21
     351: invokevirtual #128                // Method Day3Runner$Group.determineBadgeItem:()LDay3Runner$Item;
     354: invokevirtual #134                // Method Day3Runner$Item.priority:()I
     357: invokestatic  #140                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     360: aload         22
     362: swap
     363: invokeinterface #141,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     368: pop
     369: goto          316
     372: aload         17
     374: checkcast     #70                 // class java/util/List
     377: nop
     378: checkcast     #104                // class java/lang/Iterable
     381: invokestatic  #108                // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;
     384: checkcast     #104                // class java/lang/Iterable
     387: invokestatic  #145                // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
     390: istore        13
     392: getstatic     #151                // Field java/lang/System.out:Ljava/io/PrintStream;
     395: iload         13
     397: invokevirtual #156                // Method java/io/PrintStream.println:(I)V
     400: nop
     401: getstatic     #162                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
     404: astore        7
     406: aload         5
     408: aload         6
     410: invokestatic  #168                // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     413: goto          437
     416: astore        8
     418: aload         8
     420: astore        6
     422: aload         8
     424: athrow
     425: astore        8
     427: aload         5
     429: aload         6
     431: invokestatic  #168                // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     434: aload         8
     436: athrow
     437: nop
     438: return
    Exception table:
       from    to  target type
          97   406   416   Class java/lang/Throwable
          97   406   425   any
         416   425   425   any
         425   427   425   any
}


import Day2.Choice.ChoiceCategory.*
import Day2.Outcome.WDL.*
import java.nio.file.Files
import java.nio.file.Path

fun main(args: Array<String>) {
    Day2().run(Path.of("src/main/resources/day2/input.txt"))
}

class Day2 {

    fun run(input: Path) {
        val scores = Files.lines(input).map {
            val split = it.split(" ")
            return@map Turn(Choice.valueOf(split[0]), Outcome.valueOf(split[1])).ourScore()
        }.toList();

        println(scores.sum())
    }

    data class Turn(val theirChoice: Choice, val outcome: Outcome) {
        fun ourScore(): Int = outcome.score() + theirChoice.determineOurChoice(outcome).choiceCategory.score()
    }

    enum class Choice(val choiceCategory: ChoiceCategory) {
        A(ROCK),
        B(PAPER),
        C(SCISSORS);

        fun determineOurChoice(outcome: Outcome): Choice = when (outcome.wdl) {
                WIN -> when (this.choiceCategory) {
                    ROCK -> B
                    PAPER -> C
                    SCISSORS -> A
                }
                DRAW -> this
                LOSE -> when (this.choiceCategory) {
                    ROCK -> C
                    PAPER -> A
                    SCISSORS -> B
                }
            }

        enum class ChoiceCategory {
            ROCK, PAPER, SCISSORS;

            fun score(): Int = when (this) {
                ROCK -> 1
                PAPER -> 2
                SCISSORS -> 3
            }
        }
    }

    enum class Outcome(val wdl: WDL) {
        X(LOSE),
        Y(DRAW),
        Z(WIN);

        fun score(): Int = when(this.wdl) {
            LOSE -> 0
            DRAW -> 3
            WIN -> 6
        }

        enum class WDL {
            WIN, DRAW, LOSE
        }
    }
}

Compiled from "Day2.kt"
public final class Day2$Choice$WhenMappings {
  public static final int[] $EnumSwitchMapping$0;

  public static final int[] $EnumSwitchMapping$1;

  static {};
    Code:
       0: invokestatic  #14                 // Method Day2$Choice$ChoiceCategory.values:()[LDay2$Choice$ChoiceCategory;
       3: arraylength
       4: newarray       int
       6: astore_0
       7: nop
       8: aload_0
       9: getstatic     #18                 // Field Day2$Choice$ChoiceCategory.ROCK:LDay2$Choice$ChoiceCategory;
      12: invokevirtual #22                 // Method Day2$Choice$ChoiceCategory.ordinal:()I
      15: iconst_1
      16: iastore
      17: goto          21
      20: astore_1
      21: nop
      22: aload_0
      23: getstatic     #25                 // Field Day2$Choice$ChoiceCategory.PAPER:LDay2$Choice$ChoiceCategory;
      26: invokevirtual #22                 // Method Day2$Choice$ChoiceCategory.ordinal:()I
      29: iconst_2
      30: iastore
      31: goto          35
      34: astore_1
      35: nop
      36: aload_0
      37: getstatic     #28                 // Field Day2$Choice$ChoiceCategory.SCISSORS:LDay2$Choice$ChoiceCategory;
      40: invokevirtual #22                 // Method Day2$Choice$ChoiceCategory.ordinal:()I
      43: iconst_3
      44: iastore
      45: goto          49
      48: astore_1
      49: aload_0
      50: putstatic     #32                 // Field $EnumSwitchMapping$0:[I
      53: invokestatic  #37                 // Method Day2$Outcome$WDL.values:()[LDay2$Outcome$WDL;
      56: arraylength
      57: newarray       int
      59: astore_0
      60: nop
      61: aload_0
      62: getstatic     #41                 // Field Day2$Outcome$WDL.WIN:LDay2$Outcome$WDL;
      65: invokevirtual #42                 // Method Day2$Outcome$WDL.ordinal:()I
      68: iconst_1
      69: iastore
      70: goto          74
      73: astore_1
      74: nop
      75: aload_0
      76: getstatic     #45                 // Field Day2$Outcome$WDL.DRAW:LDay2$Outcome$WDL;
      79: invokevirtual #42                 // Method Day2$Outcome$WDL.ordinal:()I
      82: iconst_2
      83: iastore
      84: goto          88
      87: astore_1
      88: nop
      89: aload_0
      90: getstatic     #48                 // Field Day2$Outcome$WDL.LOSE:LDay2$Outcome$WDL;
      93: invokevirtual #42                 // Method Day2$Outcome$WDL.ordinal:()I
      96: iconst_3
      97: iastore
      98: goto          102
     101: astore_1
     102: aload_0
     103: putstatic     #51                 // Field $EnumSwitchMapping$1:[I
     106: return
    Exception table:
       from    to  target type
           7    17    20   Class java/lang/NoSuchFieldError
          21    31    34   Class java/lang/NoSuchFieldError
          35    45    48   Class java/lang/NoSuchFieldError
          60    70    73   Class java/lang/NoSuchFieldError
          74    84    87   Class java/lang/NoSuchFieldError
          88    98   101   Class java/lang/NoSuchFieldError
}

Compiled from "Day2.kt"
public final class Day2$Turn {
  private final Day2$Choice theirChoice;

  private final Day2$Outcome outcome;

  public Day2$Turn(Day2$Choice, Day2$Outcome);
    Code:
       0: aload_1
       1: ldc           #9                  // String theirChoice
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #17                 // String outcome
       9: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_0
      13: invokespecial #20                 // Method java/lang/Object."<init>":()V
      16: aload_0
      17: aload_1
      18: putfield      #23                 // Field theirChoice:LDay2$Choice;
      21: aload_0
      22: aload_2
      23: putfield      #26                 // Field outcome:LDay2$Outcome;
      26: return

  public final Day2$Choice getTheirChoice();
    Code:
       0: aload_0
       1: getfield      #23                 // Field theirChoice:LDay2$Choice;
       4: areturn

  public final Day2$Outcome getOutcome();
    Code:
       0: aload_0
       1: getfield      #26                 // Field outcome:LDay2$Outcome;
       4: areturn

  public final int ourScore();
    Code:
       0: aload_0
       1: getfield      #26                 // Field outcome:LDay2$Outcome;
       4: invokevirtual #39                 // Method Day2$Outcome.score:()I
       7: aload_0
       8: getfield      #23                 // Field theirChoice:LDay2$Choice;
      11: aload_0
      12: getfield      #26                 // Field outcome:LDay2$Outcome;
      15: invokevirtual #45                 // Method Day2$Choice.determineOurChoice:(LDay2$Outcome;)LDay2$Choice;
      18: invokevirtual #49                 // Method Day2$Choice.getChoiceCategory:()LDay2$Choice$ChoiceCategory;
      21: invokevirtual #52                 // Method Day2$Choice$ChoiceCategory.score:()I
      24: iadd
      25: ireturn

  public final Day2$Choice component1();
    Code:
       0: aload_0
       1: getfield      #23                 // Field theirChoice:LDay2$Choice;
       4: areturn

  public final Day2$Outcome component2();
    Code:
       0: aload_0
       1: getfield      #26                 // Field outcome:LDay2$Outcome;
       4: areturn

  public final Day2$Turn copy(Day2$Choice, Day2$Outcome);
    Code:
       0: aload_1
       1: ldc           #9                  // String theirChoice
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #17                 // String outcome
       9: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: new           #2                  // class Day2$Turn
      15: dup
      16: aload_1
      17: aload_2
      18: invokespecial #58                 // Method "<init>":(LDay2$Choice;LDay2$Outcome;)V
      21: areturn

  public static Day2$Turn copy$default(Day2$Turn, Day2$Choice, Day2$Outcome, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #23                 // Field theirChoice:LDay2$Choice;
      10: astore_1
      11: iload_3
      12: iconst_2
      13: iand
      14: ifeq          22
      17: aload_0
      18: getfield      #26                 // Field outcome:LDay2$Outcome;
      21: astore_2
      22: aload_0
      23: aload_1
      24: aload_2
      25: invokevirtual #62                 // Method copy:(LDay2$Choice;LDay2$Outcome;)LDay2$Turn;
      28: areturn

  public java.lang.String toString();
    Code:
       0: new           #66                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #67                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #69                 // String Turn(theirChoice=
       9: invokevirtual #73                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #23                 // Field theirChoice:LDay2$Choice;
      16: invokevirtual #76                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      19: ldc           #78                 // String , outcome=
      21: invokevirtual #73                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #26                 // Field outcome:LDay2$Outcome;
      28: invokevirtual #76                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #81                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #83                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      39: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #23                 // Field theirChoice:LDay2$Choice;
       4: invokevirtual #86                 // Method Day2$Choice.hashCode:()I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #26                 // Field outcome:LDay2$Outcome;
      16: invokevirtual #87                 // Method Day2$Outcome.hashCode:()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 Day2$Turn
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day2$Turn
      20: astore_2
      21: aload_0
      22: getfield      #23                 // Field theirChoice:LDay2$Choice;
      25: aload_2
      26: getfield      #23                 // Field theirChoice:LDay2$Choice;
      29: if_acmpeq     34
      32: iconst_0
      33: ireturn
      34: aload_0
      35: getfield      #26                 // Field outcome:LDay2$Outcome;
      38: aload_2
      39: getfield      #26                 // Field outcome:LDay2$Outcome;
      42: if_acmpeq     47
      45: iconst_0
      46: ireturn
      47: iconst_1
      48: ireturn
}

Compiled from "Day2.kt"
public final class Day2$Outcome extends java.lang.Enum<Day2$Outcome> {
  private final Day2$Outcome$WDL wdl;

  public static final Day2$Outcome X;

  public static final Day2$Outcome Y;

  public static final Day2$Outcome Z;

  private static final Day2$Outcome[] $VALUES;

  private static final kotlin.enums.EnumEntries $ENTRIES;

  private Day2$Outcome(Day2$Outcome$WDL);
    Code:
       0: aload_0
       1: aload_1
       2: iload_2
       3: invokespecial #11                 // Method java/lang/Enum."<init>":(Ljava/lang/String;I)V
       6: aload_0
       7: aload_3
       8: putfield      #15                 // Field wdl:LDay2$Outcome$WDL;
      11: return

  public final Day2$Outcome$WDL getWdl();
    Code:
       0: aload_0
       1: getfield      #15                 // Field wdl:LDay2$Outcome$WDL;
       4: areturn

  public final int score();
    Code:
       0: aload_0
       1: getfield      #15                 // Field wdl:LDay2$Outcome$WDL;
       4: getstatic     #32                 // Field Day2$Outcome$WhenMappings.$EnumSwitchMapping$0:[I
       7: swap
       8: invokevirtual #37                 // Method Day2$Outcome$WDL.ordinal:()I
      11: iaload
      12: tableswitch   { // 1 to 3
                     1: 40
                     2: 44
                     3: 48
               default: 53
          }
      40: iconst_0
      41: goto          61
      44: iconst_3
      45: goto          61
      48: bipush        6
      50: goto          61
      53: new           #39                 // class kotlin/NoWhenBranchMatchedException
      56: dup
      57: invokespecial #42                 // Method kotlin/NoWhenBranchMatchedException."<init>":()V
      60: athrow
      61: ireturn

  public static Day2$Outcome[] values();
    Code:
       0: getstatic     #48                 // Field $VALUES:[LDay2$Outcome;
       3: invokevirtual #54                 // Method java/lang/Object.clone:()Ljava/lang/Object;
       6: checkcast     #55                 // class "[LDay2$Outcome;"
       9: areturn

  public static Day2$Outcome valueOf(java.lang.String);
    Code:
       0: ldc           #2                  // class Day2$Outcome
       2: aload_0
       3: invokestatic  #60                 // Method java/lang/Enum.valueOf:(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
       6: checkcast     #2                  // class Day2$Outcome
       9: areturn

  public static kotlin.enums.EnumEntries<Day2$Outcome> getEntries();
    Code:
       0: getstatic     #68                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
       3: areturn

  private static final Day2$Outcome[] $values();
    Code:
       0: iconst_3
       1: anewarray     #2                  // class Day2$Outcome
       4: astore_0
       5: aload_0
       6: iconst_0
       7: getstatic     #72                 // Field X:LDay2$Outcome;
      10: aastore
      11: aload_0
      12: iconst_1
      13: getstatic     #75                 // Field Y:LDay2$Outcome;
      16: aastore
      17: aload_0
      18: iconst_2
      19: getstatic     #78                 // Field Z:LDay2$Outcome;
      22: aastore
      23: aload_0
      24: areturn

  static {};
    Code:
       0: new           #2                  // class Day2$Outcome
       3: dup
       4: ldc           #80                 // String X
       6: iconst_0
       7: getstatic     #83                 // Field Day2$Outcome$WDL.LOSE:LDay2$Outcome$WDL;
      10: invokespecial #85                 // Method "<init>":(Ljava/lang/String;ILDay2$Outcome$WDL;)V
      13: putstatic     #72                 // Field X:LDay2$Outcome;
      16: new           #2                  // class Day2$Outcome
      19: dup
      20: ldc           #86                 // String Y
      22: iconst_1
      23: getstatic     #89                 // Field Day2$Outcome$WDL.DRAW:LDay2$Outcome$WDL;
      26: invokespecial #85                 // Method "<init>":(Ljava/lang/String;ILDay2$Outcome$WDL;)V
      29: putstatic     #75                 // Field Y:LDay2$Outcome;
      32: new           #2                  // class Day2$Outcome
      35: dup
      36: ldc           #90                 // String Z
      38: iconst_2
      39: getstatic     #93                 // Field Day2$Outcome$WDL.WIN:LDay2$Outcome$WDL;
      42: invokespecial #85                 // Method "<init>":(Ljava/lang/String;ILDay2$Outcome$WDL;)V
      45: putstatic     #78                 // Field Z:LDay2$Outcome;
      48: invokestatic  #95                 // Method $values:()[LDay2$Outcome;
      51: putstatic     #48                 // Field $VALUES:[LDay2$Outcome;
      54: getstatic     #48                 // Field $VALUES:[LDay2$Outcome;
      57: checkcast     #97                 // class "[Ljava/lang/Enum;"
      60: invokestatic  #103                // Method kotlin/enums/EnumEntriesKt.enumEntries:([Ljava/lang/Enum;)Lkotlin/enums/EnumEntries;
      63: putstatic     #68                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
      66: return
}

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

  public final void run(java.nio.file.Path);
    Code:
       0: aload_1
       1: ldc           #15                 // String input
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokestatic  #27                 // Method java/nio/file/Files.lines:(Ljava/nio/file/Path;)Ljava/util/stream/Stream;
      10: invokedynamic #46,  0             // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      15: invokedynamic #57,  0             // InvokeDynamic #1:apply:(Lkotlin/jvm/functions/Function1;)Ljava/util/function/Function;
      20: invokeinterface #63,  2           // InterfaceMethod java/util/stream/Stream.map:(Ljava/util/function/Function;)Ljava/util/stream/Stream;
      25: invokeinterface #67,  1           // InterfaceMethod java/util/stream/Stream.toList:()Ljava/util/List;
      30: astore_2
      31: aload_2
      32: invokestatic  #71                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      35: aload_2
      36: checkcast     #73                 // class java/lang/Iterable
      39: invokestatic  #79                 // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
      42: istore_3
      43: getstatic     #85                 // Field java/lang/System.out:Ljava/io/PrintStream;
      46: iload_3
      47: invokevirtual #91                 // Method java/io/PrintStream.println:(I)V
      50: return

  private static final java.lang.Integer run$lambda$0(java.lang.String);
    Code:
       0: aload_0
       1: invokestatic  #71                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
       4: aload_0
       5: checkcast     #96                 // class java/lang/CharSequence
       8: iconst_1
       9: anewarray     #98                 // class java/lang/String
      12: astore_2
      13: aload_2
      14: iconst_0
      15: ldc           #100                // String
      17: aastore
      18: aload_2
      19: iconst_0
      20: iconst_0
      21: bipush        6
      23: aconst_null
      24: invokestatic  #106                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      27: astore_1
      28: new           #108                // class Day2$Turn
      31: dup
      32: aload_1
      33: iconst_0
      34: invokeinterface #114,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      39: checkcast     #98                 // class java/lang/String
      42: invokestatic  #120                // Method Day2$Choice.valueOf:(Ljava/lang/String;)LDay2$Choice;
      45: aload_1
      46: iconst_1
      47: invokeinterface #114,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      52: checkcast     #98                 // class java/lang/String
      55: invokestatic  #125                // Method Day2$Outcome.valueOf:(Ljava/lang/String;)LDay2$Outcome;
      58: invokespecial #128                // Method Day2$Turn."<init>":(LDay2$Choice;LDay2$Outcome;)V
      61: invokevirtual #132                // Method Day2$Turn.ourScore:()I
      64: invokestatic  #137                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      67: areturn

  private static final java.lang.Integer run$lambda$1(kotlin.jvm.functions.Function1, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: invokeinterface #144,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
       7: checkcast     #134                // class java/lang/Integer
      10: areturn
}

Compiled from "Day2.kt"
public final class Day2$Outcome$WDL extends java.lang.Enum<Day2$Outcome$WDL> {
  public static final Day2$Outcome$WDL WIN;

  public static final Day2$Outcome$WDL DRAW;

  public static final Day2$Outcome$WDL LOSE;

  private static final Day2$Outcome$WDL[] $VALUES;

  private static final kotlin.enums.EnumEntries $ENTRIES;

  private Day2$Outcome$WDL();
    Code:
       0: aload_0
       1: aload_1
       2: iload_2
       3: invokespecial #10                 // Method java/lang/Enum."<init>":(Ljava/lang/String;I)V
       6: return

  public static Day2$Outcome$WDL[] values();
    Code:
       0: getstatic     #22                 // Field $VALUES:[LDay2$Outcome$WDL;
       3: invokevirtual #28                 // Method java/lang/Object.clone:()Ljava/lang/Object;
       6: checkcast     #29                 // class "[LDay2$Outcome$WDL;"
       9: areturn

  public static Day2$Outcome$WDL valueOf(java.lang.String);
    Code:
       0: ldc           #2                  // class Day2$Outcome$WDL
       2: aload_0
       3: invokestatic  #34                 // Method java/lang/Enum.valueOf:(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
       6: checkcast     #2                  // class Day2$Outcome$WDL
       9: areturn

  public static kotlin.enums.EnumEntries<Day2$Outcome$WDL> getEntries();
    Code:
       0: getstatic     #43                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
       3: areturn

  private static final Day2$Outcome$WDL[] $values();
    Code:
       0: iconst_3
       1: anewarray     #2                  // class Day2$Outcome$WDL
       4: astore_0
       5: aload_0
       6: iconst_0
       7: getstatic     #47                 // Field WIN:LDay2$Outcome$WDL;
      10: aastore
      11: aload_0
      12: iconst_1
      13: getstatic     #50                 // Field DRAW:LDay2$Outcome$WDL;
      16: aastore
      17: aload_0
      18: iconst_2
      19: getstatic     #53                 // Field LOSE:LDay2$Outcome$WDL;
      22: aastore
      23: aload_0
      24: areturn

  static {};
    Code:
       0: new           #2                  // class Day2$Outcome$WDL
       3: dup
       4: ldc           #55                 // String WIN
       6: iconst_0
       7: invokespecial #56                 // Method "<init>":(Ljava/lang/String;I)V
      10: putstatic     #47                 // Field WIN:LDay2$Outcome$WDL;
      13: new           #2                  // class Day2$Outcome$WDL
      16: dup
      17: ldc           #57                 // String DRAW
      19: iconst_1
      20: invokespecial #56                 // Method "<init>":(Ljava/lang/String;I)V
      23: putstatic     #50                 // Field DRAW:LDay2$Outcome$WDL;
      26: new           #2                  // class Day2$Outcome$WDL
      29: dup
      30: ldc           #58                 // String LOSE
      32: iconst_2
      33: invokespecial #56                 // Method "<init>":(Ljava/lang/String;I)V
      36: putstatic     #53                 // Field LOSE:LDay2$Outcome$WDL;
      39: invokestatic  #60                 // Method $values:()[LDay2$Outcome$WDL;
      42: putstatic     #22                 // Field $VALUES:[LDay2$Outcome$WDL;
      45: getstatic     #22                 // Field $VALUES:[LDay2$Outcome$WDL;
      48: checkcast     #62                 // class "[Ljava/lang/Enum;"
      51: invokestatic  #68                 // Method kotlin/enums/EnumEntriesKt.enumEntries:([Ljava/lang/Enum;)Lkotlin/enums/EnumEntries;
      54: putstatic     #43                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
      57: return
}

Compiled from "Day2.kt"
public final class Day2Kt {
  public static final void main(java.lang.String[]);
    Code:
       0: aload_0
       1: ldc           #9                  // String args
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #17                 // class Day2
       9: dup
      10: invokespecial #21                 // Method Day2."<init>":()V
      13: ldc           #23                 // String src/main/resources/day2/input.txt
      15: iconst_0
      16: anewarray     #25                 // class java/lang/String
      19: invokestatic  #31                 // InterfaceMethod java/nio/file/Path.of:(Ljava/lang/String;[Ljava/lang/String;)Ljava/nio/file/Path;
      22: dup
      23: ldc           #33                 // String of(...)
      25: invokestatic  #36                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      28: invokevirtual #40                 // Method Day2.run:(Ljava/nio/file/Path;)V
      31: return
}

Compiled from "Day2.kt"
public final class Day2$Choice$ChoiceCategory extends java.lang.Enum<Day2$Choice$ChoiceCategory> {
  public static final Day2$Choice$ChoiceCategory ROCK;

  public static final Day2$Choice$ChoiceCategory PAPER;

  public static final Day2$Choice$ChoiceCategory SCISSORS;

  private static final Day2$Choice$ChoiceCategory[] $VALUES;

  private static final kotlin.enums.EnumEntries $ENTRIES;

  private Day2$Choice$ChoiceCategory();
    Code:
       0: aload_0
       1: aload_1
       2: iload_2
       3: invokespecial #10                 // Method java/lang/Enum."<init>":(Ljava/lang/String;I)V
       6: return

  public final int score();
    Code:
       0: aload_0
       1: getstatic     #24                 // Field Day2$Choice$ChoiceCategory$WhenMappings.$EnumSwitchMapping$0:[I
       4: swap
       5: invokevirtual #27                 // Method ordinal:()I
       8: iaload
       9: tableswitch   { // 1 to 3
                     1: 36
                     2: 40
                     3: 44
               default: 48
          }
      36: iconst_1
      37: goto          56
      40: iconst_2
      41: goto          56
      44: iconst_3
      45: goto          56
      48: new           #29                 // class kotlin/NoWhenBranchMatchedException
      51: dup
      52: invokespecial #31                 // Method kotlin/NoWhenBranchMatchedException."<init>":()V
      55: athrow
      56: ireturn

  public static Day2$Choice$ChoiceCategory[] values();
    Code:
       0: getstatic     #37                 // Field $VALUES:[LDay2$Choice$ChoiceCategory;
       3: invokevirtual #43                 // Method java/lang/Object.clone:()Ljava/lang/Object;
       6: checkcast     #44                 // class "[LDay2$Choice$ChoiceCategory;"
       9: areturn

  public static Day2$Choice$ChoiceCategory valueOf(java.lang.String);
    Code:
       0: ldc           #2                  // class Day2$Choice$ChoiceCategory
       2: aload_0
       3: invokestatic  #49                 // Method java/lang/Enum.valueOf:(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
       6: checkcast     #2                  // class Day2$Choice$ChoiceCategory
       9: areturn

  public static kotlin.enums.EnumEntries<Day2$Choice$ChoiceCategory> getEntries();
    Code:
       0: getstatic     #58                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
       3: areturn

  private static final Day2$Choice$ChoiceCategory[] $values();
    Code:
       0: iconst_3
       1: anewarray     #2                  // class Day2$Choice$ChoiceCategory
       4: astore_0
       5: aload_0
       6: iconst_0
       7: getstatic     #62                 // Field ROCK:LDay2$Choice$ChoiceCategory;
      10: aastore
      11: aload_0
      12: iconst_1
      13: getstatic     #65                 // Field PAPER:LDay2$Choice$ChoiceCategory;
      16: aastore
      17: aload_0
      18: iconst_2
      19: getstatic     #68                 // Field SCISSORS:LDay2$Choice$ChoiceCategory;
      22: aastore
      23: aload_0
      24: areturn

  static {};
    Code:
       0: new           #2                  // class Day2$Choice$ChoiceCategory
       3: dup
       4: ldc           #70                 // String ROCK
       6: iconst_0
       7: invokespecial #71                 // Method "<init>":(Ljava/lang/String;I)V
      10: putstatic     #62                 // Field ROCK:LDay2$Choice$ChoiceCategory;
      13: new           #2                  // class Day2$Choice$ChoiceCategory
      16: dup
      17: ldc           #72                 // String PAPER
      19: iconst_1
      20: invokespecial #71                 // Method "<init>":(Ljava/lang/String;I)V
      23: putstatic     #65                 // Field PAPER:LDay2$Choice$ChoiceCategory;
      26: new           #2                  // class Day2$Choice$ChoiceCategory
      29: dup
      30: ldc           #73                 // String SCISSORS
      32: iconst_2
      33: invokespecial #71                 // Method "<init>":(Ljava/lang/String;I)V
      36: putstatic     #68                 // Field SCISSORS:LDay2$Choice$ChoiceCategory;
      39: invokestatic  #75                 // Method $values:()[LDay2$Choice$ChoiceCategory;
      42: putstatic     #37                 // Field $VALUES:[LDay2$Choice$ChoiceCategory;
      45: getstatic     #37                 // Field $VALUES:[LDay2$Choice$ChoiceCategory;
      48: checkcast     #77                 // class "[Ljava/lang/Enum;"
      51: invokestatic  #83                 // Method kotlin/enums/EnumEntriesKt.enumEntries:([Ljava/lang/Enum;)Lkotlin/enums/EnumEntries;
      54: putstatic     #58                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
      57: return
}

Compiled from "Day2.kt"
public final class Day2$Choice extends java.lang.Enum<Day2$Choice> {
  private final Day2$Choice$ChoiceCategory choiceCategory;

  public static final Day2$Choice A;

  public static final Day2$Choice B;

  public static final Day2$Choice C;

  private static final Day2$Choice[] $VALUES;

  private static final kotlin.enums.EnumEntries $ENTRIES;

  private Day2$Choice(Day2$Choice$ChoiceCategory);
    Code:
       0: aload_0
       1: aload_1
       2: iload_2
       3: invokespecial #11                 // Method java/lang/Enum."<init>":(Ljava/lang/String;I)V
       6: aload_0
       7: aload_3
       8: putfield      #15                 // Field choiceCategory:LDay2$Choice$ChoiceCategory;
      11: return

  public final Day2$Choice$ChoiceCategory getChoiceCategory();
    Code:
       0: aload_0
       1: getfield      #15                 // Field choiceCategory:LDay2$Choice$ChoiceCategory;
       4: areturn

  public final Day2$Choice determineOurChoice(Day2$Outcome);
    Code:
       0: aload_1
       1: ldc           #28                 // String outcome
       3: invokestatic  #34                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokevirtual #40                 // Method Day2$Outcome.getWdl:()LDay2$Outcome$WDL;
      10: getstatic     #46                 // Field Day2$Choice$WhenMappings.$EnumSwitchMapping$1:[I
      13: swap
      14: invokevirtual #52                 // Method Day2$Outcome$WDL.ordinal:()I
      17: iaload
      18: tableswitch   { // 1 to 3
                     1: 44
                     2: 110
                     3: 114
               default: 178
          }
      44: aload_0
      45: getfield      #15                 // Field choiceCategory:LDay2$Choice$ChoiceCategory;
      48: getstatic     #55                 // Field Day2$Choice$WhenMappings.$EnumSwitchMapping$0:[I
      51: swap
      52: invokevirtual #58                 // Method Day2$Choice$ChoiceCategory.ordinal:()I
      55: iaload
      56: tableswitch   { // 1 to 3
                     1: 84
                     2: 90
                     3: 96
               default: 102
          }
      84: getstatic     #61                 // Field B:LDay2$Choice;
      87: goto          186
      90: getstatic     #64                 // Field C:LDay2$Choice;
      93: goto          186
      96: getstatic     #67                 // Field A:LDay2$Choice;
      99: goto          186
     102: new           #69                 // class kotlin/NoWhenBranchMatchedException
     105: dup
     106: invokespecial #72                 // Method kotlin/NoWhenBranchMatchedException."<init>":()V
     109: athrow
     110: aload_0
     111: goto          186
     114: aload_0
     115: getfield      #15                 // Field choiceCategory:LDay2$Choice$ChoiceCategory;
     118: getstatic     #55                 // Field Day2$Choice$WhenMappings.$EnumSwitchMapping$0:[I
     121: swap
     122: invokevirtual #58                 // Method Day2$Choice$ChoiceCategory.ordinal:()I
     125: iaload
     126: tableswitch   { // 1 to 3
                     1: 152
                     2: 158
                     3: 164
               default: 170
          }
     152: getstatic     #64                 // Field C:LDay2$Choice;
     155: goto          186
     158: getstatic     #67                 // Field A:LDay2$Choice;
     161: goto          186
     164: getstatic     #61                 // Field B:LDay2$Choice;
     167: goto          186
     170: new           #69                 // class kotlin/NoWhenBranchMatchedException
     173: dup
     174: invokespecial #72                 // Method kotlin/NoWhenBranchMatchedException."<init>":()V
     177: athrow
     178: new           #69                 // class kotlin/NoWhenBranchMatchedException
     181: dup
     182: invokespecial #72                 // Method kotlin/NoWhenBranchMatchedException."<init>":()V
     185: athrow
     186: areturn

  public static Day2$Choice[] values();
    Code:
       0: getstatic     #79                 // Field $VALUES:[LDay2$Choice;
       3: invokevirtual #85                 // Method java/lang/Object.clone:()Ljava/lang/Object;
       6: checkcast     #86                 // class "[LDay2$Choice;"
       9: areturn

  public static Day2$Choice valueOf(java.lang.String);
    Code:
       0: ldc           #2                  // class Day2$Choice
       2: aload_0
       3: invokestatic  #91                 // Method java/lang/Enum.valueOf:(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
       6: checkcast     #2                  // class Day2$Choice
       9: areturn

  public static kotlin.enums.EnumEntries<Day2$Choice> getEntries();
    Code:
       0: getstatic     #99                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
       3: areturn

  private static final Day2$Choice[] $values();
    Code:
       0: iconst_3
       1: anewarray     #2                  // class Day2$Choice
       4: astore_0
       5: aload_0
       6: iconst_0
       7: getstatic     #67                 // Field A:LDay2$Choice;
      10: aastore
      11: aload_0
      12: iconst_1
      13: getstatic     #61                 // Field B:LDay2$Choice;
      16: aastore
      17: aload_0
      18: iconst_2
      19: getstatic     #64                 // Field C:LDay2$Choice;
      22: aastore
      23: aload_0
      24: areturn

  static {};
    Code:
       0: new           #2                  // class Day2$Choice
       3: dup
       4: ldc           #102                // String A
       6: iconst_0
       7: getstatic     #105                // Field Day2$Choice$ChoiceCategory.ROCK:LDay2$Choice$ChoiceCategory;
      10: invokespecial #107                // Method "<init>":(Ljava/lang/String;ILDay2$Choice$ChoiceCategory;)V
      13: putstatic     #67                 // Field A:LDay2$Choice;
      16: new           #2                  // class Day2$Choice
      19: dup
      20: ldc           #108                // String B
      22: iconst_1
      23: getstatic     #111                // Field Day2$Choice$ChoiceCategory.PAPER:LDay2$Choice$ChoiceCategory;
      26: invokespecial #107                // Method "<init>":(Ljava/lang/String;ILDay2$Choice$ChoiceCategory;)V
      29: putstatic     #61                 // Field B:LDay2$Choice;
      32: new           #2                  // class Day2$Choice
      35: dup
      36: ldc           #112                // String C
      38: iconst_2
      39: getstatic     #115                // Field Day2$Choice$ChoiceCategory.SCISSORS:LDay2$Choice$ChoiceCategory;
      42: invokespecial #107                // Method "<init>":(Ljava/lang/String;ILDay2$Choice$ChoiceCategory;)V
      45: putstatic     #64                 // Field C:LDay2$Choice;
      48: invokestatic  #117                // Method $values:()[LDay2$Choice;
      51: putstatic     #79                 // Field $VALUES:[LDay2$Choice;
      54: getstatic     #79                 // Field $VALUES:[LDay2$Choice;
      57: checkcast     #119                // class "[Ljava/lang/Enum;"
      60: invokestatic  #125                // Method kotlin/enums/EnumEntriesKt.enumEntries:([Ljava/lang/Enum;)Lkotlin/enums/EnumEntries;
      63: putstatic     #99                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
      66: return
}

Compiled from "Day2.kt"
public final class Day2$Outcome$WhenMappings {
  public static final int[] $EnumSwitchMapping$0;

  static {};
    Code:
       0: invokestatic  #14                 // Method Day2$Outcome$WDL.values:()[LDay2$Outcome$WDL;
       3: arraylength
       4: newarray       int
       6: astore_0
       7: nop
       8: aload_0
       9: getstatic     #18                 // Field Day2$Outcome$WDL.LOSE:LDay2$Outcome$WDL;
      12: invokevirtual #22                 // Method Day2$Outcome$WDL.ordinal:()I
      15: iconst_1
      16: iastore
      17: goto          21
      20: astore_1
      21: nop
      22: aload_0
      23: getstatic     #25                 // Field Day2$Outcome$WDL.DRAW:LDay2$Outcome$WDL;
      26: invokevirtual #22                 // Method Day2$Outcome$WDL.ordinal:()I
      29: iconst_2
      30: iastore
      31: goto          35
      34: astore_1
      35: nop
      36: aload_0
      37: getstatic     #28                 // Field Day2$Outcome$WDL.WIN:LDay2$Outcome$WDL;
      40: invokevirtual #22                 // Method Day2$Outcome$WDL.ordinal:()I
      43: iconst_3
      44: iastore
      45: goto          49
      48: astore_1
      49: aload_0
      50: putstatic     #32                 // Field $EnumSwitchMapping$0:[I
      53: return
    Exception table:
       from    to  target type
           7    17    20   Class java/lang/NoSuchFieldError
          21    31    34   Class java/lang/NoSuchFieldError
          35    45    48   Class java/lang/NoSuchFieldError
}

Compiled from "Day2.kt"
public final class Day2$Choice$ChoiceCategory$WhenMappings {
  public static final int[] $EnumSwitchMapping$0;

  static {};
    Code:
       0: invokestatic  #14                 // Method Day2$Choice$ChoiceCategory.values:()[LDay2$Choice$ChoiceCategory;
       3: arraylength
       4: newarray       int
       6: astore_0
       7: nop
       8: aload_0
       9: getstatic     #18                 // Field Day2$Choice$ChoiceCategory.ROCK:LDay2$Choice$ChoiceCategory;
      12: invokevirtual #22                 // Method Day2$Choice$ChoiceCategory.ordinal:()I
      15: iconst_1
      16: iastore
      17: goto          21
      20: astore_1
      21: nop
      22: aload_0
      23: getstatic     #25                 // Field Day2$Choice$ChoiceCategory.PAPER:LDay2$Choice$ChoiceCategory;
      26: invokevirtual #22                 // Method Day2$Choice$ChoiceCategory.ordinal:()I
      29: iconst_2
      30: iastore
      31: goto          35
      34: astore_1
      35: nop
      36: aload_0
      37: getstatic     #28                 // Field Day2$Choice$ChoiceCategory.SCISSORS:LDay2$Choice$ChoiceCategory;
      40: invokevirtual #22                 // Method Day2$Choice$ChoiceCategory.ordinal:()I
      43: iconst_3
      44: iastore
      45: goto          49
      48: astore_1
      49: aload_0
      50: putstatic     #32                 // Field $EnumSwitchMapping$0:[I
      53: return
    Exception table:
       from    to  target type
           7    17    20   Class java/lang/NoSuchFieldError
          21    31    34   Class java/lang/NoSuchFieldError
          35    45    48   Class java/lang/NoSuchFieldError
}