package day06

import java.io.File
import kotlin.math.ceil
import kotlin.math.sqrt

fun main() {
    races()
    singleRace()
}

private fun races() {
    val file = File("src/main/resources/day06-boats").readLines()
    val times = file[0].split(":")[1].trim().split(" ").filter { it.isNotBlank() }.map { it.toLong() }
    val distances = file[1].split(":")[1].trim().split(" ").filter { it.isNotBlank() }.map { it.toLong() }

    times.indices
        .map { possibilities(times[it], distances[it]) }
        .reduce(Int::times)
        .let { println("Multiple races possibilities: $it") }
}

private fun singleRace() {
    val file = File("src/main/resources/day06-boats").readLines()
    val time = file[0].split(":")[1].replace(" ", "").toLong()
    val distance = file[1].split(":")[1].replace(" ", "").toLong()
    println("Single race possibilities: ${possibilities(time, distance)}")
}

private fun possibilities(t: Long, d: Long): Int {
    val base = (t - sqrt(t * t - 4 * d.toDouble())) / 2
    val lowerLimit = if (base == ceil(base)) base + 1 else ceil(base)
    return (t - 2 * lowerLimit + 1).toInt()
}

Compiled from "boats.kt"
public final class day06.BoatsKt {
  public static final void main();
    Code:
       0: invokestatic  #9                  // Method races:()V
       3: invokestatic  #12                 // Method singleRace:()V
       6: return

  private static final void races();
    Code:
       0: new           #14                 // class java/io/File
       3: dup
       4: ldc           #16                 // String src/main/resources/day06-boats
       6: invokespecial #20                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       9: aconst_null
      10: iconst_1
      11: aconst_null
      12: invokestatic  #26                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      15: astore_0
      16: aload_0
      17: iconst_0
      18: invokeinterface #32,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      23: checkcast     #34                 // class java/lang/CharSequence
      26: iconst_1
      27: anewarray     #36                 // class java/lang/String
      30: astore_2
      31: aload_2
      32: iconst_0
      33: ldc           #38                 // String :
      35: aastore
      36: aload_2
      37: iconst_0
      38: iconst_0
      39: bipush        6
      41: aconst_null
      42: invokestatic  #44                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      45: iconst_1
      46: invokeinterface #32,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      51: checkcast     #36                 // class java/lang/String
      54: checkcast     #34                 // class java/lang/CharSequence
      57: invokestatic  #48                 // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
      60: invokevirtual #52                 // Method java/lang/Object.toString:()Ljava/lang/String;
      63: checkcast     #34                 // class java/lang/CharSequence
      66: iconst_1
      67: anewarray     #36                 // class java/lang/String
      70: astore_2
      71: aload_2
      72: iconst_0
      73: ldc           #54                 // String
      75: aastore
      76: aload_2
      77: iconst_0
      78: iconst_0
      79: bipush        6
      81: aconst_null
      82: invokestatic  #44                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      85: checkcast     #56                 // class java/lang/Iterable
      88: astore_2
      89: iconst_0
      90: istore_3
      91: aload_2
      92: astore        4
      94: new           #58                 // class java/util/ArrayList
      97: dup
      98: invokespecial #60                 // Method java/util/ArrayList."<init>":()V
     101: checkcast     #62                 // class java/util/Collection
     104: astore        5
     106: iconst_0
     107: istore        6
     109: aload         4
     111: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     116: astore        7
     118: aload         7
     120: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     125: ifeq          180
     128: aload         7
     130: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     135: astore        8
     137: aload         8
     139: checkcast     #36                 // class java/lang/String
     142: astore        9
     144: iconst_0
     145: istore        10
     147: aload         9
     149: checkcast     #34                 // class java/lang/CharSequence
     152: invokestatic  #80                 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
     155: ifne          162
     158: iconst_1
     159: goto          163
     162: iconst_0
     163: nop
     164: ifeq          118
     167: aload         5
     169: aload         8
     171: invokeinterface #84,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     176: pop
     177: goto          118
     180: aload         5
     182: checkcast     #28                 // class java/util/List
     185: nop
     186: checkcast     #56                 // class java/lang/Iterable
     189: astore_2
     190: nop
     191: iconst_0
     192: istore_3
     193: aload_2
     194: astore        4
     196: new           #58                 // class java/util/ArrayList
     199: dup
     200: aload_2
     201: bipush        10
     203: invokestatic  #90                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     206: invokespecial #93                 // Method java/util/ArrayList."<init>":(I)V
     209: checkcast     #62                 // class java/util/Collection
     212: astore        5
     214: iconst_0
     215: istore        6
     217: aload         4
     219: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     224: astore        7
     226: aload         7
     228: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     233: ifeq          280
     236: aload         7
     238: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     243: astore        8
     245: aload         5
     247: aload         8
     249: checkcast     #36                 // class java/lang/String
     252: astore        9
     254: astore        12
     256: iconst_0
     257: istore        10
     259: aload         9
     261: invokestatic  #99                 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
     264: nop
     265: invokestatic  #103                // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     268: aload         12
     270: swap
     271: invokeinterface #84,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     276: pop
     277: goto          226
     280: aload         5
     282: checkcast     #28                 // class java/util/List
     285: nop
     286: astore_1
     287: aload_0
     288: iconst_1
     289: invokeinterface #32,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     294: checkcast     #34                 // class java/lang/CharSequence
     297: iconst_1
     298: anewarray     #36                 // class java/lang/String
     301: astore_3
     302: aload_3
     303: iconst_0
     304: ldc           #38                 // String :
     306: aastore
     307: aload_3
     308: iconst_0
     309: iconst_0
     310: bipush        6
     312: aconst_null
     313: invokestatic  #44                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     316: iconst_1
     317: invokeinterface #32,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     322: checkcast     #36                 // class java/lang/String
     325: checkcast     #34                 // class java/lang/CharSequence
     328: invokestatic  #48                 // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
     331: invokevirtual #52                 // Method java/lang/Object.toString:()Ljava/lang/String;
     334: checkcast     #34                 // class java/lang/CharSequence
     337: iconst_1
     338: anewarray     #36                 // class java/lang/String
     341: astore_3
     342: aload_3
     343: iconst_0
     344: ldc           #54                 // String
     346: aastore
     347: aload_3
     348: iconst_0
     349: iconst_0
     350: bipush        6
     352: aconst_null
     353: invokestatic  #44                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     356: checkcast     #56                 // class java/lang/Iterable
     359: astore_3
     360: iconst_0
     361: istore        4
     363: aload_3
     364: astore        5
     366: new           #58                 // class java/util/ArrayList
     369: dup
     370: invokespecial #60                 // Method java/util/ArrayList."<init>":()V
     373: checkcast     #62                 // class java/util/Collection
     376: astore        6
     378: iconst_0
     379: istore        7
     381: aload         5
     383: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     388: astore        8
     390: aload         8
     392: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     397: ifeq          452
     400: aload         8
     402: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     407: astore        9
     409: aload         9
     411: checkcast     #36                 // class java/lang/String
     414: astore        10
     416: iconst_0
     417: istore        11
     419: aload         10
     421: checkcast     #34                 // class java/lang/CharSequence
     424: invokestatic  #80                 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
     427: ifne          434
     430: iconst_1
     431: goto          435
     434: iconst_0
     435: nop
     436: ifeq          390
     439: aload         6
     441: aload         9
     443: invokeinterface #84,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     448: pop
     449: goto          390
     452: aload         6
     454: checkcast     #28                 // class java/util/List
     457: nop
     458: checkcast     #56                 // class java/lang/Iterable
     461: astore_3
     462: nop
     463: iconst_0
     464: istore        4
     466: aload_3
     467: astore        5
     469: new           #58                 // class java/util/ArrayList
     472: dup
     473: aload_3
     474: bipush        10
     476: invokestatic  #90                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     479: invokespecial #93                 // Method java/util/ArrayList."<init>":(I)V
     482: checkcast     #62                 // class java/util/Collection
     485: astore        6
     487: iconst_0
     488: istore        7
     490: aload         5
     492: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     497: astore        8
     499: aload         8
     501: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     506: ifeq          553
     509: aload         8
     511: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     516: astore        9
     518: aload         6
     520: aload         9
     522: checkcast     #36                 // class java/lang/String
     525: astore        10
     527: astore        12
     529: iconst_0
     530: istore        11
     532: aload         10
     534: invokestatic  #99                 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
     537: nop
     538: invokestatic  #103                // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     541: aload         12
     543: swap
     544: invokeinterface #84,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     549: pop
     550: goto          499
     553: aload         6
     555: checkcast     #28                 // class java/util/List
     558: nop
     559: astore_2
     560: aload_1
     561: checkcast     #62                 // class java/util/Collection
     564: invokestatic  #107                // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;
     567: checkcast     #56                 // class java/lang/Iterable
     570: astore_3
     571: nop
     572: iconst_0
     573: istore        4
     575: aload_3
     576: astore        5
     578: new           #58                 // class java/util/ArrayList
     581: dup
     582: aload_3
     583: bipush        10
     585: invokestatic  #90                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     588: invokespecial #93                 // Method java/util/ArrayList."<init>":(I)V
     591: checkcast     #62                 // class java/util/Collection
     594: astore        6
     596: iconst_0
     597: istore        7
     599: aload         5
     601: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     606: astore        8
     608: aload         8
     610: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     615: ifeq          685
     618: aload         8
     620: checkcast     #109                // class kotlin/collections/IntIterator
     623: invokevirtual #113                // Method kotlin/collections/IntIterator.nextInt:()I
     626: istore        9
     628: aload         6
     630: iload         9
     632: istore        10
     634: astore        12
     636: iconst_0
     637: istore        11
     639: aload_1
     640: iload         10
     642: invokeinterface #32,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     647: checkcast     #115                // class java/lang/Number
     650: invokevirtual #119                // Method java/lang/Number.longValue:()J
     653: aload_2
     654: iload         10
     656: invokeinterface #32,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     661: checkcast     #115                // class java/lang/Number
     664: invokevirtual #119                // Method java/lang/Number.longValue:()J
     667: invokestatic  #123                // Method possibilities:(JJ)I
     670: invokestatic  #128                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     673: aload         12
     675: swap
     676: invokeinterface #84,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     681: pop
     682: goto          608
     685: aload         6
     687: checkcast     #28                 // class java/util/List
     690: nop
     691: checkcast     #56                 // class java/lang/Iterable
     694: astore_3
     695: nop
     696: iconst_0
     697: istore        4
     699: aload_3
     700: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     705: astore        5
     707: aload         5
     709: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     714: ifne          727
     717: new           #130                // class java/lang/UnsupportedOperationException
     720: dup
     721: ldc           #132                // String Empty collection can\'t be reduced.
     723: invokespecial #133                // Method java/lang/UnsupportedOperationException."<init>":(Ljava/lang/String;)V
     726: athrow
     727: aload         5
     729: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     734: astore        6
     736: aload         5
     738: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     743: ifeq          787
     746: aload         6
     748: aload         5
     750: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     755: checkcast     #115                // class java/lang/Number
     758: invokevirtual #136                // Method java/lang/Number.intValue:()I
     761: istore        7
     763: checkcast     #115                // class java/lang/Number
     766: invokevirtual #136                // Method java/lang/Number.intValue:()I
     769: istore        8
     771: iconst_0
     772: istore        9
     774: iload         8
     776: iload         7
     778: imul
     779: invokestatic  #128                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     782: astore        6
     784: goto          736
     787: aload         6
     789: checkcast     #115                // class java/lang/Number
     792: invokevirtual #136                // Method java/lang/Number.intValue:()I
     795: istore        4
     797: iconst_0
     798: istore        5
     800: new           #138                // class java/lang/StringBuilder
     803: dup
     804: invokespecial #139                // Method java/lang/StringBuilder."<init>":()V
     807: ldc           #141                // String Multiple races possibilities:
     809: invokevirtual #145                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     812: iload         4
     814: invokevirtual #148                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     817: invokevirtual #149                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     820: getstatic     #155                // Field java/lang/System.out:Ljava/io/PrintStream;
     823: swap
     824: invokevirtual #161                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     827: nop
     828: nop
     829: return

