import java.io.File

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

    fun getItemPriority(item: Char): Int =
        if (item.isLowerCase()) {
            item.code - 96
        } else {
            item.code - 38
        }

    fun part1(input: List<String>): Int {
        var sumOfPriorities = 0
        for (line in input) {
            val numItemsInFirstRucksack = line.length / 2

            val itemsInFirstRucksack = line.take(numItemsInFirstRucksack).toSet()
            val seenInSecondRucksack = mutableSetOf<Char>()
            for (item in line.takeLast(numItemsInFirstRucksack)) {
                if (itemsInFirstRucksack.contains(item) and !seenInSecondRucksack.contains(item)) {
                    sumOfPriorities += getItemPriority(item)

                    seenInSecondRucksack.add(item)
                }
            }
        }

        return sumOfPriorities
    }

    fun part2(input: List<String>): Int {
        var sumOfPriorities = 0
        var group = arrayListOf<Set<Char>>()
        for (line in input) {
            group.add(line.toSet())

            if (group.size == 3) {
                val itemsCommonToAllRucksacks = group.reduce { acc, currRucksack -> acc.intersect(currRucksack) }
                val item = itemsCommonToAllRucksacks.first()
                sumOfPriorities += getItemPriority(item)

                group = arrayListOf()
            }
        }

        return sumOfPriorities
    }

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

Compiled from "Day03.kt"
public final class Day03Kt {
  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;)I
      10: istore_1
      11: getstatic     #22                 // Field java/lang/System.out:Ljava/io/PrintStream;
      14: iload_1
      15: invokevirtual #28                 // Method java/io/PrintStream.println:(I)V
      18: aload_0
      19: invokestatic  #31                 // Method main$part2:(Ljava/util/List;)I
      22: istore_1
      23: getstatic     #22                 // Field java/lang/System.out:Ljava/io/PrintStream;
      26: iload_1
      27: invokevirtual #28                 // Method java/io/PrintStream.println:(I)V
      30: 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/day03
       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 int main$getItemPriority(char);
    Code:
       0: iload_0
       1: invokestatic  #62                 // Method java/lang/Character.isLowerCase:(C)Z
       4: ifeq          14
       7: iload_0
       8: bipush        96
      10: isub
      11: goto          18
      14: iload_0
      15: bipush        38
      17: isub
      18: ireturn

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: iconst_0
       1: istore_1
       2: aload_0
       3: invokeinterface #71,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
       8: astore_2
       9: aload_2
      10: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      15: ifeq          159
      18: aload_2
      19: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      24: checkcast     #83                 // class java/lang/String
      27: astore_3
      28: aload_3
      29: invokevirtual #87                 // Method java/lang/String.length:()I
      32: iconst_2
      33: idiv
      34: istore        4
      36: aload_3
      37: iload         4
      39: invokestatic  #93                 // Method kotlin/text/StringsKt.take:(Ljava/lang/String;I)Ljava/lang/String;
      42: checkcast     #95                 // class java/lang/CharSequence
      45: invokestatic  #99                 // Method kotlin/text/StringsKt.toSet:(Ljava/lang/CharSequence;)Ljava/util/Set;
      48: astore        5
      50: new           #101                // class java/util/LinkedHashSet
      53: dup
      54: invokespecial #103                // Method java/util/LinkedHashSet."<init>":()V
      57: checkcast     #105                // class java/util/Set
      60: astore        6
      62: aload_3
      63: iload         4
      65: invokestatic  #108                // Method kotlin/text/StringsKt.takeLast:(Ljava/lang/String;I)Ljava/lang/String;
      68: astore        7
      70: iconst_0
      71: istore        8
      73: aload         7
      75: invokevirtual #87                 // Method java/lang/String.length:()I
      78: istore        9
      80: iload         8
      82: iload         9
      84: if_icmpge     9
      87: aload         7
      89: iload         8
      91: invokevirtual #112                // Method java/lang/String.charAt:(I)C
      94: istore        10
      96: aload         5
      98: iload         10
     100: invokestatic  #116                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     103: invokeinterface #120,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
     108: aload         6
     110: iload         10
     112: invokestatic  #116                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     115: invokeinterface #120,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
     120: ifne          127
     123: iconst_1
     124: goto          128
     127: iconst_0
     128: iand
     129: ifeq          153
     132: iload_1
     133: iload         10
     135: invokestatic  #122                // Method main$getItemPriority:(C)I
     138: iadd
     139: istore_1
     140: aload         6
     142: iload         10
     144: invokestatic  #116                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     147: invokeinterface #125,  2          // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
     152: pop
     153: iinc          8, 1
     156: goto          80
     159: iload_1
     160: ireturn

  private static final int main$part2(java.util.List<java.lang.String>);
    Code:
       0: iconst_0
       1: istore_1
       2: new           #134                // class java/util/ArrayList
       5: dup
       6: invokespecial #135                // Method java/util/ArrayList."<init>":()V
       9: astore_2
      10: aload_0
      11: invokeinterface #71,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      16: astore_3
      17: aload_3
      18: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      23: ifeq          197
      26: aload_3
      27: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      32: checkcast     #83                 // class java/lang/String
      35: astore        4
      37: aload_2
      38: aload         4
      40: checkcast     #95                 // class java/lang/CharSequence
      43: invokestatic  #99                 // Method kotlin/text/StringsKt.toSet:(Ljava/lang/CharSequence;)Ljava/util/Set;
      46: invokevirtual #136                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      49: pop
      50: aload_2
      51: invokevirtual #139                // Method java/util/ArrayList.size:()I
      54: iconst_3
      55: if_icmpne     17
      58: aload_2
      59: checkcast     #141                // class java/lang/Iterable
      62: astore        6
      64: iconst_0
      65: istore        7
      67: aload         6
      69: invokeinterface #142,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      74: astore        8
      76: aload         8
      78: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      83: ifne          96
      86: new           #144                // class java/lang/UnsupportedOperationException
      89: dup
      90: ldc           #146                // String Empty collection can\'t be reduced.
      92: invokespecial #149                // Method java/lang/UnsupportedOperationException."<init>":(Ljava/lang/String;)V
      95: athrow
      96: aload         8
      98: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     103: astore        9
     105: aload         8
     107: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     112: ifeq          155
     115: aload         9
     117: aload         8
     119: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     124: checkcast     #105                // class java/util/Set
     127: astore        10
     129: checkcast     #105                // class java/util/Set
     132: astore        11
     134: iconst_0
     135: istore        12
     137: aload         11
     139: checkcast     #141                // class java/lang/Iterable
     142: aload         10
     144: checkcast     #141                // class java/lang/Iterable
     147: invokestatic  #155                // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;
     150: astore        9
     152: goto          105
     155: aload         9
     157: checkcast     #105                // class java/util/Set
     160: astore        5
     162: aload         5
     164: checkcast     #141                // class java/lang/Iterable
     167: invokestatic  #159                // Method kotlin/collections/CollectionsKt.first:(Ljava/lang/Iterable;)Ljava/lang/Object;
     170: checkcast     #58                 // class java/lang/Character
     173: invokevirtual #163                // Method java/lang/Character.charValue:()C
     176: istore        6
     178: iload_1
     179: iload         6
     181: invokestatic  #122                // Method main$getItemPriority:(C)I
     184: iadd
     185: istore_1
     186: new           #134                // class java/util/ArrayList
     189: dup
     190: invokespecial #135                // Method java/util/ArrayList."<init>":()V
     193: astore_2
     194: goto          17
     197: iload_1
     198: ireturn
}


