import java.io.File
import kotlin.math.*

fun day11(in1: Int): Long {
	var expansionValue = 1
	if (in1 == 2) {
		expansionValue = 1000000 - 1
	}

	var universe: String = ""
	var xDim = 0
	var yDim = 0
	var galaxyMap = mutableMapOf<Int, Pair<Int, Int>>()
	var galaxyCount = 1

	File("day2311_puzzle_input.txt").forEachLine {
		universe += it
		xDim = it.length

		var line = it
		for (i in 0..line.length - 1) {
			if (line[i] == '#') {
				galaxyMap.put(galaxyCount, Pair(i, yDim))
				galaxyCount += 1
			}
		}
		yDim += 1
		// expand universe in yDim:
		if (!line.contains('#')) {
			yDim += expansionValue
		}
	}

	// determine at which xDim the universe will expand:
	var xDimExpandCount = mutableListOf<Int>()
	for (i in 0..xDim - 1) {
		if (!universe.chunked(xDim).map { it[i] }.contains('#')) {
			xDimExpandCount.add(i)
		}
	}

	for (key in galaxyMap.keys) {
		for (i in xDimExpandCount.size - 1 downTo 0) {
			if (galaxyMap.getValue(key).first > xDimExpandCount[i]) {
				galaxyMap.put(
					key,
					Pair(galaxyMap.getValue(key).first + (expansionValue), galaxyMap.getValue(key).second)
				)
			}
		}
	}

	var result = 0L
	for ((key, value) in galaxyMap) {
		for ((key2, value2) in galaxyMap) {
			if (key != key2) {
				result += (abs(value2.second - value.second) + abs(value2.first - value.first)).toLong()
			}
		}
	}

	return result / 2
}

fun main() {
	var t1 = System.currentTimeMillis()

	var solution1 = day11(1)
	var solution2 = day11(2)

// print solution for part 1
	println("*******************************")
	println("--- Day 11: Cosmic Expansion ---")
	println("*******************************")
	println("Solution for part1")
	println("   $solution1 ")
	println()
// print solution for part 2
	println("*******************************")
	println("Solution for part2")
	println("   $solution2 ")
	println()

	t1 = System.currentTimeMillis() - t1
	println("puzzle solved in ${t1} ms")
}

