import java.io.File

fun parseFileAndGetInput(): List<String> {
    val filepath = "/Users/jorgenstamnes/Documents/own/AdventOfCode2021/day3/src/main/kotlin/input.txt"
    return File(filepath).readLines(Charsets.UTF_8).toList()
}

fun first() {
    val inputs = parseFileAndGetInput()

    val one = '1'
    val zero = '0'

    var gammaRateBits: String = ""
    var epsilonRateBits: String = ""

    val lengthOfBits = "110111100101".length

    for (i in 0 until lengthOfBits) {
        var numberOf0s = 0
        var numberOf1s = 0

        inputs.forEach { bits ->
            val bit: Char = bits[i]
            if (bit == '1') {
                numberOf1s += 1
            }
            if (bit == '0') {
                numberOf0s += 1
            }
        }

        if (numberOf1s > numberOf0s) {
            gammaRateBits += one
            epsilonRateBits += zero
        }

        if (numberOf0s > numberOf1s) {
            gammaRateBits += zero
            epsilonRateBits += one
        }

        println("1s: $numberOf1s, gammaRate: $gammaRateBits")
        println("0s: $numberOf0s")
    }

    val powerConsumption = Integer.parseInt(epsilonRateBits, 2) * Integer.parseInt(gammaRateBits, 2)
    println("Power consumption: $powerConsumption")
}

fun getBitCountAtPosition(inputs: List<String>, position: Int): Pair<Int, Int> {
    var numberOf0s = 0
    var numberOf1s = 0

    inputs.forEach { bits ->
        val bit: Char = bits[position]
        if (bit == '1') {
            numberOf1s += 1
        }
        if (bit == '0') {
            numberOf0s += 1
        }
    }

    return Pair(numberOf1s, numberOf0s)
}

fun getRecursiveAnswer(inputs: List<String>, position: Int, searchForFewest: Boolean = false): List<String> {
    if (inputs.size == 1) return inputs

    val (oneCount, zeroCount) = getBitCountAtPosition(inputs, position)

    if (oneCount == zeroCount) {
        return getRecursiveAnswer(
            inputs.filter {
                when (searchForFewest) {
                    false -> it[position] != '1'
                    else -> it[position] != '0'
                }
            },
            position + 1, searchForFewest
        )
    }

    if (oneCount > zeroCount) {
        return getRecursiveAnswer(
            inputs.filter {
                when (searchForFewest) {
                    false -> it[position] != '1'
                    else -> it[position] != '0'
                }
            },
            position + 1, searchForFewest
        )
    }

    return getRecursiveAnswer(
        inputs.filter {
            when (searchForFewest) {
                false -> it[position] != '0'
                true -> it[position] != '1'
            }
        },
        position + 1, searchForFewest
    )
}

fun second() {
    val inputs = parseFileAndGetInput()

    var oxygenList = mutableListOf<String>()
    var co2List = mutableListOf<String>()

    oxygenList.addAll(inputs)
    co2List.addAll(inputs)

    val oxygen = getRecursiveAnswer(oxygenList, 0)
    val co2 = getRecursiveAnswer(co2List, 0, true)

    println("OxygenList: $oxygen")
    println("co2List: $co2")

    println("Answer: ${Integer.parseInt(oxygen[0], 2) * Integer.parseInt(co2[0], 2)}")
}

fun main() {
    // first()
    second()
}

Compiled from "main.kt"
public final class MainKt {
  public static final java.util.List<java.lang.String> parseFileAndGetInput();
    Code:
       0: ldc           #10                 // String /Users/jorgenstamnes/Documents/own/AdventOfCode2021/day3/src/main/kotlin/input.txt
       2: astore_0
       3: new           #12                 // class java/io/File
       6: dup
       7: aload_0
       8: invokespecial #16                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      11: getstatic     #22                 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      14: invokestatic  #28                 // Method kotlin/io/FilesKt.readLines:(Ljava/io/File;Ljava/nio/charset/Charset;)Ljava/util/List;
      17: checkcast     #30                 // class java/lang/Iterable
      20: invokestatic  #36                 // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;
      23: areturn

