package jks

import java.io.File
import java.lang.RuntimeException
import jks.Item.PAPER
import jks.Item.ROCK
import jks.Item.SCISSORS
import jks.Result.DRAW
import jks.Result.LOSER
import jks.Result.WINNER

fun main() {
    val uri = object {}::class.java.getResource("/day2_input")?.toURI()
        ?: throw RuntimeException("oh noes!")
    val lines = File(uri).readLines()

    val sumPart1 = lines
        .map { chars -> Round(toItem(chars[0]), toItem(chars[2])) }
        .map { round -> Pair(round, result(round)) }
        .sumOf { (round, result) -> round.myItem.points + result.points }
    println("Part 1: $sumPart1")

    val sumPart2 = lines
        .map { chars -> Pair(toItem(chars[0]), toResult(chars[2])) }
        .map { Pair(it, itemForDesiredResult(it.first, it.second)) }
        .sumOf { (othersItemAndResult, myItem) -> myItem.points + othersItemAndResult.second.points }
    println("Part 2: $sumPart2")
}

data class Round(val opponentsItem: Item, val myItem: Item)

enum class Item(val points: Int){
    ROCK(1),
    PAPER(2),
    SCISSORS(3)
}

enum class Result(val points: Int) {
    WINNER(6),
    DRAW(3),
    LOSER(0)
}

private fun result(round: Round): Result = when (round) {
    Round(ROCK, ROCK) -> DRAW
    Round(ROCK, PAPER) -> WINNER
    Round(ROCK, SCISSORS) -> LOSER
    Round(PAPER, ROCK) -> LOSER
    Round(PAPER, PAPER) -> DRAW
    Round(PAPER, SCISSORS) -> WINNER
    Round(SCISSORS, ROCK) -> WINNER
    Round(SCISSORS, PAPER) -> LOSER
    Round(SCISSORS, SCISSORS) -> DRAW
    else -> throw RuntimeException("$round is not valid")
}

private fun toItem(c: Char) = when (c) {
    'A', 'X' -> ROCK
    'B', 'Y' -> PAPER
    'C', 'Z' -> SCISSORS
    else -> throw RuntimeException("oh noes!")
}

private fun toResult(c: Char) = when (c) {
    'X' -> LOSER
    'Y' -> DRAW
    'Z' -> WINNER
    else -> throw RuntimeException("oh noes!")
}

private fun itemForDesiredResult(othersItem: Item, desiredResult: Result) = when {
    desiredResult == DRAW -> othersItem
    othersItem == ROCK && desiredResult == WINNER -> PAPER
    othersItem == ROCK && desiredResult == LOSER -> SCISSORS
    othersItem == PAPER && desiredResult == WINNER -> SCISSORS
    othersItem == PAPER && desiredResult == LOSER -> ROCK
    othersItem == SCISSORS && desiredResult == WINNER -> ROCK
    othersItem == SCISSORS && desiredResult == LOSER -> PAPER
    else -> throw RuntimeException("oh noes!")
}

