package kt_101

class Lambdas_111 {

    fun iterando_lambdas(){
//        val values = listOf(1,3,4,6,7,8,9,13,23,59,50)
//        values.forEach{
//            println("$it: ${it*it}")
//        }
        println()

        var prices = listOf(1.3,4.94,99.95,55.49)
        val largePrices = prices.filter {
            it > 45.0
        }
        println(largePrices)
        println()

        val salesPrices = prices.map {
            it*0.5
        }
        println(salesPrices)
        println()

        val userInput = listOf("0","123","enigma","945")
        val numbers = userInput.map {
            it.toIntOrNull()
        }
        println("numbers: ${numbers}")
        println()

        var sum123 = prices.fold(0.0){ a,b ->
            a+b
        }
        println("sum = ${sum123}")
        println()

        val stock = mapOf(1.0 to 43, 1.4 to 49, 2.4 to 44.4
                    ,59.9 to 490, 6.0 to 684)
        var stockSum = 0.0

    }

    fun lambda_basico(){
        val multiplyLambda: (Int,Int)-> Int
        multiplyLambda = {a: Int, b: Int -> Int
            a*b
        }
        val lambdaResult = multiplyLambda(123,99)
        println("lambda result = $lambdaResult")

        println()

        val lambdaResultSum2:(Int, Int)-> Int= { a, b ->
          a+b
        }
        val ss3 = lambdaResultSum2(45,85)
        val lambdaResta:(Int, Int)->Int={a, b -> a-b}
        val rest = lambdaResta(544,111)
        println("sum2 = $ss3")
        println("resta = $rest")

        var doubleLambda = {a: Double -> a*4}
        doubleLambda = {2.3 * it}
        val resDouble = doubleLambda(33.33)
        println("rdl = $resDouble")

        val square:(Int)->Int = {it* it}
        val cubeNum:(Int)->Int = {it*it*it}
        println("square = ${square(12)}")
        println("cubeNum = ${cubeNum(4)}")
    }