Compiled from "day2311_1_2.kt"
public final class Day2311_1_2Kt {
  public static final long day11(int);
    Code:
       0: new           #8                  // class kotlin/jvm/internal/Ref$IntRef
       3: dup
       4: invokespecial #12                 // Method kotlin/jvm/internal/Ref$IntRef."<init>":()V
       7: astore_1
       8: aload_1
       9: iconst_1
      10: putfield      #16                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
      13: iload_0
      14: iconst_2
      15: if_icmpne     24
      18: aload_1
      19: ldc           #17                 // int 999999
      21: putfield      #16                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
      24: new           #19                 // class kotlin/jvm/internal/Ref$ObjectRef
      27: dup
      28: invokespecial #20                 // Method kotlin/jvm/internal/Ref$ObjectRef."<init>":()V
      31: astore_2
      32: aload_2
      33: ldc           #22                 // String
      35: putfield      #25                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      38: new           #8                  // class kotlin/jvm/internal/Ref$IntRef
      41: dup
      42: invokespecial #12                 // Method kotlin/jvm/internal/Ref$IntRef."<init>":()V
      45: astore_3
      46: new           #8                  // class kotlin/jvm/internal/Ref$IntRef
      49: dup
      50: invokespecial #12                 // Method kotlin/jvm/internal/Ref$IntRef."<init>":()V
      53: astore        4
      55: new           #19                 // class kotlin/jvm/internal/Ref$ObjectRef
      58: dup
      59: invokespecial #20                 // Method kotlin/jvm/internal/Ref$ObjectRef."<init>":()V
      62: astore        5
      64: aload         5
      66: new           #27                 // class java/util/LinkedHashMap
      69: dup
      70: invokespecial #28                 // Method java/util/LinkedHashMap."<init>":()V
      73: checkcast     #30                 // class java/util/Map
      76: putfield      #25                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      79: new           #8                  // class kotlin/jvm/internal/Ref$IntRef
      82: dup
      83: invokespecial #12                 // Method kotlin/jvm/internal/Ref$IntRef."<init>":()V
      86: astore        6
      88: aload         6
      90: iconst_1
      91: putfield      #16                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
      94: new           #32                 // class java/io/File
      97: dup
      98: ldc           #34                 // String day2311_puzzle_input.txt
     100: invokespecial #37                 // Method java/io/File."<init>":(Ljava/lang/String;)V
     103: aconst_null
     104: aload_2
     105: aload_3
     106: aload         5
     108: aload         6
     110: aload         4
     112: aload_1
     113: invokedynamic #57,  0             // InvokeDynamic #0:invoke:(Lkotlin/jvm/internal/Ref$ObjectRef;Lkotlin/jvm/internal/Ref$IntRef;Lkotlin/jvm/internal/Ref$ObjectRef;Lkotlin/jvm/internal/Ref$IntRef;Lkotlin/jvm/internal/Ref$IntRef;Lkotlin/jvm/internal/Ref$IntRef;)Lkotlin/jvm/functions/Function1;
     118: iconst_1
     119: aconst_null
     120: invokestatic  #63                 // Method kotlin/io/FilesKt.forEachLine$default:(Ljava/io/File;Ljava/nio/charset/Charset;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
     123: new           #65                 // class java/util/ArrayList
     126: dup
     127: invokespecial #66                 // Method java/util/ArrayList."<init>":()V
     130: checkcast     #68                 // class java/util/List
     133: astore        7
     135: iconst_0
     136: istore        8
     138: aload_3
     139: getfield      #16                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     142: iconst_1
     143: isub
     144: istore        9
     146: iload         8
     148: iload         9
     150: if_icmpgt     310
     153: aload_2
     154: getfield      #25                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     157: checkcast     #70                 // class java/lang/CharSequence
     160: aload_3
     161: getfield      #16                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     164: invokestatic  #76                 // Method kotlin/text/StringsKt.chunked:(Ljava/lang/CharSequence;I)Ljava/util/List;
     167: checkcast     #78                 // class java/lang/Iterable
     170: astore        10
     172: iconst_0
     173: istore        11
     175: aload         10
     177: astore        12
     179: new           #65                 // class java/util/ArrayList
     182: dup
     183: aload         10
     185: bipush        10
     187: invokestatic  #84                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     190: invokespecial #87                 // Method java/util/ArrayList."<init>":(I)V
     193: checkcast     #89                 // class java/util/Collection
     196: astore        13
     198: iconst_0
     199: istore        14
     201: aload         12
     203: invokeinterface #93,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     208: astore        15
     210: aload         15
     212: invokeinterface #99,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     217: ifeq          265
     220: aload         15
     222: invokeinterface #103,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     227: astore        16
     229: aload         13
     231: aload         16
     233: checkcast     #105                // class java/lang/String
     236: astore        17
     238: astore        19
     240: iconst_0
     241: istore        18
     243: aload         17
     245: iload         8
     247: invokevirtual #109                // Method java/lang/String.charAt:(I)C
     250: invokestatic  #115                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     253: aload         19
     255: swap
     256: invokeinterface #119,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     261: pop
     262: goto          210
     265: aload         13
     267: checkcast     #68                 // class java/util/List
     270: nop
     271: bipush        35
     273: invokestatic  #115                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     276: invokeinterface #122,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
     281: ifne          297
     284: aload         7
     286: iload         8
     288: invokestatic  #127                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     291: invokeinterface #128,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     296: pop
     297: iload         8
     299: iload         9
     301: if_icmpeq     310
     304: iinc          8, 1
     307: goto          153
     310: aload         5
     312: getfield      #25                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     315: checkcast     #30                 // class java/util/Map
     318: invokeinterface #132,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
     323: invokeinterface #135,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     328: astore        8
     330: aload         8
     332: invokeinterface #99,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     337: ifeq          508
     340: aload         8
     342: invokeinterface #103,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     347: checkcast     #137                // class java/lang/Number
     350: invokevirtual #141                // Method java/lang/Number.intValue:()I
     353: istore        9
     355: aload         7
     357: invokeinterface #144,  1          // InterfaceMethod java/util/List.size:()I
     362: iconst_1
     363: isub
     364: istore        10
     366: iconst_m1
     367: iload         10
     369: if_icmpge     330
     372: aload         5
     374: getfield      #25                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     377: checkcast     #30                 // class java/util/Map
     380: iload         9
     382: invokestatic  #127                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     385: invokestatic  #150                // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;
     388: checkcast     #152                // class kotlin/Pair
     391: invokevirtual #155                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     394: checkcast     #137                // class java/lang/Number
     397: invokevirtual #141                // Method java/lang/Number.intValue:()I
     400: aload         7
     402: iload         10
     404: invokeinterface #159,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     409: checkcast     #137                // class java/lang/Number
     412: invokevirtual #141                // Method java/lang/Number.intValue:()I
     415: if_icmple     502
     418: aload         5
     420: getfield      #25                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     423: checkcast     #30                 // class java/util/Map
     426: iload         9
     428: invokestatic  #127                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     431: new           #152                // class kotlin/Pair
     434: dup
     435: aload         5
     437: getfield      #25                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     440: checkcast     #30                 // class java/util/Map
     443: iload         9
     445: invokestatic  #127                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     448: invokestatic  #150                // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;
     451: checkcast     #152                // class kotlin/Pair
     454: invokevirtual #155                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     457: checkcast     #137                // class java/lang/Number
     460: invokevirtual #141                // Method java/lang/Number.intValue:()I
     463: aload_1
     464: getfield      #16                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     467: iadd
     468: invokestatic  #127                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     471: aload         5
     473: getfield      #25                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     476: checkcast     #30                 // class java/util/Map
     479: iload         9
     481: invokestatic  #127                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     484: invokestatic  #150                // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;
     487: checkcast     #152                // class kotlin/Pair
     490: invokevirtual #162                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     493: invokespecial #165                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     496: invokeinterface #169,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     501: pop
     502: iinc          10, -1
     505: goto          366
     508: lconst_0
     509: lstore        8
     511: aload         5
     513: getfield      #25                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     516: checkcast     #30                 // class java/util/Map
     519: invokeinterface #172,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     524: invokeinterface #135,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     529: astore        10
     531: aload         10
     533: invokeinterface #99,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     538: ifeq          718
     541: aload         10
     543: invokeinterface #103,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     548: checkcast     #174                // class java/util/Map$Entry
     551: astore        11
     553: aload         11
     555: invokeinterface #177,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     560: checkcast     #137                // class java/lang/Number
     563: invokevirtual #141                // Method java/lang/Number.intValue:()I
     566: istore        12
     568: aload         11
     570: invokeinterface #179,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     575: checkcast     #152                // class kotlin/Pair
     578: astore        13
     580: aload         5
     582: getfield      #25                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     585: checkcast     #30                 // class java/util/Map
     588: invokeinterface #172,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     593: invokeinterface #135,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     598: astore        14
     600: aload         14
     602: invokeinterface #99,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     607: ifeq          531
     610: aload         14
     612: invokeinterface #103,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     617: checkcast     #174                // class java/util/Map$Entry
     620: astore        15
     622: aload         15
     624: invokeinterface #177,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     629: checkcast     #137                // class java/lang/Number
     632: invokevirtual #141                // Method java/lang/Number.intValue:()I
     635: istore        16
     637: aload         15
     639: invokeinterface #179,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     644: checkcast     #152                // class kotlin/Pair
     647: astore        17
     649: iload         12
     651: iload         16
     653: if_icmpeq     600
     656: lload         8
     658: aload         17
     660: invokevirtual #162                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     663: checkcast     #137                // class java/lang/Number
     666: invokevirtual #141                // Method java/lang/Number.intValue:()I
     669: aload         13
     671: invokevirtual #162                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     674: checkcast     #137                // class java/lang/Number
     677: invokevirtual #141                // Method java/lang/Number.intValue:()I
     680: isub
     681: invokestatic  #185                // Method java/lang/Math.abs:(I)I
     684: aload         17
     686: invokevirtual #155                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     689: checkcast     #137                // class java/lang/Number
     692: invokevirtual #141                // Method java/lang/Number.intValue:()I
     695: aload         13
     697: invokevirtual #155                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     700: checkcast     #137                // class java/lang/Number
     703: invokevirtual #141                // Method java/lang/Number.intValue:()I
     706: isub
     707: invokestatic  #185                // Method java/lang/Math.abs:(I)I
     710: iadd
     711: i2l
     712: ladd
     713: lstore        8
     715: goto          600
     718: lload         8
     720: iconst_2
     721: i2l
     722: ldiv
     723: lreturn

