package asaad

import java.io.File

class DayFive(filePath: String) {

    private val file = File(filePath)
    private val input = readInput(file)

    private fun readInput(file: File): Pair<List<String>, List<String>> {
        val lines = file.readLines()
        return lines.takeWhile { it.isNotBlank() } to lines.takeLastWhile { it.isNotBlank() }
    }

    fun result() {
        println("\tpart 1: ${solve(Stacks::applyMove)}")
        println("\tpart 2: ${solve(Stacks::applyMove2)}")
    }

    private fun solve(func: Stacks.(Move) -> Unit): String {
        val stacks = Stacks(input.first)
        for (line in input.second)
            stacks.func(Move(line))

        return stacks.getTops()
    }

    class Move(input: String){
        operator fun component1(): Int = x
        operator fun component2(): Int = from
        operator fun component3(): Int = to

        private val x: Int
        private val from : Int
        private val to: Int

        init {
            val split = input.split(" ")
            x = split[1].toInt()
            from = split[3].toInt()-1
            to = split[5].toInt()-1
        }
    }

    class Stacks(
        input: List<String>
    ){
        private val stacks :List<MutableList<String>>

        init {
            val stackNumbers = input.last().trim().split("\\s+".toRegex()).map { it.toInt() }
            val maxNumber = stackNumbers.max()
            stacks = List(maxNumber) { mutableListOf() }
            for (line in input.size-2 downTo 0){
                val split = input[line].chunked(4).map { it.trimEnd().removeSurrounding("[", "]") }
                for (number in split.indices){
                    if (split[number] == "")
                        continue
                    stacks[number].add(split[number])
                }
            }
        }

        fun applyMove(move: Move){
            val (x, from, to) = move
            repeat(x){
                stacks[to].add(stacks[from].last())
                stacks[from].removeLast()
            }
        }

        fun applyMove2(move: Move){
            val (x, from, to) = move

            stacks[to].addAll(stacks[from].takeLast(x))

            repeat(x){
                stacks[from].removeLast()
            }

        }

        fun getTops() = stacks.joinToString("") { it.last() }
    }
}

Compiled from "DayFive.kt"
public final class asaad.DayFive$Stacks {
  private final java.util.List<java.util.List<java.lang.String>> stacks;