  public static final void first();
    Code:
       0: invokestatic  #42                 // Method parseFileAndGetInput:()Ljava/util/List;
       3: astore_0
       4: bipush        49
       6: istore_1
       7: bipush        48
       9: istore_2
      10: ldc           #44                 // String
      12: astore_3
      13: ldc           #44                 // String
      15: astore        4
      17: bipush        12
      19: istore        5
      21: iconst_0
      22: istore        6
      24: iload         6
      26: iload         5
      28: if_icmpge     288
      31: iconst_0
      32: istore        7
      34: iconst_0
      35: istore        8
      37: aload_0
      38: checkcast     #30                 // class java/lang/Iterable
      41: astore        9
      43: iconst_0
      44: istore        10
      46: aload         9
      48: invokeinterface #48,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      53: astore        11
      55: aload         11
      57: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      62: ifeq          124
      65: aload         11
      67: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      72: astore        12
      74: aload         12
      76: checkcast     #60                 // class java/lang/String
      79: astore        13
      81: iconst_0
      82: istore        14
      84: aload         13
      86: iload         6
      88: invokevirtual #64                 // Method java/lang/String.charAt:(I)C
      91: istore        15
      93: iload         15
      95: bipush        49
      97: if_icmpne     106
     100: iload         8
     102: iconst_1
     103: iadd
     104: istore        8
     106: iload         15
     108: bipush        48
     110: if_icmpne     119
     113: iload         7
     115: iconst_1
     116: iadd
     117: istore        7
     119: nop
     120: nop
     121: goto          55
     124: nop
     125: iload         8
     127: iload         7
     129: if_icmple     172
     132: new           #66                 // class java/lang/StringBuilder
     135: dup
     136: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
     139: aload_3
     140: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     143: iload_1
     144: invokevirtual #75                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     147: invokevirtual #79                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     150: astore_3
     151: new           #66                 // class java/lang/StringBuilder
     154: dup
     155: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
     158: aload         4
     160: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     163: iload_2
     164: invokevirtual #75                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     167: invokevirtual #79                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     170: astore        4
     172: iload         7
     174: iload         8
     176: if_icmple     219
     179: new           #66                 // class java/lang/StringBuilder
     182: dup
     183: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
     186: aload_3
     187: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     190: iload_2
     191: invokevirtual #75                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     194: invokevirtual #79                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     197: astore_3
     198: new           #66                 // class java/lang/StringBuilder
     201: dup
     202: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
     205: aload         4
     207: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     210: iload_1
     211: invokevirtual #75                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     214: invokevirtual #79                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     217: astore        4
     219: new           #66                 // class java/lang/StringBuilder
     222: dup
     223: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
     226: ldc           #81                 // String 1s:
     228: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     231: iload         8
     233: invokevirtual #84                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     236: ldc           #86                 // String , gammaRate:
     238: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     241: aload_3
     242: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     245: invokevirtual #79                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     248: getstatic     #92                 // Field java/lang/System.out:Ljava/io/PrintStream;
     251: swap
     252: invokevirtual #98                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     255: new           #66                 // class java/lang/StringBuilder
     258: dup
     259: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
     262: ldc           #100                // String 0s:
     264: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     267: iload         7
     269: invokevirtual #84                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     272: invokevirtual #79                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     275: getstatic     #92                 // Field java/lang/System.out:Ljava/io/PrintStream;
     278: swap
     279: invokevirtual #98                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     282: iinc          6, 1
     285: goto          24
     288: aload         4
     290: iconst_2
     291: invokestatic  #106                // Method java/lang/Integer.parseInt:(Ljava/lang/String;I)I
     294: aload_3
     295: iconst_2
     296: invokestatic  #106                // Method java/lang/Integer.parseInt:(Ljava/lang/String;I)I
     299: imul
     300: istore        6
     302: new           #66                 // class java/lang/StringBuilder
     305: dup
     306: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
     309: ldc           #108                // String Power consumption:
     311: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     314: iload         6
     316: invokevirtual #84                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     319: invokevirtual #79                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     322: getstatic     #92                 // Field java/lang/System.out:Ljava/io/PrintStream;
     325: swap
     326: invokevirtual #98                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     329: return

  public static final kotlin.Pair<java.lang.Integer, java.lang.Integer> getBitCountAtPosition(java.util.List<java.lang.String>, int);
    Code:
       0: aload_0
       1: ldc           #135                // String inputs
       3: invokestatic  #141                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: iconst_0
       7: istore_2
       8: iconst_0
       9: istore_3
      10: aload_0
      11: checkcast     #30                 // class java/lang/Iterable
      14: astore        4
      16: iconst_0
      17: istore        5
      19: aload         4
      21: invokeinterface #48,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      26: astore        6
      28: aload         6
      30: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      35: ifeq          92
      38: aload         6
      40: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      45: astore        7
      47: aload         7
      49: checkcast     #60                 // class java/lang/String
      52: astore        8
      54: iconst_0
      55: istore        9
      57: aload         8
      59: iload_1
      60: invokevirtual #64                 // Method java/lang/String.charAt:(I)C
      63: istore        10
      65: iload         10
      67: bipush        49
      69: if_icmpne     76
      72: iload_3
      73: iconst_1
      74: iadd
      75: istore_3
      76: iload         10
      78: bipush        48
      80: if_icmpne     87
      83: iload_2
      84: iconst_1
      85: iadd
      86: istore_2
      87: nop
      88: nop
      89: goto          28
      92: nop
      93: new           #143                // class kotlin/Pair
      96: dup
      97: iload_3
      98: invokestatic  #147                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     101: iload_2
     102: invokestatic  #147                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     105: invokespecial #150                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     108: areturn