  public static final void main();
    Code:
       0: invokestatic  #222                // Method java/lang/System.currentTimeMillis:()J
       3: lstore_0
       4: iconst_1
       5: invokestatic  #224                // Method day11:(I)J
       8: lstore_2
       9: iconst_2
      10: invokestatic  #224                // Method day11:(I)J
      13: lstore        4
      15: ldc           #226                // String *******************************
      17: getstatic     #230                // Field java/lang/System.out:Ljava/io/PrintStream;
      20: swap
      21: invokevirtual #236                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      24: ldc           #238                // String --- Day 11: Cosmic Expansion ---
      26: getstatic     #230                // Field java/lang/System.out:Ljava/io/PrintStream;
      29: swap
      30: invokevirtual #236                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      33: ldc           #226                // String *******************************
      35: getstatic     #230                // Field java/lang/System.out:Ljava/io/PrintStream;
      38: swap
      39: invokevirtual #236                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      42: ldc           #240                // String Solution for part1
      44: getstatic     #230                // Field java/lang/System.out:Ljava/io/PrintStream;
      47: swap
      48: invokevirtual #236                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      51: new           #242                // class java/lang/StringBuilder
      54: dup
      55: invokespecial #243                // Method java/lang/StringBuilder."<init>":()V
      58: ldc           #245                // String
      60: invokevirtual #249                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      63: lload_2
      64: invokevirtual #252                // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
      67: bipush        32
      69: invokevirtual #255                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      72: invokevirtual #259                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      75: getstatic     #230                // Field java/lang/System.out:Ljava/io/PrintStream;
      78: swap
      79: invokevirtual #236                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      82: getstatic     #230                // Field java/lang/System.out:Ljava/io/PrintStream;
      85: invokevirtual #261                // Method java/io/PrintStream.println:()V
      88: ldc           #226                // String *******************************
      90: getstatic     #230                // Field java/lang/System.out:Ljava/io/PrintStream;
      93: swap
      94: invokevirtual #236                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      97: ldc_w         #263                // String Solution for part2
     100: getstatic     #230                // Field java/lang/System.out:Ljava/io/PrintStream;
     103: swap
     104: invokevirtual #236                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     107: new           #242                // class java/lang/StringBuilder
     110: dup
     111: invokespecial #243                // Method java/lang/StringBuilder."<init>":()V
     114: ldc           #245                // String
     116: invokevirtual #249                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     119: lload         4
     121: invokevirtual #252                // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
     124: bipush        32
     126: invokevirtual #255                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     129: invokevirtual #259                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     132: getstatic     #230                // Field java/lang/System.out:Ljava/io/PrintStream;
     135: swap
     136: invokevirtual #236                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     139: getstatic     #230                // Field java/lang/System.out:Ljava/io/PrintStream;
     142: invokevirtual #261                // Method java/io/PrintStream.println:()V
     145: invokestatic  #222                // Method java/lang/System.currentTimeMillis:()J
     148: lload_0
     149: lsub
     150: lstore_0
     151: new           #242                // class java/lang/StringBuilder
     154: dup
     155: invokespecial #243                // Method java/lang/StringBuilder."<init>":()V
     158: ldc_w         #265                // String puzzle solved in
     161: invokevirtual #249                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     164: lload_0
     165: invokevirtual #252                // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
     168: ldc_w         #267                // String  ms
     171: invokevirtual #249                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     174: invokevirtual #259                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     177: getstatic     #230                // Field java/lang/System.out:Ljava/io/PrintStream;
     180: swap
     181: invokevirtual #236                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     184: return

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

  private static final kotlin.Unit day11$lambda$0(kotlin.jvm.internal.Ref$ObjectRef, kotlin.jvm.internal.Ref$IntRef, kotlin.jvm.internal.Ref$ObjectRef, kotlin.jvm.internal.Ref$IntRef, kotlin.jvm.internal.Ref$IntRef, kotlin.jvm.internal.Ref$IntRef, java.lang.String);
    Code:
       0: aload         6
       2: ldc_w         #276                // String it
       5: invokestatic  #282                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       8: aload_0
       9: new           #242                // class java/lang/StringBuilder
      12: dup
      13: invokespecial #243                // Method java/lang/StringBuilder."<init>":()V
      16: aload_0
      17: getfield      #25                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      20: checkcast     #105                // class java/lang/String
      23: invokevirtual #249                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      26: aload         6
      28: invokevirtual #249                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      31: invokevirtual #259                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      34: putfield      #25                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      37: aload_1
      38: aload         6
      40: invokevirtual #285                // Method java/lang/String.length:()I
      43: putfield      #16                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
      46: aload         6
      48: astore        7
      50: iconst_0
      51: istore        8
      53: aload         7
      55: invokevirtual #285                // Method java/lang/String.length:()I
      58: istore        9
      60: iload         8
      62: iload         9
      64: if_icmpge     135
      67: aload         7
      69: iload         8
      71: invokevirtual #109                // Method java/lang/String.charAt:(I)C
      74: bipush        35
      76: if_icmpne     129
      79: aload_2
      80: getfield      #25                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      83: checkcast     #30                 // class java/util/Map
      86: aload_3
      87: getfield      #16                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
      90: invokestatic  #127                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      93: new           #152                // class kotlin/Pair
      96: dup
      97: iload         8
      99: invokestatic  #127                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     102: aload         4
     104: getfield      #16                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     107: invokestatic  #127                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     110: invokespecial #165                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     113: invokeinterface #169,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     118: pop
     119: aload_3
     120: aload_3
     121: getfield      #16                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     124: iconst_1
     125: iadd
     126: putfield      #16                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     129: iinc          8, 1
     132: goto          60
     135: aload         4
     137: aload         4
     139: getfield      #16                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     142: iconst_1
     143: iadd
     144: putfield      #16                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     147: aload         7
     149: checkcast     #70                 // class java/lang/CharSequence
     152: bipush        35
     154: iconst_0
     155: iconst_2
     156: aconst_null
     157: invokestatic  #289                // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;CZILjava/lang/Object;)Z
     160: ifne          179
     163: aload         4
     165: aload         4
     167: getfield      #16                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     170: aload         5
     172: getfield      #16                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     175: iadd
     176: putfield      #16                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     179: getstatic     #295                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
     182: areturn
}


import java.io.File
import kotlin.math.*

fun scratchCard(): Int {
	var result = 0
	val pattern = """(\d)+""".toRegex()
	File("day2304_puzzle_input.txt").forEachLine {
		var winningNumbers = pattern.findAll(it.substringAfter(": ").split(" | ")[0]).map { it.value }.toList()
		var numbersYouHave = pattern.findAll(it.substringAfter(": ").split(" | ")[1]).map { it.value }.toList()
		result += Math.pow(
			2.0,
			((winningNumbers + numbersYouHave).size - (winningNumbers + numbersYouHave).distinct().size).toDouble() - 1.0
		).toInt()

	}
	return result
}