    fun operateOnNumbers(a:Int, b:Int, operation:(Int,Int)->Int):Int{
        val result = operation(a,b)
        println("result: $result")
        return result
    }

}

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

  public final void iterando_lambdas();
    Code:
       0: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
       3: invokevirtual #22                 // Method java/io/PrintStream.println:()V
       6: iconst_4
       7: anewarray     #24                 // class java/lang/Double
      10: astore_2
      11: aload_2
      12: iconst_0
      13: ldc2_w        #25                 // double 1.3d
      16: invokestatic  #30                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      19: aastore
      20: aload_2
      21: iconst_1
      22: ldc2_w        #31                 // double 4.94d
      25: invokestatic  #30                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      28: aastore
      29: aload_2
      30: iconst_2
      31: ldc2_w        #33                 // double 99.95d
      34: invokestatic  #30                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      37: aastore
      38: aload_2
      39: iconst_3
      40: ldc2_w        #35                 // double 55.49d
      43: invokestatic  #30                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      46: aastore
      47: aload_2
      48: invokestatic  #42                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
      51: astore_1
      52: aload_1
      53: checkcast     #44                 // class java/lang/Iterable
      56: astore_3
      57: iconst_0
      58: istore        4
      60: aload_3
      61: astore        5
      63: new           #46                 // class java/util/ArrayList
      66: dup
      67: invokespecial #47                 // Method java/util/ArrayList."<init>":()V
      70: checkcast     #49                 // class java/util/Collection
      73: astore        6
      75: iconst_0
      76: istore        7
      78: aload         5
      80: invokeinterface #53,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      85: astore        8
      87: aload         8
      89: invokeinterface #59,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      94: ifeq          149
      97: aload         8
      99: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     104: astore        9
     106: aload         9
     108: checkcast     #65                 // class java/lang/Number
     111: invokevirtual #69                 // Method java/lang/Number.doubleValue:()D
     114: dstore        11
     116: iconst_0
     117: istore        14
     119: dload         11
     121: ldc2_w        #70                 // double 45.0d
     124: dcmpl
     125: ifle          132
     128: iconst_1
     129: goto          133
     132: iconst_0
     133: ifeq          87
     136: aload         6
     138: aload         9
     140: invokeinterface #75,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     145: pop
     146: goto          87
     149: aload         6
     151: checkcast     #77                 // class java/util/List
     154: nop
     155: astore_2
     156: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
     159: aload_2
     160: invokevirtual #80                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     163: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
     166: invokevirtual #22                 // Method java/io/PrintStream.println:()V
     169: aload_1
     170: checkcast     #44                 // class java/lang/Iterable
     173: astore        4
     175: iconst_0
     176: istore        5
     178: aload         4
     180: astore        6
     182: new           #46                 // class java/util/ArrayList
     185: dup
     186: aload         4
     188: bipush        10
     190: invokestatic  #84                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     193: invokespecial #87                 // Method java/util/ArrayList."<init>":(I)V
     196: checkcast     #49                 // class java/util/Collection
     199: astore        7
     201: iconst_0
     202: istore        8
     204: aload         6
     206: invokeinterface #53,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     211: astore        9
     213: aload         9
     215: invokeinterface #59,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     220: ifeq          270
     223: aload         9
     225: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     230: astore        11
     232: aload         7
     234: aload         11
     236: checkcast     #65                 // class java/lang/Number
     239: invokevirtual #69                 // Method java/lang/Number.doubleValue:()D
     242: dstore        12
     244: astore        21
     246: iconst_0
     247: istore        15
     249: dload         12
     251: ldc2_w        #88                 // double 0.5d
     254: dmul
     255: invokestatic  #30                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     258: aload         21
     260: swap
     261: invokeinterface #75,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     266: pop
     267: goto          213
     270: aload         7
     272: checkcast     #77                 // class java/util/List
     275: nop
     276: astore_3
     277: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
     280: aload_3
     281: invokevirtual #80                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     284: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
     287: invokevirtual #22                 // Method java/io/PrintStream.println:()V
     290: iconst_4
     291: anewarray     #91                 // class java/lang/String
     294: astore        5
     296: aload         5
     298: iconst_0
     299: ldc           #93                 // String 0
     301: aastore
     302: aload         5
     304: iconst_1
     305: ldc           #95                 // String 123
     307: aastore
     308: aload         5
     310: iconst_2
     311: ldc           #97                 // String enigma
     313: aastore
     314: aload         5
     316: iconst_3
     317: ldc           #99                 // String 945
     319: aastore
     320: aload         5
     322: invokestatic  #42                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     325: astore        4
     327: aload         4
     329: checkcast     #44                 // class java/lang/Iterable
     332: astore        6
     334: iconst_0
     335: istore        7
     337: aload         6
     339: astore        8
     341: new           #46                 // class java/util/ArrayList
     344: dup
     345: aload         6
     347: bipush        10
     349: invokestatic  #84                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     352: invokespecial #87                 // Method java/util/ArrayList."<init>":(I)V
     355: checkcast     #49                 // class java/util/Collection
     358: astore        9
     360: iconst_0
     361: istore        11
     363: aload         8
     365: invokeinterface #53,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     370: astore        12
     372: aload         12
     374: invokeinterface #59,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     379: ifeq          422
     382: aload         12
     384: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     389: astore        14
     391: aload         9
     393: aload         14
     395: checkcast     #91                 // class java/lang/String
     398: astore        15
     400: astore        21
     402: iconst_0
     403: istore        16
     405: aload         15
     407: invokestatic  #105                // Method kotlin/text/StringsKt.toIntOrNull:(Ljava/lang/String;)Ljava/lang/Integer;
     410: aload         21
     412: swap
     413: invokeinterface #75,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     418: pop
     419: goto          372
     422: aload         9
     424: checkcast     #77                 // class java/util/List
     427: nop
     428: astore        5
     430: new           #107                // class java/lang/StringBuilder
     433: dup
     434: invokespecial #108                // Method java/lang/StringBuilder."<init>":()V
     437: ldc           #110                // String numbers:
     439: invokevirtual #114                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     442: aload         5
     444: invokevirtual #117                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
     447: invokevirtual #121                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     450: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
     453: swap
     454: invokevirtual #80                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     457: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
     460: invokevirtual #22                 // Method java/io/PrintStream.println:()V
     463: aload_1
     464: checkcast     #44                 // class java/lang/Iterable
     467: astore        8
     469: dconst_0
     470: dstore        9
     472: iconst_0
     473: istore        11
     475: dload         9
     477: dstore        12
     479: aload         8
     481: invokeinterface #53,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     486: astore        14
     488: aload         14
     490: invokeinterface #59,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     495: ifeq          534
     498: aload         14
     500: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     505: astore        15
     507: dload         12
     509: aload         15
     511: checkcast     #65                 // class java/lang/Number
     514: invokevirtual #69                 // Method java/lang/Number.doubleValue:()D
     517: dstore        16
     519: dstore        18
     521: iconst_0
     522: istore        20
     524: dload         18
     526: dload         16
     528: dadd
     529: dstore        12
     531: goto          488
     534: dload         12
     536: dstore        6
     538: new           #107                // class java/lang/StringBuilder
     541: dup
     542: invokespecial #108                // Method java/lang/StringBuilder."<init>":()V
     545: ldc           #123                // String sum =
     547: invokevirtual #114                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     550: dload         6
     552: invokevirtual #126                // Method java/lang/StringBuilder.append:(D)Ljava/lang/StringBuilder;
     555: invokevirtual #121                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     558: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
     561: swap
     562: invokevirtual #80                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     565: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
     568: invokevirtual #22                 // Method java/io/PrintStream.println:()V
     571: iconst_5
     572: anewarray     #128                // class kotlin/Pair
     575: astore        9
     577: aload         9
     579: iconst_0
     580: dconst_1
     581: invokestatic  #30                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     584: bipush        43
     586: invokestatic  #133                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     589: invokestatic  #139                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     592: aastore
     593: aload         9
     595: iconst_1
     596: ldc2_w        #140                // double 1.4d
     599: invokestatic  #30                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     602: bipush        49
     604: invokestatic  #133                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     607: invokestatic  #139                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     610: aastore
     611: aload         9
     613: iconst_2
     614: ldc2_w        #142                // double 2.4d
     617: invokestatic  #30                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     620: ldc2_w        #144                // double 44.4d
     623: invokestatic  #30                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     626: invokestatic  #139                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     629: aastore
     630: aload         9
     632: iconst_3
     633: ldc2_w        #146                // double 59.9d
     636: invokestatic  #30                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     639: sipush        490
     642: invokestatic  #133                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     645: invokestatic  #139                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     648: aastore
     649: aload         9
     651: iconst_4
     652: ldc2_w        #148                // double 6.0d
     655: invokestatic  #30                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     658: sipush        684
     661: invokestatic  #133                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     664: invokestatic  #139                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     667: aastore
     668: aload         9
     670: invokestatic  #155                // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;
     673: astore        8
     675: dconst_0
     676: dstore        9
     678: return

  public final void lambda_basico();
    Code:
       0: aconst_null
       1: astore_1
       2: invokedynamic #219,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function2;
       7: astore_1
       8: aload_1
       9: bipush        123
      11: invokestatic  #133                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      14: bipush        99
      16: invokestatic  #133                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      19: invokeinterface #223,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      24: checkcast     #65                 // class java/lang/Number
      27: invokevirtual #227                // Method java/lang/Number.intValue:()I
      30: istore_2
      31: new           #107                // class java/lang/StringBuilder
      34: dup
      35: invokespecial #108                // Method java/lang/StringBuilder."<init>":()V
      38: ldc           #229                // String lambda result =
      40: invokevirtual #114                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      43: iload_2
      44: invokevirtual #232                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      47: invokevirtual #121                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      50: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
      53: swap
      54: invokevirtual #80                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      57: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
      60: invokevirtual #22                 // Method java/io/PrintStream.println:()V
      63: invokedynamic #237,  0            // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function2;
      68: astore_3
      69: aload_3
      70: bipush        45
      72: invokestatic  #133                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      75: bipush        85
      77: invokestatic  #133                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      80: invokeinterface #223,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      85: checkcast     #65                 // class java/lang/Number
      88: invokevirtual #227                // Method java/lang/Number.intValue:()I
      91: istore        4
      93: invokedynamic #242,  0            // InvokeDynamic #2:invoke:()Lkotlin/jvm/functions/Function2;
      98: astore        5
     100: aload         5
     102: sipush        544
     105: invokestatic  #133                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     108: bipush        111
     110: invokestatic  #133                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     113: invokeinterface #223,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     118: checkcast     #65                 // class java/lang/Number
     121: invokevirtual #227                // Method java/lang/Number.intValue:()I
     124: istore        6
     126: new           #107                // class java/lang/StringBuilder
     129: dup
     130: invokespecial #108                // Method java/lang/StringBuilder."<init>":()V
     133: ldc           #244                // String sum2 =
     135: invokevirtual #114                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     138: iload         4
     140: invokevirtual #232                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     143: invokevirtual #121                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     146: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
     149: swap
     150: invokevirtual #80                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     153: new           #107                // class java/lang/StringBuilder
     156: dup
     157: invokespecial #108                // Method java/lang/StringBuilder."<init>":()V
     160: ldc           #246                // String resta =
     162: invokevirtual #114                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     165: iload         6
     167: invokevirtual #232                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     170: invokevirtual #121                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     173: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
     176: swap
     177: invokevirtual #80                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     180: invokedynamic #258,  0            // InvokeDynamic #3:invoke:()Lkotlin/jvm/functions/Function1;
     185: astore        7
     187: invokedynamic #263,  0            // InvokeDynamic #4:invoke:()Lkotlin/jvm/functions/Function1;
     192: astore        7
     194: aload         7
     196: ldc2_w        #264                // double 33.33d
     199: invokestatic  #30                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     202: invokeinterface #269,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
     207: checkcast     #65                 // class java/lang/Number
     210: invokevirtual #69                 // Method java/lang/Number.doubleValue:()D
     213: dstore        8
     215: new           #107                // class java/lang/StringBuilder
     218: dup
     219: invokespecial #108                // Method java/lang/StringBuilder."<init>":()V
     222: ldc_w         #271                // String rdl =
     225: invokevirtual #114                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     228: dload         8
     230: invokevirtual #126                // Method java/lang/StringBuilder.append:(D)Ljava/lang/StringBuilder;
     233: invokevirtual #121                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     236: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
     239: swap
     240: invokevirtual #80                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     243: invokedynamic #279,  0            // InvokeDynamic #5:invoke:()Lkotlin/jvm/functions/Function1;
     248: astore        10
     250: invokedynamic #284,  0            // InvokeDynamic #6:invoke:()Lkotlin/jvm/functions/Function1;
     255: astore        11
     257: new           #107                // class java/lang/StringBuilder
     260: dup
     261: invokespecial #108                // Method java/lang/StringBuilder."<init>":()V
     264: ldc_w         #286                // String square =
     267: invokevirtual #114                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     270: aload         10
     272: bipush        12
     274: invokestatic  #133                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     277: invokeinterface #269,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
     282: checkcast     #65                 // class java/lang/Number
     285: invokevirtual #227                // Method java/lang/Number.intValue:()I
     288: invokevirtual #232                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     291: invokevirtual #121                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     294: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
     297: swap
     298: invokevirtual #80                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     301: new           #107                // class java/lang/StringBuilder
     304: dup
     305: invokespecial #108                // Method java/lang/StringBuilder."<init>":()V
     308: ldc_w         #288                // String cubeNum =
     311: invokevirtual #114                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     314: aload         11
     316: iconst_4
     317: invokestatic  #133                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     320: invokeinterface #269,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
     325: checkcast     #65                 // class java/lang/Number
     328: invokevirtual #227                // Method java/lang/Number.intValue:()I
     331: invokevirtual #232                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     334: invokevirtual #121                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     337: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
     340: swap
     341: invokevirtual #80                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     344: return

  public final int operateOnNumbers(int, int, kotlin.jvm.functions.Function2<? super java.lang.Integer, ? super java.lang.Integer, java.lang.Integer>);
    Code:
       0: aload_3
       1: ldc_w         #306                // String operation
       4: invokestatic  #312                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_3
       8: iload_1
       9: invokestatic  #133                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      12: iload_2
      13: invokestatic  #133                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      16: invokeinterface #223,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      21: checkcast     #65                 // class java/lang/Number
      24: invokevirtual #227                // Method java/lang/Number.intValue:()I
      27: istore        4
      29: new           #107                // class java/lang/StringBuilder
      32: dup
      33: invokespecial #108                // Method java/lang/StringBuilder."<init>":()V
      36: ldc_w         #314                // String result:
      39: invokevirtual #114                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      42: iload         4
      44: invokevirtual #232                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      47: invokevirtual #121                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      50: getstatic     #17                 // Field java/lang/System.out:Ljava/io/PrintStream;
      53: swap
      54: invokevirtual #80                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      57: iload         4
      59: ireturn

  private static final int lambda_basico$lambda$4(int, int);
    Code:
       0: getstatic     #321                // Field kotlin/jvm/internal/IntCompanionObject.INSTANCE:Lkotlin/jvm/internal/IntCompanionObject;
       3: pop
       4: iload_0
       5: iload_1
       6: imul
       7: ireturn

  private static final int lambda_basico$lambda$5(int, int);
    Code:
       0: iload_0
       1: iload_1
       2: iadd
       3: ireturn

  private static final int lambda_basico$lambda$6(int, int);
    Code:
       0: iload_0
       1: iload_1
       2: isub
       3: ireturn

  private static final double lambda_basico$lambda$7(double);
    Code:
       0: dload_0
       1: iconst_4
       2: i2d
       3: dmul
       4: dreturn

  private static final double lambda_basico$lambda$8(double);
    Code:
       0: ldc2_w        #322                // double 2.3d
       3: dload_0
       4: dmul
       5: dreturn

  private static final int lambda_basico$lambda$9(int);
    Code:
       0: iload_0
       1: iload_0
       2: imul
       3: ireturn

  private static final int lambda_basico$lambda$10(int);
    Code:
       0: iload_0
       1: iload_0
       2: imul
       3: iload_0
       4: imul
       5: ireturn
}