  private static final void singleRace();
    Code:
       0: new           #14                 // class java/io/File
       3: dup
       4: ldc           #16                 // String src/main/resources/day06-boats
       6: invokespecial #20                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       9: aconst_null
      10: iconst_1
      11: aconst_null
      12: invokestatic  #26                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      15: astore_0
      16: aload_0
      17: iconst_0
      18: invokeinterface #32,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      23: checkcast     #34                 // class java/lang/CharSequence
      26: iconst_1
      27: anewarray     #36                 // class java/lang/String
      30: astore_3
      31: aload_3
      32: iconst_0
      33: ldc           #38                 // String :
      35: aastore
      36: aload_3
      37: iconst_0
      38: iconst_0
      39: bipush        6
      41: aconst_null
      42: invokestatic  #44                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      45: iconst_1
      46: invokeinterface #32,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      51: checkcast     #36                 // class java/lang/String
      54: ldc           #54                 // String
      56: ldc           #198                // String
      58: iconst_0
      59: iconst_4
      60: aconst_null
      61: invokestatic  #202                // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;
      64: invokestatic  #99                 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
      67: lstore_1
      68: aload_0
      69: iconst_1
      70: invokeinterface #32,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      75: checkcast     #34                 // class java/lang/CharSequence
      78: iconst_1
      79: anewarray     #36                 // class java/lang/String
      82: astore        5
      84: aload         5
      86: iconst_0
      87: ldc           #38                 // String :
      89: aastore
      90: aload         5
      92: iconst_0
      93: iconst_0
      94: bipush        6
      96: aconst_null
      97: invokestatic  #44                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     100: iconst_1
     101: invokeinterface #32,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     106: checkcast     #36                 // class java/lang/String
     109: ldc           #54                 // String
     111: ldc           #198                // String
     113: iconst_0
     114: iconst_4
     115: aconst_null
     116: invokestatic  #202                // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;
     119: invokestatic  #99                 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
     122: lstore_3
     123: new           #138                // class java/lang/StringBuilder
     126: dup
     127: invokespecial #139                // Method java/lang/StringBuilder."<init>":()V
     130: ldc           #204                // String Single race possibilities:
     132: invokevirtual #145                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     135: lload_1
     136: lload_3
     137: invokestatic  #123                // Method possibilities:(JJ)I
     140: invokevirtual #148                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     143: invokevirtual #149                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     146: getstatic     #155                // Field java/lang/System.out:Ljava/io/PrintStream;
     149: swap
     150: invokevirtual #161                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     153: return

  private static final int possibilities(long, long);
    Code:
       0: lload_0
       1: l2d
       2: lload_0
       3: lload_0
       4: lmul
       5: l2d
       6: iconst_4
       7: i2d
       8: lload_2
       9: l2d
      10: dmul
      11: dsub
      12: invokestatic  #213                // Method java/lang/Math.sqrt:(D)D
      15: dsub
      16: iconst_2
      17: i2d
      18: ddiv
      19: dstore        4
      21: dload         4
      23: dload         4
      25: invokestatic  #216                // Method java/lang/Math.ceil:(D)D
      28: dcmpg
      29: ifne          36
      32: iconst_1
      33: goto          37
      36: iconst_0
      37: ifeq          48
      40: dload         4
      42: iconst_1
      43: i2d
      44: dadd
      45: goto          53
      48: dload         4
      50: invokestatic  #216                // Method java/lang/Math.ceil:(D)D
      53: dstore        6
      55: lload_0
      56: l2d
      57: iconst_2
      58: i2d
      59: dload         6
      61: dmul
      62: dsub
      63: iconst_1
      64: i2d
      65: dadd
      66: d2i
      67: ireturn

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


package day01

import java.io.File

val numericNumbers = arrayOf("1", "2", "3", "4", "5", "6", "7", "8", "9")
val wordNumbers = arrayOf("one", "two", "three", "four", "five", "six", "seven", "eight", "nine")
val numbers = wordNumbers + numericNumbers

fun main() {
    val instructions = File("src/main/resources/day01-trebuchet")
    println("Plain Numbers:" + instructions.readLines().sumOf { line ->
        line.first { it.isDigit() }.digitToInt() * 10 + line.last { it.isDigit() }.digitToInt()
    })

    println("Numbers and words:" + instructions
        .readLines()
        .map { firstLastNumber(it) }
        .sumOf { it.first * 10 + it.second }
    )
}

fun firstLastNumber(line: String): Pair<Int, Int> {
    val firstNumberIndex = numbers
        .mapIndexed { idx, value -> idx to line.indexOf(value) }
        .filter { (_, position) -> position > -1 }
        .minBy { (_, position) -> position }
        .first
    val lastNumberIndex = numbers
        .mapIndexed { idx, value -> idx to line.lastIndexOf(value) }
        .filter { (_, position) -> position > -1 }
        .maxBy { (_, position) -> position }
        .first

    fun numericValue(index: Int) = (if (index > 8) index - 9 else index) + 1
    return numericValue(firstNumberIndex) to numericValue(lastNumberIndex)
}

Compiled from "trebuchet.kt"
public final class day01.TrebuchetKt {
  private static final java.lang.String[] numericNumbers;