  public asaad.DayFive$Stacks(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #10                 // String input
       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: nop
      11: aload_1
      12: invokestatic  #25                 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
      15: checkcast     #27                 // class java/lang/String
      18: checkcast     #29                 // class java/lang/CharSequence
      21: invokestatic  #35                 // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
      24: invokevirtual #39                 // Method java/lang/Object.toString:()Ljava/lang/String;
      27: checkcast     #29                 // class java/lang/CharSequence
      30: astore_3
      31: new           #41                 // class kotlin/text/Regex
      34: dup
      35: ldc           #43                 // String \\s+
      37: invokespecial #46                 // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
      40: astore        4
      42: iconst_0
      43: istore        5
      45: aload         4
      47: aload_3
      48: iload         5
      50: invokevirtual #50                 // Method kotlin/text/Regex.split:(Ljava/lang/CharSequence;I)Ljava/util/List;
      53: checkcast     #52                 // class java/lang/Iterable
      56: astore_3
      57: nop
      58: iconst_0
      59: istore        4
      61: aload_3
      62: astore        5
      64: new           #54                 // class java/util/ArrayList
      67: dup
      68: aload_3
      69: bipush        10
      71: invokestatic  #58                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      74: invokespecial #61                 // Method java/util/ArrayList."<init>":(I)V
      77: checkcast     #63                 // class java/util/Collection
      80: astore        6
      82: iconst_0
      83: istore        7
      85: aload         5
      87: invokeinterface #67,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      92: astore        8
      94: aload         8
      96: invokeinterface #73,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     101: ifeq          148
     104: aload         8
     106: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     111: astore        9
     113: aload         6
     115: aload         9
     117: checkcast     #27                 // class java/lang/String
     120: astore        10
     122: astore        15
     124: iconst_0
     125: istore        11
     127: aload         10
     129: invokestatic  #83                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     132: nop
     133: invokestatic  #87                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     136: aload         15
     138: swap
     139: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     144: pop
     145: goto          94
     148: aload         6
     150: checkcast     #93                 // class java/util/List
     153: nop
     154: astore_2
     155: aload_2
     156: checkcast     #52                 // class java/lang/Iterable
     159: invokestatic  #97                 // Method kotlin/collections/CollectionsKt.maxOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;
     162: checkcast     #99                 // class java/lang/Number
     165: invokevirtual #103                // Method java/lang/Number.intValue:()I
     168: istore_3
     169: aload_0
     170: astore        15
     172: new           #54                 // class java/util/ArrayList
     175: dup
     176: iload_3
     177: invokespecial #61                 // Method java/util/ArrayList."<init>":(I)V
     180: astore        4
     182: iconst_0
     183: istore        5
     185: iload         5
     187: iload_3
     188: if_icmpge     230
     191: iload         5
     193: istore        6
     195: aload         4
     197: iload         6
     199: istore        7
     201: astore        16
     203: iconst_0
     204: istore        8
     206: new           #54                 // class java/util/ArrayList
     209: dup
     210: invokespecial #104                // Method java/util/ArrayList."<init>":()V
     213: checkcast     #93                 // class java/util/List
     216: nop
     217: aload         16
     219: swap
     220: invokevirtual #105                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     223: pop
     224: iinc          5, 1
     227: goto          185
     230: aload         4
     232: checkcast     #93                 // class java/util/List
     235: aload         15
     237: swap
     238: putfield      #109                // Field stacks:Ljava/util/List;
     241: aload_1
     242: invokeinterface #112,  1          // InterfaceMethod java/util/List.size:()I
     247: iconst_2
     248: isub
     249: istore        4
     251: iconst_m1
     252: iload         4
     254: if_icmpge     475
     257: aload_1
     258: iload         4
     260: invokeinterface #116,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     265: checkcast     #29                 // class java/lang/CharSequence
     268: iconst_4
     269: invokestatic  #119                // Method kotlin/text/StringsKt.chunked:(Ljava/lang/CharSequence;I)Ljava/util/List;
     272: checkcast     #52                 // class java/lang/Iterable
     275: astore        6
     277: iconst_0
     278: istore        7
     280: aload         6
     282: astore        8
     284: new           #54                 // class java/util/ArrayList
     287: dup
     288: aload         6
     290: bipush        10
     292: invokestatic  #58                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     295: invokespecial #61                 // Method java/util/ArrayList."<init>":(I)V
     298: checkcast     #63                 // class java/util/Collection
     301: astore        9
     303: iconst_0
     304: istore        10
     306: aload         8
     308: invokeinterface #67,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     313: astore        11
     315: aload         11
     317: invokeinterface #73,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     322: ifeq          384
     325: aload         11
     327: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     332: astore        12
     334: aload         9
     336: aload         12
     338: checkcast     #27                 // class java/lang/String
     341: astore        13
     343: astore        15
     345: iconst_0
     346: istore        14
     348: aload         13
     350: checkcast     #29                 // class java/lang/CharSequence
     353: invokestatic  #122                // Method kotlin/text/StringsKt.trimEnd:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
     356: invokevirtual #39                 // Method java/lang/Object.toString:()Ljava/lang/String;
     359: ldc           #124                // String [
     361: checkcast     #29                 // class java/lang/CharSequence
     364: ldc           #126                // String ]
     366: checkcast     #29                 // class java/lang/CharSequence
     369: invokestatic  #130                // Method kotlin/text/StringsKt.removeSurrounding:(Ljava/lang/String;Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
     372: aload         15
     374: swap
     375: invokeinterface #91,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     380: pop
     381: goto          315
     384: aload         9
     386: checkcast     #93                 // class java/util/List
     389: nop
     390: astore        5
     392: iconst_0
     393: istore        6
     395: aload         5
     397: checkcast     #63                 // class java/util/Collection
     400: invokeinterface #131,  1          // InterfaceMethod java/util/Collection.size:()I
     405: istore        7
     407: iload         6
     409: iload         7
     411: if_icmpge     469
     414: aload         5
     416: iload         6
     418: invokeinterface #116,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     423: ldc           #133                // String
     425: invokestatic  #137                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     428: ifeq          434
     431: goto          463
     434: aload_0
     435: getfield      #109                // Field stacks:Ljava/util/List;
     438: iload         6
     440: invokeinterface #116,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     445: checkcast     #93                 // class java/util/List
     448: aload         5
     450: iload         6
     452: invokeinterface #116,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     457: invokeinterface #138,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     462: pop
     463: iinc          6, 1
     466: goto          407
     469: iinc          4, -1
     472: goto          251
     475: nop
     476: return

  public final void applyMove(asaad.DayFive$Move);
    Code:
       0: aload_1
       1: ldc           #163                // String move
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokevirtual #168                // Method asaad/DayFive$Move.component1:()I
      10: istore_2
      11: aload_1
      12: invokevirtual #171                // Method asaad/DayFive$Move.component2:()I
      15: istore_3
      16: aload_1
      17: invokevirtual #174                // Method asaad/DayFive$Move.component3:()I
      20: istore        4
      22: iconst_0
      23: istore        5
      25: iload         5
      27: iload_2
      28: if_icmpge     100
      31: iload         5
      33: istore        6
      35: iconst_0
      36: istore        7
      38: aload_0
      39: getfield      #109                // Field stacks:Ljava/util/List;
      42: iload         4
      44: invokeinterface #116,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      49: checkcast     #93                 // class java/util/List
      52: aload_0
      53: getfield      #109                // Field stacks:Ljava/util/List;
      56: iload_3
      57: invokeinterface #116,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      62: checkcast     #93                 // class java/util/List
      65: invokestatic  #25                 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
      68: invokeinterface #138,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      73: pop
      74: aload_0
      75: getfield      #109                // Field stacks:Ljava/util/List;
      78: iload_3
      79: invokeinterface #116,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      84: checkcast     #93                 // class java/util/List
      87: invokeinterface #177,  1          // InterfaceMethod java/util/List.removeLast:()Ljava/lang/Object;
      92: pop
      93: nop
      94: iinc          5, 1
      97: goto          25
     100: return

  public final void applyMove2(asaad.DayFive$Move);
    Code:
       0: aload_1
       1: ldc           #163                // String move
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokevirtual #168                // Method asaad/DayFive$Move.component1:()I
      10: istore_2
      11: aload_1
      12: invokevirtual #171                // Method asaad/DayFive$Move.component2:()I
      15: istore_3
      16: aload_1
      17: invokevirtual #174                // Method asaad/DayFive$Move.component3:()I
      20: istore        4
      22: aload_0
      23: getfield      #109                // Field stacks:Ljava/util/List;
      26: iload         4
      28: invokeinterface #116,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      33: checkcast     #93                 // class java/util/List
      36: aload_0
      37: getfield      #109                // Field stacks:Ljava/util/List;
      40: iload_3
      41: invokeinterface #116,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      46: checkcast     #93                 // class java/util/List
      49: iload_2
      50: invokestatic  #187                // Method kotlin/collections/CollectionsKt.takeLast:(Ljava/util/List;I)Ljava/util/List;
      53: checkcast     #63                 // class java/util/Collection
      56: invokeinterface #191,  2          // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z
      61: pop
      62: iconst_0
      63: istore        5
      65: iload         5
      67: iload_2
      68: if_icmpge     104
      71: iload         5
      73: istore        6
      75: iconst_0
      76: istore        7
      78: aload_0
      79: getfield      #109                // Field stacks:Ljava/util/List;
      82: iload_3
      83: invokeinterface #116,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      88: checkcast     #93                 // class java/util/List
      91: invokeinterface #177,  1          // InterfaceMethod java/util/List.removeLast:()Ljava/lang/Object;
      96: pop
      97: nop
      98: iinc          5, 1
     101: goto          65
     104: return

  public final java.lang.String getTops();
    Code:
       0: aload_0
       1: getfield      #109                // Field stacks:Ljava/util/List;
       4: checkcast     #52                 // class java/lang/Iterable
       7: ldc           #133                // String
       9: checkcast     #29                 // class java/lang/CharSequence
      12: aconst_null
      13: aconst_null
      14: iconst_0
      15: aconst_null
      16: invokedynamic #212,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      21: bipush        30
      23: aconst_null
      24: invokestatic  #216                // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
      27: areturn

  private static final java.lang.CharSequence getTops$lambda$5(java.util.List);
    Code:
       0: aload_0
       1: ldc           #217                // String it
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokestatic  #25                 // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
      10: checkcast     #29                 // class java/lang/CharSequence
      13: areturn
}

Compiled from "DayFive.kt"
public final class asaad.DayFive {
  private final java.io.File file;