package advent.of.code.day07

import java.io.File
import java.util.*

val lineRegex = Regex("^Step ([A-Z]) must.+step ([A-Z]) can begin.$")

fun part1(): String {
    val dependsOn = mutableMapOf<Char, String>()
    val steps = TreeSet<Char>()
    File("day07.txt").readLines().forEach { line ->
        val res = lineRegex.find(line)
        steps += res!!.groupValues[1][0]
        steps += res!!.groupValues[2][0]
        dependsOn.compute(res!!.groupValues[2][0]) { _, v -> (v ?: "") + res.groupValues[1][0] }
    }
    var stepOrder = ""
    while (steps.isNotEmpty()) {
        val nextSteps = TreeSet<Char>()
        nextSteps.addAll(dependsOn.filter { it.value.isEmpty() }.keys.sorted())
        nextSteps.addAll(steps.filter { !dependsOn.contains(it) })
        val step = nextSteps.first()
        stepOrder += step
        steps.remove(step)
        dependsOn.remove(step)
        dependsOn.forEach { k, v -> dependsOn[k] = v.replace(step.toString(), "") }
    }
    return stepOrder
}

fun part2(): Int {
    val dependsOn = mutableMapOf<Char, String>()
    val steps = TreeSet<Char>()
    File("day07.txt").readLines().forEach { line ->
        val res = lineRegex.find(line)
        steps += res!!.groupValues[1][0]
        steps += res!!.groupValues[2][0]
        dependsOn.compute(res!!.groupValues[2][0]) { _, v -> (v ?: "") + res.groupValues[1][0] }
    }
    val workerCount = 5
    val workers = MutableList(workerCount) { Pair('-', 0) }
    while (steps.isNotEmpty()) {
        if (workers.any { it.first != '-' }) {
            val nextFreeWorker = workers.filter { it.first != '-' }.minBy { it.second }
            val nextWorker = Pair('-', nextFreeWorker!!.second)
            workers.remove(nextFreeWorker)
            workers.add(nextWorker)
            val lateWorkers = workers.filter { it.second < nextFreeWorker.second }
            workers.removeAll(lateWorkers)
            while (workers.size < workerCount)
                workers.add(nextWorker.copy())
            steps.remove(nextFreeWorker.first)
            dependsOn.remove(nextFreeWorker.first)
            dependsOn.forEach { k, v -> dependsOn[k] = v.replace(nextFreeWorker.first.toString(), "") }
        }
        while (workers.any { it.first == '-' }) {
            val nextSteps = TreeSet<Char>()
            nextSteps.addAll(dependsOn.filter { it.value.isEmpty() }.keys.sorted())
            nextSteps.addAll(steps.filter { !dependsOn.contains(it) })
            workers.forEach { nextSteps.remove(it.first) }
            if (nextSteps.isEmpty()) break
            val step = nextSteps.first()
            val freeWorker = workers.first { it.first == '-' }
            val newWorker = Pair(step, freeWorker.second + 60 + step.toInt() - 'A'.toInt() + 1)
            workers.remove(freeWorker)
            workers.add(newWorker)
        }
    }
    return workers.maxBy { it.second }!!.second
}

Compiled from "Solution.kt"
public final class advent.of.code.day07.SolutionKt {
  private static final kotlin.text.Regex lineRegex;

  public static final kotlin.text.Regex getLineRegex();
    Code:
       0: getstatic     #11                 // Field lineRegex:Lkotlin/text/Regex;
       3: areturn