Compiled from "Day2.kt"
public final class jks.Day2Kt {
  public static final void main();
    Code:
       0: new           #8                  // class jks/Day2Kt$main$uri$1
       3: dup
       4: invokespecial #11                 // Method jks/Day2Kt$main$uri$1."<init>":()V
       7: invokevirtual #15                 // Method java/lang/Object.getClass:()Ljava/lang/Class;
      10: ldc           #17                 // String /day2_input
      12: invokevirtual #23                 // Method java/lang/Class.getResource:(Ljava/lang/String;)Ljava/net/URL;
      15: dup
      16: ifnull        26
      19: invokevirtual #29                 // Method java/net/URL.toURI:()Ljava/net/URI;
      22: dup
      23: ifnonnull     37
      26: pop
      27: new           #31                 // class java/lang/RuntimeException
      30: dup
      31: ldc           #33                 // String oh noes!
      33: invokespecial #36                 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
      36: athrow
      37: astore_0
      38: new           #38                 // class java/io/File
      41: dup
      42: aload_0
      43: invokespecial #41                 // Method java/io/File."<init>":(Ljava/net/URI;)V
      46: aconst_null
      47: iconst_1
      48: aconst_null
      49: invokestatic  #47                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      52: astore_1
      53: aload_1
      54: checkcast     #49                 // class java/lang/Iterable
      57: astore_3
      58: nop
      59: iconst_0
      60: istore        4
      62: aload_3
      63: astore        5
      65: new           #51                 // class java/util/ArrayList
      68: dup
      69: aload_3
      70: bipush        10
      72: invokestatic  #57                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      75: invokespecial #60                 // Method java/util/ArrayList."<init>":(I)V
      78: checkcast     #62                 // class java/util/Collection
      81: astore        6
      83: iconst_0
      84: istore        7
      86: aload         5
      88: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      93: astore        8
      95: aload         8
      97: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     102: ifeq          165
     105: aload         8
     107: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     112: astore        9
     114: aload         6
     116: aload         9
     118: checkcast     #78                 // class java/lang/String
     121: astore        10
     123: astore        13
     125: iconst_0
     126: istore        11
     128: new           #80                 // class jks/Round
     131: dup
     132: aload         10
     134: iconst_0
     135: invokevirtual #84                 // Method java/lang/String.charAt:(I)C
     138: invokestatic  #88                 // Method toItem:(C)Ljks/Item;
     141: aload         10
     143: iconst_2
     144: invokevirtual #84                 // Method java/lang/String.charAt:(I)C
     147: invokestatic  #88                 // Method toItem:(C)Ljks/Item;
     150: invokespecial #91                 // Method jks/Round."<init>":(Ljks/Item;Ljks/Item;)V
     153: aload         13
     155: swap
     156: invokeinterface #95,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     161: pop
     162: goto          95
     165: aload         6
     167: checkcast     #97                 // class java/util/List
     170: nop
     171: checkcast     #49                 // class java/lang/Iterable
     174: astore_3
     175: nop
     176: iconst_0
     177: istore        4
     179: aload_3
     180: astore        5
     182: new           #51                 // class java/util/ArrayList
     185: dup
     186: aload_3
     187: bipush        10
     189: invokestatic  #57                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     192: invokespecial #60                 // Method java/util/ArrayList."<init>":(I)V
     195: checkcast     #62                 // class java/util/Collection
     198: astore        6
     200: iconst_0
     201: istore        7
     203: aload         5
     205: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     210: astore        8
     212: aload         8
     214: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     219: ifeq          271
     222: aload         8
     224: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     229: astore        9
     231: aload         6
     233: aload         9
     235: checkcast     #80                 // class jks/Round
     238: astore        10
     240: astore        13
     242: iconst_0
     243: istore        11
     245: new           #99                 // class kotlin/Pair
     248: dup
     249: aload         10
     251: aload         10
     253: invokestatic  #103                // Method result:(Ljks/Round;)Ljks/Result;
     256: invokespecial #106                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     259: aload         13
     261: swap
     262: invokeinterface #95,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     267: pop
     268: goto          212
     271: aload         6
     273: checkcast     #97                 // class java/util/List
     276: nop
     277: checkcast     #49                 // class java/lang/Iterable
     280: astore_3
     281: iconst_0
     282: istore        4
     284: aload_3
     285: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     290: astore        5
     292: aload         5
     294: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     299: ifeq          371
     302: aload         5
     304: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     309: astore        6
     311: iload         4
     313: aload         6
     315: checkcast     #99                 // class kotlin/Pair
     318: astore        7
     320: istore        13
     322: iconst_0
     323: istore        8
     325: aload         7
     327: invokevirtual #109                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     330: checkcast     #80                 // class jks/Round
     333: astore        9
     335: aload         7
     337: invokevirtual #112                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     340: checkcast     #114                // class jks/Result
     343: astore        10
     345: aload         9
     347: invokevirtual #118                // Method jks/Round.getMyItem:()Ljks/Item;
     350: invokevirtual #124                // Method jks/Item.getPoints:()I
     353: aload         10
     355: invokevirtual #125                // Method jks/Result.getPoints:()I
     358: iadd
     359: istore        14
     361: iload         13
     363: iload         14
     365: iadd
     366: istore        4
     368: goto          292
     371: iload         4
     373: istore_2
     374: new           #127                // class java/lang/StringBuilder
     377: dup
     378: invokespecial #128                // Method java/lang/StringBuilder."<init>":()V
     381: ldc           #130                // String Part 1:
     383: invokevirtual #134                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     386: iload_2
     387: invokevirtual #137                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     390: invokevirtual #141                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     393: getstatic     #147                // Field java/lang/System.out:Ljava/io/PrintStream;
     396: swap
     397: invokevirtual #153                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     400: aload_1
     401: checkcast     #49                 // class java/lang/Iterable
     404: astore        4
     406: nop
     407: iconst_0
     408: istore        5
     410: aload         4
     412: astore        6
     414: new           #51                 // class java/util/ArrayList
     417: dup
     418: aload         4
     420: bipush        10
     422: invokestatic  #57                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     425: invokespecial #60                 // Method java/util/ArrayList."<init>":(I)V
     428: checkcast     #62                 // class java/util/Collection
     431: astore        7
     433: iconst_0
     434: istore        8
     436: aload         6
     438: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     443: astore        9
     445: aload         9
     447: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     452: ifeq          515
     455: aload         9
     457: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     462: astore        10
     464: aload         7
     466: aload         10
     468: checkcast     #78                 // class java/lang/String
     471: astore        11
     473: astore        13
     475: iconst_0
     476: istore        12
     478: new           #99                 // class kotlin/Pair
     481: dup
     482: aload         11
     484: iconst_0
     485: invokevirtual #84                 // Method java/lang/String.charAt:(I)C
     488: invokestatic  #88                 // Method toItem:(C)Ljks/Item;
     491: aload         11
     493: iconst_2
     494: invokevirtual #84                 // Method java/lang/String.charAt:(I)C
     497: invokestatic  #157                // Method toResult:(C)Ljks/Result;
     500: invokespecial #106                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     503: aload         13
     505: swap
     506: invokeinterface #95,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     511: pop
     512: goto          445
     515: aload         7
     517: checkcast     #97                 // class java/util/List
     520: nop
     521: checkcast     #49                 // class java/lang/Iterable
     524: astore        4
     526: nop
     527: iconst_0
     528: istore        5
     530: aload         4
     532: astore        6
     534: new           #51                 // class java/util/ArrayList
     537: dup
     538: aload         4
     540: bipush        10
     542: invokestatic  #57                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     545: invokespecial #60                 // Method java/util/ArrayList."<init>":(I)V
     548: checkcast     #62                 // class java/util/Collection
     551: astore        7
     553: iconst_0
     554: istore        8
     556: aload         6
     558: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     563: astore        9
     565: aload         9
     567: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     572: ifeq          638
     575: aload         9
     577: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     582: astore        10
     584: aload         7
     586: aload         10
     588: checkcast     #99                 // class kotlin/Pair
     591: astore        11
     593: astore        13
     595: iconst_0
     596: istore        12
     598: new           #99                 // class kotlin/Pair
     601: dup
     602: aload         11
     604: aload         11
     606: invokevirtual #160                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     609: checkcast     #120                // class jks/Item
     612: aload         11
     614: invokevirtual #163                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     617: checkcast     #114                // class jks/Result
     620: invokestatic  #167                // Method itemForDesiredResult:(Ljks/Item;Ljks/Result;)Ljks/Item;
     623: invokespecial #106                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     626: aload         13
     628: swap
     629: invokeinterface #95,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     634: pop
     635: goto          565
     638: aload         7
     640: checkcast     #97                 // class java/util/List
     643: nop
     644: checkcast     #49                 // class java/lang/Iterable
     647: astore        4
     649: iconst_0
     650: istore        5
     652: aload         4
     654: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     659: astore        6
     661: aload         6
     663: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     668: ifeq          743
     671: aload         6
     673: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     678: astore        7
     680: iload         5
     682: aload         7
     684: checkcast     #99                 // class kotlin/Pair
     687: astore        8
     689: istore        13
     691: iconst_0
     692: istore        9
     694: aload         8
     696: invokevirtual #109                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     699: checkcast     #99                 // class kotlin/Pair
     702: astore        10
     704: aload         8
     706: invokevirtual #112                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     709: checkcast     #120                // class jks/Item
     712: astore        11
     714: aload         11
     716: invokevirtual #124                // Method jks/Item.getPoints:()I
     719: aload         10
     721: invokevirtual #163                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     724: checkcast     #114                // class jks/Result
     727: invokevirtual #125                // Method jks/Result.getPoints:()I
     730: iadd
     731: istore        14
     733: iload         13
     735: iload         14
     737: iadd
     738: istore        5
     740: goto          661
     743: iload         5
     745: istore_3
     746: new           #127                // class java/lang/StringBuilder
     749: dup
     750: invokespecial #128                // Method java/lang/StringBuilder."<init>":()V
     753: ldc           #169                // String Part 2:
     755: invokevirtual #134                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     758: iload_3
     759: invokevirtual #137                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     762: invokevirtual #141                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     765: getstatic     #147                // Field java/lang/System.out:Ljava/io/PrintStream;
     768: swap
     769: invokevirtual #153                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     772: return