  public static final java.util.List<java.lang.String> getRecursiveAnswer(java.util.List<java.lang.String>, int, boolean);
    Code:
       0: aload_0
       1: ldc           #135                // String inputs
       3: invokestatic  #141                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokeinterface #159,  1          // InterfaceMethod java/util/List.size:()I
      12: iconst_1
      13: if_icmpne     18
      16: aload_0
      17: areturn
      18: aload_0
      19: iload_1
      20: invokestatic  #161                // Method getBitCountAtPosition:(Ljava/util/List;I)Lkotlin/Pair;
      23: astore_3
      24: aload_3
      25: invokevirtual #164                // Method kotlin/Pair.component1:()Ljava/lang/Object;
      28: checkcast     #166                // class java/lang/Number
      31: invokevirtual #169                // Method java/lang/Number.intValue:()I
      34: istore        4
      36: aload_3
      37: invokevirtual #172                // Method kotlin/Pair.component2:()Ljava/lang/Object;
      40: checkcast     #166                // class java/lang/Number
      43: invokevirtual #169                // Method java/lang/Number.intValue:()I
      46: istore        5
      48: iload         4
      50: iload         5
      52: if_icmpne     191
      55: aload_0
      56: checkcast     #30                 // class java/lang/Iterable
      59: astore        6
      61: iconst_0
      62: istore        7
      64: aload         6
      66: astore        8
      68: new           #174                // class java/util/ArrayList
      71: dup
      72: invokespecial #175                // Method java/util/ArrayList."<init>":()V
      75: checkcast     #177                // class java/util/Collection
      78: astore        9
      80: iconst_0
      81: istore        10
      83: aload         8
      85: invokeinterface #48,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      90: astore        11
      92: aload         11
      94: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      99: ifeq          177
     102: aload         11
     104: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     109: astore        12
     111: aload         12
     113: checkcast     #60                 // class java/lang/String
     116: astore        13
     118: iconst_0
     119: istore        14
     121: iload_2
     122: ifne          144
     125: aload         13
     127: iload_1
     128: invokevirtual #64                 // Method java/lang/String.charAt:(I)C
     131: bipush        49
     133: if_icmpeq     140
     136: iconst_1
     137: goto          160
     140: iconst_0
     141: goto          160
     144: aload         13
     146: iload_1
     147: invokevirtual #64                 // Method java/lang/String.charAt:(I)C
     150: bipush        48
     152: if_icmpeq     159
     155: iconst_1
     156: goto          160
     159: iconst_0
     160: nop
     161: ifeq          92
     164: aload         9
     166: aload         12
     168: invokeinterface #181,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     173: pop
     174: goto          92
     177: aload         9
     179: checkcast     #131                // class java/util/List
     182: nop
     183: iload_1
     184: iconst_1
     185: iadd
     186: iload_2
     187: invokestatic  #183                // Method getRecursiveAnswer:(Ljava/util/List;IZ)Ljava/util/List;
     190: areturn
     191: iload         4
     193: iload         5
     195: if_icmple     334
     198: aload_0
     199: checkcast     #30                 // class java/lang/Iterable
     202: astore        6
     204: iconst_0
     205: istore        7
     207: aload         6
     209: astore        8
     211: new           #174                // class java/util/ArrayList
     214: dup
     215: invokespecial #175                // Method java/util/ArrayList."<init>":()V
     218: checkcast     #177                // class java/util/Collection
     221: astore        9
     223: iconst_0
     224: istore        10
     226: aload         8
     228: invokeinterface #48,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     233: astore        11
     235: aload         11
     237: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     242: ifeq          320
     245: aload         11
     247: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     252: astore        12
     254: aload         12
     256: checkcast     #60                 // class java/lang/String
     259: astore        13
     261: iconst_0
     262: istore        14
     264: iload_2
     265: ifne          287
     268: aload         13
     270: iload_1
     271: invokevirtual #64                 // Method java/lang/String.charAt:(I)C
     274: bipush        49
     276: if_icmpeq     283
     279: iconst_1
     280: goto          303
     283: iconst_0
     284: goto          303
     287: aload         13
     289: iload_1
     290: invokevirtual #64                 // Method java/lang/String.charAt:(I)C
     293: bipush        48
     295: if_icmpeq     302
     298: iconst_1
     299: goto          303
     302: iconst_0
     303: nop
     304: ifeq          235
     307: aload         9
     309: aload         12
     311: invokeinterface #181,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     316: pop
     317: goto          235
     320: aload         9
     322: checkcast     #131                // class java/util/List
     325: nop
     326: iload_1
     327: iconst_1
     328: iadd
     329: iload_2
     330: invokestatic  #183                // Method getRecursiveAnswer:(Ljava/util/List;IZ)Ljava/util/List;
     333: areturn
     334: aload_0
     335: checkcast     #30                 // class java/lang/Iterable
     338: astore        6
     340: iconst_0
     341: istore        7
     343: aload         6
     345: astore        8
     347: new           #174                // class java/util/ArrayList
     350: dup
     351: invokespecial #175                // Method java/util/ArrayList."<init>":()V
     354: checkcast     #177                // class java/util/Collection
     357: astore        9
     359: iconst_0
     360: istore        10
     362: aload         8
     364: invokeinterface #48,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     369: astore        11
     371: aload         11
     373: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     378: ifeq          477
     381: aload         11
     383: invokeinterface #58,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     388: astore        12
     390: aload         12
     392: checkcast     #60                 // class java/lang/String
     395: astore        13
     397: iconst_0
     398: istore        14
     400: iload_2
     401: istore        15
     403: iload         15
     405: ifne          427
     408: aload         13
     410: iload_1
     411: invokevirtual #64                 // Method java/lang/String.charAt:(I)C
     414: bipush        48
     416: if_icmpeq     423
     419: iconst_1
     420: goto          460
     423: iconst_0
     424: goto          460
     427: iload         15
     429: iconst_1
     430: if_icmpne     452
     433: aload         13
     435: iload_1
     436: invokevirtual #64                 // Method java/lang/String.charAt:(I)C
     439: bipush        49
     441: if_icmpeq     448
     444: iconst_1
     445: goto          460
     448: iconst_0
     449: goto          460
     452: new           #185                // class kotlin/NoWhenBranchMatchedException
     455: dup
     456: invokespecial #186                // Method kotlin/NoWhenBranchMatchedException."<init>":()V
     459: athrow
     460: nop
     461: ifeq          371
     464: aload         9
     466: aload         12
     468: invokeinterface #181,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     473: pop
     474: goto          371
     477: aload         9
     479: checkcast     #131                // class java/util/List
     482: nop
     483: iload_1
     484: iconst_1
     485: iadd
     486: iload_2
     487: invokestatic  #183                // Method getRecursiveAnswer:(Ljava/util/List;IZ)Ljava/util/List;
     490: areturn