  public static final java.lang.String part1();
    Code:
       0: new           #15                 // class java/util/LinkedHashMap
       3: dup
       4: invokespecial #19                 // Method java/util/LinkedHashMap."<init>":()V
       7: checkcast     #21                 // class java/util/Map
      10: astore_0
      11: new           #23                 // class java/util/TreeSet
      14: dup
      15: invokespecial #24                 // Method java/util/TreeSet."<init>":()V
      18: astore_1
      19: new           #26                 // class java/io/File
      22: dup
      23: ldc           #28                 // String day07.txt
      25: invokespecial #31                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      28: aconst_null
      29: iconst_1
      30: aconst_null
      31: invokestatic  #37                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      34: checkcast     #39                 // class java/lang/Iterable
      37: astore_2
      38: iconst_0
      39: istore_3
      40: aload_2
      41: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      46: astore        4
      48: aload         4
      50: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      55: ifeq          210
      58: aload         4
      60: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      65: astore        5
      67: aload         5
      69: checkcast     #55                 // class java/lang/String
      72: astore        6
      74: iconst_0
      75: istore        7
      77: getstatic     #11                 // Field lineRegex:Lkotlin/text/Regex;
      80: aload         6
      82: checkcast     #57                 // class java/lang/CharSequence
      85: iconst_0
      86: iconst_2
      87: aconst_null
      88: invokestatic  #63                 // Method kotlin/text/Regex.find$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/text/MatchResult;
      91: astore        8
      93: aload_1
      94: checkcast     #65                 // class java/util/Collection
      97: aload         8
      99: dup
     100: invokestatic  #71                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     103: invokeinterface #77,  1           // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;
     108: iconst_1
     109: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     114: checkcast     #55                 // class java/lang/String
     117: iconst_0
     118: invokevirtual #87                 // Method java/lang/String.charAt:(I)C
     121: invokestatic  #93                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     124: invokeinterface #97,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     129: pop
     130: aload_1
     131: checkcast     #65                 // class java/util/Collection
     134: aload         8
     136: invokeinterface #77,  1           // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;
     141: iconst_2
     142: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     147: checkcast     #55                 // class java/lang/String
     150: iconst_0
     151: invokevirtual #87                 // Method java/lang/String.charAt:(I)C
     154: invokestatic  #93                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     157: invokeinterface #97,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     162: pop
     163: aload_0
     164: aload         8
     166: invokeinterface #77,  1           // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;
     171: iconst_2
     172: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     177: checkcast     #55                 // class java/lang/String
     180: iconst_0
     181: invokevirtual #87                 // Method java/lang/String.charAt:(I)C
     184: invokestatic  #93                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     187: aload         8
     189: invokedynamic #117,  0            // InvokeDynamic #0:invoke:(Lkotlin/text/MatchResult;)Lkotlin/jvm/functions/Function2;
     194: invokedynamic #128,  0            // InvokeDynamic #1:apply:(Lkotlin/jvm/functions/Function2;)Ljava/util/function/BiFunction;
     199: invokeinterface #132,  3          // InterfaceMethod java/util/Map.compute:(Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;
     204: pop
     205: nop
     206: nop
     207: goto          48
     210: nop
     211: ldc           #134                // String
     213: astore_2
     214: aload_1
     215: checkcast     #65                 // class java/util/Collection
     218: invokeinterface #137,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     223: ifne          230
     226: iconst_1
     227: goto          231
     230: iconst_0
     231: ifeq          580
     234: new           #23                 // class java/util/TreeSet
     237: dup
     238: invokespecial #24                 // Method java/util/TreeSet."<init>":()V
     241: astore_3
     242: aload_3
     243: aload_0
     244: astore        4
     246: astore        13
     248: iconst_0
     249: istore        5
     251: aload         4
     253: astore        6
     255: new           #15                 // class java/util/LinkedHashMap
     258: dup
     259: invokespecial #19                 // Method java/util/LinkedHashMap."<init>":()V
     262: checkcast     #21                 // class java/util/Map
     265: astore        7
     267: iconst_0
     268: istore        8
     270: aload         6
     272: invokeinterface #141,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     277: invokeinterface #144,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     282: astore        9
     284: aload         9
     286: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     291: ifeq          365
     294: aload         9
     296: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     301: checkcast     #146                // class java/util/Map$Entry
     304: astore        10
     306: aload         10
     308: astore        11
     310: iconst_0
     311: istore        12
     313: aload         11
     315: invokeinterface #149,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     320: checkcast     #57                 // class java/lang/CharSequence
     323: invokeinterface #153,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     328: ifne          335
     331: iconst_1
     332: goto          336
     335: iconst_0
     336: nop
     337: ifeq          284
     340: aload         7
     342: aload         10
     344: invokeinterface #156,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     349: aload         10
     351: invokeinterface #149,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     356: invokeinterface #159,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     361: pop
     362: goto          284
     365: aload         7
     367: nop
     368: aload         13
     370: swap
     371: invokeinterface #162,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
     376: checkcast     #39                 // class java/lang/Iterable
     379: invokestatic  #168                // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;
     382: checkcast     #65                 // class java/util/Collection
     385: invokevirtual #172                // Method java/util/TreeSet.addAll:(Ljava/util/Collection;)Z
     388: pop
     389: aload_3
     390: aload_1
     391: checkcast     #39                 // class java/lang/Iterable
     394: astore        4
     396: astore        13
     398: iconst_0
     399: istore        5
     401: aload         4
     403: astore        6
     405: new           #174                // class java/util/ArrayList
     408: dup
     409: invokespecial #175                // Method java/util/ArrayList."<init>":()V
     412: checkcast     #65                 // class java/util/Collection
     415: astore        7
     417: iconst_0
     418: istore        8
     420: aload         6
     422: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     427: astore        9
     429: aload         9
     431: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     436: ifeq          497
     439: aload         9
     441: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     446: astore        10
     448: aload         10
     450: checkcast     #89                 // class java/lang/Character
     453: invokevirtual #179                // Method java/lang/Character.charValue:()C
     456: istore        11
     458: iconst_0
     459: istore        12
     461: iload         11
     463: invokestatic  #93                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     466: aload_0
     467: swap
     468: invokeinterface #182,  2          // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
     473: ifne          480
     476: iconst_1
     477: goto          481
     480: iconst_0
     481: ifeq          429
     484: aload         7
     486: aload         10
     488: invokeinterface #97,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     493: pop
     494: goto          429
     497: aload         7
     499: checkcast     #79                 // class java/util/List
     502: nop
     503: aload         13
     505: swap
     506: checkcast     #65                 // class java/util/Collection
     509: invokevirtual #172                // Method java/util/TreeSet.addAll:(Ljava/util/Collection;)Z
     512: pop
     513: aload_3
     514: invokevirtual #185                // Method java/util/TreeSet.first:()Ljava/lang/Object;
     517: checkcast     #89                 // class java/lang/Character
     520: astore        4
     522: new           #187                // class java/lang/StringBuilder
     525: dup
     526: invokespecial #188                // Method java/lang/StringBuilder."<init>":()V
     529: aload_2
     530: invokevirtual #192                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     533: aload         4
     535: invokevirtual #195                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
     538: invokevirtual #198                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     541: astore_2
     542: aload_1
     543: aload         4
     545: invokevirtual #201                // Method java/util/TreeSet.remove:(Ljava/lang/Object;)Z
     548: pop
     549: aload_0
     550: aload         4
     552: invokeinterface #204,  2          // InterfaceMethod java/util/Map.remove:(Ljava/lang/Object;)Ljava/lang/Object;
     557: pop
     558: aload_0
     559: aload_0
     560: aload         4
     562: invokedynamic #214,  0            // InvokeDynamic #2:invoke:(Ljava/util/Map;Ljava/lang/Character;)Lkotlin/jvm/functions/Function2;
     567: invokedynamic #225,  0            // InvokeDynamic #3:accept:(Lkotlin/jvm/functions/Function2;)Ljava/util/function/BiConsumer;
     572: invokeinterface #229,  2          // InterfaceMethod java/util/Map.forEach:(Ljava/util/function/BiConsumer;)V
     577: goto          214
     580: aload_2
     581: areturn