  private final kotlin.Pair<java.util.List<java.lang.String>, java.util.List<java.lang.String>> input;

  public asaad.DayFive(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #9                  // String filePath
       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/io/File
      14: dup
      15: aload_1
      16: invokespecial #22                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      19: putfield      #26                 // Field file:Ljava/io/File;
      22: aload_0
      23: aload_0
      24: aload_0
      25: getfield      #26                 // Field file:Ljava/io/File;
      28: invokespecial #30                 // Method readInput:(Ljava/io/File;)Lkotlin/Pair;
      31: putfield      #34                 // Field input:Lkotlin/Pair;
      34: return

  private final kotlin.Pair<java.util.List<java.lang.String>, java.util.List<java.lang.String>> readInput(java.io.File);
    Code:
       0: aload_1
       1: aconst_null
       2: iconst_1
       3: aconst_null
       4: invokestatic  #44                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
       7: astore_2
       8: aload_2
       9: checkcast     #46                 // class java/lang/Iterable
      12: astore_3
      13: iconst_0
      14: istore        4
      16: new           #48                 // class java/util/ArrayList
      19: dup
      20: invokespecial #49                 // Method java/util/ArrayList."<init>":()V
      23: astore        5
      25: aload_3
      26: invokeinterface #53,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      31: astore        6
      33: aload         6
      35: invokeinterface #59,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      40: ifeq          96
      43: aload         6
      45: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      50: astore        7
      52: aload         7
      54: checkcast     #65                 // class java/lang/String
      57: astore        8
      59: iconst_0
      60: istore        9
      62: aload         8
      64: checkcast     #67                 // class java/lang/CharSequence
      67: invokestatic  #73                 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
      70: ifne          77
      73: iconst_1
      74: goto          78
      77: iconst_0
      78: nop
      79: ifne          85
      82: goto          96
      85: aload         5
      87: aload         7
      89: invokevirtual #77                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      92: pop
      93: goto          33
      96: aload         5
      98: checkcast     #79                 // class java/util/List
     101: aload_2
     102: astore_3
     103: astore        12
     105: iconst_0
     106: istore        4
     108: aload_3
     109: invokeinterface #82,  1           // InterfaceMethod java/util/List.isEmpty:()Z
     114: ifeq          123
     117: invokestatic  #88                 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
     120: goto          277
     123: aload_3
     124: aload_3
     125: invokeinterface #92,  1           // InterfaceMethod java/util/List.size:()I
     130: invokeinterface #96,  2           // InterfaceMethod java/util/List.listIterator:(I)Ljava/util/ListIterator;
     135: astore        5
     137: aload         5
     139: invokeinterface #101,  1          // InterfaceMethod java/util/ListIterator.hasPrevious:()Z
     144: ifeq          270
     147: aload         5
     149: invokeinterface #104,  1          // InterfaceMethod java/util/ListIterator.previous:()Ljava/lang/Object;
     154: checkcast     #65                 // class java/lang/String
     157: astore        6
     159: iconst_0
     160: istore        7
     162: aload         6
     164: checkcast     #67                 // class java/lang/CharSequence
     167: invokestatic  #73                 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
     170: ifne          177
     173: iconst_1
     174: goto          178
     177: iconst_0
     178: nop
     179: ifne          137
     182: aload         5
     184: invokeinterface #105,  1          // InterfaceMethod java/util/ListIterator.next:()Ljava/lang/Object;
     189: pop
     190: aload_3
     191: invokeinterface #92,  1           // InterfaceMethod java/util/List.size:()I
     196: aload         5
     198: invokeinterface #108,  1          // InterfaceMethod java/util/ListIterator.nextIndex:()I
     203: isub
     204: istore        8
     206: iload         8
     208: ifne          217
     211: invokestatic  #88                 // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
     214: goto          277
     217: new           #48                 // class java/util/ArrayList
     220: dup
     221: iload         8
     223: invokespecial #111                // Method java/util/ArrayList."<init>":(I)V
     226: astore        9
     228: aload         9
     230: astore        10
     232: iconst_0
     233: istore        11
     235: aload         5
     237: invokeinterface #112,  1          // InterfaceMethod java/util/ListIterator.hasNext:()Z
     242: ifeq          261
     245: aload         10
     247: aload         5
     249: invokeinterface #105,  1          // InterfaceMethod java/util/ListIterator.next:()Ljava/lang/Object;
     254: invokevirtual #77                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     257: pop
     258: goto          235
     261: nop
     262: aload         9
     264: checkcast     #79                 // class java/util/List
     267: goto          277
     270: aload_3
     271: checkcast     #46                 // class java/lang/Iterable
     274: invokestatic  #116                // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;
     277: aload         12
     279: swap
     280: invokestatic  #122                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     283: areturn

  public final void result();
    Code:
       0: new           #145                // class java/lang/StringBuilder
       3: dup
       4: invokespecial #146                // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #148                // String \tpart 1:
       9: invokevirtual #152                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getstatic     #158                // Field asaad/DayFive$result$1.INSTANCE:Lasaad/DayFive$result$1;
      16: checkcast     #160                // class kotlin/jvm/functions/Function2
      19: invokespecial #164                // Method solve:(Lkotlin/jvm/functions/Function2;)Ljava/lang/String;
      22: invokevirtual #152                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      25: invokevirtual #168                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      28: getstatic     #174                // Field java/lang/System.out:Ljava/io/PrintStream;
      31: swap
      32: invokevirtual #180                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      35: new           #145                // class java/lang/StringBuilder
      38: dup
      39: invokespecial #146                // Method java/lang/StringBuilder."<init>":()V
      42: ldc           #182                // String \tpart 2:
      44: invokevirtual #152                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      47: aload_0
      48: getstatic     #187                // Field asaad/DayFive$result$2.INSTANCE:Lasaad/DayFive$result$2;
      51: checkcast     #160                // class kotlin/jvm/functions/Function2
      54: invokespecial #164                // Method solve:(Lkotlin/jvm/functions/Function2;)Ljava/lang/String;
      57: invokevirtual #152                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      60: invokevirtual #168                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      63: getstatic     #174                // Field java/lang/System.out:Ljava/io/PrintStream;
      66: swap
      67: invokevirtual #180                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      70: return

  private final java.lang.String solve(kotlin.jvm.functions.Function2<? super asaad.DayFive$Stacks, ? super asaad.DayFive$Move, kotlin.Unit>);
    Code:
       0: new           #190                // class asaad/DayFive$Stacks
       3: dup
       4: aload_0
       5: getfield      #34                 // Field input:Lkotlin/Pair;
       8: invokevirtual #195                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      11: checkcast     #79                 // class java/util/List
      14: invokespecial #198                // Method asaad/DayFive$Stacks."<init>":(Ljava/util/List;)V
      17: astore_2
      18: aload_0
      19: getfield      #34                 // Field input:Lkotlin/Pair;
      22: invokevirtual #201                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      25: checkcast     #79                 // class java/util/List
      28: invokeinterface #202,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      33: astore_3
      34: aload_3
      35: invokeinterface #59,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      40: ifeq          74
      43: aload_3
      44: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      49: checkcast     #65                 // class java/lang/String
      52: astore        4
      54: aload_1
      55: aload_2
      56: new           #204                // class asaad/DayFive$Move
      59: dup
      60: aload         4
      62: invokespecial #205                // Method asaad/DayFive$Move."<init>":(Ljava/lang/String;)V
      65: invokeinterface #209,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      70: pop
      71: goto          34
      74: aload_2
      75: invokevirtual #212                // Method asaad/DayFive$Stacks.getTops:()Ljava/lang/String;
      78: areturn
}

Compiled from "DayFive.kt"
public final class asaad.DayFive$Move {
  private final int x;