import java.io.File
import java.lang.IllegalArgumentException
import kotlin.math.abs

typealias Pos = Pair<Int, Int>

enum class Direction {
    UP,
    RIGHT,
    DOWN,
    LEFT,
}

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

    fun convertToDirection(dirStr: String): Direction =
        when (dirStr) {
            "U"  -> Direction.UP
            "R"  -> Direction.RIGHT
            "D"  -> Direction.DOWN
            "L"  -> Direction.LEFT
            else -> throw IllegalArgumentException("We should never get here")
        }

    fun moveHead(headPos: Pos, dir: Direction): Pos =
        when (dir) {
            Direction.UP    -> headPos.let { (x, y) -> Pair(x, y+1) }
            Direction.RIGHT -> headPos.let { (x, y) -> Pair(x+1, y) }
            Direction.DOWN  -> headPos.let { (x, y) -> Pair(x, y-1) }
            Direction.LEFT  -> headPos.let { (x, y) -> Pair(x-1, y) }
        }

    fun moveTail(headPos: Pos, tailPos: Pos): Pos {
        val horizontalDist = abs(headPos.first - tailPos.first)
        val verticalDist = abs(headPos.second - tailPos.second)

        return if ((horizontalDist == 2) or (verticalDist == 2)) {
            if (horizontalDist == 0) {
                tailPos.let { (x, y) -> Pair(x, (y + headPos.second).div(2)) }
            } else if (verticalDist == 0) {
                tailPos.let { (x, y) -> Pair((x + headPos.first).div(2), y) }
            } else if (horizontalDist == 1) {
                tailPos.let { (_, y) -> Pair(headPos.first, (y + headPos.second).div(2)) }
            } else if (verticalDist == 1) {
                tailPos.let { (x, _) -> Pair((x + headPos.first).div(2), headPos.second) }
            } else {
                tailPos.let { (x, y) -> Pair((x + headPos.first).div(2), (y + headPos.second).div(2)) }
            }
        } else {
            tailPos
        }
    }

    fun move(headPos: Pos, tailPos: Pos, dir: Direction): Pair<Pos, Pos> {
        val nextHeadPos = moveHead(headPos, dir)
        val nextTailPos = moveTail(nextHeadPos, tailPos)

        return Pair(nextHeadPos, nextTailPos)
    }

    fun part1(input: List<String>): Int {
        var currHeadPosition = Pair(0, 0)
        var currTailPosition = Pair(0, 0)
        val seenPositions = mutableSetOf(currTailPosition)
        for (line in input) {
            val (dir, steps) = line.split(" ").let { (dirStr, stepsStr, _) ->
                Pair(convertToDirection(dirStr), stepsStr.toInt())
            }

            repeat(steps) {
                val (nextHeadPosition, nextTailPosition) = move(currHeadPosition, currTailPosition, dir)
                currHeadPosition = nextHeadPosition
                currTailPosition = nextTailPosition

                seenPositions.add(currTailPosition)
            }
        }

        return seenPositions.count()
    }

    fun part2(input: List<String>): Int {
        val currPositions = MutableList(10) { Pair(0, 0) }
        val seenPositions = mutableSetOf(currPositions.last())
        for (line in input) {
            val (dir, steps) = line.split(" ").let { (dirStr, stepsStr, _) ->
                Pair(convertToDirection(dirStr), stepsStr.toInt())
            }

            repeat(steps) {
                currPositions[0] = moveHead(currPositions[0], dir)
                for (knotIndex in currPositions.indices.drop(1)) {
                    currPositions[knotIndex] = moveTail(currPositions[knotIndex-1], currPositions[knotIndex])
                }

                seenPositions.add(currPositions.last())
            }
        }

        return seenPositions.count()
    }

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

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

  static {};
    Code:
       0: invokestatic  #14                 // Method Direction.values:()[LDirection;
       3: arraylength
       4: newarray       int
       6: astore_0
       7: nop
       8: aload_0
       9: getstatic     #18                 // Field Direction.UP:LDirection;
      12: invokevirtual #22                 // Method Direction.ordinal:()I
      15: iconst_1
      16: iastore
      17: goto          21
      20: astore_1
      21: nop
      22: aload_0
      23: getstatic     #25                 // Field Direction.RIGHT:LDirection;
      26: invokevirtual #22                 // Method Direction.ordinal:()I
      29: iconst_2
      30: iastore
      31: goto          35
      34: astore_1
      35: nop
      36: aload_0
      37: getstatic     #28                 // Field Direction.DOWN:LDirection;
      40: invokevirtual #22                 // Method Direction.ordinal:()I
      43: iconst_3
      44: iastore
      45: goto          49
      48: astore_1
      49: nop
      50: aload_0
      51: getstatic     #31                 // Field Direction.LEFT:LDirection;
      54: invokevirtual #22                 // Method Direction.ordinal:()I
      57: iconst_4
      58: iastore
      59: goto          63
      62: astore_1
      63: aload_0
      64: putstatic     #35                 // Field $EnumSwitchMapping$0:[I
      67: 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
          49    59    62   Class java/lang/NoSuchFieldError
}