  public static java.util.List getRecursiveAnswer$default(java.util.List, int, boolean, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_4
       2: iand
       3: ifeq          8
       6: iconst_0
       7: istore_2
       8: aload_0
       9: iload_1
      10: iload_2
      11: invokestatic  #183                // Method getRecursiveAnswer:(Ljava/util/List;IZ)Ljava/util/List;
      14: areturn

  public static final void second();
    Code:
       0: invokestatic  #42                 // Method parseFileAndGetInput:()Ljava/util/List;
       3: astore_0
       4: new           #174                // class java/util/ArrayList
       7: dup
       8: invokespecial #175                // Method java/util/ArrayList."<init>":()V
      11: checkcast     #131                // class java/util/List
      14: astore_1
      15: new           #174                // class java/util/ArrayList
      18: dup
      19: invokespecial #175                // Method java/util/ArrayList."<init>":()V
      22: checkcast     #131                // class java/util/List
      25: astore_2
      26: aload_1
      27: aload_0
      28: checkcast     #177                // class java/util/Collection
      31: invokeinterface #208,  2          // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z
      36: pop
      37: aload_2
      38: aload_0
      39: checkcast     #177                // class java/util/Collection
      42: invokeinterface #208,  2          // InterfaceMethod java/util/List.addAll:(Ljava/util/Collection;)Z
      47: pop
      48: aload_1
      49: iconst_0
      50: iconst_0
      51: iconst_4
      52: aconst_null
      53: invokestatic  #210                // Method getRecursiveAnswer$default:(Ljava/util/List;IZILjava/lang/Object;)Ljava/util/List;
      56: astore_3
      57: aload_2
      58: iconst_0
      59: iconst_1
      60: invokestatic  #183                // Method getRecursiveAnswer:(Ljava/util/List;IZ)Ljava/util/List;
      63: astore        4
      65: new           #66                 // class java/lang/StringBuilder
      68: dup
      69: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
      72: ldc           #212                // String OxygenList:
      74: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      77: aload_3
      78: invokevirtual #215                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      81: invokevirtual #79                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      84: getstatic     #92                 // Field java/lang/System.out:Ljava/io/PrintStream;
      87: swap
      88: invokevirtual #98                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      91: new           #66                 // class java/lang/StringBuilder
      94: dup
      95: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
      98: ldc           #217                // String co2List:
     100: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     103: aload         4
     105: invokevirtual #215                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
     108: invokevirtual #79                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     111: getstatic     #92                 // Field java/lang/System.out:Ljava/io/PrintStream;
     114: swap
     115: invokevirtual #98                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     118: new           #66                 // class java/lang/StringBuilder
     121: dup
     122: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
     125: ldc           #219                // String Answer:
     127: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     130: aload_3
     131: iconst_0
     132: invokeinterface #223,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     137: checkcast     #60                 // class java/lang/String
     140: iconst_2
     141: invokestatic  #106                // Method java/lang/Integer.parseInt:(Ljava/lang/String;I)I
     144: aload         4
     146: iconst_0
     147: invokeinterface #223,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     152: checkcast     #60                 // class java/lang/String
     155: iconst_2
     156: invokestatic  #106                // Method java/lang/Integer.parseInt:(Ljava/lang/String;I)I
     159: imul
     160: invokevirtual #84                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     163: invokevirtual #79                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     166: getstatic     #92                 // Field java/lang/System.out:Ljava/io/PrintStream;
     169: swap
     170: invokevirtual #98                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     173: return

  public static final void main();
    Code:
       0: invokestatic  #230                // Method second:()V
       3: return

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


import java.io.File

fun main() {
    fun part1(input: List<String>): Int {
        val ranges = input.map { elfAssignments ->
            elfAssignments.asRanges()
        }
        return ranges.count { it.first.fullyOverlaps(it.second) || it.second.fullyOverlaps(it.first) }
    }

    fun part2(input: List<String>): Int {
        val ranges = input.map { elfAssignments ->
            elfAssignments.asRanges()
        }
        return ranges.count { it.first.overlaps(it.second) || it.second.overlaps(it.first) }
    }

    val input = File("src/input.txt").readLines()
    println(part1(input))
    println(part2(input))
}

private infix fun IntRange.fullyOverlaps(otherRange: IntRange): Boolean =
    first <= otherRange.first && last >= otherRange.last

private infix fun IntRange.overlaps(otherRange: IntRange): Boolean =
    first <= otherRange.last && otherRange.first <= last

private fun String.asIntRange(): IntRange =
    substringBefore("-").toInt()..substringAfter("-").toInt()

private fun String.asRanges(): Pair<IntRange, IntRange> =
    substringBefore(",").asIntRange() to substringAfter(",").asIntRange()

Compiled from "Day04.kt"
public final class Day04Kt {
  public static final void main();
    Code:
       0: new           #8                  // class java/io/File
       3: dup
       4: ldc           #10                 // String src/input.txt
       6: invokespecial #14                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       9: aconst_null
      10: iconst_1
      11: aconst_null
      12: invokestatic  #20                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      15: astore_0
      16: aload_0
      17: invokestatic  #24                 // Method main$part1:(Ljava/util/List;)I
      20: istore_1
      21: getstatic     #30                 // Field java/lang/System.out:Ljava/io/PrintStream;
      24: iload_1
      25: invokevirtual #36                 // Method java/io/PrintStream.println:(I)V
      28: aload_0
      29: invokestatic  #39                 // Method main$part2:(Ljava/util/List;)I
      32: istore_1
      33: getstatic     #30                 // Field java/lang/System.out:Ljava/io/PrintStream;
      36: iload_1
      37: invokevirtual #36                 // Method java/io/PrintStream.println:(I)V
      40: return

  private static final boolean fullyOverlaps(kotlin.ranges.IntRange, kotlin.ranges.IntRange);
    Code:
       0: aload_0
       1: invokevirtual #49                 // Method kotlin/ranges/IntRange.getFirst:()I
       4: aload_1
       5: invokevirtual #49                 // Method kotlin/ranges/IntRange.getFirst:()I
       8: if_icmpgt     26
      11: aload_0
      12: invokevirtual #52                 // Method kotlin/ranges/IntRange.getLast:()I
      15: aload_1
      16: invokevirtual #52                 // Method kotlin/ranges/IntRange.getLast:()I
      19: if_icmplt     26
      22: iconst_1
      23: goto          27
      26: iconst_0
      27: ireturn

  private static final boolean overlaps(kotlin.ranges.IntRange, kotlin.ranges.IntRange);
    Code:
       0: aload_0
       1: invokevirtual #49                 // Method kotlin/ranges/IntRange.getFirst:()I
       4: aload_1
       5: invokevirtual #52                 // Method kotlin/ranges/IntRange.getLast:()I
       8: if_icmpgt     26
      11: aload_1
      12: invokevirtual #49                 // Method kotlin/ranges/IntRange.getFirst:()I
      15: aload_0
      16: invokevirtual #52                 // Method kotlin/ranges/IntRange.getLast:()I
      19: if_icmpgt     26
      22: iconst_1
      23: goto          27
      26: iconst_0
      27: ireturn

  private static final kotlin.ranges.IntRange asIntRange(java.lang.String);
    Code:
       0: new           #45                 // class kotlin/ranges/IntRange
       3: dup
       4: aload_0
       5: ldc           #61                 // String -
       7: aconst_null
       8: iconst_2
       9: aconst_null
      10: invokestatic  #67                 // Method kotlin/text/StringsKt.substringBefore$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
      13: invokestatic  #73                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      16: aload_0
      17: ldc           #61                 // String -
      19: aconst_null
      20: iconst_2
      21: aconst_null
      22: invokestatic  #76                 // Method kotlin/text/StringsKt.substringAfter$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
      25: invokestatic  #73                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      28: invokespecial #79                 // Method kotlin/ranges/IntRange."<init>":(II)V
      31: areturn

  private static final kotlin.Pair<kotlin.ranges.IntRange, kotlin.ranges.IntRange> asRanges(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #86                 // String ,
       3: aconst_null
       4: iconst_2
       5: aconst_null
       6: invokestatic  #67                 // Method kotlin/text/StringsKt.substringBefore$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
       9: invokestatic  #88                 // Method asIntRange:(Ljava/lang/String;)Lkotlin/ranges/IntRange;
      12: aload_0
      13: ldc           #86                 // String ,
      15: aconst_null
      16: iconst_2
      17: aconst_null
      18: invokestatic  #76                 // Method kotlin/text/StringsKt.substringAfter$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
      21: invokestatic  #88                 // Method asIntRange:(Ljava/lang/String;)Lkotlin/ranges/IntRange;
      24: invokestatic  #94                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      27: areturn

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

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: checkcast     #103                // class java/lang/Iterable
       4: astore_2
       5: iconst_0
       6: istore_3
       7: aload_2
       8: astore        4
      10: new           #105                // class java/util/ArrayList
      13: dup
      14: aload_2
      15: bipush        10
      17: invokestatic  #111                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      20: invokespecial #113                // Method java/util/ArrayList."<init>":(I)V
      23: checkcast     #115                // class java/util/Collection
      26: astore        5
      28: iconst_0
      29: istore        6
      31: aload         4
      33: invokeinterface #119,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      38: astore        7
      40: aload         7
      42: invokeinterface #125,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      47: ifeq          90
      50: aload         7
      52: invokeinterface #129,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: astore        8
      59: aload         5
      61: aload         8
      63: checkcast     #131                // class java/lang/String
      66: astore        9
      68: astore        11
      70: iconst_0
      71: istore        10
      73: aload         9
      75: invokestatic  #133                // Method asRanges:(Ljava/lang/String;)Lkotlin/Pair;
      78: aload         11
      80: swap
      81: invokeinterface #137,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      86: pop
      87: goto          40
      90: aload         5
      92: checkcast     #139                // class java/util/List
      95: nop
      96: astore_1
      97: aload_1
      98: checkcast     #103                // class java/lang/Iterable
     101: astore_2
     102: iconst_0
     103: istore_3
     104: aload_2
     105: instanceof    #115                // class java/util/Collection
     108: ifeq          127
     111: aload_2
     112: checkcast     #115                // class java/util/Collection
     115: invokeinterface #142,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     120: ifeq          127
     123: iconst_0
     124: goto          235
     127: iconst_0
     128: istore        4
     130: aload_2
     131: invokeinterface #119,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     136: astore        5
     138: aload         5
     140: invokeinterface #125,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     145: ifeq          233
     148: aload         5
     150: invokeinterface #129,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     155: astore        6
     157: aload         6
     159: checkcast     #144                // class kotlin/Pair
     162: astore        7
     164: iconst_0
     165: istore        8
     167: aload         7
     169: invokevirtual #146                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     172: checkcast     #45                 // class kotlin/ranges/IntRange
     175: aload         7
     177: invokevirtual #149                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     180: checkcast     #45                 // class kotlin/ranges/IntRange
     183: invokestatic  #151                // Method fullyOverlaps:(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Z
     186: ifne          211
     189: aload         7
     191: invokevirtual #149                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     194: checkcast     #45                 // class kotlin/ranges/IntRange
     197: aload         7
     199: invokevirtual #146                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     202: checkcast     #45                 // class kotlin/ranges/IntRange
     205: invokestatic  #151                // Method fullyOverlaps:(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Z
     208: ifeq          215
     211: iconst_1
     212: goto          216
     215: iconst_0
     216: ifeq          138
     219: iinc          4, 1
     222: iload         4
     224: ifge          138
     227: invokestatic  #154                // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V
     230: goto          138
     233: iload         4
     235: ireturn

  private static final int main$part2(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: checkcast     #103                // class java/lang/Iterable
       4: astore_2
       5: iconst_0
       6: istore_3
       7: aload_2
       8: astore        4
      10: new           #105                // class java/util/ArrayList
      13: dup
      14: aload_2
      15: bipush        10
      17: invokestatic  #111                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      20: invokespecial #113                // Method java/util/ArrayList."<init>":(I)V
      23: checkcast     #115                // class java/util/Collection
      26: astore        5
      28: iconst_0
      29: istore        6
      31: aload         4
      33: invokeinterface #119,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      38: astore        7
      40: aload         7
      42: invokeinterface #125,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      47: ifeq          90
      50: aload         7
      52: invokeinterface #129,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: astore        8
      59: aload         5
      61: aload         8
      63: checkcast     #131                // class java/lang/String
      66: astore        9
      68: astore        11
      70: iconst_0
      71: istore        10
      73: aload         9
      75: invokestatic  #133                // Method asRanges:(Ljava/lang/String;)Lkotlin/Pair;
      78: aload         11
      80: swap
      81: invokeinterface #137,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      86: pop
      87: goto          40
      90: aload         5
      92: checkcast     #139                // class java/util/List
      95: nop
      96: astore_1
      97: aload_1
      98: checkcast     #103                // class java/lang/Iterable
     101: astore_2
     102: iconst_0
     103: istore_3
     104: aload_2
     105: instanceof    #115                // class java/util/Collection
     108: ifeq          127
     111: aload_2
     112: checkcast     #115                // class java/util/Collection
     115: invokeinterface #142,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     120: ifeq          127
     123: iconst_0
     124: goto          235
     127: iconst_0
     128: istore        4
     130: aload_2
     131: invokeinterface #119,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     136: astore        5
     138: aload         5
     140: invokeinterface #125,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     145: ifeq          233
     148: aload         5
     150: invokeinterface #129,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     155: astore        6
     157: aload         6
     159: checkcast     #144                // class kotlin/Pair
     162: astore        7
     164: iconst_0
     165: istore        8
     167: aload         7
     169: invokevirtual #146                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     172: checkcast     #45                 // class kotlin/ranges/IntRange
     175: aload         7
     177: invokevirtual #149                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     180: checkcast     #45                 // class kotlin/ranges/IntRange
     183: invokestatic  #176                // Method overlaps:(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Z
     186: ifne          211
     189: aload         7
     191: invokevirtual #149                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     194: checkcast     #45                 // class kotlin/ranges/IntRange
     197: aload         7
     199: invokevirtual #146                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     202: checkcast     #45                 // class kotlin/ranges/IntRange
     205: invokestatic  #176                // Method overlaps:(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Z
     208: ifeq          215
     211: iconst_1
     212: goto          216
     215: iconst_0
     216: ifeq          138
     219: iinc          4, 1
     222: iload         4
     224: ifge          138
     227: invokestatic  #154                // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V
     230: goto          138
     233: iload         4
     235: ireturn
}


import java.io.File

fun main() {
    val values = mapOf<String, Int>(
        "X" to 1, // pt1 Rock / 2 lose
        "Y" to 2, // pt1 Paper / 2 draw
        "Z" to 3 // pt1 Sissors / 2 win
    )

    fun determineGameResult(theirs: String, mine: String): Int {
        return when(theirs.single() to mine.single()) {
            'B' to 'X', 'C' to 'Y', 'A' to 'Z' -> 0
            'B' to 'Y', 'C' to 'Z', 'A' to 'X' -> 3
            'B' to 'Z', 'C' to 'X', 'A' to 'Y' -> 6
            else -> error("Before you wreck yourself")
        }
    }

    fun determineGuess(game: List<String>): Char {
        val theirGuess = game[0].single()
        return when(game[1].single()) {
            'X' -> // lose
                when(theirGuess){
                    'B' -> 'X'
                    'C' -> 'Y'
                    'A' -> 'Z'
                    else -> error("Check input")
                }
            'Y' -> // draw
                when(theirGuess){
                    'B' -> 'Y'
                    'C' -> 'Z'
                    'A' -> 'X'
                    else -> error("Check input")
                }
            'Z' -> // win
                when(theirGuess){
                    'B' -> 'Z'
                    'C' -> 'X'
                    'A' -> 'Y'
                    else -> error("Check input")
                }
            else -> error("Check your input")
        }
    }

    fun rockPaperSissors(input: List<String>, part: Int) {
        var score = 0
        require(part in 1..2) {
            "part must be 1 or 2"
        }
        input.map { currentGame ->
            currentGame.split(" ").let {
                val myGuess = if(part == 1) it[1] else determineGuess(it).toString()
                val myScore = values[myGuess] ?: error("Check yourself")
                val gameScore = determineGameResult(it[0], myGuess)
                score += myScore + gameScore!!
            }
        }
        println(score)
    }

    val input = File("src/input.txt").readLines()
    rockPaperSissors(input, 1)
    rockPaperSissors(input, 2)
}

Compiled from "Day02.kt"
public final class Day02Kt {
  public static final void main();
    Code:
       0: iconst_3
       1: anewarray     #8                  // class kotlin/Pair
       4: astore_1
       5: aload_1
       6: iconst_0
       7: ldc           #10                 // String X
       9: iconst_1
      10: invokestatic  #16                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      13: invokestatic  #22                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      16: aastore
      17: aload_1
      18: iconst_1
      19: ldc           #24                 // String Y
      21: iconst_2
      22: invokestatic  #16                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      25: invokestatic  #22                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      28: aastore
      29: aload_1
      30: iconst_2
      31: ldc           #26                 // String Z
      33: iconst_3
      34: invokestatic  #16                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      37: invokestatic  #22                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      40: aastore
      41: aload_1
      42: invokestatic  #32                 // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;
      45: astore_0
      46: new           #34                 // class java/io/File
      49: dup
      50: ldc           #36                 // String src/input.txt
      52: invokespecial #40                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      55: aconst_null
      56: iconst_1
      57: aconst_null
      58: invokestatic  #46                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      61: astore_1
      62: aload_0
      63: aload_1
      64: iconst_1
      65: invokestatic  #50                 // Method main$rockPaperSissors:(Ljava/util/Map;Ljava/util/List;I)V
      68: aload_0
      69: aload_1
      70: iconst_2
      71: invokestatic  #50                 // Method main$rockPaperSissors:(Ljava/util/Map;Ljava/util/List;I)V
      74: return

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

  private static final int main$determineGameResult(java.lang.String, java.lang.String);
    Code:
       0: aload_0
       1: checkcast     #63                 // class java/lang/CharSequence
       4: invokestatic  #69                 // Method kotlin/text/StringsKt.single:(Ljava/lang/CharSequence;)C
       7: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      10: aload_1
      11: checkcast     #63                 // class java/lang/CharSequence
      14: invokestatic  #69                 // Method kotlin/text/StringsKt.single:(Ljava/lang/CharSequence;)C
      17: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      20: invokestatic  #22                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      23: astore_2
      24: aload_2
      25: bipush        66
      27: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      30: bipush        88
      32: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      35: invokestatic  #22                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      38: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      41: ifne          84
      44: aload_2
      45: bipush        67
      47: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      50: bipush        89
      52: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      55: invokestatic  #22                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      58: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      61: ifne          84
      64: aload_2
      65: bipush        65
      67: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      70: bipush        90
      72: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      75: invokestatic  #22                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      78: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      81: ifeq          88
      84: iconst_0
      85: goto          230
      88: aload_2
      89: bipush        66
      91: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      94: bipush        89
      96: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      99: invokestatic  #22                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     102: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     105: ifne          148
     108: aload_2
     109: bipush        67
     111: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     114: bipush        90
     116: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     119: invokestatic  #22                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     122: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     125: ifne          148
     128: aload_2
     129: bipush        65
     131: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     134: bipush        88
     136: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     139: invokestatic  #22                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     142: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     145: ifeq          152
     148: iconst_3
     149: goto          230
     152: aload_2
     153: bipush        66
     155: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     158: bipush        90
     160: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     163: invokestatic  #22                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     166: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     169: ifne          212
     172: aload_2
     173: bipush        67
     175: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     178: bipush        88
     180: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     183: invokestatic  #22                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     186: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     189: ifne          212
     192: aload_2
     193: bipush        65
     195: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     198: bipush        89
     200: invokestatic  #74                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     203: invokestatic  #22                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     206: invokestatic  #80                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     209: ifeq          217
     212: bipush        6
     214: goto          230
     217: new           #82                 // class java/lang/IllegalStateException
     220: dup
     221: ldc           #84                 // String Before you wreck yourself
     223: invokevirtual #88                 // Method java/lang/Object.toString:()Ljava/lang/String;
     226: invokespecial #89                 // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     229: athrow
     230: ireturn

  private static final char main$determineGuess(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: iconst_0
       2: invokeinterface #101,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
       7: checkcast     #63                 // class java/lang/CharSequence
      10: invokestatic  #69                 // Method kotlin/text/StringsKt.single:(Ljava/lang/CharSequence;)C
      13: istore_1
      14: aload_0
      15: iconst_1
      16: invokeinterface #101,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      21: checkcast     #63                 // class java/lang/CharSequence
      24: invokestatic  #69                 // Method kotlin/text/StringsKt.single:(Ljava/lang/CharSequence;)C
      27: tableswitch   { // 88 to 90
                    88: 52
                    89: 108
                    90: 164
               default: 220
          }
      52: iload_1
      53: tableswitch   { // 65 to 67
                    65: 90
                    66: 80
                    67: 85
               default: 95
          }
      80: bipush        88
      82: goto          233
      85: bipush        89
      87: goto          233
      90: bipush        90
      92: goto          233
      95: new           #82                 // class java/lang/IllegalStateException
      98: dup
      99: ldc           #103                // String Check input
     101: invokevirtual #88                 // Method java/lang/Object.toString:()Ljava/lang/String;
     104: invokespecial #89                 // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     107: athrow
     108: iload_1
     109: tableswitch   { // 65 to 67
                    65: 146
                    66: 136
                    67: 141
               default: 151
          }
     136: bipush        89
     138: goto          233
     141: bipush        90
     143: goto          233
     146: bipush        88
     148: goto          233
     151: new           #82                 // class java/lang/IllegalStateException
     154: dup
     155: ldc           #103                // String Check input
     157: invokevirtual #88                 // Method java/lang/Object.toString:()Ljava/lang/String;
     160: invokespecial #89                 // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     163: athrow
     164: iload_1
     165: tableswitch   { // 65 to 67
                    65: 202
                    66: 192
                    67: 197
               default: 207
          }
     192: bipush        90
     194: goto          233
     197: bipush        88
     199: goto          233
     202: bipush        89
     204: goto          233
     207: new           #82                 // class java/lang/IllegalStateException
     210: dup
     211: ldc           #103                // String Check input
     213: invokevirtual #88                 // Method java/lang/Object.toString:()Ljava/lang/String;
     216: invokespecial #89                 // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     219: athrow
     220: new           #82                 // class java/lang/IllegalStateException
     223: dup
     224: ldc           #105                // String Check your input
     226: invokevirtual #88                 // Method java/lang/Object.toString:()Ljava/lang/String;
     229: invokespecial #89                 // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     232: athrow
     233: ireturn

  private static final void main$rockPaperSissors(java.util.Map<java.lang.String, java.lang.Integer>, java.util.List<java.lang.String>, int);
    Code:
       0: iconst_0
       1: istore_3
       2: iconst_1
       3: iload_2
       4: if_icmpgt     20
       7: iload_2
       8: iconst_3
       9: if_icmpge     16
      12: iconst_1
      13: goto          21
      16: iconst_0
      17: goto          21
      20: iconst_0
      21: ifne          44
      24: iconst_0
      25: istore        5
      27: ldc           #111                // String part must be 1 or 2
      29: astore        5
      31: new           #113                // class java/lang/IllegalArgumentException
      34: dup
      35: aload         5
      37: invokevirtual #88                 // Method java/lang/Object.toString:()Ljava/lang/String;
      40: invokespecial #114                // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
      43: athrow
      44: aload_1
      45: checkcast     #116                // class java/lang/Iterable
      48: astore        4
      50: iconst_0
      51: istore        5
      53: aload         4
      55: astore        6
      57: new           #118                // class java/util/ArrayList
      60: dup
      61: aload         4
      63: bipush        10
      65: invokestatic  #124                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      68: invokespecial #127                // Method java/util/ArrayList."<init>":(I)V
      71: checkcast     #129                // class java/util/Collection
      74: astore        7
      76: iconst_0
      77: istore        8
      79: aload         6
      81: invokeinterface #133,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      86: astore        9
      88: aload         9
      90: invokeinterface #139,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      95: ifeq          262
      98: aload         9
     100: invokeinterface #143,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     105: astore        10
     107: aload         7
     109: aload         10
     111: checkcast     #145                // class java/lang/String
     114: astore        11
     116: astore        19
     118: iconst_0
     119: istore        12
     121: aload         11
     123: checkcast     #63                 // class java/lang/CharSequence
     126: iconst_1
     127: anewarray     #145                // class java/lang/String
     130: astore        13
     132: aload         13
     134: iconst_0
     135: ldc           #147                // String
     137: aastore
     138: aload         13
     140: iconst_0
     141: iconst_0
     142: bipush        6
     144: aconst_null
     145: invokestatic  #151                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     148: astore        14
     150: iconst_0
     151: istore        15
     153: iload_2
     154: iconst_1
     155: if_icmpne     172
     158: aload         14
     160: iconst_1
     161: invokeinterface #101,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     166: checkcast     #145                // class java/lang/String
     169: goto          180
     172: aload         14
     174: invokestatic  #153                // Method main$determineGuess:(Ljava/util/List;)C
     177: invokestatic  #156                // Method java/lang/String.valueOf:(C)Ljava/lang/String;
     180: astore        16
     182: aload_0
     183: aload         16
     185: invokeinterface #161,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     190: checkcast     #12                 // class java/lang/Integer
     193: dup
     194: ifnull        203
     197: invokevirtual #165                // Method java/lang/Integer.intValue:()I
     200: goto          217
     203: pop
     204: new           #82                 // class java/lang/IllegalStateException
     207: dup
     208: ldc           #167                // String Check yourself
     210: invokevirtual #88                 // Method java/lang/Object.toString:()Ljava/lang/String;
     213: invokespecial #89                 // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     216: athrow
     217: istore        17
     219: aload         14
     221: iconst_0
     222: invokeinterface #101,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     227: checkcast     #145                // class java/lang/String
     230: aload         16
     232: invokestatic  #169                // Method main$determineGameResult:(Ljava/lang/String;Ljava/lang/String;)I
     235: istore        18
     237: iload_3
     238: iload         17
     240: iload         18
     242: iadd
     243: iadd
     244: istore_3
     245: nop
     246: nop
     247: nop
     248: aload         19
     250: getstatic     #175                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
     253: invokeinterface #179,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     258: pop
     259: goto          88
     262: aload         7
     264: checkcast     #97                 // class java/util/List
     267: nop
     268: pop
     269: iload_3
     270: istore        4
     272: getstatic     #185                // Field java/lang/System.out:Ljava/io/PrintStream;
     275: iload         4
     277: invokevirtual #190                // Method java/io/PrintStream.println:(I)V
     280: return
}