fun scratchCardPart2(): Int {
	var puzzle_input = mutableListOf<String>()
	File("day2304_puzzle_input.txt").forEachLine {
		puzzle_input.add(it)
	}
	val pattern = """(\d)+""".toRegex()
	val wonCards = puzzle_input.toMutableList()
	val wonCardsIterator = wonCards.listIterator()

	while (wonCardsIterator.hasNext()) {
		var card = wonCardsIterator.next()
		var cardNumber = pattern.find(card.substringBefore(":"))!!.value.toInt()
		var winningNumbers = pattern.findAll(card.substringAfter(": ").split(" | ")[0]).map { it.value }.toList()
		var numbersYouHave = pattern.findAll(card.substringAfter(": ").split(" | ")[1]).map { it.value }.toList()
		var wins = (winningNumbers + numbersYouHave).size - (winningNumbers + numbersYouHave).distinct().size

		for (i in 0..wins - 1) {
			wonCardsIterator.add(puzzle_input[cardNumber + i])
			wonCardsIterator.previous()
		}
	}
	return wonCards.size
}

fun main() {
	var t1 = System.currentTimeMillis()

	var solution1 = scratchCard()
	var solution2 = scratchCardPart2()

// print solution for part 1
	println("*******************************")
	println("--- Day 4: Scratchcards ---")
	println("*******************************")
	println("Solution for part1")
	println("   $solution1 points are they worth in total")
	println()
// print solution for part 2
	println("*******************************")
	println("Solution for part2")
	println("   $solution2 total scratchcards do you end up with")
	println()

	t1 = System.currentTimeMillis() - t1
	println("puzzle solved in ${t1} ms")
}

Compiled from "day2304_1_2.kt"
public final class Day2304_1_2Kt {
  public static final int scratchCard();
    Code:
       0: new           #8                  // class kotlin/jvm/internal/Ref$IntRef
       3: dup
       4: invokespecial #12                 // Method kotlin/jvm/internal/Ref$IntRef."<init>":()V
       7: astore_0
       8: new           #14                 // class kotlin/text/Regex
      11: dup
      12: ldc           #16                 // String (\\d)+
      14: invokespecial #19                 // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
      17: astore_1
      18: new           #21                 // class java/io/File
      21: dup
      22: ldc           #23                 // String day2304_puzzle_input.txt
      24: invokespecial #24                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      27: aconst_null
      28: aload_1
      29: aload_0
      30: invokedynamic #44,  0             // InvokeDynamic #0:invoke:(Lkotlin/text/Regex;Lkotlin/jvm/internal/Ref$IntRef;)Lkotlin/jvm/functions/Function1;
      35: iconst_1
      36: aconst_null
      37: invokestatic  #50                 // Method kotlin/io/FilesKt.forEachLine$default:(Ljava/io/File;Ljava/nio/charset/Charset;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
      40: aload_0
      41: getfield      #54                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
      44: ireturn

  public static final int scratchCardPart2();
    Code:
       0: new           #61                 // class kotlin/jvm/internal/Ref$ObjectRef
       3: dup
       4: invokespecial #62                 // Method kotlin/jvm/internal/Ref$ObjectRef."<init>":()V
       7: astore_0
       8: aload_0
       9: new           #64                 // class java/util/ArrayList
      12: dup
      13: invokespecial #65                 // Method java/util/ArrayList."<init>":()V
      16: checkcast     #67                 // class java/util/List
      19: putfield      #70                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      22: new           #21                 // class java/io/File
      25: dup
      26: ldc           #23                 // String day2304_puzzle_input.txt
      28: invokespecial #24                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      31: aconst_null
      32: aload_0
      33: invokedynamic #78,  0             // InvokeDynamic #1:invoke:(Lkotlin/jvm/internal/Ref$ObjectRef;)Lkotlin/jvm/functions/Function1;
      38: iconst_1
      39: aconst_null
      40: invokestatic  #50                 // Method kotlin/io/FilesKt.forEachLine$default:(Ljava/io/File;Ljava/nio/charset/Charset;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
      43: new           #14                 // class kotlin/text/Regex
      46: dup
      47: ldc           #16                 // String (\\d)+
      49: invokespecial #19                 // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
      52: astore_1
      53: aload_0
      54: getfield      #70                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      57: checkcast     #80                 // class java/util/Collection
      60: invokestatic  #86                 // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;
      63: astore_2
      64: aload_2
      65: invokeinterface #90,  1           // InterfaceMethod java/util/List.listIterator:()Ljava/util/ListIterator;
      70: astore_3
      71: aload_3
      72: invokeinterface #96,  1           // InterfaceMethod java/util/ListIterator.hasNext:()Z
      77: ifeq          357
      80: aload_3
      81: invokeinterface #100,  1          // InterfaceMethod java/util/ListIterator.next:()Ljava/lang/Object;
      86: checkcast     #102                // class java/lang/String
      89: astore        4
      91: aload_1
      92: aload         4
      94: ldc           #104                // String :
      96: aconst_null
      97: iconst_2
      98: aconst_null
      99: invokestatic  #110                // Method kotlin/text/StringsKt.substringBefore$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
     102: checkcast     #112                // class java/lang/CharSequence
     105: iconst_0
     106: iconst_2
     107: aconst_null
     108: invokestatic  #116                // Method kotlin/text/Regex.find$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/text/MatchResult;
     111: dup
     112: invokestatic  #122                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     115: invokeinterface #128,  1          // InterfaceMethod kotlin/text/MatchResult.getValue:()Ljava/lang/String;
     120: invokestatic  #134                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     123: istore        5
     125: aload_1
     126: aload         4
     128: ldc           #136                // String :
     130: aconst_null
     131: iconst_2
     132: aconst_null
     133: invokestatic  #139                // Method kotlin/text/StringsKt.substringAfter$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
     136: checkcast     #112                // class java/lang/CharSequence
     139: iconst_1
     140: anewarray     #102                // class java/lang/String
     143: astore        7
     145: aload         7
     147: iconst_0
     148: ldc           #141                // String  |
     150: aastore
     151: aload         7
     153: iconst_0
     154: iconst_0
     155: bipush        6
     157: aconst_null
     158: invokestatic  #145                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     161: iconst_0
     162: invokeinterface #149,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     167: checkcast     #112                // class java/lang/CharSequence
     170: iconst_0
     171: iconst_2
     172: aconst_null
     173: invokestatic  #153                // Method kotlin/text/Regex.findAll$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/sequences/Sequence;
     176: invokedynamic #162,  0            // InvokeDynamic #2:invoke:()Lkotlin/jvm/functions/Function1;
     181: invokestatic  #168                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
     184: invokestatic  #172                // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;
     187: astore        6
     189: aload_1
     190: aload         4
     192: ldc           #136                // String :
     194: aconst_null
     195: iconst_2
     196: aconst_null
     197: invokestatic  #139                // Method kotlin/text/StringsKt.substringAfter$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
     200: checkcast     #112                // class java/lang/CharSequence
     203: iconst_1
     204: anewarray     #102                // class java/lang/String
     207: astore        8
     209: aload         8
     211: iconst_0
     212: ldc           #141                // String  |
     214: aastore
     215: aload         8
     217: iconst_0
     218: iconst_0
     219: bipush        6
     221: aconst_null
     222: invokestatic  #145                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     225: iconst_1
     226: invokeinterface #149,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     231: checkcast     #112                // class java/lang/CharSequence
     234: iconst_0
     235: iconst_2
     236: aconst_null
     237: invokestatic  #153                // Method kotlin/text/Regex.findAll$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/sequences/Sequence;
     240: invokedynamic #177,  0            // InvokeDynamic #3:invoke:()Lkotlin/jvm/functions/Function1;
     245: invokestatic  #168                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
     248: invokestatic  #172                // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;
     251: astore        7
     253: aload         6
     255: checkcast     #80                 // class java/util/Collection
     258: aload         7
     260: checkcast     #179                // class java/lang/Iterable
     263: invokestatic  #183                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     266: invokeinterface #186,  1          // InterfaceMethod java/util/List.size:()I
     271: aload         6
     273: checkcast     #80                 // class java/util/Collection
     276: aload         7
     278: checkcast     #179                // class java/lang/Iterable
     281: invokestatic  #183                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     284: checkcast     #179                // class java/lang/Iterable
     287: invokestatic  #190                // Method kotlin/collections/CollectionsKt.distinct:(Ljava/lang/Iterable;)Ljava/util/List;
     290: invokeinterface #186,  1          // InterfaceMethod java/util/List.size:()I
     295: isub
     296: istore        8
     298: iconst_0
     299: istore        9
     301: iload         8
     303: iconst_1
     304: isub
     305: istore        10
     307: iload         9
     309: iload         10
     311: if_icmpgt     71
     314: aload_3
     315: aload_0
     316: getfield      #70                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     319: checkcast     #67                 // class java/util/List
     322: iload         5
     324: iload         9
     326: iadd
     327: invokeinterface #149,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     332: invokeinterface #193,  2          // InterfaceMethod java/util/ListIterator.add:(Ljava/lang/Object;)V
     337: aload_3
     338: invokeinterface #196,  1          // InterfaceMethod java/util/ListIterator.previous:()Ljava/lang/Object;
     343: pop
     344: iload         9
     346: iload         10
     348: if_icmpeq     71
     351: iinc          9, 1
     354: goto          314
     357: aload_2
     358: invokeinterface #186,  1          // InterfaceMethod java/util/List.size:()I
     363: ireturn