Compiled from "Day09.kt"
public final class Day09Kt {
  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;)I
      10: istore_1
      11: getstatic     #22                 // Field java/lang/System.out:Ljava/io/PrintStream;
      14: iload_1
      15: invokevirtual #28                 // Method java/io/PrintStream.println:(I)V
      18: aload_0
      19: invokestatic  #31                 // Method main$part2:(Ljava/util/List;)I
      22: istore_1
      23: getstatic     #22                 // Field java/lang/System.out:Ljava/io/PrintStream;
      26: iload_1
      27: invokevirtual #28                 // Method java/io/PrintStream.println:(I)V
      30: 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/day09
       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 Direction main$convertToDirection(java.lang.String);
    Code:
       0: aload_0
       1: astore_1
       2: aload_1
       3: invokevirtual #62                 // Method java/lang/String.hashCode:()I
       6: lookupswitch  { // 4
                    68: 60
                    76: 84
                    82: 48
                    85: 72
               default: 120
          }
      48: aload_1
      49: ldc           #64                 // String R
      51: invokevirtual #68                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
      54: ifne          102
      57: goto          120
      60: aload_1
      61: ldc           #70                 // String D
      63: invokevirtual #68                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
      66: ifne          108
      69: goto          120
      72: aload_1
      73: ldc           #72                 // String U
      75: invokevirtual #68                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
      78: ifne          96
      81: goto          120
      84: aload_1
      85: ldc           #74                 // String L
      87: invokevirtual #68                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
      90: ifne          114
      93: goto          120
      96: getstatic     #80                 // Field Direction.UP:LDirection;
      99: goto          130
     102: getstatic     #83                 // Field Direction.RIGHT:LDirection;
     105: goto          130
     108: getstatic     #86                 // Field Direction.DOWN:LDirection;
     111: goto          130
     114: getstatic     #89                 // Field Direction.LEFT:LDirection;
     117: goto          130
     120: new           #91                 // class java/lang/IllegalArgumentException
     123: dup
     124: ldc           #93                 // String We should never get here
     126: invokespecial #96                 // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
     129: athrow
     130: areturn

  private static final kotlin.Pair<java.lang.Integer, java.lang.Integer> main$moveHead(kotlin.Pair<java.lang.Integer, java.lang.Integer>, Direction);
    Code:
       0: aload_1
       1: getstatic     #106                // Field Day09Kt$WhenMappings.$EnumSwitchMapping$0:[I
       4: swap
       5: invokevirtual #109                // Method Direction.ordinal:()I
       8: iaload
       9: tableswitch   { // 1 to 4
                     1: 40
                     2: 90
                     3: 140
                     4: 190
               default: 240
          }
      40: aload_0
      41: astore_2
      42: iconst_0
      43: istore_3
      44: aload_2
      45: invokevirtual #115                // Method kotlin/Pair.component1:()Ljava/lang/Object;
      48: checkcast     #117                // class java/lang/Number
      51: invokevirtual #120                // Method java/lang/Number.intValue:()I
      54: istore        4
      56: aload_2
      57: invokevirtual #123                // Method kotlin/Pair.component2:()Ljava/lang/Object;
      60: checkcast     #117                // class java/lang/Number
      63: invokevirtual #120                // Method java/lang/Number.intValue:()I
      66: istore        5
      68: new           #111                // class kotlin/Pair
      71: dup
      72: iload         4
      74: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      77: iload         5
      79: iconst_1
      80: iadd
      81: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      84: invokespecial #132                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      87: goto          248
      90: aload_0
      91: astore_2
      92: iconst_0
      93: istore_3
      94: aload_2
      95: invokevirtual #115                // Method kotlin/Pair.component1:()Ljava/lang/Object;
      98: checkcast     #117                // class java/lang/Number
     101: invokevirtual #120                // Method java/lang/Number.intValue:()I
     104: istore        4
     106: aload_2
     107: invokevirtual #123                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     110: checkcast     #117                // class java/lang/Number
     113: invokevirtual #120                // Method java/lang/Number.intValue:()I
     116: istore        5
     118: new           #111                // class kotlin/Pair
     121: dup
     122: iload         4
     124: iconst_1
     125: iadd
     126: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     129: iload         5
     131: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     134: invokespecial #132                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     137: goto          248
     140: aload_0
     141: astore_2
     142: iconst_0
     143: istore_3
     144: aload_2
     145: invokevirtual #115                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     148: checkcast     #117                // class java/lang/Number
     151: invokevirtual #120                // Method java/lang/Number.intValue:()I
     154: istore        4
     156: aload_2
     157: invokevirtual #123                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     160: checkcast     #117                // class java/lang/Number
     163: invokevirtual #120                // Method java/lang/Number.intValue:()I
     166: istore        5
     168: new           #111                // class kotlin/Pair
     171: dup
     172: iload         4
     174: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     177: iload         5
     179: iconst_1
     180: isub
     181: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     184: invokespecial #132                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     187: goto          248
     190: aload_0
     191: astore_2
     192: iconst_0
     193: istore_3
     194: aload_2
     195: invokevirtual #115                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     198: checkcast     #117                // class java/lang/Number
     201: invokevirtual #120                // Method java/lang/Number.intValue:()I
     204: istore        4
     206: aload_2
     207: invokevirtual #123                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     210: checkcast     #117                // class java/lang/Number
     213: invokevirtual #120                // Method java/lang/Number.intValue:()I
     216: istore        5
     218: new           #111                // class kotlin/Pair
     221: dup
     222: iload         4
     224: iconst_1
     225: isub
     226: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     229: iload         5
     231: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     234: invokespecial #132                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     237: goto          248
     240: new           #134                // class kotlin/NoWhenBranchMatchedException
     243: dup
     244: invokespecial #136                // Method kotlin/NoWhenBranchMatchedException."<init>":()V
     247: athrow
     248: areturn

  private static final kotlin.Pair<java.lang.Integer, java.lang.Integer> main$moveTail(kotlin.Pair<java.lang.Integer, java.lang.Integer>, kotlin.Pair<java.lang.Integer, java.lang.Integer>);
    Code:
       0: aload_0
       1: invokevirtual #152                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
       4: checkcast     #117                // class java/lang/Number
       7: invokevirtual #120                // Method java/lang/Number.intValue:()I
      10: aload_1
      11: invokevirtual #152                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      14: checkcast     #117                // class java/lang/Number
      17: invokevirtual #120                // Method java/lang/Number.intValue:()I
      20: isub
      21: invokestatic  #158                // Method java/lang/Math.abs:(I)I
      24: istore_2
      25: aload_0
      26: invokevirtual #161                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      29: checkcast     #117                // class java/lang/Number
      32: invokevirtual #120                // Method java/lang/Number.intValue:()I
      35: aload_1
      36: invokevirtual #161                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      39: checkcast     #117                // class java/lang/Number
      42: invokevirtual #120                // Method java/lang/Number.intValue:()I
      45: isub
      46: invokestatic  #158                // Method java/lang/Math.abs:(I)I
      49: istore_3
      50: iload_2
      51: iconst_2
      52: if_icmpne     59
      55: iconst_1
      56: goto          60
      59: iconst_0
      60: iload_3
      61: iconst_2
      62: if_icmpne     69
      65: iconst_1
      66: goto          70
      69: iconst_0
      70: ior
      71: ifeq          402
      74: iload_2
      75: ifne          143
      78: aload_1
      79: astore        4
      81: iconst_0
      82: istore        5
      84: aload         4
      86: invokevirtual #115                // Method kotlin/Pair.component1:()Ljava/lang/Object;
      89: checkcast     #117                // class java/lang/Number
      92: invokevirtual #120                // Method java/lang/Number.intValue:()I
      95: istore        6
      97: aload         4
      99: invokevirtual #123                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     102: checkcast     #117                // class java/lang/Number
     105: invokevirtual #120                // Method java/lang/Number.intValue:()I
     108: istore        7
     110: new           #111                // class kotlin/Pair
     113: dup
     114: iload         6
     116: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     119: iload         7
     121: aload_0
     122: invokevirtual #161                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     125: checkcast     #117                // class java/lang/Number
     128: invokevirtual #120                // Method java/lang/Number.intValue:()I
     131: iadd
     132: iconst_2
     133: idiv
     134: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     137: invokespecial #132                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     140: goto          403
     143: iload_3
     144: ifne          212
     147: aload_1
     148: astore        4
     150: iconst_0
     151: istore        5
     153: aload         4
     155: invokevirtual #115                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     158: checkcast     #117                // class java/lang/Number
     161: invokevirtual #120                // Method java/lang/Number.intValue:()I
     164: istore        6
     166: aload         4
     168: invokevirtual #123                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     171: checkcast     #117                // class java/lang/Number
     174: invokevirtual #120                // Method java/lang/Number.intValue:()I
     177: istore        7
     179: new           #111                // class kotlin/Pair
     182: dup
     183: iload         6
     185: aload_0
     186: invokevirtual #152                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     189: checkcast     #117                // class java/lang/Number
     192: invokevirtual #120                // Method java/lang/Number.intValue:()I
     195: iadd
     196: iconst_2
     197: idiv
     198: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     201: iload         7
     203: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     206: invokespecial #132                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     209: goto          403
     212: iload_2
     213: iconst_1
     214: if_icmpne     268
     217: aload_1
     218: astore        4
     220: iconst_0
     221: istore        5
     223: aload         4
     225: invokevirtual #123                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     228: checkcast     #117                // class java/lang/Number
     231: invokevirtual #120                // Method java/lang/Number.intValue:()I
     234: istore        6
     236: new           #111                // class kotlin/Pair
     239: dup
     240: aload_0
     241: invokevirtual #152                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     244: iload         6
     246: aload_0
     247: invokevirtual #161                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     250: checkcast     #117                // class java/lang/Number
     253: invokevirtual #120                // Method java/lang/Number.intValue:()I
     256: iadd
     257: iconst_2
     258: idiv
     259: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     262: invokespecial #132                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     265: goto          403
     268: iload_3
     269: iconst_1
     270: if_icmpne     324
     273: aload_1
     274: astore        4
     276: iconst_0
     277: istore        5
     279: aload         4
     281: invokevirtual #115                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     284: checkcast     #117                // class java/lang/Number
     287: invokevirtual #120                // Method java/lang/Number.intValue:()I
     290: istore        6
     292: new           #111                // class kotlin/Pair
     295: dup
     296: iload         6
     298: aload_0
     299: invokevirtual #152                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     302: checkcast     #117                // class java/lang/Number
     305: invokevirtual #120                // Method java/lang/Number.intValue:()I
     308: iadd
     309: iconst_2
     310: idiv
     311: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     314: aload_0
     315: invokevirtual #161                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     318: invokespecial #132                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     321: goto          403
     324: aload_1
     325: astore        4
     327: iconst_0
     328: istore        5
     330: aload         4
     332: invokevirtual #115                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     335: checkcast     #117                // class java/lang/Number
     338: invokevirtual #120                // Method java/lang/Number.intValue:()I
     341: istore        6
     343: aload         4
     345: invokevirtual #123                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     348: checkcast     #117                // class java/lang/Number
     351: invokevirtual #120                // Method java/lang/Number.intValue:()I
     354: istore        7
     356: new           #111                // class kotlin/Pair
     359: dup
     360: iload         6
     362: aload_0
     363: invokevirtual #152                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     366: checkcast     #117                // class java/lang/Number
     369: invokevirtual #120                // Method java/lang/Number.intValue:()I
     372: iadd
     373: iconst_2
     374: idiv
     375: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     378: iload         7
     380: aload_0
     381: invokevirtual #161                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     384: checkcast     #117                // class java/lang/Number
     387: invokevirtual #120                // Method java/lang/Number.intValue:()I
     390: iadd
     391: iconst_2
     392: idiv
     393: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     396: invokespecial #132                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     399: goto          403
     402: aload_1
     403: areturn

  private static final kotlin.Pair<kotlin.Pair<java.lang.Integer, java.lang.Integer>, kotlin.Pair<java.lang.Integer, java.lang.Integer>> main$move(kotlin.Pair<java.lang.Integer, java.lang.Integer>, kotlin.Pair<java.lang.Integer, java.lang.Integer>, Direction);
    Code:
       0: aload_0
       1: aload_2
       2: invokestatic  #174                // Method main$moveHead:(Lkotlin/Pair;LDirection;)Lkotlin/Pair;
       5: astore_3
       6: aload_3
       7: aload_1
       8: invokestatic  #176                // Method main$moveTail:(Lkotlin/Pair;Lkotlin/Pair;)Lkotlin/Pair;
      11: astore        4
      13: new           #111                // class kotlin/Pair
      16: dup
      17: aload_3
      18: aload         4
      20: invokespecial #132                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      23: areturn

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: aconst_null
       1: astore_1
       2: new           #111                // class kotlin/Pair
       5: dup
       6: iconst_0
       7: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      10: iconst_0
      11: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      14: invokespecial #132                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      17: astore_1
      18: aconst_null
      19: astore_2
      20: new           #111                // class kotlin/Pair
      23: dup
      24: iconst_0
      25: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      28: iconst_0
      29: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      32: invokespecial #132                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      35: astore_2
      36: iconst_1
      37: anewarray     #111                // class kotlin/Pair
      40: astore        4
      42: aload         4
      44: iconst_0
      45: aload_2
      46: aastore
      47: aload         4
      49: invokestatic  #185                // Method kotlin/collections/SetsKt.mutableSetOf:([Ljava/lang/Object;)Ljava/util/Set;
      52: astore_3
      53: aload_0
      54: invokeinterface #191,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      59: astore        4
      61: aload         4
      63: invokeinterface #197,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      68: ifeq          254
      71: aload         4
      73: invokeinterface #200,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      78: checkcast     #58                 // class java/lang/String
      81: astore        5
      83: aload         5
      85: checkcast     #202                // class java/lang/CharSequence
      88: iconst_1
      89: anewarray     #58                 // class java/lang/String
      92: astore        7
      94: aload         7
      96: iconst_0
      97: ldc           #204                // String
      99: aastore
     100: aload         7
     102: iconst_0
     103: iconst_0
     104: bipush        6
     106: aconst_null
     107: invokestatic  #210                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     110: astore        8
     112: iconst_0
     113: istore        9
     115: aload         8
     117: iconst_0
     118: invokeinterface #214,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     123: checkcast     #58                 // class java/lang/String
     126: astore        10
     128: aload         8
     130: iconst_1
     131: invokeinterface #214,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     136: checkcast     #58                 // class java/lang/String
     139: astore        11
     141: new           #111                // class kotlin/Pair
     144: dup
     145: aload         10
     147: invokestatic  #216                // Method main$convertToDirection:(Ljava/lang/String;)LDirection;
     150: aload         11
     152: invokestatic  #220                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     155: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     158: invokespecial #132                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     161: nop
     162: astore        6
     164: aload         6
     166: invokevirtual #115                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     169: checkcast     #76                 // class Direction
     172: astore        7
     174: aload         6
     176: invokevirtual #123                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     179: checkcast     #117                // class java/lang/Number
     182: invokevirtual #120                // Method java/lang/Number.intValue:()I
     185: istore        8
     187: iconst_0
     188: istore        9
     190: iload         9
     192: iload         8
     194: if_icmpge     61
     197: iload         9
     199: istore        10
     201: iconst_0
     202: istore        11
     204: aload_1
     205: aload_2
     206: aload         7
     208: invokestatic  #222                // Method main$move:(Lkotlin/Pair;Lkotlin/Pair;LDirection;)Lkotlin/Pair;
     211: astore        12
     213: aload         12
     215: invokevirtual #115                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     218: checkcast     #111                // class kotlin/Pair
     221: astore        13
     223: aload         12
     225: invokevirtual #123                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     228: checkcast     #111                // class kotlin/Pair
     231: astore        14
     233: aload         13
     235: astore_1
     236: aload         14
     238: astore_2
     239: aload_3
     240: aload_2
     241: invokeinterface #227,  2          // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
     246: pop
     247: nop
     248: iinc          9, 1
     251: goto          190
     254: aload_3
     255: checkcast     #229                // class java/util/Collection
     258: invokeinterface #232,  1          // InterfaceMethod java/util/Collection.size:()I
     263: ireturn

  private static final int main$part2(java.util.List<java.lang.String>);
    Code:
       0: bipush        10
       2: istore_2
       3: new           #247                // class java/util/ArrayList
       6: dup
       7: iload_2
       8: invokespecial #249                // Method java/util/ArrayList."<init>":(I)V
      11: astore_3
      12: iconst_0
      13: istore        4
      15: iload         4
      17: iload_2
      18: if_icmpge     63
      21: iload         4
      23: istore        5
      25: aload_3
      26: iload         5
      28: istore        6
      30: astore        13
      32: iconst_0
      33: istore        7
      35: new           #111                // class kotlin/Pair
      38: dup
      39: iconst_0
      40: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      43: iconst_0
      44: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      47: invokespecial #132                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      50: aload         13
      52: swap
      53: invokevirtual #250                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      56: pop
      57: iinc          4, 1
      60: goto          15
      63: aload_3
      64: checkcast     #187                // class java/util/List
      67: astore_1
      68: iconst_1
      69: anewarray     #111                // class kotlin/Pair
      72: astore_3
      73: aload_3
      74: iconst_0
      75: aload_1
      76: invokestatic  #256                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
      79: aastore
      80: aload_3
      81: invokestatic  #185                // Method kotlin/collections/SetsKt.mutableSetOf:([Ljava/lang/Object;)Ljava/util/Set;
      84: astore_2
      85: aload_0
      86: invokeinterface #191,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      91: astore_3
      92: aload_3
      93: invokeinterface #197,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      98: ifeq          359
     101: aload_3
     102: invokeinterface #200,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     107: checkcast     #58                 // class java/lang/String
     110: astore        4
     112: aload         4
     114: checkcast     #202                // class java/lang/CharSequence
     117: iconst_1
     118: anewarray     #58                 // class java/lang/String
     121: astore        6
     123: aload         6
     125: iconst_0
     126: ldc           #204                // String
     128: aastore
     129: aload         6
     131: iconst_0
     132: iconst_0
     133: bipush        6
     135: aconst_null
     136: invokestatic  #210                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     139: astore        7
     141: iconst_0
     142: istore        8
     144: aload         7
     146: iconst_0
     147: invokeinterface #214,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     152: checkcast     #58                 // class java/lang/String
     155: astore        9
     157: aload         7
     159: iconst_1
     160: invokeinterface #214,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     165: checkcast     #58                 // class java/lang/String
     168: astore        10
     170: new           #111                // class kotlin/Pair
     173: dup
     174: aload         9
     176: invokestatic  #216                // Method main$convertToDirection:(Ljava/lang/String;)LDirection;
     179: aload         10
     181: invokestatic  #220                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     184: invokestatic  #129                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     187: invokespecial #132                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     190: nop
     191: astore        5
     193: aload         5
     195: invokevirtual #115                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     198: checkcast     #76                 // class Direction
     201: astore        6
     203: aload         5
     205: invokevirtual #123                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     208: checkcast     #117                // class java/lang/Number
     211: invokevirtual #120                // Method java/lang/Number.intValue:()I
     214: istore        7
     216: iconst_0
     217: istore        8
     219: iload         8
     221: iload         7
     223: if_icmpge     92
     226: iload         8
     228: istore        9
     230: iconst_0
     231: istore        10
     233: aload_1
     234: iconst_0
     235: aload_1
     236: iconst_0
     237: invokeinterface #214,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     242: checkcast     #111                // class kotlin/Pair
     245: aload         6
     247: invokestatic  #174                // Method main$moveHead:(Lkotlin/Pair;LDirection;)Lkotlin/Pair;
     250: invokeinterface #260,  3          // InterfaceMethod java/util/List.set:(ILjava/lang/Object;)Ljava/lang/Object;
     255: pop
     256: aload_1
     257: checkcast     #229                // class java/util/Collection
     260: invokestatic  #264                // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;
     263: checkcast     #266                // class java/lang/Iterable
     266: iconst_1
     267: invokestatic  #270                // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
     270: invokeinterface #191,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     275: astore        11
     277: aload         11
     279: invokeinterface #197,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     284: ifeq          341
     287: aload         11
     289: invokeinterface #200,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     294: checkcast     #117                // class java/lang/Number
     297: invokevirtual #120                // Method java/lang/Number.intValue:()I
     300: istore        12
     302: aload_1
     303: iload         12
     305: aload_1
     306: iload         12
     308: iconst_1
     309: isub
     310: invokeinterface #214,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     315: checkcast     #111                // class kotlin/Pair
     318: aload_1
     319: iload         12
     321: invokeinterface #214,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     326: checkcast     #111                // class kotlin/Pair
     329: invokestatic  #176                // Method main$moveTail:(Lkotlin/Pair;Lkotlin/Pair;)Lkotlin/Pair;
     332: invokeinterface #260,  3          // InterfaceMethod java/util/List.set:(ILjava/lang/Object;)Ljava/lang/Object;
     337: pop
     338: goto          277
     341: aload_2
     342: aload_1
     343: invokestatic  #256                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     346: invokeinterface #227,  2          // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
     351: pop
     352: nop
     353: iinc          8, 1
     356: goto          219
     359: aload_2
     360: checkcast     #229                // class java/util/Collection
     363: invokeinterface #232,  1          // InterfaceMethod java/util/Collection.size:()I
     368: ireturn
}