  private static final java.lang.String[] wordNumbers;

  private static final java.lang.String[] numbers;

  public static final java.lang.String[] getNumericNumbers();
    Code:
       0: getstatic     #11                 // Field numericNumbers:[Ljava/lang/String;
       3: areturn

  public static final java.lang.String[] getWordNumbers();
    Code:
       0: getstatic     #15                 // Field wordNumbers:[Ljava/lang/String;
       3: areturn

  public static final java.lang.String[] getNumbers();
    Code:
       0: getstatic     #19                 // Field numbers:[Ljava/lang/String;
       3: areturn

  public static final void main();
    Code:
       0: new           #23                 // class java/io/File
       3: dup
       4: ldc           #25                 // String src/main/resources/day01-trebuchet
       6: invokespecial #29                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       9: astore_0
      10: new           #31                 // class java/lang/StringBuilder
      13: dup
      14: invokespecial #33                 // Method java/lang/StringBuilder."<init>":()V
      17: ldc           #35                 // String Plain Numbers:
      19: invokevirtual #39                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      22: aload_0
      23: aconst_null
      24: iconst_1
      25: aconst_null
      26: invokestatic  #45                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      29: checkcast     #47                 // class java/lang/Iterable
      32: astore_1
      33: astore        16
      35: iconst_0
      36: istore_2
      37: aload_1
      38: invokeinterface #51,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      43: astore_3
      44: aload_3
      45: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      50: ifeq          258
      53: aload_3
      54: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      59: astore        4
      61: iload_2
      62: aload         4
      64: checkcast     #63                 // class java/lang/String
      67: astore        5
      69: istore        17
      71: iconst_0
      72: istore        6
      74: aload         5
      76: checkcast     #65                 // class java/lang/CharSequence
      79: astore        7
      81: iconst_0
      82: istore        8
      84: iconst_0
      85: istore        9
      87: iload         9
      89: aload         7
      91: invokeinterface #69,  1           // InterfaceMethod java/lang/CharSequence.length:()I
      96: if_icmpge     137
      99: aload         7
     101: iload         9
     103: invokeinterface #73,  2           // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     108: istore        10
     110: iload         10
     112: istore        11
     114: iconst_0
     115: istore        12
     117: iload         11
     119: invokestatic  #79                 // Method java/lang/Character.isDigit:(C)Z
     122: nop
     123: ifeq          131
     126: iload         10
     128: goto          147
     131: iinc          9, 1
     134: goto          87
     137: new           #81                 // class java/util/NoSuchElementException
     140: dup
     141: ldc           #83                 // String Char sequence contains no character matching the predicate.
     143: invokespecial #84                 // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
     146: athrow
     147: invokestatic  #90                 // Method kotlin/text/CharsKt.digitToInt:(C)I
     150: bipush        10
     152: imul
     153: aload         5
     155: checkcast     #65                 // class java/lang/CharSequence
     158: astore        7
     160: istore        13
     162: iconst_0
     163: istore        8
     165: aload         7
     167: invokeinterface #69,  1           // InterfaceMethod java/lang/CharSequence.length:()I
     172: iconst_m1
     173: iadd
     174: istore        9
     176: iconst_0
     177: iload         9
     179: if_icmpgt     227
     182: iload         9
     184: istore        10
     186: iinc          9, -1
     189: aload         7
     191: iload         10
     193: invokeinterface #73,  2           // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     198: istore        11
     200: iload         11
     202: istore        12
     204: iconst_0
     205: istore        14
     207: iload         12
     209: invokestatic  #79                 // Method java/lang/Character.isDigit:(C)Z
     212: nop
     213: ifeq          221
     216: iload         11
     218: goto          237
     221: iconst_0
     222: iload         9
     224: if_icmple     182
     227: new           #81                 // class java/util/NoSuchElementException
     230: dup
     231: ldc           #83                 // String Char sequence contains no character matching the predicate.
     233: invokespecial #84                 // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
     236: athrow
     237: istore        15
     239: iload         13
     241: iload         15
     243: invokestatic  #90                 // Method kotlin/text/CharsKt.digitToInt:(C)I
     246: iadd
     247: istore        18
     249: iload         17
     251: iload         18
     253: iadd
     254: istore_2
     255: goto          44
     258: iload_2
     259: istore        17
     261: aload         16
     263: iload         17
     265: invokevirtual #93                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     268: invokevirtual #97                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     271: getstatic     #103                // Field java/lang/System.out:Ljava/io/PrintStream;
     274: swap
     275: invokevirtual #109                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     278: new           #31                 // class java/lang/StringBuilder
     281: dup
     282: invokespecial #33                 // Method java/lang/StringBuilder."<init>":()V
     285: ldc           #111                // String Numbers and words:
     287: invokevirtual #39                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     290: aload_0
     291: aconst_null
     292: iconst_1
     293: aconst_null
     294: invokestatic  #45                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
     297: checkcast     #47                 // class java/lang/Iterable
     300: astore_1
     301: astore        16
     303: iconst_0
     304: istore_2
     305: aload_1
     306: astore_3
     307: new           #113                // class java/util/ArrayList
     310: dup
     311: aload_1
     312: bipush        10
     314: invokestatic  #119                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     317: invokespecial #122                // Method java/util/ArrayList."<init>":(I)V
     320: checkcast     #124                // class java/util/Collection
     323: astore        4
     325: iconst_0
     326: istore        5
     328: aload_3
     329: invokeinterface #51,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     334: astore        6
     336: aload         6
     338: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     343: ifeq          386
     346: aload         6
     348: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     353: astore        7
     355: aload         4
     357: aload         7
     359: checkcast     #63                 // class java/lang/String
     362: astore        8
     364: astore        17
     366: iconst_0
     367: istore        9
     369: aload         8
     371: invokestatic  #128                // Method firstLastNumber:(Ljava/lang/String;)Lkotlin/Pair;
     374: aload         17
     376: swap
     377: invokeinterface #132,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     382: pop
     383: goto          336
     386: aload         4
     388: checkcast     #134                // class java/util/List
     391: nop
     392: aload         16
     394: swap
     395: checkcast     #47                 // class java/lang/Iterable
     398: astore_1
     399: astore        16
     401: iconst_0
     402: istore_2
     403: aload_1
     404: invokeinterface #51,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     409: astore_3
     410: aload_3
     411: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     416: ifeq          477
     419: aload_3
     420: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     425: astore        4
     427: iload_2
     428: aload         4
     430: checkcast     #136                // class kotlin/Pair
     433: astore        5
     435: istore        17
     437: iconst_0
     438: istore        6
     440: aload         5
     442: invokevirtual #139                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     445: checkcast     #141                // class java/lang/Number
     448: invokevirtual #144                // Method java/lang/Number.intValue:()I
     451: bipush        10
     453: imul
     454: aload         5
     456: invokevirtual #147                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     459: checkcast     #141                // class java/lang/Number
     462: invokevirtual #144                // Method java/lang/Number.intValue:()I
     465: iadd
     466: istore        18
     468: iload         17
     470: iload         18
     472: iadd
     473: istore_2
     474: goto          410
     477: iload_2
     478: istore        17
     480: aload         16
     482: iload         17
     484: invokevirtual #93                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     487: invokevirtual #97                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     490: getstatic     #103                // Field java/lang/System.out:Ljava/io/PrintStream;
     493: swap
     494: invokevirtual #109                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     497: return