  public static final int part2();
    Code:
       0: new           #15                 // class java/util/LinkedHashMap
       3: dup
       4: invokespecial #19                 // Method java/util/LinkedHashMap."<init>":()V
       7: checkcast     #21                 // class java/util/Map
      10: astore_0
      11: new           #23                 // class java/util/TreeSet
      14: dup
      15: invokespecial #24                 // Method java/util/TreeSet."<init>":()V
      18: astore_1
      19: new           #26                 // class java/io/File
      22: dup
      23: ldc           #28                 // String day07.txt
      25: invokespecial #31                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      28: aconst_null
      29: iconst_1
      30: aconst_null
      31: invokestatic  #37                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      34: checkcast     #39                 // class java/lang/Iterable
      37: astore_2
      38: iconst_0
      39: istore_3
      40: aload_2
      41: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      46: astore        4
      48: aload         4
      50: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      55: ifeq          210
      58: aload         4
      60: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      65: astore        5
      67: aload         5
      69: checkcast     #55                 // class java/lang/String
      72: astore        6
      74: iconst_0
      75: istore        7
      77: getstatic     #11                 // Field lineRegex:Lkotlin/text/Regex;
      80: aload         6
      82: checkcast     #57                 // class java/lang/CharSequence
      85: iconst_0
      86: iconst_2
      87: aconst_null
      88: invokestatic  #63                 // Method kotlin/text/Regex.find$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/text/MatchResult;
      91: astore        8
      93: aload_1
      94: checkcast     #65                 // class java/util/Collection
      97: aload         8
      99: dup
     100: invokestatic  #71                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     103: invokeinterface #77,  1           // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;
     108: iconst_1
     109: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     114: checkcast     #55                 // class java/lang/String
     117: iconst_0
     118: invokevirtual #87                 // Method java/lang/String.charAt:(I)C
     121: invokestatic  #93                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     124: invokeinterface #97,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     129: pop
     130: aload_1
     131: checkcast     #65                 // class java/util/Collection
     134: aload         8
     136: invokeinterface #77,  1           // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;
     141: iconst_2
     142: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     147: checkcast     #55                 // class java/lang/String
     150: iconst_0
     151: invokevirtual #87                 // Method java/lang/String.charAt:(I)C
     154: invokestatic  #93                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     157: invokeinterface #97,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     162: pop
     163: aload_0
     164: aload         8
     166: invokeinterface #77,  1           // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;
     171: iconst_2
     172: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     177: checkcast     #55                 // class java/lang/String
     180: iconst_0
     181: invokevirtual #87                 // Method java/lang/String.charAt:(I)C
     184: invokestatic  #93                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     187: aload         8
     189: invokedynamic #266,  0            // InvokeDynamic #4:invoke:(Lkotlin/text/MatchResult;)Lkotlin/jvm/functions/Function2;
     194: invokedynamic #271,  0            // InvokeDynamic #5:apply:(Lkotlin/jvm/functions/Function2;)Ljava/util/function/BiFunction;
     199: invokeinterface #132,  3          // InterfaceMethod java/util/Map.compute:(Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;
     204: pop
     205: nop
     206: nop
     207: goto          48
     210: nop
     211: iconst_5
     212: istore_2
     213: new           #174                // class java/util/ArrayList
     216: dup
     217: iload_2
     218: invokespecial #274                // Method java/util/ArrayList."<init>":(I)V
     221: astore        4
     223: iconst_0
     224: istore        5
     226: iload         5
     228: iload_2
     229: if_icmpge     276
     232: iload         5
     234: istore        6
     236: aload         4
     238: iload         6
     240: istore        7
     242: astore        16
     244: iconst_0
     245: istore        8
     247: new           #276                // class kotlin/Pair
     250: dup
     251: bipush        45
     253: invokestatic  #93                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     256: iconst_0
     257: invokestatic  #281                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     260: invokespecial #283                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     263: aload         16
     265: swap
     266: invokevirtual #284                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     269: pop
     270: iinc          5, 1
     273: goto          226
     276: aload         4
     278: checkcast     #79                 // class java/util/List
     281: astore_3
     282: aload_1
     283: checkcast     #65                 // class java/util/Collection
     286: invokeinterface #137,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     291: ifne          298
     294: iconst_1
     295: goto          299
     298: iconst_0
     299: ifeq          1524
     302: aload_3
     303: checkcast     #39                 // class java/lang/Iterable
     306: astore        4
     308: iconst_0
     309: istore        5
     311: aload         4
     313: instanceof    #65                 // class java/util/Collection
     316: ifeq          336
     319: aload         4
     321: checkcast     #65                 // class java/util/Collection
     324: invokeinterface #137,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     329: ifeq          336
     332: iconst_0
     333: goto          403
     336: aload         4
     338: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     343: astore        6
     345: aload         6
     347: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     352: ifeq          402
     355: aload         6
     357: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     362: astore        7
     364: aload         7
     366: checkcast     #276                // class kotlin/Pair
     369: astore        8
     371: iconst_0
     372: istore        9
     374: aload         8
     376: invokevirtual #287                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     379: checkcast     #89                 // class java/lang/Character
     382: invokevirtual #179                // Method java/lang/Character.charValue:()C
     385: bipush        45
     387: if_icmpeq     394
     390: iconst_1
     391: goto          395
     394: iconst_0
     395: ifeq          345
     398: iconst_1
     399: goto          403
     402: iconst_0
     403: ifeq          905
     406: aload_3
     407: checkcast     #39                 // class java/lang/Iterable
     410: astore        5
     412: iconst_0
     413: istore        6
     415: aload         5
     417: astore        7
     419: new           #174                // class java/util/ArrayList
     422: dup
     423: invokespecial #175                // Method java/util/ArrayList."<init>":()V
     426: checkcast     #65                 // class java/util/Collection
     429: astore        8
     431: iconst_0
     432: istore        9
     434: aload         7
     436: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     441: astore        10
     443: aload         10
     445: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     450: ifeq          509
     453: aload         10
     455: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     460: astore        11
     462: aload         11
     464: checkcast     #276                // class kotlin/Pair
     467: astore        12
     469: iconst_0
     470: istore        13
     472: aload         12
     474: invokevirtual #287                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     477: checkcast     #89                 // class java/lang/Character
     480: invokevirtual #179                // Method java/lang/Character.charValue:()C
     483: bipush        45
     485: if_icmpeq     492
     488: iconst_1
     489: goto          493
     492: iconst_0
     493: ifeq          443
     496: aload         8
     498: aload         11
     500: invokeinterface #97,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     505: pop
     506: goto          443
     509: aload         8
     511: checkcast     #79                 // class java/util/List
     514: nop
     515: checkcast     #39                 // class java/lang/Iterable
     518: astore        5
     520: nop
     521: iconst_0
     522: istore        6
     524: aload         5
     526: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     531: astore        7
     533: aload         7
     535: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     540: ifne          551
     543: new           #289                // class java/util/NoSuchElementException
     546: dup
     547: invokespecial #290                // Method java/util/NoSuchElementException."<init>":()V
     550: athrow
     551: aload         7
     553: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     558: astore        8
     560: aload         7
     562: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     567: ifne          575
     570: aload         8
     572: goto          657
     575: aload         8
     577: checkcast     #276                // class kotlin/Pair
     580: astore        9
     582: iconst_0
     583: istore        10
     585: aload         9
     587: invokevirtual #293                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     590: checkcast     #295                // class java/lang/Number
     593: invokevirtual #298                // Method java/lang/Number.intValue:()I
     596: istore        9
     598: aload         7
     600: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     605: astore        10
     607: aload         10
     609: checkcast     #276                // class kotlin/Pair
     612: astore        11
     614: iconst_0
     615: istore        12
     617: aload         11
     619: invokevirtual #293                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     622: checkcast     #295                // class java/lang/Number
     625: invokevirtual #298                // Method java/lang/Number.intValue:()I
     628: istore        11
     630: iload         9
     632: iload         11
     634: if_icmple     645
     637: aload         10
     639: astore        8
     641: iload         11
     643: istore        9
     645: aload         7
     647: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     652: ifne          598
     655: aload         8
     657: checkcast     #276                // class kotlin/Pair
     660: astore        4
     662: new           #276                // class kotlin/Pair
     665: dup
     666: bipush        45
     668: invokestatic  #93                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     671: aload         4
     673: dup
     674: invokestatic  #71                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     677: invokevirtual #293                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     680: invokespecial #283                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     683: astore        5
     685: aload_3
     686: aload         4
     688: invokeinterface #299,  2          // InterfaceMethod java/util/List.remove:(Ljava/lang/Object;)Z
     693: pop
     694: aload_3
     695: aload         5
     697: invokeinterface #300,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     702: pop
     703: aload_3
     704: checkcast     #39                 // class java/lang/Iterable
     707: astore        7
     709: iconst_0
     710: istore        8
     712: aload         7
     714: astore        9
     716: new           #174                // class java/util/ArrayList
     719: dup
     720: invokespecial #175                // Method java/util/ArrayList."<init>":()V
     723: checkcast     #65                 // class java/util/Collection
     726: astore        10
     728: iconst_0
     729: istore        11
     731: aload         9
     733: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     738: astore        12
     740: aload         12
     742: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     747: ifeq          815
     750: aload         12
     752: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     757: astore        13
     759: aload         13
     761: checkcast     #276                // class kotlin/Pair
     764: astore        14
     766: iconst_0
     767: istore        15
     769: aload         14
     771: invokevirtual #293                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     774: checkcast     #295                // class java/lang/Number
     777: invokevirtual #298                // Method java/lang/Number.intValue:()I
     780: aload         4
     782: invokevirtual #293                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     785: checkcast     #295                // class java/lang/Number
     788: invokevirtual #298                // Method java/lang/Number.intValue:()I
     791: if_icmpge     798
     794: iconst_1
     795: goto          799
     798: iconst_0
     799: ifeq          740
     802: aload         10
     804: aload         13
     806: invokeinterface #97,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     811: pop
     812: goto          740
     815: aload         10
     817: checkcast     #79                 // class java/util/List
     820: nop
     821: astore        6
     823: aload_3
     824: aload         6
     826: checkcast     #65                 // class java/util/Collection
     829: invokeinterface #303,  2          // InterfaceMethod java/util/List.removeAll:(Ljava/util/Collection;)Z
     834: pop
     835: aload_3
     836: invokeinterface #306,  1          // InterfaceMethod java/util/List.size:()I
     841: iload_2
     842: if_icmpge     864
     845: aload_3
     846: aload         5
     848: aconst_null
     849: aconst_null
     850: iconst_3
     851: aconst_null
     852: invokestatic  #310                // Method kotlin/Pair.copy$default:(Lkotlin/Pair;Ljava/lang/Object;Ljava/lang/Object;ILjava/lang/Object;)Lkotlin/Pair;
     855: invokeinterface #300,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     860: pop
     861: goto          835
     864: aload_1
     865: aload         4
     867: invokevirtual #287                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     870: invokevirtual #201                // Method java/util/TreeSet.remove:(Ljava/lang/Object;)Z
     873: pop
     874: aload_0
     875: aload         4
     877: invokevirtual #287                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     880: invokeinterface #204,  2          // InterfaceMethod java/util/Map.remove:(Ljava/lang/Object;)Ljava/lang/Object;
     885: pop
     886: aload_0
     887: aload_0
     888: aload         4
     890: invokedynamic #318,  0            // InvokeDynamic #6:invoke:(Ljava/util/Map;Lkotlin/Pair;)Lkotlin/jvm/functions/Function2;
     895: invokedynamic #323,  0            // InvokeDynamic #7:accept:(Lkotlin/jvm/functions/Function2;)Ljava/util/function/BiConsumer;
     900: invokeinterface #229,  2          // InterfaceMethod java/util/Map.forEach:(Ljava/util/function/BiConsumer;)V
     905: aload_3
     906: checkcast     #39                 // class java/lang/Iterable
     909: astore        4
     911: iconst_0
     912: istore        5
     914: aload         4
     916: instanceof    #65                 // class java/util/Collection
     919: ifeq          939
     922: aload         4
     924: checkcast     #65                 // class java/util/Collection
     927: invokeinterface #137,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     932: ifeq          939
     935: iconst_0
     936: goto          1006
     939: aload         4
     941: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     946: astore        6
     948: aload         6
     950: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     955: ifeq          1005
     958: aload         6
     960: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     965: astore        7
     967: aload         7
     969: checkcast     #276                // class kotlin/Pair
     972: astore        8
     974: iconst_0
     975: istore        9
     977: aload         8
     979: invokevirtual #287                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     982: checkcast     #89                 // class java/lang/Character
     985: invokevirtual #179                // Method java/lang/Character.charValue:()C
     988: bipush        45
     990: if_icmpne     997
     993: iconst_1
     994: goto          998
     997: iconst_0
     998: ifeq          948
    1001: iconst_1
    1002: goto          1006
    1005: iconst_0
    1006: ifeq          282
    1009: new           #23                 // class java/util/TreeSet
    1012: dup
    1013: invokespecial #24                 // Method java/util/TreeSet."<init>":()V
    1016: astore        4
    1018: aload         4
    1020: aload_0
    1021: astore        5
    1023: astore        16
    1025: iconst_0
    1026: istore        6
    1028: aload         5
    1030: astore        7
    1032: new           #15                 // class java/util/LinkedHashMap
    1035: dup
    1036: invokespecial #19                 // Method java/util/LinkedHashMap."<init>":()V
    1039: checkcast     #21                 // class java/util/Map
    1042: astore        8
    1044: iconst_0
    1045: istore        9
    1047: aload         7
    1049: invokeinterface #141,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
    1054: invokeinterface #144,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
    1059: astore        10
    1061: aload         10
    1063: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1068: ifeq          1142
    1071: aload         10
    1073: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1078: checkcast     #146                // class java/util/Map$Entry
    1081: astore        11
    1083: aload         11
    1085: astore        12
    1087: iconst_0
    1088: istore        13
    1090: aload         12
    1092: invokeinterface #149,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
    1097: checkcast     #57                 // class java/lang/CharSequence
    1100: invokeinterface #153,  1          // InterfaceMethod java/lang/CharSequence.length:()I
    1105: ifne          1112
    1108: iconst_1
    1109: goto          1113
    1112: iconst_0
    1113: nop
    1114: ifeq          1061
    1117: aload         8
    1119: aload         11
    1121: invokeinterface #156,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
    1126: aload         11
    1128: invokeinterface #149,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
    1133: invokeinterface #159,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    1138: pop
    1139: goto          1061
    1142: aload         8
    1144: nop
    1145: aload         16
    1147: swap
    1148: invokeinterface #162,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
    1153: checkcast     #39                 // class java/lang/Iterable
    1156: invokestatic  #168                // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;
    1159: checkcast     #65                 // class java/util/Collection
    1162: invokevirtual #172                // Method java/util/TreeSet.addAll:(Ljava/util/Collection;)Z
    1165: pop
    1166: aload         4
    1168: aload_1
    1169: checkcast     #39                 // class java/lang/Iterable
    1172: astore        5
    1174: astore        16
    1176: iconst_0
    1177: istore        6
    1179: aload         5
    1181: astore        7
    1183: new           #174                // class java/util/ArrayList
    1186: dup
    1187: invokespecial #175                // Method java/util/ArrayList."<init>":()V
    1190: checkcast     #65                 // class java/util/Collection
    1193: astore        8
    1195: iconst_0
    1196: istore        9
    1198: aload         7
    1200: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1205: astore        10
    1207: aload         10
    1209: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1214: ifeq          1275
    1217: aload         10
    1219: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1224: astore        11
    1226: aload         11
    1228: checkcast     #89                 // class java/lang/Character
    1231: invokevirtual #179                // Method java/lang/Character.charValue:()C
    1234: istore        12
    1236: iconst_0
    1237: istore        13
    1239: iload         12
    1241: invokestatic  #93                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
    1244: aload_0
    1245: swap
    1246: invokeinterface #182,  2          // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
    1251: ifne          1258
    1254: iconst_1
    1255: goto          1259
    1258: iconst_0
    1259: ifeq          1207
    1262: aload         8
    1264: aload         11
    1266: invokeinterface #97,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1271: pop
    1272: goto          1207
    1275: aload         8
    1277: checkcast     #79                 // class java/util/List
    1280: nop
    1281: aload         16
    1283: swap
    1284: checkcast     #65                 // class java/util/Collection
    1287: invokevirtual #172                // Method java/util/TreeSet.addAll:(Ljava/util/Collection;)Z
    1290: pop
    1291: aload_3
    1292: checkcast     #39                 // class java/lang/Iterable
    1295: astore        5
    1297: iconst_0
    1298: istore        6
    1300: aload         5
    1302: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1307: astore        7
    1309: aload         7
    1311: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1316: ifeq          1353
    1319: aload         7
    1321: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1326: astore        8
    1328: aload         8
    1330: checkcast     #276                // class kotlin/Pair
    1333: astore        9
    1335: iconst_0
    1336: istore        10
    1338: aload         4
    1340: aload         9
    1342: invokevirtual #287                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
    1345: invokevirtual #201                // Method java/util/TreeSet.remove:(Ljava/lang/Object;)Z
    1348: pop
    1349: nop
    1350: goto          1309
    1353: nop
    1354: aload         4
    1356: invokevirtual #324                // Method java/util/TreeSet.isEmpty:()Z
    1359: ifne          282
    1362: aload         4
    1364: invokevirtual #185                // Method java/util/TreeSet.first:()Ljava/lang/Object;
    1367: checkcast     #89                 // class java/lang/Character
    1370: astore        5
    1372: aload_3
    1373: checkcast     #39                 // class java/lang/Iterable
    1376: astore        7
    1378: iconst_0
    1379: istore        8
    1381: aload         7
    1383: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1388: astore        9
    1390: aload         9
    1392: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1397: ifeq          1448
    1400: aload         9
    1402: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1407: astore        10
    1409: aload         10
    1411: checkcast     #276                // class kotlin/Pair
    1414: astore        11
    1416: iconst_0
    1417: istore        12
    1419: aload         11
    1421: invokevirtual #287                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
    1424: checkcast     #89                 // class java/lang/Character
    1427: invokevirtual #179                // Method java/lang/Character.charValue:()C
    1430: bipush        45
    1432: if_icmpne     1439
    1435: iconst_1
    1436: goto          1440
    1439: iconst_0
    1440: ifeq          1390
    1443: aload         10
    1445: goto          1459
    1448: new           #289                // class java/util/NoSuchElementException
    1451: dup
    1452: ldc_w         #326                // String Collection contains no element matching the predicate.
    1455: invokespecial #327                // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
    1458: athrow
    1459: checkcast     #276                // class kotlin/Pair
    1462: astore        6
    1464: new           #276                // class kotlin/Pair
    1467: dup
    1468: aload         5
    1470: aload         6
    1472: invokevirtual #293                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
    1475: checkcast     #295                // class java/lang/Number
    1478: invokevirtual #298                // Method java/lang/Number.intValue:()I
    1481: bipush        60
    1483: iadd
    1484: aload         5
    1486: invokevirtual #179                // Method java/lang/Character.charValue:()C
    1489: iadd
    1490: bipush        65
    1492: isub
    1493: iconst_1
    1494: iadd
    1495: invokestatic  #281                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
    1498: invokespecial #283                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
    1501: astore        7
    1503: aload_3
    1504: aload         6
    1506: invokeinterface #299,  2          // InterfaceMethod java/util/List.remove:(Ljava/lang/Object;)Z
    1511: pop
    1512: aload_3
    1513: aload         7
    1515: invokeinterface #300,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
    1520: pop
    1521: goto          905
    1524: aload_3
    1525: checkcast     #39                 // class java/lang/Iterable
    1528: astore        4
    1530: iconst_0
    1531: istore        5
    1533: aload         4
    1535: invokeinterface #43,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1540: astore        6
    1542: aload         6
    1544: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1549: ifne          1560
    1552: new           #289                // class java/util/NoSuchElementException
    1555: dup
    1556: invokespecial #290                // Method java/util/NoSuchElementException."<init>":()V
    1559: athrow
    1560: aload         6
    1562: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1567: astore        7
    1569: aload         6
    1571: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1576: ifne          1584
    1579: aload         7
    1581: goto          1666
    1584: aload         7
    1586: checkcast     #276                // class kotlin/Pair
    1589: astore        8
    1591: iconst_0
    1592: istore        9
    1594: aload         8
    1596: invokevirtual #293                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
    1599: checkcast     #295                // class java/lang/Number
    1602: invokevirtual #298                // Method java/lang/Number.intValue:()I
    1605: istore        8
    1607: aload         6
    1609: invokeinterface #53,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1614: astore        9
    1616: aload         9
    1618: checkcast     #276                // class kotlin/Pair
    1621: astore        10
    1623: iconst_0
    1624: istore        11
    1626: aload         10
    1628: invokevirtual #293                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
    1631: checkcast     #295                // class java/lang/Number
    1634: invokevirtual #298                // Method java/lang/Number.intValue:()I
    1637: istore        10
    1639: iload         8
    1641: iload         10
    1643: if_icmpge     1654
    1646: aload         9
    1648: astore        7
    1650: iload         10
    1652: istore        8
    1654: aload         6
    1656: invokeinterface #49,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1661: ifne          1607
    1664: aload         7
    1666: dup
    1667: invokestatic  #71                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
    1670: checkcast     #276                // class kotlin/Pair
    1673: invokevirtual #293                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
    1676: checkcast     #295                // class java/lang/Number
    1679: invokevirtual #298                // Method java/lang/Number.intValue:()I
    1682: ireturn