import java.io.File
import java.lang.IllegalArgumentException

enum class Result(val score: Int) {
    LOSE(0),
    DRAW(3),
    WIN(6),
}

enum class Move(val value: Int) {
    ROCK(1),
    PAPER(2),
    SCISSORS(3);

    fun against(other: Move): Result = when (other.value) {
        ((value + 1) % 3) + 1 -> Result.WIN
        value                 -> Result.DRAW
        else                  -> Result.LOSE
    }

    fun obtainsAgainst(result: Result): Move = when (result) {
        Result.WIN  -> fromValue((value % 3) + 1)
        Result.LOSE -> fromValue(((value + 1) % 3) + 1)
        else        -> this
    }

    companion object {
        fun fromValue(value: Int): Move = when (value) {
            1    -> ROCK
            2    -> PAPER
            3    -> SCISSORS
            else -> throw IllegalArgumentException("We should never get here")
        }
    }
}

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

    fun decryptMove(encryptedMove: String): Move = when (encryptedMove) {
        "A", "X" -> Move.ROCK
        "B", "Y" -> Move.PAPER
        "C", "Z" -> Move.SCISSORS
        else     -> throw IllegalArgumentException("We should never get here")
    }

    fun decryptResult(encryptedResult: String): Result = when (encryptedResult) {
        "X"  -> Result.LOSE
        "Y"  -> Result.DRAW
        "Z"  -> Result.WIN
        else -> throw IllegalArgumentException("We should never get here")
    }

    fun part1(input: List<String>): Int {
        var score = 0
        for (line in input) {
            val (theirMove, myMove, _) = line.split(" ").map { decryptMove(it) }
            score += myMove.value + myMove.against(theirMove).score
        }

        return score
    }

    fun part2(input: List<String>): Int {
        var score = 0
        for (line in input) {
            val (theirMove, myResult) = line.split(" ").let { (theirMoveStr, myResultStr, _) ->
                Pair(decryptMove(theirMoveStr), decryptResult(myResultStr))
            }
            score += theirMove.obtainsAgainst(myResult).value + myResult.score
        }

        return score
    }

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