  public static final kotlin.Pair<java.lang.Integer, java.lang.Integer> firstLastNumber(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #178                // String line
       3: invokestatic  #184                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: getstatic     #19                 // Field numbers:[Ljava/lang/String;
       9: astore_2
      10: nop
      11: iconst_0
      12: istore_3
      13: aload_2
      14: astore        4
      16: new           #113                // class java/util/ArrayList
      19: dup
      20: aload_2
      21: arraylength
      22: invokespecial #122                // Method java/util/ArrayList."<init>":(I)V
      25: checkcast     #124                // class java/util/Collection
      28: astore        5
      30: iconst_0
      31: istore        6
      33: iconst_0
      34: istore        7
      36: iconst_0
      37: istore        8
      39: aload         4
      41: arraylength
      42: istore        9
      44: iload         8
      46: iload         9
      48: if_icmpge     116
      51: aload         4
      53: iload         8
      55: aaload
      56: astore        10
      58: aload         5
      60: iload         7
      62: iinc          7, 1
      65: aload         10
      67: astore        11
      69: istore        12
      71: astore        15
      73: iconst_0
      74: istore        13
      76: iload         12
      78: invokestatic  #190                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      81: aload_0
      82: checkcast     #65                 // class java/lang/CharSequence
      85: aload         11
      87: iconst_0
      88: iconst_0
      89: bipush        6
      91: aconst_null
      92: invokestatic  #196                // Method kotlin/text/StringsKt.indexOf$default:(Ljava/lang/CharSequence;Ljava/lang/String;IZILjava/lang/Object;)I
      95: invokestatic  #190                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      98: invokestatic  #202                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     101: aload         15
     103: swap
     104: invokeinterface #132,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     109: pop
     110: iinc          8, 1
     113: goto          44
     116: aload         5
     118: checkcast     #134                // class java/util/List
     121: nop
     122: checkcast     #47                 // class java/lang/Iterable
     125: astore_2
     126: nop
     127: iconst_0
     128: istore_3
     129: aload_2
     130: astore        4
     132: new           #113                // class java/util/ArrayList
     135: dup
     136: invokespecial #203                // Method java/util/ArrayList."<init>":()V
     139: checkcast     #124                // class java/util/Collection
     142: astore        5
     144: iconst_0
     145: istore        6
     147: aload         4
     149: invokeinterface #51,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     154: astore        7
     156: aload         7
     158: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     163: ifeq          225
     166: aload         7
     168: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     173: astore        8
     175: aload         8
     177: checkcast     #136                // class kotlin/Pair
     180: astore        9
     182: iconst_0
     183: istore        10
     185: aload         9
     187: invokevirtual #206                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     190: checkcast     #141                // class java/lang/Number
     193: invokevirtual #144                // Method java/lang/Number.intValue:()I
     196: istore        11
     198: iload         11
     200: iconst_m1
     201: if_icmple     208
     204: iconst_1
     205: goto          209
     208: iconst_0
     209: ifeq          156
     212: aload         5
     214: aload         8
     216: invokeinterface #132,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     221: pop
     222: goto          156
     225: aload         5
     227: checkcast     #134                // class java/util/List
     230: nop
     231: checkcast     #47                 // class java/lang/Iterable
     234: astore_2
     235: nop
     236: iconst_0
     237: istore_3
     238: aload_2
     239: invokeinterface #51,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     244: astore        4
     246: aload         4
     248: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     253: ifne          264
     256: new           #81                 // class java/util/NoSuchElementException
     259: dup
     260: invokespecial #207                // Method java/util/NoSuchElementException."<init>":()V
     263: athrow
     264: aload         4
     266: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     271: astore        5
     273: aload         4
     275: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     280: ifne          288
     283: aload         5
     285: goto          378
     288: aload         5
     290: checkcast     #136                // class kotlin/Pair
     293: astore        6
     295: iconst_0
     296: istore        7
     298: aload         6
     300: invokevirtual #206                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     303: checkcast     #141                // class java/lang/Number
     306: invokevirtual #144                // Method java/lang/Number.intValue:()I
     309: istore        8
     311: iload         8
     313: istore        6
     315: aload         4
     317: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     322: astore        7
     324: aload         7
     326: checkcast     #136                // class kotlin/Pair
     329: astore        8
     331: iconst_0
     332: istore        9
     334: aload         8
     336: invokevirtual #206                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     339: checkcast     #141                // class java/lang/Number
     342: invokevirtual #144                // Method java/lang/Number.intValue:()I
     345: istore        10
     347: iload         10
     349: istore        8
     351: iload         6
     353: iload         8
     355: if_icmple     366
     358: aload         7
     360: astore        5
     362: iload         8
     364: istore        6
     366: aload         4
     368: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     373: ifne          315
     376: aload         5
     378: checkcast     #136                // class kotlin/Pair
     381: invokevirtual #139                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     384: checkcast     #141                // class java/lang/Number
     387: invokevirtual #144                // Method java/lang/Number.intValue:()I
     390: istore_1
     391: getstatic     #19                 // Field numbers:[Ljava/lang/String;
     394: astore_3
     395: nop
     396: iconst_0
     397: istore        4
     399: aload_3
     400: astore        5
     402: new           #113                // class java/util/ArrayList
     405: dup
     406: aload_3
     407: arraylength
     408: invokespecial #122                // Method java/util/ArrayList."<init>":(I)V
     411: checkcast     #124                // class java/util/Collection
     414: astore        6
     416: iconst_0
     417: istore        7
     419: iconst_0
     420: istore        8
     422: iconst_0
     423: istore        9
     425: aload         5
     427: arraylength
     428: istore        10
     430: iload         9
     432: iload         10
     434: if_icmpge     502
     437: aload         5
     439: iload         9
     441: aaload
     442: astore        11
     444: aload         6
     446: iload         8
     448: iinc          8, 1
     451: aload         11
     453: astore        12
     455: istore        13
     457: astore        15
     459: iconst_0
     460: istore        14
     462: iload         13
     464: invokestatic  #190                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     467: aload_0
     468: checkcast     #65                 // class java/lang/CharSequence
     471: aload         12
     473: iconst_0
     474: iconst_0
     475: bipush        6
     477: aconst_null
     478: invokestatic  #210                // Method kotlin/text/StringsKt.lastIndexOf$default:(Ljava/lang/CharSequence;Ljava/lang/String;IZILjava/lang/Object;)I
     481: invokestatic  #190                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     484: invokestatic  #202                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     487: aload         15
     489: swap
     490: invokeinterface #132,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     495: pop
     496: iinc          9, 1
     499: goto          430
     502: aload         6
     504: checkcast     #134                // class java/util/List
     507: nop
     508: checkcast     #47                 // class java/lang/Iterable
     511: astore_3
     512: nop
     513: iconst_0
     514: istore        4
     516: aload_3
     517: astore        5
     519: new           #113                // class java/util/ArrayList
     522: dup
     523: invokespecial #203                // Method java/util/ArrayList."<init>":()V
     526: checkcast     #124                // class java/util/Collection
     529: astore        6
     531: iconst_0
     532: istore        7
     534: aload         5
     536: invokeinterface #51,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     541: astore        8
     543: aload         8
     545: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     550: ifeq          612
     553: aload         8
     555: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     560: astore        9
     562: aload         9
     564: checkcast     #136                // class kotlin/Pair
     567: astore        10
     569: iconst_0
     570: istore        11
     572: aload         10
     574: invokevirtual #206                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     577: checkcast     #141                // class java/lang/Number
     580: invokevirtual #144                // Method java/lang/Number.intValue:()I
     583: istore        12
     585: iload         12
     587: iconst_m1
     588: if_icmple     595
     591: iconst_1
     592: goto          596
     595: iconst_0
     596: ifeq          543
     599: aload         6
     601: aload         9
     603: invokeinterface #132,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     608: pop
     609: goto          543
     612: aload         6
     614: checkcast     #134                // class java/util/List
     617: nop
     618: checkcast     #47                 // class java/lang/Iterable
     621: astore_3
     622: nop
     623: iconst_0
     624: istore        4
     626: aload_3
     627: invokeinterface #51,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     632: astore        5
     634: aload         5
     636: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     641: ifne          652
     644: new           #81                 // class java/util/NoSuchElementException
     647: dup
     648: invokespecial #207                // Method java/util/NoSuchElementException."<init>":()V
     651: athrow
     652: aload         5
     654: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     659: astore        6
     661: aload         5
     663: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     668: ifne          676
     671: aload         6
     673: goto          766
     676: aload         6
     678: checkcast     #136                // class kotlin/Pair
     681: astore        7
     683: iconst_0
     684: istore        8
     686: aload         7
     688: invokevirtual #206                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     691: checkcast     #141                // class java/lang/Number
     694: invokevirtual #144                // Method java/lang/Number.intValue:()I
     697: istore        9
     699: iload         9
     701: istore        7
     703: aload         5
     705: invokeinterface #61,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     710: astore        8
     712: aload         8
     714: checkcast     #136                // class kotlin/Pair
     717: astore        9
     719: iconst_0
     720: istore        10
     722: aload         9
     724: invokevirtual #206                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     727: checkcast     #141                // class java/lang/Number
     730: invokevirtual #144                // Method java/lang/Number.intValue:()I
     733: istore        11
     735: iload         11
     737: istore        9
     739: iload         7
     741: iload         9
     743: if_icmpge     754
     746: aload         8
     748: astore        6
     750: iload         9
     752: istore        7
     754: aload         5
     756: invokeinterface #57,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     761: ifne          703
     764: aload         6
     766: checkcast     #136                // class kotlin/Pair
     769: invokevirtual #139                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     772: checkcast     #141                // class java/lang/Number
     775: invokevirtual #144                // Method java/lang/Number.intValue:()I
     778: istore_2
     779: iload_1
     780: invokestatic  #214                // Method firstLastNumber$numericValue:(I)I
     783: invokestatic  #190                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     786: iload_2
     787: invokestatic  #214                // Method firstLastNumber$numericValue:(I)I
     790: invokestatic  #190                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     793: invokestatic  #202                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     796: areturn

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

  private static final int firstLastNumber$numericValue(int);
    Code:
       0: iload_0
       1: bipush        8
       3: if_icmple     13
       6: iload_0
       7: bipush        9
       9: isub
      10: goto          14
      13: iload_0
      14: iconst_1
      15: iadd
      16: ireturn

  static {};
    Code:
       0: bipush        9
       2: anewarray     #63                 // class java/lang/String
       5: astore_0
       6: aload_0
       7: iconst_0
       8: ldc_w         #257                // String 1
      11: aastore
      12: aload_0
      13: iconst_1
      14: ldc_w         #259                // String 2
      17: aastore
      18: aload_0
      19: iconst_2
      20: ldc_w         #261                // String 3
      23: aastore
      24: aload_0
      25: iconst_3
      26: ldc_w         #263                // String 4
      29: aastore
      30: aload_0
      31: iconst_4
      32: ldc_w         #265                // String 5
      35: aastore
      36: aload_0
      37: iconst_5
      38: ldc_w         #267                // String 6
      41: aastore
      42: aload_0
      43: bipush        6
      45: ldc_w         #269                // String 7
      48: aastore
      49: aload_0
      50: bipush        7
      52: ldc_w         #271                // String 8
      55: aastore
      56: aload_0
      57: bipush        8
      59: ldc_w         #273                // String 9
      62: aastore
      63: aload_0
      64: putstatic     #11                 // Field numericNumbers:[Ljava/lang/String;
      67: bipush        9
      69: anewarray     #63                 // class java/lang/String
      72: astore_0
      73: aload_0
      74: iconst_0
      75: ldc_w         #275                // String one
      78: aastore
      79: aload_0
      80: iconst_1
      81: ldc_w         #277                // String two
      84: aastore
      85: aload_0
      86: iconst_2
      87: ldc_w         #279                // String three
      90: aastore
      91: aload_0
      92: iconst_3
      93: ldc_w         #281                // String four
      96: aastore
      97: aload_0
      98: iconst_4
      99: ldc_w         #283                // String five
     102: aastore
     103: aload_0
     104: iconst_5
     105: ldc_w         #285                // String six
     108: aastore
     109: aload_0
     110: bipush        6
     112: ldc_w         #287                // String seven
     115: aastore
     116: aload_0
     117: bipush        7
     119: ldc_w         #289                // String eight
     122: aastore
     123: aload_0
     124: bipush        8
     126: ldc_w         #291                // String nine
     129: aastore
     130: aload_0
     131: putstatic     #15                 // Field wordNumbers:[Ljava/lang/String;
     134: getstatic     #15                 // Field wordNumbers:[Ljava/lang/String;
     137: getstatic     #11                 // Field numericNumbers:[Ljava/lang/String;
     140: invokestatic  #297                // Method kotlin/collections/ArraysKt.plus:([Ljava/lang/Object;[Ljava/lang/Object;)[Ljava/lang/Object;
     143: checkcast     #249                // class "[Ljava/lang/String;"
     146: putstatic     #19                 // Field numbers:[Ljava/lang/String;
     149: return
}


package day03

import java.io.File

import kotlin.text.StringBuilder

fun main() {
    val lines = File("src/main/resources/day03-engine").readLines()
    println("Sum of part numbers: ${engineSum(lines)}")
    println("Sum of gear ratios: ${gears(lines)}")
}

fun gears(lines: List<String>): Int {
    val emptyLine = ".".repeat(lines[0].length)
    val extendedLines = listOf(emptyLine) + lines + emptyLine
    val numbers: List<List<Pair<IntRange, Int>>> = rangeNumbers(extendedLines)

    return extendedLines.mapIndexed { lineNo, line ->
        line.mapIndexed { charNo, char ->
            if (char == '*') {
                val gearedParts = getAdjacentNumbers(charNo, numbers[lineNo - 1]) +
                        getAdjacentNumbers(charNo, numbers[lineNo + 1]) +
                        getAdjacentNumbers(charNo, numbers[lineNo])
                if (gearedParts.size == 2) gearedParts[0] * gearedParts[1] else 0
            } else 0
        }
    }.flatten().sum()
}

fun getAdjacentNumbers(position: Int, line: List<Pair<IntRange, Int>>) = line
    .filter { (range, _) -> range.contains(position) || range.contains(position + 1) || range.contains(position - 1) }
    .map { (_, number) -> number }

private fun rangeNumbers(lines: List<String>) = lines.map { line ->
    var inNumber = false
    val rowRanges = mutableListOf<Pair<IntRange, Int>>()
    val actualNumber = StringBuilder()
    var beginning = -1
    line.forEachIndexed { index, c ->
        if (c.isDigit()) actualNumber.append(c)
        if (c.isDigit() && !inNumber) {
            beginning = index
            inNumber = true
        }
        if ((!c.isDigit() || index == line.length - 1) && inNumber) {
            rowRanges.add(beginning..<index to actualNumber.toString().toInt())
            actualNumber.clear()
            inNumber = false
        }
    }
    rowRanges
}

fun engineSum(lines: List<String>): Int {
    val emptyLine = ".".repeat(lines[0].length + 2)
    return lines
        .mapIndexed { id, line ->
            fun extendLine(line: String) = StringBuilder(".").append(line).append(".").toString()
            val above = if (id == 0) emptyLine else extendLine(lines[id - 1])
            val below = if (id == lines.size - 1) emptyLine else extendLine(lines[id + 1])
            processLine(extendLine(line), above, below)
        }
        .flatten()
        .sum()
}

fun processLine(line: String, above: String, below: String): List<Int> {
    val lineNumbers = mutableListOf<Int>()
    val actualNumber = StringBuilder()
    var wasSymbol = false
    line.forEachIndexed() { position, char ->
        val charAbove = above[position]
        val charBelow = below[position]
        fun isSymbol(char: Char) = !char.isDigit() && char != '.'
        fun hasSymbol() = isSymbol(char) || isSymbol(charAbove) || isSymbol(charBelow)
        if (!char.isDigit() && (actualNumber.isNotEmpty() && (wasSymbol || hasSymbol()))) lineNumbers.add(
            actualNumber.toString().toInt()
        )
        if (char.isDigit()) actualNumber.append(char)
        if (!char.isDigit()) actualNumber.clear()
        if (hasSymbol()) wasSymbol = true
        if (char == '.' && !isSymbol(charAbove) && !isSymbol(charBelow)) wasSymbol = false
    }
    return lineNumbers
}

Compiled from "engine.kt"
public final class day03.EngineKt {
  public static final void main();
    Code:
       0: new           #8                  // class java/io/File
       3: dup
       4: ldc           #10                 // String src/main/resources/day03-engine
       6: invokespecial #14                 // Method java/io/File."<init>":(Ljava/lang/String;)V
       9: aconst_null
      10: iconst_1
      11: aconst_null
      12: invokestatic  #20                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      15: astore_0
      16: new           #22                 // class java/lang/StringBuilder
      19: dup
      20: invokespecial #24                 // Method java/lang/StringBuilder."<init>":()V
      23: ldc           #26                 // String Sum of part numbers:
      25: invokevirtual #30                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      28: aload_0
      29: invokestatic  #34                 // Method engineSum:(Ljava/util/List;)I
      32: invokevirtual #37                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      35: invokevirtual #41                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      38: getstatic     #47                 // Field java/lang/System.out:Ljava/io/PrintStream;
      41: swap
      42: invokevirtual #53                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      45: new           #22                 // class java/lang/StringBuilder
      48: dup
      49: invokespecial #24                 // Method java/lang/StringBuilder."<init>":()V
      52: ldc           #55                 // String Sum of gear ratios:
      54: invokevirtual #30                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      57: aload_0
      58: invokestatic  #58                 // Method gears:(Ljava/util/List;)I
      61: invokevirtual #37                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      64: invokevirtual #41                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      67: getstatic     #47                 // Field java/lang/System.out:Ljava/io/PrintStream;
      70: swap
      71: invokevirtual #53                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      74: return