  private final int from;

  private final int to;

  public asaad.DayFive$Move(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: nop
      11: aload_1
      12: checkcast     #20                 // class java/lang/CharSequence
      15: iconst_1
      16: anewarray     #22                 // class java/lang/String
      19: astore_3
      20: aload_3
      21: iconst_0
      22: ldc           #24                 // String
      24: aastore
      25: aload_3
      26: iconst_0
      27: iconst_0
      28: bipush        6
      30: aconst_null
      31: invokestatic  #30                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      34: astore_2
      35: aload_0
      36: aload_2
      37: iconst_1
      38: invokeinterface #36,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      43: checkcast     #22                 // class java/lang/String
      46: invokestatic  #42                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      49: putfield      #46                 // Field x:I
      52: aload_0
      53: aload_2
      54: iconst_3
      55: invokeinterface #36,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      60: checkcast     #22                 // class java/lang/String
      63: invokestatic  #42                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      66: iconst_1
      67: isub
      68: putfield      #49                 // Field from:I
      71: aload_0
      72: aload_2
      73: iconst_5
      74: invokeinterface #36,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      79: checkcast     #22                 // class java/lang/String
      82: invokestatic  #42                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      85: iconst_1
      86: isub
      87: putfield      #52                 // Field to:I
      90: nop
      91: return

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

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

  public final int component3();
    Code:
       0: aload_0
       1: getfield      #52                 // Field to:I
       4: ireturn
}

Compiled from "DayFive.kt"
final class asaad.DayFive$result$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function2<asaad.DayFive$Stacks, asaad.DayFive$Move, kotlin.Unit> {
  public static final asaad.DayFive$result$1 INSTANCE;

  asaad.DayFive$result$1();
    Code:
       0: aload_0
       1: iconst_2
       2: ldc           #11                 // class asaad/DayFive$Stacks
       4: ldc           #13                 // String applyMove
       6: ldc           #15                 // String applyMove(Lasaad/DayFive$Move;)V
       8: iconst_0
       9: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      12: return

  public final void invoke(asaad.DayFive$Stacks, asaad.DayFive$Move);
    Code:
       0: aload_1
       1: ldc           #24                 // String p0
       3: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #32                 // String p1
       9: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_1
      13: aload_2
      14: invokevirtual #35                 // Method asaad/DayFive$Stacks.applyMove:(Lasaad/DayFive$Move;)V
      17: return

  public java.lang.Object invoke(java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #11                 // class asaad/DayFive$Stacks
       5: aload_2
       6: checkcast     #40                 // class asaad/DayFive$Move
       9: invokevirtual #42                 // Method invoke:(Lasaad/DayFive$Stacks;Lasaad/DayFive$Move;)V
      12: getstatic     #48                 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      15: areturn

  static {};
    Code:
       0: new           #2                  // class asaad/DayFive$result$1
       3: dup
       4: invokespecial #53                 // Method "<init>":()V
       7: putstatic     #55                 // Field INSTANCE:Lasaad/DayFive$result$1;
      10: return
}

Compiled from "DayFive.kt"
final class asaad.DayFive$result$2 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function2<asaad.DayFive$Stacks, asaad.DayFive$Move, kotlin.Unit> {
  public static final asaad.DayFive$result$2 INSTANCE;

  asaad.DayFive$result$2();
    Code:
       0: aload_0
       1: iconst_2
       2: ldc           #11                 // class asaad/DayFive$Stacks
       4: ldc           #13                 // String applyMove2
       6: ldc           #15                 // String applyMove2(Lasaad/DayFive$Move;)V
       8: iconst_0
       9: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      12: return

  public final void invoke(asaad.DayFive$Stacks, asaad.DayFive$Move);
    Code:
       0: aload_1
       1: ldc           #24                 // String p0
       3: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #32                 // String p1
       9: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_1
      13: aload_2
      14: invokevirtual #35                 // Method asaad/DayFive$Stacks.applyMove2:(Lasaad/DayFive$Move;)V
      17: return