  public static final void main();
    Code:
       0: invokestatic  #216                // Method java/lang/System.currentTimeMillis:()J
       3: lstore_0
       4: invokestatic  #218                // Method scratchCard:()I
       7: istore_2
       8: invokestatic  #220                // Method scratchCardPart2:()I
      11: istore_3
      12: ldc           #222                // String *******************************
      14: getstatic     #226                // Field java/lang/System.out:Ljava/io/PrintStream;
      17: swap
      18: invokevirtual #231                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      21: ldc           #233                // String --- Day 4: Scratchcards ---
      23: getstatic     #226                // Field java/lang/System.out:Ljava/io/PrintStream;
      26: swap
      27: invokevirtual #231                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      30: ldc           #222                // String *******************************
      32: getstatic     #226                // Field java/lang/System.out:Ljava/io/PrintStream;
      35: swap
      36: invokevirtual #231                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      39: ldc           #235                // String Solution for part1
      41: getstatic     #226                // Field java/lang/System.out:Ljava/io/PrintStream;
      44: swap
      45: invokevirtual #231                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      48: new           #237                // class java/lang/StringBuilder
      51: dup
      52: invokespecial #238                // Method java/lang/StringBuilder."<init>":()V
      55: ldc           #240                // String
      57: invokevirtual #244                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      60: iload_2
      61: invokevirtual #247                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      64: ldc           #249                // String  points are they worth in total
      66: invokevirtual #244                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      69: invokevirtual #252                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      72: getstatic     #226                // Field java/lang/System.out:Ljava/io/PrintStream;
      75: swap
      76: invokevirtual #231                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      79: getstatic     #226                // Field java/lang/System.out:Ljava/io/PrintStream;
      82: invokevirtual #254                // Method java/io/PrintStream.println:()V
      85: ldc           #222                // String *******************************
      87: getstatic     #226                // Field java/lang/System.out:Ljava/io/PrintStream;
      90: swap
      91: invokevirtual #231                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      94: ldc_w         #256                // String Solution for part2
      97: getstatic     #226                // Field java/lang/System.out:Ljava/io/PrintStream;
     100: swap
     101: invokevirtual #231                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     104: new           #237                // class java/lang/StringBuilder
     107: dup
     108: invokespecial #238                // Method java/lang/StringBuilder."<init>":()V
     111: ldc           #240                // String
     113: invokevirtual #244                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     116: iload_3
     117: invokevirtual #247                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     120: ldc_w         #258                // String  total scratchcards do you end up with
     123: invokevirtual #244                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     126: invokevirtual #252                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     129: getstatic     #226                // Field java/lang/System.out:Ljava/io/PrintStream;
     132: swap
     133: invokevirtual #231                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     136: getstatic     #226                // Field java/lang/System.out:Ljava/io/PrintStream;
     139: invokevirtual #254                // Method java/io/PrintStream.println:()V
     142: invokestatic  #216                // Method java/lang/System.currentTimeMillis:()J
     145: lload_0
     146: lsub
     147: lstore_0
     148: new           #237                // class java/lang/StringBuilder
     151: dup
     152: invokespecial #238                // Method java/lang/StringBuilder."<init>":()V
     155: ldc_w         #260                // String puzzle solved in
     158: invokevirtual #244                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     161: lload_0
     162: invokevirtual #263                // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
     165: ldc_w         #265                // String  ms
     168: invokevirtual #244                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     171: invokevirtual #252                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     174: getstatic     #226                // Field java/lang/System.out:Ljava/io/PrintStream;
     177: swap
     178: invokevirtual #231                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     181: return

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

  private static final java.lang.String scratchCard$lambda$2$lambda$0(kotlin.text.MatchResult);
    Code:
       0: aload_0
       1: ldc_w         #277                // String it
       4: invokestatic  #281                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokeinterface #128,  1          // InterfaceMethod kotlin/text/MatchResult.getValue:()Ljava/lang/String;
      13: areturn