  private static final java.lang.String part1$lambda$2$lambda$0(kotlin.text.MatchResult, java.lang.Character, java.lang.String);
    Code:
       0: aload_1
       1: ldc_w         #366                // String <unused var>
       4: invokestatic  #370                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: new           #187                // class java/lang/StringBuilder
      10: dup
      11: invokespecial #188                // Method java/lang/StringBuilder."<init>":()V
      14: aload_2
      15: dup
      16: ifnonnull     22
      19: pop
      20: ldc           #134                // String
      22: invokevirtual #192                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      25: aload_0
      26: invokeinterface #77,  1           // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;
      31: iconst_1
      32: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      37: checkcast     #55                 // class java/lang/String
      40: iconst_0
      41: invokevirtual #87                 // Method java/lang/String.charAt:(I)C
      44: invokevirtual #373                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      47: invokevirtual #198                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      50: areturn

  private static final java.lang.String part1$lambda$2$lambda$1(kotlin.jvm.functions.Function2, java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: aload_2
       3: invokeinterface #379,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
       8: checkcast     #55                 // class java/lang/String
      11: areturn

  private static final kotlin.Unit part1$lambda$5(java.util.Map, java.lang.Character, java.lang.Character, java.lang.String);
    Code:
       0: aload_2
       1: ldc_w         #385                // String k
       4: invokestatic  #370                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_3
       8: ldc_w         #386                // String v
      11: invokestatic  #370                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      14: aload_0
      15: aload_2
      16: aload_3
      17: aload_1
      18: invokevirtual #387                // Method java/lang/Character.toString:()Ljava/lang/String;
      21: ldc           #134                // String
      23: iconst_0
      24: iconst_4
      25: aconst_null
      26: invokestatic  #393                // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;
      29: invokeinterface #159,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      34: pop
      35: getstatic     #399                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      38: areturn

  private static final void part1$lambda$6(kotlin.jvm.functions.Function2, java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: aload_2
       3: invokeinterface #379,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
       8: pop
       9: return

  private static final java.lang.String part2$lambda$9$lambda$7(kotlin.text.MatchResult, java.lang.Character, java.lang.String);
    Code:
       0: aload_1
       1: ldc_w         #366                // String <unused var>
       4: invokestatic  #370                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: new           #187                // class java/lang/StringBuilder
      10: dup
      11: invokespecial #188                // Method java/lang/StringBuilder."<init>":()V
      14: aload_2
      15: dup
      16: ifnonnull     22
      19: pop
      20: ldc           #134                // String
      22: invokevirtual #192                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      25: aload_0
      26: invokeinterface #77,  1           // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;
      31: iconst_1
      32: invokeinterface #83,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      37: checkcast     #55                 // class java/lang/String
      40: iconst_0
      41: invokevirtual #87                 // Method java/lang/String.charAt:(I)C
      44: invokevirtual #373                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      47: invokevirtual #198                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      50: areturn

  private static final java.lang.String part2$lambda$9$lambda$8(kotlin.jvm.functions.Function2, java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: aload_2
       3: invokeinterface #379,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
       8: checkcast     #55                 // class java/lang/String
      11: areturn

  private static final kotlin.Unit part2$lambda$15(java.util.Map, kotlin.Pair, java.lang.Character, java.lang.String);
    Code:
       0: aload_2
       1: ldc_w         #385                // String k
       4: invokestatic  #370                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_3
       8: ldc_w         #386                // String v
      11: invokestatic  #370                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      14: aload_0
      15: aload_2
      16: aload_3
      17: aload_1
      18: invokevirtual #287                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      21: checkcast     #89                 // class java/lang/Character
      24: invokevirtual #179                // Method java/lang/Character.charValue:()C
      27: invokestatic  #404                // Method java/lang/String.valueOf:(C)Ljava/lang/String;
      30: ldc           #134                // String
      32: iconst_0
      33: iconst_4
      34: aconst_null
      35: invokestatic  #393                // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;
      38: invokeinterface #159,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      43: pop
      44: getstatic     #399                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      47: areturn

  private static final void part2$lambda$16(kotlin.jvm.functions.Function2, java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: aload_2
       3: invokeinterface #379,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
       8: pop
       9: return

  static {};
    Code:
       0: new           #59                 // class kotlin/text/Regex
       3: dup
       4: ldc_w         #408                // String ^Step ([A-Z]) must.+step ([A-Z]) can begin.$
       7: invokespecial #409                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
      10: putstatic     #11                 // Field lineRegex:Lkotlin/text/Regex;
      13: return
}


package advent.of.code.day08

import java.io.File

data class Node(
    val children: List<Node>,
    val metadata: List<Int>
) {
    val length: Int = 2 + metadata.size + children.sumBy { it.length }
    val metadataSum: Int = metadata.sum() + children.sumBy { it.metadataSum }
    val metadataValue: Int = if (children.isEmpty()) metadataSum
    else metadata.sumBy { if (it <= children.size) children[it - 1].metadataValue else 0 }
}

private val tree = tree(File("day08.txt")
    .readText()
    .trim()
    .split(" ")
    .map { it.toInt() })

fun tree(input: List<Int>): Node {
    val childCount = input[0]
    val metadataCount = input[1]
    val children = mutableListOf<Node>()
    var childInput = input.drop(2)
    for (s in (1..childCount)) {
        val child = tree(childInput)
        children += child
        childInput = childInput.drop(child.length)
    }
    return Node(children, input.drop(2 + children.sumBy { it.length }).take(metadataCount))
}

fun part1() = tree.metadataSum

fun part2() = tree.metadataValue

Compiled from "Solution.kt"
public final class advent.of.code.day08.SolutionKt {
  private static final advent.of.code.day08.Node tree;

  public static final advent.of.code.day08.Node tree(java.util.List<java.lang.Integer>);
    Code:
       0: aload_0
       1: ldc           #10                 // String input
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: iconst_0
       8: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      13: checkcast     #24                 // class java/lang/Number
      16: invokevirtual #28                 // Method java/lang/Number.intValue:()I
      19: istore_1
      20: aload_0
      21: iconst_1
      22: invokeinterface #22,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      27: checkcast     #24                 // class java/lang/Number
      30: invokevirtual #28                 // Method java/lang/Number.intValue:()I
      33: istore_2
      34: new           #30                 // class java/util/ArrayList
      37: dup
      38: invokespecial #34                 // Method java/util/ArrayList."<init>":()V
      41: checkcast     #18                 // class java/util/List
      44: astore_3
      45: aload_0
      46: checkcast     #36                 // class java/lang/Iterable
      49: iconst_2
      50: invokestatic  #42                 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
      53: astore        4
      55: iconst_1
      56: istore        5
      58: iload         5
      60: iload_1
      61: if_icmpgt     110
      64: aload         4
      66: invokestatic  #44                 // Method tree:(Ljava/util/List;)Ladvent/of/code/day08/Node;
      69: astore        6
      71: aload_3
      72: checkcast     #46                 // class java/util/Collection
      75: aload         6
      77: invokeinterface #50,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      82: pop
      83: aload         4
      85: checkcast     #36                 // class java/lang/Iterable
      88: aload         6
      90: invokevirtual #55                 // Method advent/of/code/day08/Node.getLength:()I
      93: invokestatic  #42                 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
      96: astore        4
      98: iload         5
     100: iload_1
     101: if_icmpeq     110
     104: iinc          5, 1
     107: goto          64
     110: aload_3
     111: aload_0
     112: checkcast     #36                 // class java/lang/Iterable
     115: iconst_2
     116: aload_3
     117: checkcast     #36                 // class java/lang/Iterable
     120: astore        5
     122: istore        14
     124: astore        13
     126: astore        12
     128: iconst_0
     129: istore        6
     131: iconst_0
     132: istore        7
     134: aload         5
     136: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     141: astore        8
     143: aload         8
     145: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     150: ifeq          193
     153: aload         8
     155: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     160: astore        9
     162: iload         7
     164: aload         9
     166: checkcast     #52                 // class advent/of/code/day08/Node
     169: astore        10
     171: istore        15
     173: iconst_0
     174: istore        11
     176: aload         10
     178: invokevirtual #55                 // Method advent/of/code/day08/Node.getLength:()I
     181: istore        16
     183: iload         15
     185: iload         16
     187: iadd
     188: istore        7
     190: goto          143
     193: iload         7
     195: istore        15
     197: aload         12
     199: aload         13
     201: iload         14
     203: iload         15
     205: iadd
     206: invokestatic  #42                 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
     209: checkcast     #36                 // class java/lang/Iterable
     212: iload_2
     213: invokestatic  #72                 // Method kotlin/collections/CollectionsKt.take:(Ljava/lang/Iterable;I)Ljava/util/List;
     216: astore        17
     218: astore        18
     220: new           #52                 // class advent/of/code/day08/Node
     223: dup
     224: aload         18
     226: aload         17
     228: invokespecial #75                 // Method advent/of/code/day08/Node."<init>":(Ljava/util/List;Ljava/util/List;)V
     231: areturn

  public static final int part1();
    Code:
       0: getstatic     #95                 // Field tree:Ladvent/of/code/day08/Node;
       3: invokevirtual #98                 // Method advent/of/code/day08/Node.getMetadataSum:()I
       6: ireturn

  public static final int part2();
    Code:
       0: getstatic     #95                 // Field tree:Ladvent/of/code/day08/Node;
       3: invokevirtual #102                // Method advent/of/code/day08/Node.getMetadataValue:()I
       6: ireturn

  static {};
    Code:
       0: new           #105                // class java/io/File
       3: dup
       4: ldc           #107                // String day08.txt
       6: invokespecial #110                // Method java/io/File."<init>":(Ljava/lang/String;)V
       9: aconst_null
      10: iconst_1
      11: aconst_null
      12: invokestatic  #116                // Method kotlin/io/FilesKt.readText$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/lang/String;
      15: checkcast     #118                // class java/lang/CharSequence
      18: invokestatic  #124                // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
      21: invokevirtual #128                // Method java/lang/Object.toString:()Ljava/lang/String;
      24: checkcast     #118                // class java/lang/CharSequence
      27: iconst_1
      28: anewarray     #130                // class java/lang/String
      31: astore_0
      32: aload_0
      33: iconst_0
      34: ldc           #132                // String
      36: aastore
      37: aload_0
      38: iconst_0
      39: iconst_0
      40: bipush        6
      42: aconst_null
      43: invokestatic  #136                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      46: checkcast     #36                 // class java/lang/Iterable
      49: astore_0
      50: nop
      51: iconst_0
      52: istore_1
      53: aload_0
      54: astore_2
      55: new           #30                 // class java/util/ArrayList
      58: dup
      59: aload_0
      60: bipush        10
      62: invokestatic  #140                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      65: invokespecial #143                // Method java/util/ArrayList."<init>":(I)V
      68: checkcast     #46                 // class java/util/Collection
      71: astore_3
      72: iconst_0
      73: istore        4
      75: aload_2
      76: invokeinterface #59,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      81: astore        5
      83: aload         5
      85: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      90: ifeq          136
      93: aload         5
      95: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     100: astore        6
     102: aload_3
     103: aload         6
     105: checkcast     #130                // class java/lang/String
     108: astore        7
     110: astore        9
     112: iconst_0
     113: istore        8
     115: aload         7
     117: invokestatic  #149                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     120: nop
     121: invokestatic  #153                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     124: aload         9
     126: swap
     127: invokeinterface #50,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     132: pop
     133: goto          83
     136: aload_3
     137: checkcast     #18                 // class java/util/List
     140: nop
     141: invokestatic  #44                 // Method tree:(Ljava/util/List;)Ladvent/of/code/day08/Node;
     144: putstatic     #95                 // Field tree:Ladvent/of/code/day08/Node;
     147: return
}