  public java.lang.Object invoke(java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #11                 // class asaad/DayFive$Stacks
       5: aload_2
       6: checkcast     #40                 // class asaad/DayFive$Move
       9: invokevirtual #42                 // Method invoke:(Lasaad/DayFive$Stacks;Lasaad/DayFive$Move;)V
      12: getstatic     #48                 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      15: areturn

  static {};
    Code:
       0: new           #2                  // class asaad/DayFive$result$2
       3: dup
       4: invokespecial #53                 // Method "<init>":()V
       7: putstatic     #55                 // Field INSTANCE:Lasaad/DayFive$result$2;
      10: return
}


package asaad

import java.io.File

class DayTwo(filePath: String) {
    /*
     *  rock -> Scissors -> paper ->rock...  ->win, <-loose
     */
    private val file = File(filePath)
    private val input = readInput(file)

    private fun readInput(file: File) = file.readLines()

    private var part1 = true

    private val handMapper = mapOf(
        "A" to HAND.ROCK,
        "X" to HAND.ROCK,
        "Y" to HAND.PAPER,
        "B" to HAND.PAPER,
        "Z" to HAND.SCISSORS,
        "C" to HAND.SCISSORS
    )

    private val outcomeMapper = mapOf(
        "X" to OUTCOME.LOOSE,
        "Y" to OUTCOME.DRAW,
        "Z" to OUTCOME.WIN
    )

    private val handSize = HAND.values().size

    fun result() {
        println("\tpart 1: ${solve()}")
        part1 = false
        println("\tpart 2: ${solve()}")
    }

    private fun solve() =
        input.fold(0) { acc: Int, round: String ->
            acc + roundScore(round)
        }

    private fun roundScore(round: String): Int {
        var score = 0
        val (firstCol, secondCol) = round.split(" ")
        val opponentHand = handParser(firstCol)

        val myHand = if (part1) handParser(secondCol) else outcomeToHand(opponentHand, outcomeParser(secondCol))
        score += myHand.score + roundOutcome(opponentHand, myHand).score

        return score
    }

    private fun roundOutcome(opponent: HAND, mine: HAND): OUTCOME = when {
        opponent == mine -> OUTCOME.DRAW
        (opponent.ordinal + 1).mod(handSize)
                == mine.ordinal -> OUTCOME.WIN

        else -> OUTCOME.LOOSE
    }

    private fun outcomeToHand(opponent: HAND, outcome: OUTCOME): HAND = when (outcome) {
        OUTCOME.LOOSE -> HAND.values()[(opponent.ordinal + handSize - 1).mod(handSize)]
        OUTCOME.WIN -> HAND.values()[(opponent.ordinal + 1).mod(handSize)]
        else -> opponent
    }

    private fun handParser(input: String) = handMapper[input]!!

    private fun outcomeParser(input: String) = outcomeMapper[input]!!

    private enum class OUTCOME(val score: Int) {
        WIN(6),
        LOOSE(0),
        DRAW(3);
    }

    private enum class HAND(val score: Int) {
        ROCK(1),
        PAPER(2),
        SCISSORS(3);
    }
}

Compiled from "DayTwo.kt"
public final class asaad.DayTwo {
  private final java.io.File file;

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

  private boolean part1;

  private final java.util.Map<java.lang.String, asaad.DayTwo$HAND> handMapper;

  private final java.util.Map<java.lang.String, asaad.DayTwo$OUTCOME> outcomeMapper;

  private final int handSize;