  private static final java.lang.String scratchCard$lambda$2$lambda$1(kotlin.text.MatchResult);
    Code:
       0: aload_0
       1: ldc_w         #277                // String it
       4: invokestatic  #281                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokeinterface #128,  1          // InterfaceMethod kotlin/text/MatchResult.getValue:()Ljava/lang/String;
      13: areturn

  private static final kotlin.Unit scratchCard$lambda$2(kotlin.text.Regex, kotlin.jvm.internal.Ref$IntRef, java.lang.String);
    Code:
       0: aload_2
       1: ldc_w         #277                // String it
       4: invokestatic  #281                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: aload_2
       9: ldc           #136                // String :
      11: aconst_null
      12: iconst_2
      13: aconst_null
      14: invokestatic  #139                // Method kotlin/text/StringsKt.substringAfter$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
      17: checkcast     #112                // class java/lang/CharSequence
      20: iconst_1
      21: anewarray     #102                // class java/lang/String
      24: astore        4
      26: aload         4
      28: iconst_0
      29: ldc           #141                // String  |
      31: aastore
      32: aload         4
      34: iconst_0
      35: iconst_0
      36: bipush        6
      38: aconst_null
      39: invokestatic  #145                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      42: iconst_0
      43: invokeinterface #149,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      48: checkcast     #112                // class java/lang/CharSequence
      51: iconst_0
      52: iconst_2
      53: aconst_null
      54: invokestatic  #153                // Method kotlin/text/Regex.findAll$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/sequences/Sequence;
      57: invokedynamic #287,  0            // InvokeDynamic #4:invoke:()Lkotlin/jvm/functions/Function1;
      62: invokestatic  #168                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      65: invokestatic  #172                // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;
      68: astore_3
      69: aload_0
      70: aload_2
      71: ldc           #136                // String :
      73: aconst_null
      74: iconst_2
      75: aconst_null
      76: invokestatic  #139                // Method kotlin/text/StringsKt.substringAfter$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
      79: checkcast     #112                // class java/lang/CharSequence
      82: iconst_1
      83: anewarray     #102                // class java/lang/String
      86: astore        5
      88: aload         5
      90: iconst_0
      91: ldc           #141                // String  |
      93: aastore
      94: aload         5
      96: iconst_0
      97: iconst_0
      98: bipush        6
     100: aconst_null
     101: invokestatic  #145                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     104: iconst_1
     105: invokeinterface #149,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     110: checkcast     #112                // class java/lang/CharSequence
     113: iconst_0
     114: iconst_2
     115: aconst_null
     116: invokestatic  #153                // Method kotlin/text/Regex.findAll$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/sequences/Sequence;
     119: invokedynamic #291,  0            // InvokeDynamic #5:invoke:()Lkotlin/jvm/functions/Function1;
     124: invokestatic  #168                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
     127: invokestatic  #172                // Method kotlin/sequences/SequencesKt.toList:(Lkotlin/sequences/Sequence;)Ljava/util/List;
     130: astore        4
     132: aload_1
     133: aload_1
     134: getfield      #54                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     137: ldc2_w        #292                // double 2.0d
     140: aload_3
     141: checkcast     #80                 // class java/util/Collection
     144: aload         4
     146: checkcast     #179                // class java/lang/Iterable
     149: invokestatic  #183                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     152: invokeinterface #186,  1          // InterfaceMethod java/util/List.size:()I
     157: aload_3
     158: checkcast     #80                 // class java/util/Collection
     161: aload         4
     163: checkcast     #179                // class java/lang/Iterable
     166: invokestatic  #183                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     169: checkcast     #179                // class java/lang/Iterable
     172: invokestatic  #190                // Method kotlin/collections/CollectionsKt.distinct:(Ljava/lang/Iterable;)Ljava/util/List;
     175: invokeinterface #186,  1          // InterfaceMethod java/util/List.size:()I
     180: isub
     181: i2d
     182: dconst_1
     183: dsub
     184: invokestatic  #299                // Method java/lang/Math.pow:(DD)D
     187: d2i
     188: iadd
     189: putfield      #54                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     192: getstatic     #305                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
     195: areturn

  private static final kotlin.Unit scratchCardPart2$lambda$3(kotlin.jvm.internal.Ref$ObjectRef, java.lang.String);
    Code:
       0: aload_1
       1: ldc_w         #277                // String it
       4: invokestatic  #281                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: getfield      #70                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      11: checkcast     #67                 // class java/util/List
      14: aload_1
      15: invokeinterface #310,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      20: pop
      21: getstatic     #305                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      24: areturn

  private static final java.lang.String scratchCardPart2$lambda$4(kotlin.text.MatchResult);
    Code:
       0: aload_0
       1: ldc_w         #277                // String it
       4: invokestatic  #281                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokeinterface #128,  1          // InterfaceMethod kotlin/text/MatchResult.getValue:()Ljava/lang/String;
      13: areturn

  private static final java.lang.String scratchCardPart2$lambda$5(kotlin.text.MatchResult);
    Code:
       0: aload_0
       1: ldc_w         #277                // String it
       4: invokestatic  #281                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokeinterface #128,  1          // InterfaceMethod kotlin/text/MatchResult.getValue:()Ljava/lang/String;
      13: areturn
}


import java.io.File

fun trebuchet(in1: Int): Int {
                var conMap = mutableMapOf("0" to 1, "1" to 1, "2" to 2, "3" to 3, "4" to 4, "5" to 5, "6" to 6, "7" to 7, "8" to 8, "9" to 9)
                var pattern = """\d""".toRegex()
                if (in1 ==  2) {
                               var conMap2 = mapOf("one" to 1, "two" to 2, "three" to 3, "four" to 4, "five" to 5, "six" to 6, "seven" to 7, "eight" to 8, "nine" to 9)
                               conMap = conMap.plus(conMap2).toMutableMap()
                               pattern = """\d|one|two|three|four|five|six|seven|eight|nine""".toRegex()
                }

                var calibValues = mutableListOf<Int>()
                File("day2301_puzzle_input.txt").forEachLine {
                               var firstDigit = pattern.find(it)!!.value
                               var matches = pattern.findAll(it)
                               var secondDigit = ""
                               matches.forEach{
                                               secondDigit = it.value
                               }
                               calibValues.add(conMap.getValue(firstDigit)*10 + conMap.getValue(secondDigit))
                }
                return calibValues.sum()
}