  public static final int gears(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: ldc           #63                 // String lines
       3: invokestatic  #69                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: ldc           #71                 // String .
       8: checkcast     #73                 // class java/lang/CharSequence
      11: aload_0
      12: iconst_0
      13: invokeinterface #79,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      18: checkcast     #81                 // class java/lang/String
      21: invokevirtual #85                 // Method java/lang/String.length:()I
      24: invokestatic  #91                 // Method kotlin/text/StringsKt.repeat:(Ljava/lang/CharSequence;I)Ljava/lang/String;
      27: astore_1
      28: aload_1
      29: invokestatic  #97                 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
      32: checkcast     #99                 // class java/util/Collection
      35: aload_0
      36: checkcast     #101                // class java/lang/Iterable
      39: invokestatic  #105                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
      42: checkcast     #99                 // class java/util/Collection
      45: aload_1
      46: invokestatic  #108                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/List;
      49: astore_2
      50: aload_2
      51: invokestatic  #112                // Method rangeNumbers:(Ljava/util/List;)Ljava/util/List;
      54: astore_3
      55: aload_2
      56: checkcast     #101                // class java/lang/Iterable
      59: astore        4
      61: iconst_0
      62: istore        5
      64: aload         4
      66: astore        6
      68: new           #114                // class java/util/ArrayList
      71: dup
      72: aload         4
      74: bipush        10
      76: invokestatic  #118                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      79: invokespecial #121                // Method java/util/ArrayList."<init>":(I)V
      82: checkcast     #99                 // class java/util/Collection
      85: astore        7
      87: iconst_0
      88: istore        8
      90: iconst_0
      91: istore        9
      93: aload         6
      95: invokeinterface #125,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     100: astore        10
     102: aload         10
     104: invokeinterface #131,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     109: ifeq          401
     112: aload         10
     114: invokeinterface #135,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     119: astore        11
     121: aload         7
     123: iload         9
     125: iinc          9, 1
     128: istore        12
     130: iload         12
     132: ifge          138
     135: invokestatic  #138                // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
     138: iload         12
     140: aload         11
     142: checkcast     #81                 // class java/lang/String
     145: astore        13
     147: istore        14
     149: astore        29
     151: iconst_0
     152: istore        15
     154: aload         13
     156: checkcast     #73                 // class java/lang/CharSequence
     159: astore        16
     161: iconst_0
     162: istore        17
     164: aload         16
     166: astore        18
     168: new           #114                // class java/util/ArrayList
     171: dup
     172: aload         16
     174: invokeinterface #139,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     179: invokespecial #121                // Method java/util/ArrayList."<init>":(I)V
     182: checkcast     #99                 // class java/util/Collection
     185: astore        19
     187: iconst_0
     188: istore        20
     190: iconst_0
     191: istore        21
     193: iconst_0
     194: istore        22
     196: iload         22
     198: aload         18
     200: invokeinterface #139,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     205: if_icmpge     382
     208: aload         18
     210: iload         22
     212: invokeinterface #143,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     217: istore        23
     219: aload         19
     221: iload         21
     223: iinc          21, 1
     226: iload         23
     228: istore        24
     230: istore        25
     232: astore        26
     234: iconst_0
     235: istore        27
     237: iload         24
     239: bipush        42
     241: if_icmpne     363
     244: iload         25
     246: aload_3
     247: iload         14
     249: iconst_1
     250: isub
     251: invokeinterface #79,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     256: checkcast     #75                 // class java/util/List
     259: invokestatic  #147                // Method getAdjacentNumbers:(ILjava/util/List;)Ljava/util/List;
     262: checkcast     #99                 // class java/util/Collection
     265: iload         25
     267: aload_3
     268: iload         14
     270: iconst_1
     271: iadd
     272: invokeinterface #79,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     277: checkcast     #75                 // class java/util/List
     280: invokestatic  #147                // Method getAdjacentNumbers:(ILjava/util/List;)Ljava/util/List;
     283: checkcast     #101                // class java/lang/Iterable
     286: invokestatic  #105                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     289: checkcast     #99                 // class java/util/Collection
     292: iload         25
     294: aload_3
     295: iload         14
     297: invokeinterface #79,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     302: checkcast     #75                 // class java/util/List
     305: invokestatic  #147                // Method getAdjacentNumbers:(ILjava/util/List;)Ljava/util/List;
     308: checkcast     #101                // class java/lang/Iterable
     311: invokestatic  #105                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     314: astore        28
     316: aload         28
     318: invokeinterface #150,  1          // InterfaceMethod java/util/List.size:()I
     323: iconst_2
     324: if_icmpne     359
     327: aload         28
     329: iconst_0
     330: invokeinterface #79,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     335: checkcast     #152                // class java/lang/Number
     338: invokevirtual #155                // Method java/lang/Number.intValue:()I
     341: aload         28
     343: iconst_1
     344: invokeinterface #79,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     349: checkcast     #152                // class java/lang/Number
     352: invokevirtual #155                // Method java/lang/Number.intValue:()I
     355: imul
     356: goto          364
     359: iconst_0
     360: goto          364
     363: iconst_0
     364: invokestatic  #161                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     367: aload         26
     369: swap
     370: invokeinterface #165,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     375: pop
     376: iinc          22, 1
     379: goto          196
     382: aload         19
     384: checkcast     #75                 // class java/util/List
     387: nop
     388: nop
     389: aload         29
     391: swap
     392: invokeinterface #165,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     397: pop
     398: goto          102
     401: aload         7
     403: checkcast     #75                 // class java/util/List
     406: nop
     407: checkcast     #101                // class java/lang/Iterable
     410: invokestatic  #169                // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;
     413: checkcast     #101                // class java/lang/Iterable
     416: invokestatic  #173                // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
     419: ireturn

  public static final java.util.List<java.lang.Integer> getAdjacentNumbers(int, java.util.List<kotlin.Pair<kotlin.ranges.IntRange, java.lang.Integer>>);
    Code:
       0: aload_1
       1: ldc           #199                // String line
       3: invokestatic  #69                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: checkcast     #101                // class java/lang/Iterable
      10: astore_2
      11: nop
      12: iconst_0
      13: istore_3
      14: aload_2
      15: astore        4
      17: new           #114                // class java/util/ArrayList
      20: dup
      21: invokespecial #200                // Method java/util/ArrayList."<init>":()V
      24: checkcast     #99                 // class java/util/Collection
      27: astore        5
      29: iconst_0
      30: istore        6
      32: aload         4
      34: invokeinterface #125,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      39: astore        7
      41: aload         7
      43: invokeinterface #131,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      48: ifeq          132
      51: aload         7
      53: invokeinterface #135,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      58: astore        8
      60: aload         8
      62: checkcast     #202                // class kotlin/Pair
      65: astore        9
      67: iconst_0
      68: istore        10
      70: aload         9
      72: invokevirtual #205                // Method kotlin/Pair.component1:()Ljava/lang/Object;
      75: checkcast     #207                // class kotlin/ranges/IntRange
      78: astore        11
      80: aload         11
      82: iload_0
      83: invokevirtual #211                // Method kotlin/ranges/IntRange.contains:(I)Z
      86: ifne          111
      89: aload         11
      91: iload_0
      92: iconst_1
      93: iadd
      94: invokevirtual #211                // Method kotlin/ranges/IntRange.contains:(I)Z
      97: ifne          111
     100: aload         11
     102: iload_0
     103: iconst_1
     104: isub
     105: invokevirtual #211                // Method kotlin/ranges/IntRange.contains:(I)Z
     108: ifeq          115
     111: iconst_1
     112: goto          116
     115: iconst_0
     116: ifeq          41
     119: aload         5
     121: aload         8
     123: invokeinterface #165,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     128: pop
     129: goto          41
     132: aload         5
     134: checkcast     #75                 // class java/util/List
     137: nop
     138: checkcast     #101                // class java/lang/Iterable
     141: astore_2
     142: nop
     143: iconst_0
     144: istore_3
     145: aload_2
     146: astore        4
     148: new           #114                // class java/util/ArrayList
     151: dup
     152: aload_2
     153: bipush        10
     155: invokestatic  #118                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     158: invokespecial #121                // Method java/util/ArrayList."<init>":(I)V
     161: checkcast     #99                 // class java/util/Collection
     164: astore        5
     166: iconst_0
     167: istore        6
     169: aload         4
     171: invokeinterface #125,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     176: astore        7
     178: aload         7
     180: invokeinterface #131,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     185: ifeq          241
     188: aload         7
     190: invokeinterface #135,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     195: astore        8
     197: aload         5
     199: aload         8
     201: checkcast     #202                // class kotlin/Pair
     204: astore        9
     206: astore        12
     208: iconst_0
     209: istore        10
     211: aload         9
     213: invokevirtual #214                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     216: checkcast     #152                // class java/lang/Number
     219: invokevirtual #155                // Method java/lang/Number.intValue:()I
     222: istore        11
     224: iload         11
     226: invokestatic  #161                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     229: aload         12
     231: swap
     232: invokeinterface #165,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     237: pop
     238: goto          178
     241: aload         5
     243: checkcast     #75                 // class java/util/List
     246: nop
     247: areturn

  private static final java.util.List<java.util.List<kotlin.Pair<kotlin.ranges.IntRange, java.lang.Integer>>> rangeNumbers(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: checkcast     #101                // class java/lang/Iterable
       4: astore_1
       5: iconst_0
       6: istore_2
       7: aload_1
       8: astore_3
       9: new           #114                // class java/util/ArrayList
      12: dup
      13: aload_1
      14: bipush        10
      16: invokestatic  #118                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      19: invokespecial #121                // Method java/util/ArrayList."<init>":(I)V
      22: checkcast     #99                 // class java/util/Collection
      25: astore        4
      27: iconst_0
      28: istore        5
      30: aload_3
      31: invokeinterface #125,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      36: astore        6
      38: aload         6
      40: invokeinterface #131,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      45: ifeq          282
      48: aload         6
      50: invokeinterface #135,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      55: astore        7
      57: aload         4
      59: aload         7
      61: checkcast     #81                 // class java/lang/String
      64: astore        8
      66: astore        22
      68: iconst_0
      69: istore        9
      71: iconst_0
      72: istore        10
      74: new           #114                // class java/util/ArrayList
      77: dup
      78: invokespecial #200                // Method java/util/ArrayList."<init>":()V
      81: checkcast     #75                 // class java/util/List
      84: astore        11
      86: new           #22                 // class java/lang/StringBuilder
      89: dup
      90: invokespecial #24                 // Method java/lang/StringBuilder."<init>":()V
      93: astore        12
      95: iconst_0
      96: istore        13
      98: iconst_m1
      99: istore        13
     101: aload         8
     103: checkcast     #73                 // class java/lang/CharSequence
     106: astore        14
     108: iconst_0
     109: istore        15
     111: iconst_0
     112: istore        16
     114: iconst_0
     115: istore        17
     117: iload         17
     119: aload         14
     121: invokeinterface #139,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     126: if_icmpge     267
     129: aload         14
     131: iload         17
     133: invokeinterface #143,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     138: istore        18
     140: iload         16
     142: iinc          16, 1
     145: iload         18
     147: istore        19
     149: istore        20
     151: iconst_0
     152: istore        21
     154: iload         19
     156: invokestatic  #236                // Method java/lang/Character.isDigit:(C)Z
     159: ifeq          170
     162: aload         12
     164: iload         19
     166: invokevirtual #239                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     169: pop
     170: iload         19
     172: invokestatic  #236                // Method java/lang/Character.isDigit:(C)Z
     175: ifeq          190
     178: iload         10
     180: ifne          190
     183: iload         20
     185: istore        13
     187: iconst_1
     188: istore        10
     190: iload         19
     192: invokestatic  #236                // Method java/lang/Character.isDigit:(C)Z
     195: ifeq          210
     198: iload         20
     200: aload         8
     202: invokevirtual #85                 // Method java/lang/String.length:()I
     205: iconst_1
     206: isub
     207: if_icmpne     259
     210: iload         10
     212: ifeq          259
     215: aload         11
     217: iload         13
     219: iload         20
     221: invokestatic  #245                // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;
     224: aload         12
     226: invokevirtual #41                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     229: dup
     230: ldc           #247                // String toString(...)
     232: invokestatic  #250                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     235: invokestatic  #254                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     238: invokestatic  #161                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     241: invokestatic  #260                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     244: invokeinterface #261,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     249: pop
     250: aload         12
     252: invokestatic  #265                // Method kotlin/text/StringsKt.clear:(Ljava/lang/StringBuilder;)Ljava/lang/StringBuilder;
     255: pop
     256: iconst_0
     257: istore        10
     259: nop
     260: nop
     261: iinc          17, 1
     264: goto          117
     267: nop
     268: aload         11
     270: aload         22
     272: swap
     273: invokeinterface #165,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     278: pop
     279: goto          38
     282: aload         4
     284: checkcast     #75                 // class java/util/List
     287: nop
     288: areturn

  public static final int engineSum(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: ldc           #63                 // String lines
       3: invokestatic  #69                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: ldc           #71                 // String .
       8: checkcast     #73                 // class java/lang/CharSequence
      11: aload_0
      12: iconst_0
      13: invokeinterface #79,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      18: checkcast     #81                 // class java/lang/String
      21: invokevirtual #85                 // Method java/lang/String.length:()I
      24: iconst_2
      25: iadd
      26: invokestatic  #91                 // Method kotlin/text/StringsKt.repeat:(Ljava/lang/CharSequence;I)Ljava/lang/String;
      29: astore_1
      30: aload_0
      31: checkcast     #101                // class java/lang/Iterable
      34: astore_2
      35: nop
      36: iconst_0
      37: istore_3
      38: aload_2
      39: astore        4
      41: new           #114                // class java/util/ArrayList
      44: dup
      45: aload_2
      46: bipush        10
      48: invokestatic  #118                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      51: invokespecial #121                // Method java/util/ArrayList."<init>":(I)V
      54: checkcast     #99                 // class java/util/Collection
      57: astore        5
      59: iconst_0
      60: istore        6
      62: iconst_0
      63: istore        7
      65: aload         4
      67: invokeinterface #125,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      72: astore        8
      74: aload         8
      76: invokeinterface #131,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      81: ifeq          212
      84: aload         8
      86: invokeinterface #135,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      91: astore        9
      93: aload         5
      95: iload         7
      97: iinc          7, 1
     100: istore        10
     102: iload         10
     104: ifge          110
     107: invokestatic  #138                // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
     110: iload         10
     112: aload         9
     114: checkcast     #81                 // class java/lang/String
     117: astore        11
     119: istore        12
     121: astore        16
     123: iconst_0
     124: istore        13
     126: iload         12
     128: ifne          135
     131: aload_1
     132: goto          151
     135: aload_0
     136: iload         12
     138: iconst_1
     139: isub
     140: invokeinterface #79,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     145: checkcast     #81                 // class java/lang/String
     148: invokestatic  #283                // Method engineSum$lambda$6$extendLine:(Ljava/lang/String;)Ljava/lang/String;
     151: astore        14
     153: iload         12
     155: aload_0
     156: invokeinterface #150,  1          // InterfaceMethod java/util/List.size:()I
     161: iconst_1
     162: isub
     163: if_icmpne     170
     166: aload_1
     167: goto          186
     170: aload_0
     171: iload         12
     173: iconst_1
     174: iadd
     175: invokeinterface #79,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     180: checkcast     #81                 // class java/lang/String
     183: invokestatic  #283                // Method engineSum$lambda$6$extendLine:(Ljava/lang/String;)Ljava/lang/String;
     186: astore        15
     188: aload         11
     190: invokestatic  #283                // Method engineSum$lambda$6$extendLine:(Ljava/lang/String;)Ljava/lang/String;
     193: aload         14
     195: aload         15
     197: invokestatic  #287                // Method processLine:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/List;
     200: aload         16
     202: swap
     203: invokeinterface #165,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     208: pop
     209: goto          74
     212: aload         5
     214: checkcast     #75                 // class java/util/List
     217: nop
     218: checkcast     #101                // class java/lang/Iterable
     221: invokestatic  #169                // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;
     224: checkcast     #101                // class java/lang/Iterable
     227: invokestatic  #173                // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
     230: ireturn

  public static final java.util.List<java.lang.Integer> processLine(java.lang.String, java.lang.String, java.lang.String);
    Code:
       0: aload_0
       1: ldc           #199                // String line
       3: invokestatic  #69                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc_w         #293                // String above
      10: invokestatic  #69                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      13: aload_2
      14: ldc_w         #294                // String below
      17: invokestatic  #69                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      20: new           #114                // class java/util/ArrayList
      23: dup
      24: invokespecial #200                // Method java/util/ArrayList."<init>":()V
      27: checkcast     #75                 // class java/util/List
      30: astore_3
      31: new           #22                 // class java/lang/StringBuilder
      34: dup
      35: invokespecial #24                 // Method java/lang/StringBuilder."<init>":()V
      38: astore        4
      40: iconst_0
      41: istore        5
      43: aload_0
      44: checkcast     #73                 // class java/lang/CharSequence
      47: astore        6
      49: iconst_0
      50: istore        7
      52: iconst_0
      53: istore        8
      55: iconst_0
      56: istore        9
      58: iload         9
      60: aload         6
      62: invokeinterface #139,  1          // InterfaceMethod java/lang/CharSequence.length:()I
      67: if_icmpge     260
      70: aload         6
      72: iload         9
      74: invokeinterface #143,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
      79: istore        10
      81: iload         8
      83: iinc          8, 1
      86: iload         10
      88: istore        11
      90: istore        12
      92: iconst_0
      93: istore        13
      95: aload_1
      96: iload         12
      98: invokevirtual #295                // Method java/lang/String.charAt:(I)C
     101: istore        14
     103: aload_2
     104: iload         12
     106: invokevirtual #295                // Method java/lang/String.charAt:(I)C
     109: istore        15
     111: iload         11
     113: invokestatic  #236                // Method java/lang/Character.isDigit:(C)Z
     116: ifne          181
     119: aload         4
     121: checkcast     #73                 // class java/lang/CharSequence
     124: invokeinterface #139,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     129: ifle          136
     132: iconst_1
     133: goto          137
     136: iconst_0
     137: ifeq          181
     140: iload         5
     142: ifne          157
     145: iload         11
     147: iload         14
     149: iload         15
     151: invokestatic  #299                // Method processLine$lambda$7$hasSymbol:(CCC)Z
     154: ifeq          181
     157: aload_3
     158: aload         4
     160: invokevirtual #41                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     163: dup
     164: ldc           #247                // String toString(...)
     166: invokestatic  #250                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     169: invokestatic  #254                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     172: invokestatic  #161                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     175: invokeinterface #261,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     180: pop
     181: iload         11
     183: invokestatic  #236                // Method java/lang/Character.isDigit:(C)Z
     186: ifeq          197
     189: aload         4
     191: iload         11
     193: invokevirtual #239                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     196: pop
     197: iload         11
     199: invokestatic  #236                // Method java/lang/Character.isDigit:(C)Z
     202: ifne          211
     205: aload         4
     207: invokestatic  #265                // Method kotlin/text/StringsKt.clear:(Ljava/lang/StringBuilder;)Ljava/lang/StringBuilder;
     210: pop
     211: iload         11
     213: iload         14
     215: iload         15
     217: invokestatic  #299                // Method processLine$lambda$7$hasSymbol:(CCC)Z
     220: ifeq          226
     223: iconst_1
     224: istore        5
     226: iload         11
     228: bipush        46
     230: if_icmpne     252
     233: iload         14
     235: invokestatic  #302                // Method processLine$lambda$7$isSymbol:(C)Z
     238: ifne          252
     241: iload         15
     243: invokestatic  #302                // Method processLine$lambda$7$isSymbol:(C)Z
     246: ifne          252
     249: iconst_0
     250: istore        5
     252: nop
     253: nop
     254: iinc          9, 1
     257: goto          58
     260: nop
     261: aload_3
     262: areturn

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

  private static final java.lang.String engineSum$lambda$6$extendLine(java.lang.String);
    Code:
       0: new           #22                 // class java/lang/StringBuilder
       3: dup
       4: ldc           #71                 // String .
       6: invokespecial #313                // Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V
       9: aload_0
      10: invokevirtual #30                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      13: ldc           #71                 // String .
      15: invokevirtual #30                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      18: invokevirtual #41                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      21: dup
      22: ldc           #247                // String toString(...)
      24: invokestatic  #250                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      27: areturn

  private static final boolean processLine$lambda$7$isSymbol(char);
    Code:
       0: iload_0
       1: invokestatic  #236                // Method java/lang/Character.isDigit:(C)Z
       4: ifne          17
       7: iload_0
       8: bipush        46
      10: if_icmpeq     17
      13: iconst_1
      14: goto          18
      17: iconst_0
      18: ireturn

  private static final boolean processLine$lambda$7$hasSymbol(char, char, char);
    Code:
       0: iload_0
       1: invokestatic  #302                // Method processLine$lambda$7$isSymbol:(C)Z
       4: ifne          21
       7: iload_1
       8: invokestatic  #302                // Method processLine$lambda$7$isSymbol:(C)Z
      11: ifne          21
      14: iload_2
      15: invokestatic  #302                // Method processLine$lambda$7$isSymbol:(C)Z
      18: ifeq          25
      21: iconst_1
      22: goto          26
      25: iconst_0
      26: ireturn
}