  public asaad.DayTwo(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #9                  // String filePath
       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/io/File
      14: dup
      15: aload_1
      16: invokespecial #22                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      19: putfield      #26                 // Field file:Ljava/io/File;
      22: aload_0
      23: aload_0
      24: aload_0
      25: getfield      #26                 // Field file:Ljava/io/File;
      28: invokespecial #30                 // Method readInput:(Ljava/io/File;)Ljava/util/List;
      31: putfield      #34                 // Field input:Ljava/util/List;
      34: aload_0
      35: iconst_1
      36: putfield      #38                 // Field part1:Z
      39: aload_0
      40: bipush        6
      42: anewarray     #40                 // class kotlin/Pair
      45: astore_2
      46: aload_2
      47: iconst_0
      48: ldc           #42                 // String A
      50: getstatic     #48                 // Field asaad/DayTwo$HAND.ROCK:Lasaad/DayTwo$HAND;
      53: invokestatic  #54                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      56: aastore
      57: aload_2
      58: iconst_1
      59: ldc           #56                 // String X
      61: getstatic     #48                 // Field asaad/DayTwo$HAND.ROCK:Lasaad/DayTwo$HAND;
      64: invokestatic  #54                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      67: aastore
      68: aload_2
      69: iconst_2
      70: ldc           #58                 // String Y
      72: getstatic     #61                 // Field asaad/DayTwo$HAND.PAPER:Lasaad/DayTwo$HAND;
      75: invokestatic  #54                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      78: aastore
      79: aload_2
      80: iconst_3
      81: ldc           #63                 // String B
      83: getstatic     #61                 // Field asaad/DayTwo$HAND.PAPER:Lasaad/DayTwo$HAND;
      86: invokestatic  #54                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      89: aastore
      90: aload_2
      91: iconst_4
      92: ldc           #64                 // String Z
      94: getstatic     #67                 // Field asaad/DayTwo$HAND.SCISSORS:Lasaad/DayTwo$HAND;
      97: invokestatic  #54                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     100: aastore
     101: aload_2
     102: iconst_5
     103: ldc           #69                 // String C
     105: getstatic     #67                 // Field asaad/DayTwo$HAND.SCISSORS:Lasaad/DayTwo$HAND;
     108: invokestatic  #54                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     111: aastore
     112: aload_2
     113: invokestatic  #75                 // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;
     116: putfield      #79                 // Field handMapper:Ljava/util/Map;
     119: aload_0
     120: iconst_3
     121: anewarray     #40                 // class kotlin/Pair
     124: astore_2
     125: aload_2
     126: iconst_0
     127: ldc           #56                 // String X
     129: getstatic     #85                 // Field asaad/DayTwo$OUTCOME.LOOSE:Lasaad/DayTwo$OUTCOME;
     132: invokestatic  #54                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     135: aastore
     136: aload_2
     137: iconst_1
     138: ldc           #58                 // String Y
     140: getstatic     #88                 // Field asaad/DayTwo$OUTCOME.DRAW:Lasaad/DayTwo$OUTCOME;
     143: invokestatic  #54                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     146: aastore
     147: aload_2
     148: iconst_2
     149: ldc           #64                 // String Z
     151: getstatic     #91                 // Field asaad/DayTwo$OUTCOME.WIN:Lasaad/DayTwo$OUTCOME;
     154: invokestatic  #54                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     157: aastore
     158: aload_2
     159: invokestatic  #75                 // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;
     162: putfield      #94                 // Field outcomeMapper:Ljava/util/Map;
     165: aload_0
     166: invokestatic  #98                 // Method asaad/DayTwo$HAND.values:()[Lasaad/DayTwo$HAND;
     169: arraylength
     170: putfield      #102                // Field handSize:I
     173: return

  private final java.util.List<java.lang.String> readInput(java.io.File);
    Code:
       0: aload_1
       1: aconst_null
       2: iconst_1
       3: aconst_null
       4: invokestatic  #112                // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
       7: areturn

  public final void result();
    Code:
       0: new           #115                // class java/lang/StringBuilder
       3: dup
       4: invokespecial #116                // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #118                // String \tpart 1:
       9: invokevirtual #122                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: invokespecial #126                // Method solve:()I
      16: invokevirtual #129                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: invokevirtual #133                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      22: getstatic     #139                // Field java/lang/System.out:Ljava/io/PrintStream;
      25: swap
      26: invokevirtual #145                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      29: aload_0
      30: iconst_0
      31: putfield      #38                 // Field part1:Z
      34: new           #115                // class java/lang/StringBuilder
      37: dup
      38: invokespecial #116                // Method java/lang/StringBuilder."<init>":()V
      41: ldc           #147                // String \tpart 2:
      43: invokevirtual #122                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      46: aload_0
      47: invokespecial #126                // Method solve:()I
      50: invokevirtual #129                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      53: invokevirtual #133                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      56: getstatic     #139                // Field java/lang/System.out:Ljava/io/PrintStream;
      59: swap
      60: invokevirtual #145                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      63: return

  private final int solve();
    Code:
       0: aload_0
       1: getfield      #34                 // Field input:Ljava/util/List;
       4: checkcast     #149                // class java/lang/Iterable
       7: astore_1
       8: iconst_0
       9: istore_2
      10: iconst_0
      11: istore_3
      12: iload_2
      13: istore        4
      15: aload_1
      16: invokeinterface #153,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      21: astore        5
      23: aload         5
      25: invokeinterface #159,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      30: ifeq          70
      33: aload         5
      35: invokeinterface #163,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      40: astore        6
      42: iload         4
      44: aload         6
      46: checkcast     #165                // class java/lang/String
      49: astore        7
      51: istore        8
      53: iconst_0
      54: istore        9
      56: iload         8
      58: aload_0
      59: aload         7
      61: invokespecial #169                // Method roundScore:(Ljava/lang/String;)I
      64: iadd
      65: istore        4
      67: goto          23
      70: iload         4
      72: ireturn

  private final int roundScore(java.lang.String);
    Code:
       0: iconst_0
       1: istore_2
       2: aload_1
       3: checkcast     #181                // class java/lang/CharSequence
       6: iconst_1
       7: anewarray     #165                // class java/lang/String
      10: astore        4
      12: aload         4
      14: iconst_0
      15: ldc           #183                // String
      17: aastore
      18: aload         4
      20: iconst_0
      21: iconst_0
      22: bipush        6
      24: aconst_null
      25: invokestatic  #189                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      28: astore_3
      29: aload_3
      30: iconst_0
      31: invokeinterface #195,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      36: checkcast     #165                // class java/lang/String
      39: astore        4
      41: aload_3
      42: iconst_1
      43: invokeinterface #195,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      48: checkcast     #165                // class java/lang/String
      51: astore        5
      53: aload_0
      54: aload         4
      56: invokespecial #199                // Method handParser:(Ljava/lang/String;)Lasaad/DayTwo$HAND;
      59: astore        6
      61: aload_0
      62: getfield      #38                 // Field part1:Z
      65: ifeq          77
      68: aload_0
      69: aload         5
      71: invokespecial #199                // Method handParser:(Ljava/lang/String;)Lasaad/DayTwo$HAND;
      74: goto          89
      77: aload_0
      78: aload         6
      80: aload_0
      81: aload         5
      83: invokespecial #203                // Method outcomeParser:(Ljava/lang/String;)Lasaad/DayTwo$OUTCOME;
      86: invokespecial #207                // Method outcomeToHand:(Lasaad/DayTwo$HAND;Lasaad/DayTwo$OUTCOME;)Lasaad/DayTwo$HAND;
      89: astore        7
      91: iload_2
      92: aload         7
      94: invokevirtual #210                // Method asaad/DayTwo$HAND.getScore:()I
      97: aload_0
      98: aload         6
     100: aload         7
     102: invokespecial #214                // Method roundOutcome:(Lasaad/DayTwo$HAND;Lasaad/DayTwo$HAND;)Lasaad/DayTwo$OUTCOME;
     105: invokevirtual #215                // Method asaad/DayTwo$OUTCOME.getScore:()I
     108: iadd
     109: iadd
     110: istore_2
     111: iload_2
     112: ireturn

  private final asaad.DayTwo$OUTCOME roundOutcome(asaad.DayTwo$HAND, asaad.DayTwo$HAND);
    Code:
       0: nop
       1: aload_1
       2: aload_2
       3: if_acmpne     12
       6: getstatic     #88                 // Field asaad/DayTwo$OUTCOME.DRAW:Lasaad/DayTwo$OUTCOME;
       9: goto          68
      12: aload_1
      13: invokevirtual #223                // Method asaad/DayTwo$HAND.ordinal:()I
      16: iconst_1
      17: iadd
      18: istore_3
      19: aload_0
      20: getfield      #102                // Field handSize:I
      23: istore        4
      25: iload_3
      26: iload         4
      28: irem
      29: istore        5
      31: iload         5
      33: iload         4
      35: iload         5
      37: iload         4
      39: ixor
      40: iload         5
      42: iload         5
      44: ineg
      45: ior
      46: iand
      47: bipush        31
      49: ishr
      50: iand
      51: iadd
      52: aload_2
      53: invokevirtual #223                // Method asaad/DayTwo$HAND.ordinal:()I
      56: if_icmpne     65
      59: getstatic     #91                 // Field asaad/DayTwo$OUTCOME.WIN:Lasaad/DayTwo$OUTCOME;
      62: goto          68
      65: getstatic     #85                 // Field asaad/DayTwo$OUTCOME.LOOSE:Lasaad/DayTwo$OUTCOME;
      68: areturn

  private final asaad.DayTwo$HAND outcomeToHand(asaad.DayTwo$HAND, asaad.DayTwo$OUTCOME);
    Code:
       0: aload_2
       1: getstatic     #231                // Field asaad/DayTwo$WhenMappings.$EnumSwitchMapping$0:[I
       4: swap
       5: invokevirtual #232                // Method asaad/DayTwo$OUTCOME.ordinal:()I
       8: iaload
       9: tableswitch   { // 1 to 2
                     1: 32
                     2: 84
               default: 131
          }
      32: invokestatic  #98                 // Method asaad/DayTwo$HAND.values:()[Lasaad/DayTwo$HAND;
      35: aload_1
      36: invokevirtual #223                // Method asaad/DayTwo$HAND.ordinal:()I
      39: aload_0
      40: getfield      #102                // Field handSize:I
      43: iadd
      44: iconst_1
      45: isub
      46: istore_3
      47: aload_0
      48: getfield      #102                // Field handSize:I
      51: istore        4
      53: iload_3
      54: iload         4
      56: irem
      57: istore        5
      59: iload         5
      61: iload         4
      63: iload         5
      65: iload         4
      67: ixor
      68: iload         5
      70: iload         5
      72: ineg
      73: ior
      74: iand
      75: bipush        31
      77: ishr
      78: iand
      79: iadd
      80: aaload
      81: goto          132
      84: invokestatic  #98                 // Method asaad/DayTwo$HAND.values:()[Lasaad/DayTwo$HAND;
      87: aload_1
      88: invokevirtual #223                // Method asaad/DayTwo$HAND.ordinal:()I
      91: iconst_1
      92: iadd
      93: istore_3
      94: aload_0
      95: getfield      #102                // Field handSize:I
      98: istore        4
     100: iload_3
     101: iload         4
     103: irem
     104: istore        5
     106: iload         5
     108: iload         4
     110: iload         5
     112: iload         4
     114: ixor
     115: iload         5
     117: iload         5
     119: ineg
     120: ior
     121: iand
     122: bipush        31
     124: ishr
     125: iand
     126: iadd
     127: aaload
     128: goto          132
     131: aload_1
     132: areturn

  private final asaad.DayTwo$HAND handParser(java.lang.String);
    Code:
       0: aload_0
       1: getfield      #79                 // Field handMapper:Ljava/util/Map;
       4: aload_1
       5: invokeinterface #238,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      10: dup
      11: invokestatic  #241                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      14: checkcast     #44                 // class asaad/DayTwo$HAND
      17: areturn

  private final asaad.DayTwo$OUTCOME outcomeParser(java.lang.String);
    Code:
       0: aload_0
       1: getfield      #94                 // Field outcomeMapper:Ljava/util/Map;
       4: aload_1
       5: invokeinterface #238,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      10: dup
      11: invokestatic  #241                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      14: checkcast     #81                 // class asaad/DayTwo$OUTCOME
      17: areturn
}

Compiled from "DayTwo.kt"
final class asaad.DayTwo$HAND extends java.lang.Enum<asaad.DayTwo$HAND> {
  private final int score;