fun main() {
                var t1 = System.currentTimeMillis()

                var solution1 = trebuchet(1)
                var solution2 = trebuchet(2)

// print solution for part 1
                println("*******************************")
                println("--- Day 1: Trebuchet?! ---")
                println("*******************************")
                println("Solution for part1")
                println("   $solution1 is the sum of all of the calibration values")
                println()
// print solution for part 2
                println("*******************************")
                println("Solution for part2")
                println("   $solution2 is the sum of all of the calibration values")
                println()

                t1 = System.currentTimeMillis() - t1
                println("puzzle solved in ${t1} ms")
}

Compiled from "day2301_1_2.kt"
public final class Day2301_1_2Kt {
  public static final int trebuchet(int);
    Code:
       0: new           #8                  // class kotlin/jvm/internal/Ref$ObjectRef
       3: dup
       4: invokespecial #12                 // Method kotlin/jvm/internal/Ref$ObjectRef."<init>":()V
       7: astore_1
       8: aload_1
       9: bipush        10
      11: anewarray     #14                 // class kotlin/Pair
      14: astore_2
      15: aload_2
      16: iconst_0
      17: ldc           #16                 // String 0
      19: iconst_1
      20: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      23: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      26: aastore
      27: aload_2
      28: iconst_1
      29: ldc           #30                 // String 1
      31: iconst_1
      32: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      35: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      38: aastore
      39: aload_2
      40: iconst_2
      41: ldc           #32                 // String 2
      43: iconst_2
      44: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      47: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      50: aastore
      51: aload_2
      52: iconst_3
      53: ldc           #34                 // String 3
      55: iconst_3
      56: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      59: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      62: aastore
      63: aload_2
      64: iconst_4
      65: ldc           #36                 // String 4
      67: iconst_4
      68: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      71: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      74: aastore
      75: aload_2
      76: iconst_5
      77: ldc           #38                 // String 5
      79: iconst_5
      80: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      83: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      86: aastore
      87: aload_2
      88: bipush        6
      90: ldc           #40                 // String 6
      92: bipush        6
      94: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      97: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     100: aastore
     101: aload_2
     102: bipush        7
     104: ldc           #42                 // String 7
     106: bipush        7
     108: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     111: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     114: aastore
     115: aload_2
     116: bipush        8
     118: ldc           #44                 // String 8
     120: bipush        8
     122: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     125: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     128: aastore
     129: aload_2
     130: bipush        9
     132: ldc           #46                 // String 9
     134: bipush        9
     136: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     139: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     142: aastore
     143: aload_2
     144: invokestatic  #52                 // Method kotlin/collections/MapsKt.mutableMapOf:([Lkotlin/Pair;)Ljava/util/Map;
     147: putfield      #56                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     150: new           #8                  // class kotlin/jvm/internal/Ref$ObjectRef
     153: dup
     154: invokespecial #12                 // Method kotlin/jvm/internal/Ref$ObjectRef."<init>":()V
     157: astore_2
     158: aload_2
     159: new           #58                 // class kotlin/text/Regex
     162: dup
     163: ldc           #60                 // String \\d
     165: invokespecial #63                 // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
     168: putfield      #56                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     171: iload_0
     172: iconst_2
     173: if_icmpne     344
     176: bipush        9
     178: anewarray     #14                 // class kotlin/Pair
     181: astore        4
     183: aload         4
     185: iconst_0
     186: ldc           #65                 // String one
     188: iconst_1
     189: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     192: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     195: aastore
     196: aload         4
     198: iconst_1
     199: ldc           #67                 // String two
     201: iconst_2
     202: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     205: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     208: aastore
     209: aload         4
     211: iconst_2
     212: ldc           #69                 // String three
     214: iconst_3
     215: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     218: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     221: aastore
     222: aload         4
     224: iconst_3
     225: ldc           #71                 // String four
     227: iconst_4
     228: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     231: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     234: aastore
     235: aload         4
     237: iconst_4
     238: ldc           #73                 // String five
     240: iconst_5
     241: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     244: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     247: aastore
     248: aload         4
     250: iconst_5
     251: ldc           #75                 // String six
     253: bipush        6
     255: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     258: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     261: aastore
     262: aload         4
     264: bipush        6
     266: ldc           #77                 // String seven
     268: bipush        7
     270: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     273: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     276: aastore
     277: aload         4
     279: bipush        7
     281: ldc           #79                 // String eight
     283: bipush        8
     285: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     288: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     291: aastore
     292: aload         4
     294: bipush        8
     296: ldc           #81                 // String nine
     298: bipush        9
     300: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     303: invokestatic  #28                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     306: aastore
     307: aload         4
     309: invokestatic  #84                 // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;
     312: astore_3
     313: aload_1
     314: aload_1
     315: getfield      #56                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     318: checkcast     #86                 // class java/util/Map
     321: aload_3
     322: invokestatic  #90                 // Method kotlin/collections/MapsKt.plus:(Ljava/util/Map;Ljava/util/Map;)Ljava/util/Map;
     325: invokestatic  #94                 // Method kotlin/collections/MapsKt.toMutableMap:(Ljava/util/Map;)Ljava/util/Map;
     328: putfield      #56                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     331: aload_2
     332: new           #58                 // class kotlin/text/Regex
     335: dup
     336: ldc           #96                 // String \\d|one|two|three|four|five|six|seven|eight|nine
     338: invokespecial #63                 // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
     341: putfield      #56                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     344: new           #8                  // class kotlin/jvm/internal/Ref$ObjectRef
     347: dup
     348: invokespecial #12                 // Method kotlin/jvm/internal/Ref$ObjectRef."<init>":()V
     351: astore_3
     352: aload_3
     353: new           #98                 // class java/util/ArrayList
     356: dup
     357: invokespecial #99                 // Method java/util/ArrayList."<init>":()V
     360: checkcast     #101                // class java/util/List
     363: putfield      #56                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     366: new           #103                // class java/io/File
     369: dup
     370: ldc           #105                // String day2301_puzzle_input.txt
     372: invokespecial #106                // Method java/io/File."<init>":(Ljava/lang/String;)V
     375: aconst_null
     376: aload_2
     377: aload_3
     378: aload_1
     379: invokedynamic #126,  0            // InvokeDynamic #0:invoke:(Lkotlin/jvm/internal/Ref$ObjectRef;Lkotlin/jvm/internal/Ref$ObjectRef;Lkotlin/jvm/internal/Ref$ObjectRef;)Lkotlin/jvm/functions/Function1;
     384: iconst_1
     385: aconst_null
     386: invokestatic  #132                // Method kotlin/io/FilesKt.forEachLine$default:(Ljava/io/File;Ljava/nio/charset/Charset;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
     389: aload_3
     390: getfield      #56                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     393: checkcast     #134                // class java/lang/Iterable
     396: invokestatic  #140                // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
     399: ireturn