  private static final jks.Result result(jks.Round);
    Code:
       0: aload_0
       1: astore_1
       2: aload_1
       3: new           #80                 // class jks/Round
       6: dup
       7: getstatic     #206                // Field jks/Item.ROCK:Ljks/Item;
      10: getstatic     #206                // Field jks/Item.ROCK:Ljks/Item;
      13: invokespecial #91                 // Method jks/Round."<init>":(Ljks/Item;Ljks/Item;)V
      16: invokestatic  #212                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      19: ifeq          28
      22: getstatic     #215                // Field jks/Result.DRAW:Ljks/Result;
      25: goto          263
      28: aload_1
      29: new           #80                 // class jks/Round
      32: dup
      33: getstatic     #206                // Field jks/Item.ROCK:Ljks/Item;
      36: getstatic     #218                // Field jks/Item.PAPER:Ljks/Item;
      39: invokespecial #91                 // Method jks/Round."<init>":(Ljks/Item;Ljks/Item;)V
      42: invokestatic  #212                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      45: ifeq          54
      48: getstatic     #221                // Field jks/Result.WINNER:Ljks/Result;
      51: goto          263
      54: aload_1
      55: new           #80                 // class jks/Round
      58: dup
      59: getstatic     #206                // Field jks/Item.ROCK:Ljks/Item;
      62: getstatic     #224                // Field jks/Item.SCISSORS:Ljks/Item;
      65: invokespecial #91                 // Method jks/Round."<init>":(Ljks/Item;Ljks/Item;)V
      68: invokestatic  #212                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      71: ifeq          80
      74: getstatic     #227                // Field jks/Result.LOSER:Ljks/Result;
      77: goto          263
      80: aload_1
      81: new           #80                 // class jks/Round
      84: dup
      85: getstatic     #218                // Field jks/Item.PAPER:Ljks/Item;
      88: getstatic     #206                // Field jks/Item.ROCK:Ljks/Item;
      91: invokespecial #91                 // Method jks/Round."<init>":(Ljks/Item;Ljks/Item;)V
      94: invokestatic  #212                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      97: ifeq          106
     100: getstatic     #227                // Field jks/Result.LOSER:Ljks/Result;
     103: goto          263
     106: aload_1
     107: new           #80                 // class jks/Round
     110: dup
     111: getstatic     #218                // Field jks/Item.PAPER:Ljks/Item;
     114: getstatic     #218                // Field jks/Item.PAPER:Ljks/Item;
     117: invokespecial #91                 // Method jks/Round."<init>":(Ljks/Item;Ljks/Item;)V
     120: invokestatic  #212                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     123: ifeq          132
     126: getstatic     #215                // Field jks/Result.DRAW:Ljks/Result;
     129: goto          263
     132: aload_1
     133: new           #80                 // class jks/Round
     136: dup
     137: getstatic     #218                // Field jks/Item.PAPER:Ljks/Item;
     140: getstatic     #224                // Field jks/Item.SCISSORS:Ljks/Item;
     143: invokespecial #91                 // Method jks/Round."<init>":(Ljks/Item;Ljks/Item;)V
     146: invokestatic  #212                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     149: ifeq          158
     152: getstatic     #221                // Field jks/Result.WINNER:Ljks/Result;
     155: goto          263
     158: aload_1
     159: new           #80                 // class jks/Round
     162: dup
     163: getstatic     #224                // Field jks/Item.SCISSORS:Ljks/Item;
     166: getstatic     #206                // Field jks/Item.ROCK:Ljks/Item;
     169: invokespecial #91                 // Method jks/Round."<init>":(Ljks/Item;Ljks/Item;)V
     172: invokestatic  #212                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     175: ifeq          184
     178: getstatic     #221                // Field jks/Result.WINNER:Ljks/Result;
     181: goto          263
     184: aload_1
     185: new           #80                 // class jks/Round
     188: dup
     189: getstatic     #224                // Field jks/Item.SCISSORS:Ljks/Item;
     192: getstatic     #218                // Field jks/Item.PAPER:Ljks/Item;
     195: invokespecial #91                 // Method jks/Round."<init>":(Ljks/Item;Ljks/Item;)V
     198: invokestatic  #212                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     201: ifeq          210
     204: getstatic     #227                // Field jks/Result.LOSER:Ljks/Result;
     207: goto          263
     210: aload_1
     211: new           #80                 // class jks/Round
     214: dup
     215: getstatic     #224                // Field jks/Item.SCISSORS:Ljks/Item;
     218: getstatic     #224                // Field jks/Item.SCISSORS:Ljks/Item;
     221: invokespecial #91                 // Method jks/Round."<init>":(Ljks/Item;Ljks/Item;)V
     224: invokestatic  #212                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     227: ifeq          236
     230: getstatic     #215                // Field jks/Result.DRAW:Ljks/Result;
     233: goto          263
     236: new           #31                 // class java/lang/RuntimeException
     239: dup
     240: new           #127                // class java/lang/StringBuilder
     243: dup
     244: invokespecial #128                // Method java/lang/StringBuilder."<init>":()V
     247: aload_0
     248: invokevirtual #230                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
     251: ldc           #232                // String  is not valid
     253: invokevirtual #134                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     256: invokevirtual #141                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     259: invokespecial #36                 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
     262: athrow
     263: areturn

  private static final jks.Item toItem(char);
    Code:
       0: iload_0
       1: lookupswitch  { // 6
                    65: 60
                    66: 66
                    67: 72
                    88: 60
                    89: 66
                    90: 72
               default: 78
          }
      60: getstatic     #206                // Field jks/Item.ROCK:Ljks/Item;
      63: goto          88
      66: getstatic     #218                // Field jks/Item.PAPER:Ljks/Item;
      69: goto          88
      72: getstatic     #224                // Field jks/Item.SCISSORS:Ljks/Item;
      75: goto          88
      78: new           #31                 // class java/lang/RuntimeException
      81: dup
      82: ldc           #33                 // String oh noes!
      84: invokespecial #36                 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
      87: athrow
      88: areturn

  private static final jks.Result toResult(char);
    Code:
       0: iload_0
       1: tableswitch   { // 88 to 90
                    88: 28
                    89: 34
                    90: 40
               default: 46
          }
      28: getstatic     #227                // Field jks/Result.LOSER:Ljks/Result;
      31: goto          56
      34: getstatic     #215                // Field jks/Result.DRAW:Ljks/Result;
      37: goto          56
      40: getstatic     #221                // Field jks/Result.WINNER:Ljks/Result;
      43: goto          56
      46: new           #31                 // class java/lang/RuntimeException
      49: dup
      50: ldc           #33                 // String oh noes!
      52: invokespecial #36                 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
      55: athrow
      56: areturn

  private static final jks.Item itemForDesiredResult(jks.Item, jks.Result);
    Code:
       0: nop
       1: aload_1
       2: getstatic     #215                // Field jks/Result.DRAW:Ljks/Result;
       5: if_acmpne     12
       8: aload_0
       9: goto          142
      12: aload_0
      13: getstatic     #206                // Field jks/Item.ROCK:Ljks/Item;
      16: if_acmpne     32
      19: aload_1
      20: getstatic     #221                // Field jks/Result.WINNER:Ljks/Result;
      23: if_acmpne     32
      26: getstatic     #218                // Field jks/Item.PAPER:Ljks/Item;
      29: goto          142
      32: aload_0
      33: getstatic     #206                // Field jks/Item.ROCK:Ljks/Item;
      36: if_acmpne     52
      39: aload_1
      40: getstatic     #227                // Field jks/Result.LOSER:Ljks/Result;
      43: if_acmpne     52
      46: getstatic     #224                // Field jks/Item.SCISSORS:Ljks/Item;
      49: goto          142
      52: aload_0
      53: getstatic     #218                // Field jks/Item.PAPER:Ljks/Item;
      56: if_acmpne     72
      59: aload_1
      60: getstatic     #221                // Field jks/Result.WINNER:Ljks/Result;
      63: if_acmpne     72
      66: getstatic     #224                // Field jks/Item.SCISSORS:Ljks/Item;
      69: goto          142
      72: aload_0
      73: getstatic     #218                // Field jks/Item.PAPER:Ljks/Item;
      76: if_acmpne     92
      79: aload_1
      80: getstatic     #227                // Field jks/Result.LOSER:Ljks/Result;
      83: if_acmpne     92
      86: getstatic     #206                // Field jks/Item.ROCK:Ljks/Item;
      89: goto          142
      92: aload_0
      93: getstatic     #224                // Field jks/Item.SCISSORS:Ljks/Item;
      96: if_acmpne     112
      99: aload_1
     100: getstatic     #221                // Field jks/Result.WINNER:Ljks/Result;
     103: if_acmpne     112
     106: getstatic     #206                // Field jks/Item.ROCK:Ljks/Item;
     109: goto          142
     112: aload_0
     113: getstatic     #224                // Field jks/Item.SCISSORS:Ljks/Item;
     116: if_acmpne     132
     119: aload_1
     120: getstatic     #227                // Field jks/Result.LOSER:Ljks/Result;
     123: if_acmpne     132
     126: getstatic     #218                // Field jks/Item.PAPER:Ljks/Item;
     129: goto          142
     132: new           #31                 // class java/lang/RuntimeException
     135: dup
     136: ldc           #33                 // String oh noes!
     138: invokespecial #36                 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
     141: athrow
     142: areturn

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

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


package problems.day2

import java.io.File

private const val gamesFile = "input/day2/games.txt"

fun main() {
    part1()
    part2()
}

private data class Round(val red: Int, val green: Int, val blue: Int)

private data class Game(val id: Int, val rounds: List<Round>) {
    fun allRedUnder(max: Int) = rounds.all { it.red <= max }
    fun allGreenUnder(max: Int) = rounds.all { it.green <= max }
    fun allBlueUnder(max: Int) = rounds.all { it.blue <= max }
    fun power() = maxRed() * maxGreen() * maxBlue()