  public static final asaad.DayTwo$HAND ROCK;

  public static final asaad.DayTwo$HAND PAPER;

  public static final asaad.DayTwo$HAND SCISSORS;

  private static final asaad.DayTwo$HAND[] $VALUES;

  private static final kotlin.enums.EnumEntries $ENTRIES;

  private asaad.DayTwo$HAND(int);
    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: iload_3
       8: putfield      #15                 // Field score:I
      11: return

  public final int getScore();
    Code:
       0: aload_0
       1: getfield      #15                 // Field score:I
       4: ireturn

  public static asaad.DayTwo$HAND[] values();
    Code:
       0: getstatic     #28                 // Field $VALUES:[Lasaad/DayTwo$HAND;
       3: invokevirtual #34                 // Method java/lang/Object.clone:()Ljava/lang/Object;
       6: checkcast     #35                 // class "[Lasaad/DayTwo$HAND;"
       9: areturn

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

  public static kotlin.enums.EnumEntries<asaad.DayTwo$HAND> getEntries();
    Code:
       0: getstatic     #49                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
       3: areturn

  private static final asaad.DayTwo$HAND[] $values();
    Code:
       0: iconst_3
       1: anewarray     #2                  // class asaad/DayTwo$HAND
       4: astore_0
       5: aload_0
       6: iconst_0
       7: getstatic     #53                 // Field ROCK:Lasaad/DayTwo$HAND;
      10: aastore
      11: aload_0
      12: iconst_1
      13: getstatic     #56                 // Field PAPER:Lasaad/DayTwo$HAND;
      16: aastore
      17: aload_0
      18: iconst_2
      19: getstatic     #59                 // Field SCISSORS:Lasaad/DayTwo$HAND;
      22: aastore
      23: aload_0
      24: areturn