  public static final void main();
    Code:
       0: invokestatic  #155                // Method java/lang/System.currentTimeMillis:()J
       3: lstore_0
       4: iconst_1
       5: invokestatic  #157                // Method trebuchet:(I)I
       8: istore_2
       9: iconst_2
      10: invokestatic  #157                // Method trebuchet:(I)I
      13: istore_3
      14: ldc           #159                // String *******************************
      16: getstatic     #163                // Field java/lang/System.out:Ljava/io/PrintStream;
      19: swap
      20: invokevirtual #169                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      23: ldc           #171                // String --- Day 1: Trebuchet?! ---
      25: getstatic     #163                // Field java/lang/System.out:Ljava/io/PrintStream;
      28: swap
      29: invokevirtual #169                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      32: ldc           #159                // String *******************************
      34: getstatic     #163                // Field java/lang/System.out:Ljava/io/PrintStream;
      37: swap
      38: invokevirtual #169                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      41: ldc           #173                // String Solution for part1
      43: getstatic     #163                // Field java/lang/System.out:Ljava/io/PrintStream;
      46: swap
      47: invokevirtual #169                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      50: new           #175                // class java/lang/StringBuilder
      53: dup
      54: invokespecial #176                // Method java/lang/StringBuilder."<init>":()V
      57: ldc           #178                // String
      59: invokevirtual #182                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      62: iload_2
      63: invokevirtual #185                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      66: ldc           #187                // String  is the sum of all of the calibration values
      68: invokevirtual #182                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      71: invokevirtual #191                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      74: getstatic     #163                // Field java/lang/System.out:Ljava/io/PrintStream;
      77: swap
      78: invokevirtual #169                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      81: getstatic     #163                // Field java/lang/System.out:Ljava/io/PrintStream;
      84: invokevirtual #193                // Method java/io/PrintStream.println:()V
      87: ldc           #159                // String *******************************
      89: getstatic     #163                // Field java/lang/System.out:Ljava/io/PrintStream;
      92: swap
      93: invokevirtual #169                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      96: ldc           #195                // String Solution for part2
      98: getstatic     #163                // Field java/lang/System.out:Ljava/io/PrintStream;
     101: swap
     102: invokevirtual #169                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     105: new           #175                // class java/lang/StringBuilder
     108: dup
     109: invokespecial #176                // Method java/lang/StringBuilder."<init>":()V
     112: ldc           #178                // String
     114: invokevirtual #182                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     117: iload_3
     118: invokevirtual #185                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     121: ldc           #187                // String  is the sum of all of the calibration values
     123: invokevirtual #182                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     126: invokevirtual #191                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     129: getstatic     #163                // Field java/lang/System.out:Ljava/io/PrintStream;
     132: swap
     133: invokevirtual #169                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     136: getstatic     #163                // Field java/lang/System.out:Ljava/io/PrintStream;
     139: invokevirtual #193                // Method java/io/PrintStream.println:()V
     142: invokestatic  #155                // Method java/lang/System.currentTimeMillis:()J
     145: lload_0
     146: lsub
     147: lstore_0
     148: new           #175                // class java/lang/StringBuilder
     151: dup
     152: invokespecial #176                // Method java/lang/StringBuilder."<init>":()V
     155: ldc           #197                // String puzzle solved in
     157: invokevirtual #182                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     160: lload_0
     161: invokevirtual #200                // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
     164: ldc           #202                // String  ms
     166: invokevirtual #182                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     169: invokevirtual #191                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     172: getstatic     #163                // Field java/lang/System.out:Ljava/io/PrintStream;
     175: swap
     176: invokevirtual #169                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     179: return

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

  private static final kotlin.Unit trebuchet$lambda$1(kotlin.jvm.internal.Ref$ObjectRef, kotlin.jvm.internal.Ref$ObjectRef, kotlin.jvm.internal.Ref$ObjectRef, java.lang.String);
    Code:
       0: aload_3
       1: ldc           #213                // String it
       3: invokestatic  #219                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #56                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      10: checkcast     #58                 // class kotlin/text/Regex
      13: aload_3
      14: checkcast     #221                // class java/lang/CharSequence
      17: iconst_0
      18: iconst_2
      19: aconst_null
      20: invokestatic  #225                // Method kotlin/text/Regex.find$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/text/MatchResult;
      23: dup
      24: invokestatic  #228                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      27: invokeinterface #233,  1          // InterfaceMethod kotlin/text/MatchResult.getValue:()Ljava/lang/String;
      32: astore        4
      34: aload_0
      35: getfield      #56                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      38: checkcast     #58                 // class kotlin/text/Regex
      41: aload_3
      42: checkcast     #221                // class java/lang/CharSequence
      45: iconst_0
      46: iconst_2
      47: aconst_null
      48: invokestatic  #237                // Method kotlin/text/Regex.findAll$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/sequences/Sequence;
      51: astore        5
      53: aconst_null
      54: astore        6
      56: ldc           #239                // String
      58: astore        6
      60: aload         5
      62: astore        7
      64: iconst_0
      65: istore        8
      67: aload         7
      69: invokeinterface #245,  1          // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
      74: astore        9
      76: aload         9
      78: invokeinterface #251,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      83: ifeq          119
      86: aload         9
      88: invokeinterface #255,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      93: astore        10
      95: aload         10
      97: checkcast     #230                // class kotlin/text/MatchResult
     100: astore        11
     102: iconst_0
     103: istore        12
     105: aload         11
     107: invokeinterface #233,  1          // InterfaceMethod kotlin/text/MatchResult.getValue:()Ljava/lang/String;
     112: astore        6
     114: nop
     115: nop
     116: goto          76
     119: nop
     120: aload_1
     121: getfield      #56                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     124: checkcast     #101                // class java/util/List
     127: aload_2
     128: getfield      #56                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     131: checkcast     #86                 // class java/util/Map
     134: aload         4
     136: invokestatic  #258                // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;
     139: checkcast     #260                // class java/lang/Number
     142: invokevirtual #264                // Method java/lang/Number.intValue:()I
     145: bipush        10
     147: imul
     148: aload_2
     149: getfield      #56                 // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     152: checkcast     #86                 // class java/util/Map
     155: aload         6
     157: invokestatic  #258                // Method kotlin/collections/MapsKt.getValue:(Ljava/util/Map;Ljava/lang/Object;)Ljava/lang/Object;
     160: checkcast     #260                // class java/lang/Number
     163: invokevirtual #264                // Method java/lang/Number.intValue:()I
     166: iadd
     167: invokestatic  #22                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     170: invokeinterface #268,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     175: pop
     176: getstatic     #274                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
     179: areturn
}