    private fun maxRed() = rounds.maxOf { it.red }
    private fun maxGreen() = rounds.maxOf { it.green }
    private fun maxBlue() = rounds.maxOf { it.blue }
}

private fun part1() {
    val idSum = File(gamesFile).bufferedReader().useLines { sumIDs(it) }
    println("ID sum is $idSum")
}

private fun sumIDs(lines: Sequence<String>) =
    lines.map { it.toGame() }
        .filter { it.allRedUnder(12) and it.allGreenUnder(13) and it.allBlueUnder(14) }
        .map { it.id }
        .sum()

private fun String.toGame(): Game =
    Game(
        this.substringBefore(":").toGameID(),
        this.substringAfter(":").toRounds(),
    )

private fun String.toGameID(): Int = this.trim().removePrefix("Game ").toInt()

private fun String.toRounds(): List<Round> = this.trim().split(";").map { it.toRound() }

private fun String.toRound(): Round {
    var red = 0
    var green = 0
    var blue = 0

    this.split(",").map { it.trim() }.forEach {
        val amount = it.substringBefore(" ").toInt()
        when (it.substringAfter(" ")) {
            "red" -> red = amount
            "blue" -> blue = amount
            "green" -> green = amount
        }
    }

    return Round(red, green, blue)
}

private fun part2() {
    val powerSum = File(gamesFile).bufferedReader().useLines { sumPower(it) }
    println("Power sum is $powerSum")
}

private fun sumPower(lines: Sequence<String>) = lines.map { it.toGame().power() }.sum()

Compiled from "daytwo.kt"
public final class problems.day2.DaytwoKt {
  private static final java.lang.String gamesFile;

  public static final void main();
    Code:
       0: invokestatic  #9                  // Method part1:()V
       3: invokestatic  #12                 // Method part2:()V
       6: return

  private static final void part1();
    Code:
       0: new           #16                 // class java/io/File
       3: dup
       4: ldc           #18                 // String input/day2/games.txt
       6: invokespecial #22                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       9: astore_1
      10: getstatic     #28                 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      13: astore_2
      14: sipush        8192
      17: istore_3
      18: aload_1
      19: astore        4
      21: new           #30                 // class java/io/InputStreamReader
      24: dup
      25: new           #32                 // class java/io/FileInputStream
      28: dup
      29: aload         4
      31: invokespecial #35                 // Method java/io/FileInputStream."<init>":(Ljava/io/File;)V
      34: checkcast     #37                 // class java/io/InputStream
      37: aload_2
      38: invokespecial #40                 // Method java/io/InputStreamReader."<init>":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
      41: checkcast     #42                 // class java/io/Reader
      44: astore        4
      46: aload         4
      48: instanceof    #44                 // class java/io/BufferedReader
      51: ifeq          62
      54: aload         4
      56: checkcast     #44                 // class java/io/BufferedReader
      59: goto          72
      62: new           #44                 // class java/io/BufferedReader
      65: dup
      66: aload         4
      68: iload_3
      69: invokespecial #47                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
      72: checkcast     #42                 // class java/io/Reader
      75: astore_1
      76: nop
      77: iconst_0
      78: istore_2
      79: aload_1
      80: astore_3
      81: sipush        8192
      84: istore        4
      86: aload_3
      87: instanceof    #44                 // class java/io/BufferedReader
      90: ifeq          100
      93: aload_3
      94: checkcast     #44                 // class java/io/BufferedReader
      97: goto          110
     100: new           #44                 // class java/io/BufferedReader
     103: dup
     104: aload_3
     105: iload         4
     107: invokespecial #47                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
     110: checkcast     #49                 // class java/io/Closeable
     113: astore_3
     114: aconst_null
     115: astore        4
     117: nop
     118: aload_3
     119: checkcast     #44                 // class java/io/BufferedReader
     122: astore        5
     124: iconst_0
     125: istore        6
     127: aload         5
     129: invokestatic  #55                 // Method kotlin/io/TextStreamsKt.lineSequence:(Ljava/io/BufferedReader;)Lkotlin/sequences/Sequence;
     132: astore        7
     134: iconst_0
     135: istore        8
     137: aload         7
     139: invokestatic  #59                 // Method sumIDs:(Lkotlin/sequences/Sequence;)I
     142: istore        5
     144: aload_3
     145: aload         4
     147: invokestatic  #65                 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     150: iload         5
     152: goto          175
     155: astore        6
     157: aload         6
     159: astore        4
     161: aload         6
     163: athrow
     164: astore        6
     166: aload_3
     167: aload         4
     169: invokestatic  #65                 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     172: aload         6
     174: athrow
     175: nop
     176: istore_0
     177: new           #67                 // class java/lang/StringBuilder
     180: dup
     181: invokespecial #69                 // Method java/lang/StringBuilder."<init>":()V
     184: ldc           #71                 // String ID sum is
     186: invokevirtual #75                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     189: iload_0
     190: invokevirtual #78                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     193: invokevirtual #82                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     196: getstatic     #88                 // Field java/lang/System.out:Ljava/io/PrintStream;
     199: swap
     200: invokevirtual #94                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     203: return
    Exception table:
       from    to  target type
         117   144   155   Class java/lang/Throwable
         117   144   164   any
         155   164   164   any
         164   166   164   any

  private static final int sumIDs(kotlin.sequences.Sequence<java.lang.String>);
    Code:
       0: aload_0
       1: invokedynamic #129,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
       6: invokestatic  #135                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
       9: invokedynamic #143,  0            // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function1;
      14: invokestatic  #146                // Method kotlin/sequences/SequencesKt.filter:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      17: invokedynamic #154,  0            // InvokeDynamic #2:invoke:()Lkotlin/jvm/functions/Function1;
      22: invokestatic  #135                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      25: invokestatic  #157                // Method kotlin/sequences/SequencesKt.sumOfInt:(Lkotlin/sequences/Sequence;)I
      28: ireturn

  private static final problems.day2.Game toGame(java.lang.String);
    Code:
       0: new           #161                // class problems/day2/Game
       3: dup
       4: aload_0
       5: ldc           #163                // String :
       7: aconst_null
       8: iconst_2
       9: aconst_null
      10: invokestatic  #169                // Method kotlin/text/StringsKt.substringBefore$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
      13: invokestatic  #173                // Method toGameID:(Ljava/lang/String;)I
      16: aload_0
      17: ldc           #163                // String :
      19: aconst_null
      20: iconst_2
      21: aconst_null
      22: invokestatic  #176                // Method kotlin/text/StringsKt.substringAfter$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
      25: invokestatic  #180                // Method toRounds:(Ljava/lang/String;)Ljava/util/List;
      28: invokespecial #183                // Method problems/day2/Game."<init>":(ILjava/util/List;)V
      31: areturn