  static {};
    Code:
       0: new           #2                  // class asaad/DayTwo$HAND
       3: dup
       4: ldc           #62                 // String ROCK
       6: iconst_0
       7: iconst_1
       8: invokespecial #64                 // Method "<init>":(Ljava/lang/String;II)V
      11: putstatic     #53                 // Field ROCK:Lasaad/DayTwo$HAND;
      14: new           #2                  // class asaad/DayTwo$HAND
      17: dup
      18: ldc           #65                 // String PAPER
      20: iconst_1
      21: iconst_2
      22: invokespecial #64                 // Method "<init>":(Ljava/lang/String;II)V
      25: putstatic     #56                 // Field PAPER:Lasaad/DayTwo$HAND;
      28: new           #2                  // class asaad/DayTwo$HAND
      31: dup
      32: ldc           #66                 // String SCISSORS
      34: iconst_2
      35: iconst_3
      36: invokespecial #64                 // Method "<init>":(Ljava/lang/String;II)V
      39: putstatic     #59                 // Field SCISSORS:Lasaad/DayTwo$HAND;
      42: invokestatic  #68                 // Method $values:()[Lasaad/DayTwo$HAND;
      45: putstatic     #28                 // Field $VALUES:[Lasaad/DayTwo$HAND;
      48: getstatic     #28                 // Field $VALUES:[Lasaad/DayTwo$HAND;
      51: checkcast     #70                 // class "[Ljava/lang/Enum;"
      54: invokestatic  #76                 // Method kotlin/enums/EnumEntriesKt.enumEntries:([Ljava/lang/Enum;)Lkotlin/enums/EnumEntries;
      57: putstatic     #49                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
      60: return
}

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

  static {};
    Code:
       0: invokestatic  #14                 // Method asaad/DayTwo$OUTCOME.values:()[Lasaad/DayTwo$OUTCOME;
       3: arraylength
       4: newarray       int
       6: astore_0
       7: nop
       8: aload_0
       9: getstatic     #18                 // Field asaad/DayTwo$OUTCOME.LOOSE:Lasaad/DayTwo$OUTCOME;
      12: invokevirtual #22                 // Method asaad/DayTwo$OUTCOME.ordinal:()I
      15: iconst_1
      16: iastore
      17: goto          21
      20: astore_1
      21: nop
      22: aload_0
      23: getstatic     #25                 // Field asaad/DayTwo$OUTCOME.WIN:Lasaad/DayTwo$OUTCOME;
      26: invokevirtual #22                 // Method asaad/DayTwo$OUTCOME.ordinal:()I
      29: iconst_2
      30: iastore
      31: goto          35
      34: astore_1
      35: aload_0
      36: putstatic     #29                 // Field $EnumSwitchMapping$0:[I
      39: return
    Exception table:
       from    to  target type
           7    17    20   Class java/lang/NoSuchFieldError
          21    31    34   Class java/lang/NoSuchFieldError
}

Compiled from "DayTwo.kt"
final class asaad.DayTwo$OUTCOME extends java.lang.Enum<asaad.DayTwo$OUTCOME> {
  private final int score;

  public static final asaad.DayTwo$OUTCOME WIN;

  public static final asaad.DayTwo$OUTCOME LOOSE;

  public static final asaad.DayTwo$OUTCOME DRAW;

  private static final asaad.DayTwo$OUTCOME[] $VALUES;

  private static final kotlin.enums.EnumEntries $ENTRIES;

  private asaad.DayTwo$OUTCOME(int);
    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: iload_3
       8: putfield      #15                 // Field score:I
      11: return

  public final int getScore();
    Code:
       0: aload_0
       1: getfield      #15                 // Field score:I
       4: ireturn

  public static asaad.DayTwo$OUTCOME[] values();
    Code:
       0: getstatic     #28                 // Field $VALUES:[Lasaad/DayTwo$OUTCOME;
       3: invokevirtual #34                 // Method java/lang/Object.clone:()Ljava/lang/Object;
       6: checkcast     #35                 // class "[Lasaad/DayTwo$OUTCOME;"
       9: areturn

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

  public static kotlin.enums.EnumEntries<asaad.DayTwo$OUTCOME> getEntries();
    Code:
       0: getstatic     #49                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
       3: areturn

  private static final asaad.DayTwo$OUTCOME[] $values();
    Code:
       0: iconst_3
       1: anewarray     #2                  // class asaad/DayTwo$OUTCOME
       4: astore_0
       5: aload_0
       6: iconst_0
       7: getstatic     #53                 // Field WIN:Lasaad/DayTwo$OUTCOME;
      10: aastore
      11: aload_0
      12: iconst_1
      13: getstatic     #56                 // Field LOOSE:Lasaad/DayTwo$OUTCOME;
      16: aastore
      17: aload_0
      18: iconst_2
      19: getstatic     #59                 // Field DRAW:Lasaad/DayTwo$OUTCOME;
      22: aastore
      23: aload_0
      24: areturn

  static {};
    Code:
       0: new           #2                  // class asaad/DayTwo$OUTCOME
       3: dup
       4: ldc           #62                 // String WIN
       6: iconst_0
       7: bipush        6
       9: invokespecial #64                 // Method "<init>":(Ljava/lang/String;II)V
      12: putstatic     #53                 // Field WIN:Lasaad/DayTwo$OUTCOME;
      15: new           #2                  // class asaad/DayTwo$OUTCOME
      18: dup
      19: ldc           #65                 // String LOOSE
      21: iconst_1
      22: iconst_0
      23: invokespecial #64                 // Method "<init>":(Ljava/lang/String;II)V
      26: putstatic     #56                 // Field LOOSE:Lasaad/DayTwo$OUTCOME;
      29: new           #2                  // class asaad/DayTwo$OUTCOME
      32: dup
      33: ldc           #66                 // String DRAW
      35: iconst_2
      36: iconst_3
      37: invokespecial #64                 // Method "<init>":(Ljava/lang/String;II)V
      40: putstatic     #59                 // Field DRAW:Lasaad/DayTwo$OUTCOME;
      43: invokestatic  #68                 // Method $values:()[Lasaad/DayTwo$OUTCOME;
      46: putstatic     #28                 // Field $VALUES:[Lasaad/DayTwo$OUTCOME;
      49: getstatic     #28                 // Field $VALUES:[Lasaad/DayTwo$OUTCOME;
      52: checkcast     #70                 // class "[Ljava/lang/Enum;"
      55: invokestatic  #76                 // Method kotlin/enums/EnumEntriesKt.enumEntries:([Ljava/lang/Enum;)Lkotlin/enums/EnumEntries;
      58: putstatic     #49                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
      61: return
}