Compiled from "Day02.kt"
public final class Day02Kt {
  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;)I
      10: istore_1
      11: getstatic     #22                 // Field java/lang/System.out:Ljava/io/PrintStream;
      14: iload_1
      15: invokevirtual #28                 // Method java/io/PrintStream.println:(I)V
      18: aload_0
      19: invokestatic  #31                 // Method main$part2:(Ljava/util/List;)I
      22: istore_1
      23: getstatic     #22                 // Field java/lang/System.out:Ljava/io/PrintStream;
      26: iload_1
      27: invokevirtual #28                 // Method java/io/PrintStream.println:(I)V
      30: 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/day02
       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 Move main$decryptMove(java.lang.String);
    Code:
       0: aload_0
       1: astore_1
       2: aload_1
       3: invokevirtual #62                 // Method java/lang/String.hashCode:()I
       6: lookupswitch  { // 6
                    65: 64
                    66: 76
                    67: 88
                    88: 100
                    89: 112
                    90: 124
               default: 154
          }
      64: aload_1
      65: ldc           #64                 // String A
      67: invokevirtual #68                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
      70: ifne          136
      73: goto          154
      76: aload_1
      77: ldc           #70                 // String B
      79: invokevirtual #68                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
      82: ifne          142
      85: goto          154
      88: aload_1
      89: ldc           #72                 // String C
      91: invokevirtual #68                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
      94: ifne          148
      97: goto          154
     100: aload_1
     101: ldc           #74                 // String X
     103: invokevirtual #68                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     106: ifne          136
     109: goto          154
     112: aload_1
     113: ldc           #76                 // String Y
     115: invokevirtual #68                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     118: ifne          142
     121: goto          154
     124: aload_1
     125: ldc           #78                 // String Z
     127: invokevirtual #68                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     130: ifne          148
     133: goto          154
     136: getstatic     #84                 // Field Move.ROCK:LMove;
     139: goto          164
     142: getstatic     #87                 // Field Move.PAPER:LMove;
     145: goto          164
     148: getstatic     #90                 // Field Move.SCISSORS:LMove;
     151: goto          164
     154: new           #92                 // class java/lang/IllegalArgumentException
     157: dup
     158: ldc           #94                 // String We should never get here
     160: invokespecial #97                 // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
     163: athrow
     164: areturn

  private static final Result main$decryptResult(java.lang.String);
    Code:
       0: aload_0
       1: astore_1
       2: aload_1
       3: invokevirtual #62                 // Method java/lang/String.hashCode:()I
       6: tableswitch   { // 88 to 90
                    88: 32
                    89: 44
                    90: 56
               default: 86
          }
      32: aload_1
      33: ldc           #74                 // String X
      35: invokevirtual #68                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
      38: ifne          68
      41: goto          86
      44: aload_1
      45: ldc           #76                 // String Y
      47: invokevirtual #68                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
      50: ifne          74
      53: goto          86
      56: aload_1
      57: ldc           #78                 // String Z
      59: invokevirtual #68                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
      62: ifne          80
      65: goto          86
      68: getstatic     #106                // Field Result.LOSE:LResult;
      71: goto          96
      74: getstatic     #109                // Field Result.DRAW:LResult;
      77: goto          96
      80: getstatic     #112                // Field Result.WIN:LResult;
      83: goto          96
      86: new           #92                 // class java/lang/IllegalArgumentException
      89: dup
      90: ldc           #94                 // String We should never get here
      92: invokespecial #97                 // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
      95: athrow
      96: areturn

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: iconst_0
       1: istore_1
       2: aload_0
       3: invokeinterface #120,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
       8: astore_2
       9: aload_2
      10: invokeinterface #126,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      15: ifeq          203
      18: aload_2
      19: invokeinterface #130,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      24: checkcast     #58                 // class java/lang/String
      27: astore_3
      28: aload_3
      29: checkcast     #132                // class java/lang/CharSequence
      32: iconst_1
      33: anewarray     #58                 // class java/lang/String
      36: astore        5
      38: aload         5
      40: iconst_0
      41: ldc           #134                // String
      43: aastore
      44: aload         5
      46: iconst_0
      47: iconst_0
      48: bipush        6
      50: aconst_null
      51: invokestatic  #140                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      54: checkcast     #142                // class java/lang/Iterable
      57: astore        5
      59: iconst_0
      60: istore        6
      62: aload         5
      64: astore        7
      66: new           #144                // class java/util/ArrayList
      69: dup
      70: aload         5
      72: bipush        10
      74: invokestatic  #150                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      77: invokespecial #152                // Method java/util/ArrayList."<init>":(I)V
      80: checkcast     #154                // class java/util/Collection
      83: astore        8
      85: iconst_0
      86: istore        9
      88: aload         7
      90: invokeinterface #155,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      95: astore        10
      97: aload         10
      99: invokeinterface #126,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     104: ifeq          147
     107: aload         10
     109: invokeinterface #130,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     114: astore        11
     116: aload         8
     118: aload         11
     120: checkcast     #58                 // class java/lang/String
     123: astore        12
     125: astore        14
     127: iconst_0
     128: istore        13
     130: aload         12
     132: invokestatic  #157                // Method main$decryptMove:(Ljava/lang/String;)LMove;
     135: aload         14
     137: swap
     138: invokeinterface #160,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     143: pop
     144: goto          97
     147: aload         8
     149: checkcast     #116                // class java/util/List
     152: nop
     153: astore        4
     155: aload         4
     157: iconst_0
     158: invokeinterface #164,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     163: checkcast     #80                 // class Move
     166: astore        5
     168: aload         4
     170: iconst_1
     171: invokeinterface #164,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     176: checkcast     #80                 // class Move
     179: astore        6
     181: iload_1
     182: aload         6
     184: invokevirtual #167                // Method Move.getValue:()I
     187: aload         6
     189: aload         5
     191: invokevirtual #171                // Method Move.against:(LMove;)LResult;
     194: invokevirtual #174                // Method Result.getScore:()I
     197: iadd
     198: iadd
     199: istore_1
     200: goto          9
     203: iload_1
     204: ireturn

  private static final int main$part2(java.util.List<java.lang.String>);
    Code:
       0: iconst_0
       1: istore_1
       2: aload_0
       3: invokeinterface #120,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
       8: astore_2
       9: aload_2
      10: invokeinterface #126,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      15: ifeq          147
      18: aload_2
      19: invokeinterface #130,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      24: checkcast     #58                 // class java/lang/String
      27: astore_3
      28: aload_3
      29: checkcast     #132                // class java/lang/CharSequence
      32: iconst_1
      33: anewarray     #58                 // class java/lang/String
      36: astore        5
      38: aload         5
      40: iconst_0
      41: ldc           #134                // String
      43: aastore
      44: aload         5
      46: iconst_0
      47: iconst_0
      48: bipush        6
      50: aconst_null
      51: invokestatic  #140                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      54: astore        6
      56: iconst_0
      57: istore        7
      59: aload         6
      61: iconst_0
      62: invokeinterface #164,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      67: checkcast     #58                 // class java/lang/String
      70: astore        8
      72: aload         6
      74: iconst_1
      75: invokeinterface #164,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      80: checkcast     #58                 // class java/lang/String
      83: astore        9
      85: new           #192                // class kotlin/Pair
      88: dup
      89: aload         8
      91: invokestatic  #157                // Method main$decryptMove:(Ljava/lang/String;)LMove;
      94: aload         9
      96: invokestatic  #194                // Method main$decryptResult:(Ljava/lang/String;)LResult;
      99: invokespecial #197                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     102: nop
     103: astore        4
     105: aload         4
     107: invokevirtual #200                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     110: checkcast     #80                 // class Move
     113: astore        5
     115: aload         4
     117: invokevirtual #203                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     120: checkcast     #102                // class Result
     123: astore        6
     125: iload_1
     126: aload         5
     128: aload         6
     130: invokevirtual #207                // Method Move.obtainsAgainst:(LResult;)LMove;
     133: invokevirtual #167                // Method Move.getValue:()I
     136: aload         6
     138: invokevirtual #174                // Method Result.getScore:()I
     141: iadd
     142: iadd
     143: istore_1
     144: goto          9
     147: iload_1
     148: ireturn
}