  private static final int toGameID(java.lang.String);
    Code:
       0: aload_0
       1: checkcast     #187                // class java/lang/CharSequence
       4: invokestatic  #191                // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
       7: invokevirtual #192                // Method java/lang/Object.toString:()Ljava/lang/String;
      10: ldc           #194                // String Game
      12: checkcast     #187                // class java/lang/CharSequence
      15: invokestatic  #198                // Method kotlin/text/StringsKt.removePrefix:(Ljava/lang/String;Ljava/lang/CharSequence;)Ljava/lang/String;
      18: invokestatic  #203                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      21: ireturn

  private static final java.util.List<problems.day2.Round> toRounds(java.lang.String);
    Code:
       0: aload_0
       1: checkcast     #187                // class java/lang/CharSequence
       4: invokestatic  #191                // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
       7: invokevirtual #192                // Method java/lang/Object.toString:()Ljava/lang/String;
      10: checkcast     #187                // class java/lang/CharSequence
      13: iconst_1
      14: anewarray     #207                // class java/lang/String
      17: astore_1
      18: aload_1
      19: iconst_0
      20: ldc           #209                // String ;
      22: aastore
      23: aload_1
      24: iconst_0
      25: iconst_0
      26: bipush        6
      28: aconst_null
      29: invokestatic  #213                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      32: checkcast     #215                // class java/lang/Iterable
      35: astore_1
      36: iconst_0
      37: istore_2
      38: aload_1
      39: astore_3
      40: new           #217                // class java/util/ArrayList
      43: dup
      44: aload_1
      45: bipush        10
      47: invokestatic  #223                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      50: invokespecial #226                // Method java/util/ArrayList."<init>":(I)V
      53: checkcast     #228                // class java/util/Collection
      56: astore        4
      58: iconst_0
      59: istore        5
      61: aload_3
      62: invokeinterface #232,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      67: astore        6
      69: aload         6
      71: invokeinterface #238,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      76: ifeq          119
      79: aload         6
      81: invokeinterface #242,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      86: astore        7
      88: aload         4
      90: aload         7
      92: checkcast     #207                // class java/lang/String
      95: astore        8
      97: astore        10
      99: iconst_0
     100: istore        9
     102: aload         8
     104: invokestatic  #246                // Method toRound:(Ljava/lang/String;)Lproblems/day2/Round;
     107: aload         10
     109: swap
     110: invokeinterface #250,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     115: pop
     116: goto          69
     119: aload         4
     121: checkcast     #252                // class java/util/List
     124: nop
     125: areturn

  private static final problems.day2.Round toRound(java.lang.String);
    Code:
       0: iconst_0
       1: istore_1
       2: iconst_0
       3: istore_2
       4: iconst_0
       5: istore_3
       6: aload_0
       7: checkcast     #187                // class java/lang/CharSequence
      10: iconst_1
      11: anewarray     #207                // class java/lang/String
      14: astore        4
      16: aload         4
      18: iconst_0
      19: ldc_w         #265                // String ,
      22: aastore
      23: aload         4
      25: iconst_0
      26: iconst_0
      27: bipush        6
      29: aconst_null
      30: invokestatic  #213                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      33: checkcast     #215                // class java/lang/Iterable
      36: astore        4
      38: iconst_0
      39: istore        5
      41: aload         4
      43: astore        6
      45: new           #217                // class java/util/ArrayList
      48: dup
      49: aload         4
      51: bipush        10
      53: invokestatic  #223                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      56: invokespecial #226                // Method java/util/ArrayList."<init>":(I)V
      59: checkcast     #228                // class java/util/Collection
      62: astore        7
      64: iconst_0
      65: istore        8
      67: aload         6
      69: invokeinterface #232,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      74: astore        9
      76: aload         9
      78: invokeinterface #238,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      83: ifeq          133
      86: aload         9
      88: invokeinterface #242,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      93: astore        10
      95: aload         7
      97: aload         10
      99: checkcast     #207                // class java/lang/String
     102: astore        11
     104: astore        13
     106: iconst_0
     107: istore        12
     109: aload         11
     111: checkcast     #187                // class java/lang/CharSequence
     114: invokestatic  #191                // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
     117: invokevirtual #192                // Method java/lang/Object.toString:()Ljava/lang/String;
     120: nop
     121: aload         13
     123: swap
     124: invokeinterface #250,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     129: pop
     130: goto          76
     133: aload         7
     135: checkcast     #252                // class java/util/List
     138: nop
     139: checkcast     #215                // class java/lang/Iterable
     142: astore        4
     144: nop
     145: iconst_0
     146: istore        5
     148: aload         4
     150: invokeinterface #232,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     155: astore        6
     157: aload         6
     159: invokeinterface #238,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     164: ifeq          318
     167: aload         6
     169: invokeinterface #242,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     174: astore        7
     176: aload         7
     178: checkcast     #207                // class java/lang/String
     181: astore        8
     183: iconst_0
     184: istore        9
     186: aload         8
     188: ldc_w         #267                // String
     191: aconst_null
     192: iconst_2
     193: aconst_null
     194: invokestatic  #169                // Method kotlin/text/StringsKt.substringBefore$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
     197: invokestatic  #203                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     200: istore        10
     202: aload         8
     204: ldc_w         #267                // String
     207: aconst_null
     208: iconst_2
     209: aconst_null
     210: invokestatic  #176                // Method kotlin/text/StringsKt.substringAfter$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
     213: astore        11
     215: aload         11
     217: invokevirtual #271                // Method java/lang/String.hashCode:()I
     220: lookupswitch  { // 3
                112785: 256
               3027034: 284
              98619139: 270
               default: 313
          }
     256: aload         11
     258: ldc_w         #273                // String red
     261: invokevirtual #276                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     264: ifne          298
     267: goto          313
     270: aload         11
     272: ldc_w         #278                // String green
     275: invokevirtual #276                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     278: ifne          310
     281: goto          313
     284: aload         11
     286: ldc_w         #280                // String blue
     289: invokevirtual #276                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     292: ifne          304
     295: goto          313
     298: iload         10
     300: istore_1
     301: goto          313
     304: iload         10
     306: istore_3
     307: goto          313
     310: iload         10
     312: istore_2
     313: nop
     314: nop
     315: goto          157
     318: nop
     319: new           #282                // class problems/day2/Round
     322: dup
     323: iload_1
     324: iload_2
     325: iload_3
     326: invokespecial #285                // Method problems/day2/Round."<init>":(III)V
     329: areturn

  private static final void part2();
    Code:
       0: new           #16                 // class java/io/File
       3: dup
       4: ldc           #18                 // String input/day2/games.txt
       6: invokespecial #22                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       9: astore_1
      10: getstatic     #28                 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      13: astore_2
      14: sipush        8192
      17: istore_3
      18: aload_1
      19: astore        4
      21: new           #30                 // class java/io/InputStreamReader
      24: dup
      25: new           #32                 // class java/io/FileInputStream
      28: dup
      29: aload         4
      31: invokespecial #35                 // Method java/io/FileInputStream."<init>":(Ljava/io/File;)V
      34: checkcast     #37                 // class java/io/InputStream
      37: aload_2
      38: invokespecial #40                 // Method java/io/InputStreamReader."<init>":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
      41: checkcast     #42                 // class java/io/Reader
      44: astore        4
      46: aload         4
      48: instanceof    #44                 // class java/io/BufferedReader
      51: ifeq          62
      54: aload         4
      56: checkcast     #44                 // class java/io/BufferedReader
      59: goto          72
      62: new           #44                 // class java/io/BufferedReader
      65: dup
      66: aload         4
      68: iload_3
      69: invokespecial #47                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
      72: checkcast     #42                 // class java/io/Reader
      75: astore_1
      76: nop
      77: iconst_0
      78: istore_2
      79: aload_1
      80: astore_3
      81: sipush        8192
      84: istore        4
      86: aload_3
      87: instanceof    #44                 // class java/io/BufferedReader
      90: ifeq          100
      93: aload_3
      94: checkcast     #44                 // class java/io/BufferedReader
      97: goto          110
     100: new           #44                 // class java/io/BufferedReader
     103: dup
     104: aload_3
     105: iload         4
     107: invokespecial #47                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
     110: checkcast     #49                 // class java/io/Closeable
     113: astore_3
     114: aconst_null
     115: astore        4
     117: nop
     118: aload_3
     119: checkcast     #44                 // class java/io/BufferedReader
     122: astore        5
     124: iconst_0
     125: istore        6
     127: aload         5
     129: invokestatic  #55                 // Method kotlin/io/TextStreamsKt.lineSequence:(Ljava/io/BufferedReader;)Lkotlin/sequences/Sequence;
     132: astore        7
     134: iconst_0
     135: istore        8
     137: aload         7
     139: invokestatic  #295                // Method sumPower:(Lkotlin/sequences/Sequence;)I
     142: istore        5
     144: aload_3
     145: aload         4
     147: invokestatic  #65                 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     150: iload         5
     152: goto          175
     155: astore        6
     157: aload         6
     159: astore        4
     161: aload         6
     163: athrow
     164: astore        6
     166: aload_3
     167: aload         4
     169: invokestatic  #65                 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     172: aload         6
     174: athrow
     175: nop
     176: istore_0
     177: new           #67                 // class java/lang/StringBuilder
     180: dup
     181: invokespecial #69                 // Method java/lang/StringBuilder."<init>":()V
     184: ldc_w         #297                // String Power sum is
     187: invokevirtual #75                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     190: iload_0
     191: invokevirtual #78                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     194: invokevirtual #82                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     197: getstatic     #88                 // Field java/lang/System.out:Ljava/io/PrintStream;
     200: swap
     201: invokevirtual #94                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     204: return
    Exception table:
       from    to  target type
         117   144   155   Class java/lang/Throwable
         117   144   164   any
         155   164   164   any
         164   166   164   any

  private static final int sumPower(kotlin.sequences.Sequence<java.lang.String>);
    Code:
       0: aload_0
       1: invokedynamic #306,  0            // InvokeDynamic #3:invoke:()Lkotlin/jvm/functions/Function1;
       6: invokestatic  #135                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
       9: invokestatic  #157                // Method kotlin/sequences/SequencesKt.sumOfInt:(Lkotlin/sequences/Sequence;)I
      12: ireturn

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

  private static final problems.day2.Game sumIDs$lambda$1(java.lang.String);
    Code:
       0: aload_0
       1: ldc_w         #312                // String it
       4: invokestatic  #318                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokestatic  #320                // Method toGame:(Ljava/lang/String;)Lproblems/day2/Game;
      11: areturn

  private static final boolean sumIDs$lambda$2(problems.day2.Game);
    Code:
       0: aload_0
       1: ldc_w         #312                // String it
       4: invokestatic  #318                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: bipush        12
      10: invokevirtual #324                // Method problems/day2/Game.allRedUnder:(I)Z
      13: aload_0
      14: bipush        13
      16: invokevirtual #327                // Method problems/day2/Game.allGreenUnder:(I)Z
      19: iand
      20: aload_0
      21: bipush        14
      23: invokevirtual #330                // Method problems/day2/Game.allBlueUnder:(I)Z
      26: iand
      27: ireturn

  private static final int sumIDs$lambda$3(problems.day2.Game);
    Code:
       0: aload_0
       1: ldc_w         #312                // String it
       4: invokestatic  #318                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokevirtual #334                // Method problems/day2/Game.getId:()I
      11: ireturn

  private static final int sumPower$lambda$8(java.lang.String);
    Code:
       0: aload_0
       1: ldc_w         #312                // String it
       4: invokestatic  #318                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokestatic  #320                // Method toGame:(Ljava/lang/String;)Lproblems/day2/Game;
      11: invokevirtual #337                // Method problems/day2/Game.power:()I
      14: ireturn
}


package problems.day1

import java.io.File

private const val calibrationValues = "input/day1/calibration_values.txt"

fun main() {
    part1()
    part2()
}
private fun part1() {
    val sum = File(calibrationValues)
        .bufferedReader()
        .useLines { sumLines(it) }

    println("Sum of values is $sum")
}

private fun sumLines(lines: Sequence<String>) = lines.map { parseLine(it) }.sum()

private fun parseLine(input: String): Int {
    val numbers = input.filter { c -> c in '0'..'9' }
    return "${numbers.first()}${numbers.last()}".toInt()
}

private fun part2() {
    val sum = File(calibrationValues)
        .bufferedReader()
        .useLines { sumLinesV2(it) }

    println("Sum of values is $sum")
}

private fun sumLinesV2(lines: Sequence<String>) = lines.map { parseLineV2(it) }.sum()

private fun parseLineV2(input: String): Int {
    val first = input.findAnyOf(numTargets)?.second?.toNumString()
    val last = input.findLastAnyOf(numTargets)?.second?.toNumString()

    return "$first$last".toInt()
}

private val numTargets = listOf(
    "1", "2", "3", "4", "5", "6", "7", "8", "9",
    "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"
)

private fun String.toNumString() = when (this) {
    "one" -> "1"
    "two" -> "2"
    "three" -> "3"
    "four" -> "4"
    "five" -> "5"
    "six" -> "6"
    "seven" -> "7"
    "eight" -> "8"
    "nine" -> "9"
    else -> this
}

Compiled from "dayone.kt"
public final class problems.day1.DayoneKt {
  private static final java.lang.String calibrationValues;

  private static final java.util.List<java.lang.String> numTargets;

  public static final void main();
    Code:
       0: invokestatic  #9                  // Method part1:()V
       3: invokestatic  #12                 // Method part2:()V
       6: return

  private static final void part1();
    Code:
       0: new           #16                 // class java/io/File
       3: dup
       4: ldc           #18                 // String input/day1/calibration_values.txt
       6: invokespecial #22                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       9: astore_1
      10: getstatic     #28                 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      13: astore_2
      14: sipush        8192
      17: istore_3
      18: aload_1
      19: astore        4
      21: new           #30                 // class java/io/InputStreamReader
      24: dup
      25: new           #32                 // class java/io/FileInputStream
      28: dup
      29: aload         4
      31: invokespecial #35                 // Method java/io/FileInputStream."<init>":(Ljava/io/File;)V
      34: checkcast     #37                 // class java/io/InputStream
      37: aload_2
      38: invokespecial #40                 // Method java/io/InputStreamReader."<init>":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
      41: checkcast     #42                 // class java/io/Reader
      44: astore        4
      46: aload         4
      48: instanceof    #44                 // class java/io/BufferedReader
      51: ifeq          62
      54: aload         4
      56: checkcast     #44                 // class java/io/BufferedReader
      59: goto          72
      62: new           #44                 // class java/io/BufferedReader
      65: dup
      66: aload         4
      68: iload_3
      69: invokespecial #47                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
      72: checkcast     #42                 // class java/io/Reader
      75: astore_1
      76: nop
      77: iconst_0
      78: istore_2
      79: aload_1
      80: astore_3
      81: sipush        8192
      84: istore        4
      86: aload_3
      87: instanceof    #44                 // class java/io/BufferedReader
      90: ifeq          100
      93: aload_3
      94: checkcast     #44                 // class java/io/BufferedReader
      97: goto          110
     100: new           #44                 // class java/io/BufferedReader
     103: dup
     104: aload_3
     105: iload         4
     107: invokespecial #47                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
     110: checkcast     #49                 // class java/io/Closeable
     113: astore_3
     114: aconst_null
     115: astore        4
     117: nop
     118: aload_3
     119: checkcast     #44                 // class java/io/BufferedReader
     122: astore        5
     124: iconst_0
     125: istore        6
     127: aload         5
     129: invokestatic  #55                 // Method kotlin/io/TextStreamsKt.lineSequence:(Ljava/io/BufferedReader;)Lkotlin/sequences/Sequence;
     132: astore        7
     134: iconst_0
     135: istore        8
     137: aload         7
     139: invokestatic  #59                 // Method sumLines:(Lkotlin/sequences/Sequence;)I
     142: istore        5
     144: aload_3
     145: aload         4
     147: invokestatic  #65                 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     150: iload         5
     152: goto          175
     155: astore        6
     157: aload         6
     159: astore        4
     161: aload         6
     163: athrow
     164: astore        6
     166: aload_3
     167: aload         4
     169: invokestatic  #65                 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     172: aload         6
     174: athrow
     175: nop
     176: istore_0
     177: new           #67                 // class java/lang/StringBuilder
     180: dup
     181: invokespecial #69                 // Method java/lang/StringBuilder."<init>":()V
     184: ldc           #71                 // String Sum of values is
     186: invokevirtual #75                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     189: iload_0
     190: invokevirtual #78                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     193: invokevirtual #82                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     196: getstatic     #88                 // Field java/lang/System.out:Ljava/io/PrintStream;
     199: swap
     200: invokevirtual #94                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     203: return
    Exception table:
       from    to  target type
         117   144   155   Class java/lang/Throwable
         117   144   164   any
         155   164   164   any
         164   166   164   any

  private static final int sumLines(kotlin.sequences.Sequence<java.lang.String>);
    Code:
       0: aload_0
       1: invokedynamic #130,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
       6: invokestatic  #136                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
       9: invokestatic  #139                // Method kotlin/sequences/SequencesKt.sumOfInt:(Lkotlin/sequences/Sequence;)I
      12: ireturn

  private static final int parseLine(java.lang.String);
    Code:
       0: aload_0
       1: astore_2
       2: iconst_0
       3: istore_3
       4: aload_2
       5: checkcast     #143                // class java/lang/CharSequence
       8: astore        4
      10: new           #67                 // class java/lang/StringBuilder
      13: dup
      14: invokespecial #69                 // Method java/lang/StringBuilder."<init>":()V
      17: checkcast     #145                // class java/lang/Appendable
      20: astore        5
      22: iconst_0
      23: istore        6
      25: iconst_0
      26: istore        7
      28: aload         4
      30: invokeinterface #149,  1          // InterfaceMethod java/lang/CharSequence.length:()I
      35: istore        8
      37: iload         7
      39: iload         8
      41: if_icmpge     104
      44: aload         4
      46: iload         7
      48: invokeinterface #153,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
      53: istore        9
      55: iload         9
      57: istore        10
      59: iconst_0
      60: istore        11
      62: bipush        48
      64: iload         10
      66: if_icmpgt     84
      69: iload         10
      71: bipush        58
      73: if_icmpge     80
      76: iconst_1
      77: goto          85
      80: iconst_0
      81: goto          85
      84: iconst_0
      85: ifeq          98
      88: aload         5
      90: iload         9
      92: invokeinterface #156,  2          // InterfaceMethod java/lang/Appendable.append:(C)Ljava/lang/Appendable;
      97: pop
      98: iinc          7, 1
     101: goto          37
     104: aload         5
     106: checkcast     #67                 // class java/lang/StringBuilder
     109: invokevirtual #82                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     112: astore_1
     113: new           #67                 // class java/lang/StringBuilder
     116: dup
     117: invokespecial #69                 // Method java/lang/StringBuilder."<init>":()V
     120: aload_1
     121: checkcast     #143                // class java/lang/CharSequence
     124: invokestatic  #162                // Method kotlin/text/StringsKt.first:(Ljava/lang/CharSequence;)C
     127: invokevirtual #165                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     130: aload_1
     131: checkcast     #143                // class java/lang/CharSequence
     134: invokestatic  #168                // Method kotlin/text/StringsKt.last:(Ljava/lang/CharSequence;)C
     137: invokevirtual #165                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     140: invokevirtual #82                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     143: invokestatic  #173                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     146: ireturn

  private static final void part2();
    Code:
       0: new           #16                 // class java/io/File
       3: dup
       4: ldc           #18                 // String input/day1/calibration_values.txt
       6: invokespecial #22                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       9: astore_1
      10: getstatic     #28                 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      13: astore_2
      14: sipush        8192
      17: istore_3
      18: aload_1
      19: astore        4
      21: new           #30                 // class java/io/InputStreamReader
      24: dup
      25: new           #32                 // class java/io/FileInputStream
      28: dup
      29: aload         4
      31: invokespecial #35                 // Method java/io/FileInputStream."<init>":(Ljava/io/File;)V
      34: checkcast     #37                 // class java/io/InputStream
      37: aload_2
      38: invokespecial #40                 // Method java/io/InputStreamReader."<init>":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
      41: checkcast     #42                 // class java/io/Reader
      44: astore        4
      46: aload         4
      48: instanceof    #44                 // class java/io/BufferedReader
      51: ifeq          62
      54: aload         4
      56: checkcast     #44                 // class java/io/BufferedReader
      59: goto          72
      62: new           #44                 // class java/io/BufferedReader
      65: dup
      66: aload         4
      68: iload_3
      69: invokespecial #47                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
      72: checkcast     #42                 // class java/io/Reader
      75: astore_1
      76: nop
      77: iconst_0
      78: istore_2
      79: aload_1
      80: astore_3
      81: sipush        8192
      84: istore        4
      86: aload_3
      87: instanceof    #44                 // class java/io/BufferedReader
      90: ifeq          100
      93: aload_3
      94: checkcast     #44                 // class java/io/BufferedReader
      97: goto          110
     100: new           #44                 // class java/io/BufferedReader
     103: dup
     104: aload_3
     105: iload         4
     107: invokespecial #47                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
     110: checkcast     #49                 // class java/io/Closeable
     113: astore_3
     114: aconst_null
     115: astore        4
     117: nop
     118: aload_3
     119: checkcast     #44                 // class java/io/BufferedReader
     122: astore        5
     124: iconst_0
     125: istore        6
     127: aload         5
     129: invokestatic  #55                 // Method kotlin/io/TextStreamsKt.lineSequence:(Ljava/io/BufferedReader;)Lkotlin/sequences/Sequence;
     132: astore        7
     134: iconst_0
     135: istore        8
     137: aload         7
     139: invokestatic  #193                // Method sumLinesV2:(Lkotlin/sequences/Sequence;)I
     142: istore        5
     144: aload_3
     145: aload         4
     147: invokestatic  #65                 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     150: iload         5
     152: goto          175
     155: astore        6
     157: aload         6
     159: astore        4
     161: aload         6
     163: athrow
     164: astore        6
     166: aload_3
     167: aload         4
     169: invokestatic  #65                 // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     172: aload         6
     174: athrow
     175: nop
     176: istore_0
     177: new           #67                 // class java/lang/StringBuilder
     180: dup
     181: invokespecial #69                 // Method java/lang/StringBuilder."<init>":()V
     184: ldc           #71                 // String Sum of values is
     186: invokevirtual #75                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     189: iload_0
     190: invokevirtual #78                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     193: invokevirtual #82                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     196: getstatic     #88                 // Field java/lang/System.out:Ljava/io/PrintStream;
     199: swap
     200: invokevirtual #94                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     203: return
    Exception table:
       from    to  target type
         117   144   155   Class java/lang/Throwable
         117   144   164   any
         155   164   164   any
         164   166   164   any

  private static final int sumLinesV2(kotlin.sequences.Sequence<java.lang.String>);
    Code:
       0: aload_0
       1: invokedynamic #199,  0            // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function1;
       6: invokestatic  #136                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
       9: invokestatic  #139                // Method kotlin/sequences/SequencesKt.sumOfInt:(Lkotlin/sequences/Sequence;)I
      12: ireturn

  private static final int parseLineV2(java.lang.String);
    Code:
       0: aload_0
       1: checkcast     #143                // class java/lang/CharSequence
       4: getstatic     #204                // Field numTargets:Ljava/util/List;
       7: checkcast     #206                // class java/util/Collection
      10: iconst_0
      11: iconst_0
      12: bipush        6
      14: aconst_null
      15: invokestatic  #210                // Method kotlin/text/StringsKt.findAnyOf$default:(Ljava/lang/CharSequence;Ljava/util/Collection;IZILjava/lang/Object;)Lkotlin/Pair;
      18: dup
      19: ifnull        38
      22: invokevirtual #216                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      25: checkcast     #190                // class java/lang/String
      28: dup
      29: ifnull        38
      32: invokestatic  #220                // Method toNumString:(Ljava/lang/String;)Ljava/lang/String;
      35: goto          40
      38: pop
      39: aconst_null
      40: astore_1
      41: aload_0
      42: checkcast     #143                // class java/lang/CharSequence
      45: getstatic     #204                // Field numTargets:Ljava/util/List;
      48: checkcast     #206                // class java/util/Collection
      51: iconst_0
      52: iconst_0
      53: bipush        6
      55: aconst_null
      56: invokestatic  #223                // Method kotlin/text/StringsKt.findLastAnyOf$default:(Ljava/lang/CharSequence;Ljava/util/Collection;IZILjava/lang/Object;)Lkotlin/Pair;
      59: dup
      60: ifnull        79
      63: invokevirtual #216                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      66: checkcast     #190                // class java/lang/String
      69: dup
      70: ifnull        79
      73: invokestatic  #220                // Method toNumString:(Ljava/lang/String;)Ljava/lang/String;
      76: goto          81
      79: pop
      80: aconst_null
      81: astore_2
      82: new           #67                 // class java/lang/StringBuilder
      85: dup
      86: invokespecial #69                 // Method java/lang/StringBuilder."<init>":()V
      89: aload_1
      90: invokevirtual #75                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      93: aload_2
      94: invokevirtual #75                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      97: invokevirtual #82                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     100: invokestatic  #173                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     103: ireturn

  private static final java.lang.String toNumString(java.lang.String);
    Code:
       0: aload_0
       1: astore_1
       2: aload_1
       3: invokevirtual #226                // Method java/lang/String.hashCode:()I
       6: lookupswitch  { // 9
                110182: 124
                113890: 100
                115276: 148
               3143346: 172
               3149094: 112
               3381426: 88
              96505999: 184
             109330445: 136
             110339486: 160
               default: 247
          }
      88: aload_1
      89: ldc           #228                // String nine
      91: invokevirtual #232                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
      94: ifne          241
      97: goto          247
     100: aload_1
     101: ldc           #234                // String six
     103: invokevirtual #232                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     106: ifne          223
     109: goto          247
     112: aload_1
     113: ldc           #236                // String four
     115: invokevirtual #232                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     118: ifne          211
     121: goto          247
     124: aload_1
     125: ldc           #238                // String one
     127: invokevirtual #232                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     130: ifne          196
     133: goto          247
     136: aload_1
     137: ldc           #240                // String seven
     139: invokevirtual #232                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     142: ifne          229
     145: goto          247
     148: aload_1
     149: ldc           #242                // String two
     151: invokevirtual #232                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     154: ifne          201
     157: goto          247
     160: aload_1
     161: ldc           #244                // String three
     163: invokevirtual #232                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     166: ifne          206
     169: goto          247
     172: aload_1
     173: ldc           #246                // String five
     175: invokevirtual #232                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     178: ifne          217
     181: goto          247
     184: aload_1
     185: ldc           #248                // String eight
     187: invokevirtual #232                // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     190: ifne          235
     193: goto          247
     196: ldc           #250                // String 1
     198: goto          248
     201: ldc           #252                // String 2
     203: goto          248
     206: ldc           #254                // String 3
     208: goto          248
     211: ldc_w         #256                // String 4
     214: goto          248
     217: ldc_w         #258                // String 5
     220: goto          248
     223: ldc_w         #260                // String 6
     226: goto          248
     229: ldc_w         #262                // String 7
     232: goto          248
     235: ldc_w         #264                // String 8
     238: goto          248
     241: ldc_w         #266                // String 9
     244: goto          248
     247: aload_0
     248: areturn

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

  private static final int sumLines$lambda$1(java.lang.String);
    Code:
       0: aload_0
       1: ldc_w         #273                // String it
       4: invokestatic  #279                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokestatic  #281                // Method parseLine:(Ljava/lang/String;)I
      11: ireturn

  private static final int sumLinesV2$lambda$4(java.lang.String);
    Code:
       0: aload_0
       1: ldc_w         #273                // String it
       4: invokestatic  #279                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokestatic  #283                // Method parseLineV2:(Ljava/lang/String;)I
      11: ireturn

  static {};
    Code:
       0: bipush        18
       2: anewarray     #190                // class java/lang/String
       5: astore_0
       6: aload_0
       7: iconst_0
       8: ldc           #250                // String 1
      10: aastore
      11: aload_0
      12: iconst_1
      13: ldc           #252                // String 2
      15: aastore
      16: aload_0
      17: iconst_2
      18: ldc           #254                // String 3
      20: aastore
      21: aload_0
      22: iconst_3
      23: ldc_w         #256                // String 4
      26: aastore
      27: aload_0
      28: iconst_4
      29: ldc_w         #258                // String 5
      32: aastore
      33: aload_0
      34: iconst_5
      35: ldc_w         #260                // String 6
      38: aastore
      39: aload_0
      40: bipush        6
      42: ldc_w         #262                // String 7
      45: aastore
      46: aload_0
      47: bipush        7
      49: ldc_w         #264                // String 8
      52: aastore
      53: aload_0
      54: bipush        8
      56: ldc_w         #266                // String 9
      59: aastore
      60: aload_0
      61: bipush        9
      63: ldc           #238                // String one
      65: aastore
      66: aload_0
      67: bipush        10
      69: ldc           #242                // String two
      71: aastore
      72: aload_0
      73: bipush        11
      75: ldc           #244                // String three
      77: aastore
      78: aload_0
      79: bipush        12
      81: ldc           #236                // String four
      83: aastore
      84: aload_0
      85: bipush        13
      87: ldc           #246                // String five
      89: aastore
      90: aload_0
      91: bipush        14
      93: ldc           #234                // String six
      95: aastore
      96: aload_0
      97: bipush        15
      99: ldc           #240                // String seven
     101: aastore
     102: aload_0
     103: bipush        16
     105: ldc           #248                // String eight
     107: aastore
     108: aload_0
     109: bipush        17
     111: ldc           #228                // String nine
     113: aastore
     114: aload_0
     115: invokestatic  #290                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     118: putstatic     #204                // Field numTargets:Ljava/util/List;
     121: return
}