import kotlin.String
import kotlin.collections.List

object Day3 {
    data class NumberPosition(
        val number: Int,
        val start: Int,
        val end: Int,
        val row: Int
    )

    data class Symbol(val symbol: Char, val coordinate: Coordinate)

    data class Coordinate(val x: Int, val y: Int)

    private val reservedSymbol = ".".first()

    fun part1(input: List<String>): String {
        val numbers = parseNumbers(input)
        val specialCharacters = parseSpecialCharacters(input).associateBy { it.coordinate }
        val partNumbers = numbers.filter {
            val (_, start, end, row) = it
            val up = row - 1
            val down = row + 1
            val left = start - 1
            val right = end + 1
            val coordinateCandidates = (left..right).flatMap { x ->
                listOf(
                    Coordinate(x, up),
                    Coordinate(x, down)
                )
            } + listOf(Coordinate(left, row), Coordinate(right, row))
            coordinateCandidates.any { specialCharacters.containsKey(it) }
        }
        return partNumbers.sumOf { it.number }.toString()
    }

    private fun parseNumbers(input: List<String>): List<NumberPosition> {
        return input.zip(input.indices).flatMap { (line, rowIndex) ->
            val charArray = line.toCharArray()
            val withIndexes = charArray.zip(charArray.indices)
            val deque = ArrayDeque(withIndexes)
            var buffer = ""
            var start = 0
            var end = 0
            val numbers = mutableListOf<NumberPosition>()
            while (deque.isNotEmpty()) {
                val (char, index) = deque.removeFirst()
                if (char.isDigit()) {
                    end = index
                    buffer += char
                } else {
                    if (buffer.isNotEmpty()) {
                        numbers.add(NumberPosition(buffer.toInt(), start, end, rowIndex))
                    }
                    buffer = ""
                    start = index + 1
                    end = index + 1
                }
            }
            if (buffer.isNotEmpty()) {
                numbers.add(NumberPosition(buffer.toInt(), start, end, rowIndex))
            }
            numbers
        }
    }

    private fun parseSpecialCharacters(input: List<String>): List<Symbol> {
        val validSymbols = input.map { it.toCharArray() }
            .map { it.zip(it.indices) }
            .map { it.filter { !it.first.isDigit() }.filter { it.first != reservedSymbol } }
        return validSymbols.zip(validSymbols.indices)
            .flatMap { (row, rowIndex) -> row.map { Symbol(it.first, Coordinate(it.second, rowIndex)) } }
    }

    fun part2(input: List<String>): String {
        val numbers = parseNumbers(input)
        val specialCharacters = parseSpecialCharacters(input)
        val gears = specialCharacters.filter { it.symbol == '*' }.associateBy { it.coordinate }
        return gears.map { adjacent(it.key, numbers) }
            .filter { it.size == 2 }
            .map { it.map { it.number }.reduce { a, b -> a * b } }
            .sum().toString()
    }

    private fun adjacent(it: Coordinate, numbers: List<NumberPosition>): List<NumberPosition> {
        val up = Coordinate(it.x, it.y - 1)
        val down = Coordinate(it.x, it.y + 1)
        val left = Coordinate(it.x - 1, it.y)
        val right = Coordinate(it.x + 1, it.y)
        val upLeft = Coordinate(it.x - 1, it.y - 1)
        val upRight = Coordinate(it.x + 1, it.y - 1)
        val downLeft = Coordinate(it.x - 1, it.y + 1)
        val downRight = Coordinate(it.x + 1, it.y + 1)
        val candidates = listOf(up, down, left, right, upLeft, upRight, downLeft, downRight)
        return numbers.filter { num -> candidates.any { it.x <= num.end && it.x >= num.start && it.y == num.row } }
    }
}

Compiled from "Day3.kt"
public final class Day3$Coordinate {
  private final int x;

  private final int y;

  public Day3$Coordinate(int, int);
    Code:
       0: aload_0
       1: invokespecial #9                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: iload_1
       6: putfield      #13                 // Field x:I
       9: aload_0
      10: iload_2
      11: putfield      #16                 // Field y:I
      14: return

  public final int getX();
    Code:
       0: aload_0
       1: getfield      #13                 // Field x:I
       4: ireturn

  public final int getY();
    Code:
       0: aload_0
       1: getfield      #16                 // Field y:I
       4: ireturn

  public final int component1();
    Code:
       0: aload_0
       1: getfield      #13                 // Field x:I
       4: ireturn

  public final int component2();
    Code:
       0: aload_0
       1: getfield      #16                 // Field y:I
       4: ireturn

  public final Day3$Coordinate copy(int, int);
    Code:
       0: new           #2                  // class Day3$Coordinate
       3: dup
       4: iload_1
       5: iload_2
       6: invokespecial #28                 // Method "<init>":(II)V
       9: areturn

  public static Day3$Coordinate copy$default(Day3$Coordinate, int, int, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #13                 // Field x:I
      10: istore_1
      11: iload_3
      12: iconst_2
      13: iand
      14: ifeq          22
      17: aload_0
      18: getfield      #16                 // Field y:I
      21: istore_2
      22: aload_0
      23: iload_1
      24: iload_2
      25: invokevirtual #32                 // Method copy:(II)LDay3$Coordinate;
      28: areturn

  public java.lang.String toString();
    Code:
       0: new           #36                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #37                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #39                 // String Coordinate(x=
       9: invokevirtual #43                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field x:I
      16: invokevirtual #46                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #48                 // String , y=
      21: invokevirtual #43                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #16                 // Field y:I
      28: invokevirtual #46                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #51                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #53                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      39: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #13                 // Field x:I
       4: invokestatic  #59                 // Method java/lang/Integer.hashCode:(I)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #16                 // Field y:I
      16: invokestatic  #59                 // Method java/lang/Integer.hashCode:(I)I
      19: iadd
      20: istore_1
      21: iload_1
      22: ireturn

  public boolean equals(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: if_acmpne     7
       5: iconst_1
       6: ireturn
       7: aload_1
       8: instanceof    #2                  // class Day3$Coordinate
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day3$Coordinate
      20: astore_2
      21: aload_0
      22: getfield      #13                 // Field x:I
      25: aload_2
      26: getfield      #13                 // Field x:I
      29: if_icmpeq     34
      32: iconst_0
      33: ireturn
      34: aload_0
      35: getfield      #16                 // Field y:I
      38: aload_2
      39: getfield      #16                 // Field y:I
      42: if_icmpeq     47
      45: iconst_0
      46: ireturn
      47: iconst_1
      48: ireturn
}

Compiled from "Day3.kt"
public final class Day3 {
  public static final Day3 INSTANCE;

  private static final char reservedSymbol;

  private Day3();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final java.lang.String part1(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #16                 // String input
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: invokespecial #26                 // Method parseNumbers:(Ljava/util/List;)Ljava/util/List;
      11: astore_2
      12: aload_0
      13: aload_1
      14: invokespecial #29                 // Method parseSpecialCharacters:(Ljava/util/List;)Ljava/util/List;
      17: checkcast     #31                 // class java/lang/Iterable
      20: astore        4
      22: iconst_0
      23: istore        5
      25: aload         4
      27: bipush        10
      29: invokestatic  #37                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      32: invokestatic  #43                 // Method kotlin/collections/MapsKt.mapCapacity:(I)I
      35: bipush        16
      37: invokestatic  #49                 // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I
      40: istore        6
      42: aload         4
      44: astore        7
      46: new           #51                 // class java/util/LinkedHashMap
      49: dup
      50: iload         6
      52: invokespecial #54                 // Method java/util/LinkedHashMap."<init>":(I)V
      55: checkcast     #56                 // class java/util/Map
      58: astore        8
      60: iconst_0
      61: istore        9
      63: aload         7
      65: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      70: astore        10
      72: aload         10
      74: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      79: ifeq          124
      82: aload         10
      84: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      89: astore        11
      91: aload         8
      93: aload         11
      95: checkcast     #72                 // class Day3$Symbol
      98: astore        12
     100: astore        32
     102: iconst_0
     103: istore        13
     105: aload         12
     107: invokevirtual #76                 // Method Day3$Symbol.getCoordinate:()LDay3$Coordinate;
     110: aload         32
     112: swap
     113: aload         11
     115: invokeinterface #80,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     120: pop
     121: goto          72
     124: aload         8
     126: nop
     127: astore_3
     128: aload_2
     129: checkcast     #31                 // class java/lang/Iterable
     132: astore        5
     134: iconst_0
     135: istore        6
     137: aload         5
     139: astore        7
     141: new           #82                 // class java/util/ArrayList
     144: dup
     145: invokespecial #83                 // Method java/util/ArrayList."<init>":()V
     148: checkcast     #85                 // class java/util/Collection
     151: astore        8
     153: iconst_0
     154: istore        9
     156: aload         7
     158: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     163: astore        10
     165: aload         10
     167: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     172: ifeq          535
     175: aload         10
     177: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     182: astore        11
     184: aload         11
     186: checkcast     #87                 // class Day3$NumberPosition
     189: astore        12
     191: iconst_0
     192: istore        13
     194: aload         12
     196: invokevirtual #91                 // Method Day3$NumberPosition.component2:()I
     199: istore        14
     201: aload         12
     203: invokevirtual #94                 // Method Day3$NumberPosition.component3:()I
     206: istore        15
     208: aload         12
     210: invokevirtual #97                 // Method Day3$NumberPosition.component4:()I
     213: istore        16
     215: iload         16
     217: iconst_1
     218: isub
     219: istore        17
     221: iload         16
     223: iconst_1
     224: iadd
     225: istore        18
     227: iload         14
     229: iconst_1
     230: isub
     231: istore        19
     233: iload         15
     235: iconst_1
     236: iadd
     237: istore        20
     239: new           #99                 // class kotlin/ranges/IntRange
     242: dup
     243: iload         19
     245: iload         20
     247: invokespecial #102                // Method kotlin/ranges/IntRange."<init>":(II)V
     250: checkcast     #31                 // class java/lang/Iterable
     253: astore        21
     255: iconst_0
     256: istore        22
     258: aload         21
     260: astore        23
     262: new           #82                 // class java/util/ArrayList
     265: dup
     266: invokespecial #83                 // Method java/util/ArrayList."<init>":()V
     269: checkcast     #85                 // class java/util/Collection
     272: astore        24
     274: iconst_0
     275: istore        25
     277: aload         23
     279: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     284: astore        26
     286: aload         26
     288: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     293: ifeq          371
     296: aload         26
     298: checkcast     #104                // class kotlin/collections/IntIterator
     301: invokevirtual #107                // Method kotlin/collections/IntIterator.nextInt:()I
     304: istore        27
     306: iload         27
     308: istore        28
     310: iconst_0
     311: istore        29
     313: iconst_2
     314: anewarray     #109                // class Day3$Coordinate
     317: astore        30
     319: aload         30
     321: iconst_0
     322: new           #109                // class Day3$Coordinate
     325: dup
     326: iload         28
     328: iload         17
     330: invokespecial #110                // Method Day3$Coordinate."<init>":(II)V
     333: aastore
     334: aload         30
     336: iconst_1
     337: new           #109                // class Day3$Coordinate
     340: dup
     341: iload         28
     343: iload         18
     345: invokespecial #110                // Method Day3$Coordinate."<init>":(II)V
     348: aastore
     349: aload         30
     351: invokestatic  #114                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     354: checkcast     #31                 // class java/lang/Iterable
     357: nop
     358: astore        28
     360: aload         24
     362: aload         28
     364: invokestatic  #118                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     367: pop
     368: goto          286
     371: aload         24
     373: checkcast     #120                // class java/util/List
     376: nop
     377: checkcast     #85                 // class java/util/Collection
     380: iconst_2
     381: anewarray     #109                // class Day3$Coordinate
     384: astore        21
     386: aload         21
     388: iconst_0
     389: new           #109                // class Day3$Coordinate
     392: dup
     393: iload         19
     395: iload         16
     397: invokespecial #110                // Method Day3$Coordinate."<init>":(II)V
     400: aastore
     401: aload         21
     403: iconst_1
     404: new           #109                // class Day3$Coordinate
     407: dup
     408: iload         20
     410: iload         16
     412: invokespecial #110                // Method Day3$Coordinate."<init>":(II)V
     415: aastore
     416: aload         21
     418: invokestatic  #114                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     421: checkcast     #31                 // class java/lang/Iterable
     424: invokestatic  #124                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     427: astore        31
     429: aload         31
     431: checkcast     #31                 // class java/lang/Iterable
     434: astore        21
     436: iconst_0
     437: istore        22
     439: aload         21
     441: instanceof    #85                 // class java/util/Collection
     444: ifeq          464
     447: aload         21
     449: checkcast     #85                 // class java/util/Collection
     452: invokeinterface #127,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     457: ifeq          464
     460: iconst_0
     461: goto          518
     464: aload         21
     466: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     471: astore        23
     473: aload         23
     475: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     480: ifeq          517
     483: aload         23
     485: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     490: astore        24
     492: aload         24
     494: checkcast     #109                // class Day3$Coordinate
     497: astore        25
     499: iconst_0
     500: istore        26
     502: aload_3
     503: aload         25
     505: invokeinterface #131,  2          // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
     510: ifeq          473
     513: iconst_1
     514: goto          518
     517: iconst_0
     518: nop
     519: ifeq          165
     522: aload         8
     524: aload         11
     526: invokeinterface #134,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     531: pop
     532: goto          165
     535: aload         8
     537: checkcast     #120                // class java/util/List
     540: nop
     541: astore        4
     543: aload         4
     545: checkcast     #31                 // class java/lang/Iterable
     548: astore        5
     550: iconst_0
     551: istore        6
     553: aload         5
     555: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     560: astore        7
     562: aload         7
     564: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     569: ifeq          612
     572: aload         7
     574: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     579: astore        8
     581: iload         6
     583: aload         8
     585: checkcast     #87                 // class Day3$NumberPosition
     588: astore        9
     590: istore        32
     592: iconst_0
     593: istore        10
     595: aload         9
     597: invokevirtual #137                // Method Day3$NumberPosition.getNumber:()I
     600: istore        33
     602: iload         32
     604: iload         33
     606: iadd
     607: istore        6
     609: goto          562
     612: iload         6
     614: invokestatic  #143                // Method java/lang/String.valueOf:(I)Ljava/lang/String;
     617: areturn

  private final java.util.List<Day3$NumberPosition> parseNumbers(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: checkcast     #31                 // class java/lang/Iterable
       4: aload_1
       5: checkcast     #85                 // class java/util/Collection
       8: invokestatic  #194                // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;
      11: checkcast     #31                 // class java/lang/Iterable
      14: invokestatic  #198                // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;
      17: checkcast     #31                 // class java/lang/Iterable
      20: astore_2
      21: iconst_0
      22: istore_3
      23: aload_2
      24: astore        4
      26: new           #82                 // class java/util/ArrayList
      29: dup
      30: invokespecial #83                 // Method java/util/ArrayList."<init>":()V
      33: checkcast     #85                 // class java/util/Collection
      36: astore        5
      38: iconst_0
      39: istore        6
      41: aload         4
      43: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      48: astore        7
      50: aload         7
      52: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      57: ifeq          391
      60: aload         7
      62: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      67: astore        8
      69: aload         8
      71: checkcast     #200                // class kotlin/Pair
      74: astore        9
      76: iconst_0
      77: istore        10
      79: aload         9
      81: invokevirtual #203                // Method kotlin/Pair.component1:()Ljava/lang/Object;
      84: checkcast     #139                // class java/lang/String
      87: astore        11
      89: aload         9
      91: invokevirtual #205                // Method kotlin/Pair.component2:()Ljava/lang/Object;
      94: checkcast     #207                // class java/lang/Number
      97: invokevirtual #210                // Method java/lang/Number.intValue:()I
     100: istore        12
     102: aload         11
     104: invokevirtual #214                // Method java/lang/String.toCharArray:()[C
     107: dup
     108: ldc           #216                // String toCharArray(...)
     110: invokestatic  #219                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     113: astore        13
     115: aload         13
     117: aload         13
     119: invokestatic  #224                // Method kotlin/collections/ArraysKt.getIndices:([C)Lkotlin/ranges/IntRange;
     122: checkcast     #31                 // class java/lang/Iterable
     125: invokestatic  #227                // Method kotlin/collections/ArraysKt.zip:([CLjava/lang/Iterable;)Ljava/util/List;
     128: astore        14
     130: new           #229                // class kotlin/collections/ArrayDeque
     133: dup
     134: aload         14
     136: checkcast     #85                 // class java/util/Collection
     139: invokespecial #232                // Method kotlin/collections/ArrayDeque."<init>":(Ljava/util/Collection;)V
     142: astore        15
     144: ldc           #234                // String
     146: astore        16
     148: iconst_0
     149: istore        17
     151: iconst_0
     152: istore        18
     154: new           #82                 // class java/util/ArrayList
     157: dup
     158: invokespecial #83                 // Method java/util/ArrayList."<init>":()V
     161: checkcast     #120                // class java/util/List
     164: astore        19
     166: aload         15
     168: checkcast     #85                 // class java/util/Collection
     171: invokeinterface #127,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     176: ifne          183
     179: iconst_1
     180: goto          184
     183: iconst_0
     184: ifeq          326
     187: aload         15
     189: invokevirtual #237                // Method kotlin/collections/ArrayDeque.removeFirst:()Ljava/lang/Object;
     192: checkcast     #200                // class kotlin/Pair
     195: astore        20
     197: aload         20
     199: invokevirtual #203                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     202: checkcast     #239                // class java/lang/Character
     205: invokevirtual #243                // Method java/lang/Character.charValue:()C
     208: istore        21
     210: aload         20
     212: invokevirtual #205                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     215: checkcast     #207                // class java/lang/Number
     218: invokevirtual #210                // Method java/lang/Number.intValue:()I
     221: istore        22
     223: iload         21
     225: invokestatic  #247                // Method java/lang/Character.isDigit:(C)Z
     228: ifeq          260
     231: iload         22
     233: istore        18
     235: new           #249                // class java/lang/StringBuilder
     238: dup
     239: invokespecial #250                // Method java/lang/StringBuilder."<init>":()V
     242: aload         16
     244: invokevirtual #254                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     247: iload         21
     249: invokevirtual #257                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     252: invokevirtual #261                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     255: astore        16
     257: goto          166
     260: aload         16
     262: checkcast     #263                // class java/lang/CharSequence
     265: invokeinterface #266,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     270: ifle          277
     273: iconst_1
     274: goto          278
     277: iconst_0
     278: ifeq          307
     281: aload         19
     283: new           #87                 // class Day3$NumberPosition
     286: dup
     287: aload         16
     289: invokestatic  #272                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     292: iload         17
     294: iload         18
     296: iload         12
     298: invokespecial #275                // Method Day3$NumberPosition."<init>":(IIII)V
     301: invokeinterface #276,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     306: pop
     307: ldc           #234                // String
     309: astore        16
     311: iload         22
     313: iconst_1
     314: iadd
     315: istore        17
     317: iload         22
     319: iconst_1
     320: iadd
     321: istore        18
     323: goto          166
     326: aload         16
     328: checkcast     #263                // class java/lang/CharSequence
     331: invokeinterface #266,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     336: ifle          343
     339: iconst_1
     340: goto          344
     343: iconst_0
     344: ifeq          373
     347: aload         19
     349: new           #87                 // class Day3$NumberPosition
     352: dup
     353: aload         16
     355: invokestatic  #272                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     358: iload         17
     360: iload         18
     362: iload         12
     364: invokespecial #275                // Method Day3$NumberPosition."<init>":(IIII)V
     367: invokeinterface #276,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     372: pop
     373: aload         19
     375: checkcast     #31                 // class java/lang/Iterable
     378: astore        9
     380: aload         5
     382: aload         9
     384: invokestatic  #118                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     387: pop
     388: goto          50
     391: aload         5
     393: checkcast     #120                // class java/util/List
     396: nop
     397: areturn

  private final java.util.List<Day3$Symbol> parseSpecialCharacters(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: checkcast     #31                 // class java/lang/Iterable
       4: astore_3
       5: iconst_0
       6: istore        4
       8: aload_3
       9: astore        5
      11: new           #82                 // class java/util/ArrayList
      14: dup
      15: aload_3
      16: bipush        10
      18: invokestatic  #37                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #292                // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #85                 // class java/util/Collection
      27: astore        6
      29: iconst_0
      30: istore        7
      32: aload         5
      34: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      39: astore        8
      41: aload         8
      43: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      48: ifeq          98
      51: aload         8
      53: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      58: astore        9
      60: aload         6
      62: aload         9
      64: checkcast     #139                // class java/lang/String
      67: astore        10
      69: astore        24
      71: iconst_0
      72: istore        11
      74: aload         10
      76: invokevirtual #214                // Method java/lang/String.toCharArray:()[C
      79: dup
      80: ldc           #216                // String toCharArray(...)
      82: invokestatic  #219                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      85: nop
      86: aload         24
      88: swap
      89: invokeinterface #134,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      94: pop
      95: goto          41
      98: aload         6
     100: checkcast     #120                // class java/util/List
     103: nop
     104: checkcast     #31                 // class java/lang/Iterable
     107: astore_3
     108: nop
     109: iconst_0
     110: istore        4
     112: aload_3
     113: astore        5
     115: new           #82                 // class java/util/ArrayList
     118: dup
     119: aload_3
     120: bipush        10
     122: invokestatic  #37                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     125: invokespecial #292                // Method java/util/ArrayList."<init>":(I)V
     128: checkcast     #85                 // class java/util/Collection
     131: astore        6
     133: iconst_0
     134: istore        7
     136: aload         5
     138: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     143: astore        8
     145: aload         8
     147: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     152: ifeq          203
     155: aload         8
     157: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     162: astore        9
     164: aload         6
     166: aload         9
     168: checkcast     #290                // class "[C"
     171: astore        10
     173: astore        24
     175: iconst_0
     176: istore        11
     178: aload         10
     180: aload         10
     182: invokestatic  #224                // Method kotlin/collections/ArraysKt.getIndices:([C)Lkotlin/ranges/IntRange;
     185: checkcast     #31                 // class java/lang/Iterable
     188: invokestatic  #227                // Method kotlin/collections/ArraysKt.zip:([CLjava/lang/Iterable;)Ljava/util/List;
     191: aload         24
     193: swap
     194: invokeinterface #134,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     199: pop
     200: goto          145
     203: aload         6
     205: checkcast     #120                // class java/util/List
     208: nop
     209: checkcast     #31                 // class java/lang/Iterable
     212: astore_3
     213: nop
     214: iconst_0
     215: istore        4
     217: aload_3
     218: astore        5
     220: new           #82                 // class java/util/ArrayList
     223: dup
     224: aload_3
     225: bipush        10
     227: invokestatic  #37                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     230: invokespecial #292                // Method java/util/ArrayList."<init>":(I)V
     233: checkcast     #85                 // class java/util/Collection
     236: astore        6
     238: iconst_0
     239: istore        7
     241: aload         5
     243: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     248: astore        8
     250: aload         8
     252: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     257: ifeq          517
     260: aload         8
     262: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     267: astore        9
     269: aload         6
     271: aload         9
     273: checkcast     #120                // class java/util/List
     276: astore        10
     278: astore        24
     280: iconst_0
     281: istore        11
     283: aload         10
     285: checkcast     #31                 // class java/lang/Iterable
     288: astore        12
     290: iconst_0
     291: istore        13
     293: aload         12
     295: astore        14
     297: new           #82                 // class java/util/ArrayList
     300: dup
     301: invokespecial #83                 // Method java/util/ArrayList."<init>":()V
     304: checkcast     #85                 // class java/util/Collection
     307: astore        15
     309: iconst_0
     310: istore        16
     312: aload         14
     314: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     319: astore        17
     321: aload         17
     323: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     328: ifeq          388
     331: aload         17
     333: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     338: astore        18
     340: aload         18
     342: checkcast     #200                // class kotlin/Pair
     345: astore        19
     347: iconst_0
     348: istore        20
     350: aload         19
     352: invokevirtual #295                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     355: checkcast     #239                // class java/lang/Character
     358: invokevirtual #243                // Method java/lang/Character.charValue:()C
     361: invokestatic  #247                // Method java/lang/Character.isDigit:(C)Z
     364: ifne          371
     367: iconst_1
     368: goto          372
     371: iconst_0
     372: ifeq          321
     375: aload         15
     377: aload         18
     379: invokeinterface #134,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     384: pop
     385: goto          321
     388: aload         15
     390: checkcast     #120                // class java/util/List
     393: nop
     394: checkcast     #31                 // class java/lang/Iterable
     397: astore        12
     399: nop
     400: iconst_0
     401: istore        13
     403: aload         12
     405: astore        14
     407: new           #82                 // class java/util/ArrayList
     410: dup
     411: invokespecial #83                 // Method java/util/ArrayList."<init>":()V
     414: checkcast     #85                 // class java/util/Collection
     417: astore        15
     419: iconst_0
     420: istore        16
     422: aload         14
     424: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     429: astore        17
     431: aload         17
     433: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     438: ifeq          498
     441: aload         17
     443: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     448: astore        18
     450: aload         18
     452: checkcast     #200                // class kotlin/Pair
     455: astore        19
     457: iconst_0
     458: istore        20
     460: aload         19
     462: invokevirtual #295                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     465: checkcast     #239                // class java/lang/Character
     468: invokevirtual #243                // Method java/lang/Character.charValue:()C
     471: getstatic     #298                // Field reservedSymbol:C
     474: if_icmpeq     481
     477: iconst_1
     478: goto          482
     481: iconst_0
     482: ifeq          431
     485: aload         15
     487: aload         18
     489: invokeinterface #134,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     494: pop
     495: goto          431
     498: aload         15
     500: checkcast     #120                // class java/util/List
     503: nop
     504: nop
     505: aload         24
     507: swap
     508: invokeinterface #134,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     513: pop
     514: goto          250
     517: aload         6
     519: checkcast     #120                // class java/util/List
     522: nop
     523: astore_2
     524: aload_2
     525: checkcast     #31                 // class java/lang/Iterable
     528: aload_2
     529: checkcast     #85                 // class java/util/Collection
     532: invokestatic  #194                // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;
     535: checkcast     #31                 // class java/lang/Iterable
     538: invokestatic  #198                // Method kotlin/collections/CollectionsKt.zip:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;
     541: checkcast     #31                 // class java/lang/Iterable
     544: astore_3
     545: nop
     546: iconst_0
     547: istore        4
     549: aload_3
     550: astore        5
     552: new           #82                 // class java/util/ArrayList
     555: dup
     556: invokespecial #83                 // Method java/util/ArrayList."<init>":()V
     559: checkcast     #85                 // class java/util/Collection
     562: astore        6
     564: iconst_0
     565: istore        7
     567: aload         5
     569: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     574: astore        8
     576: aload         8
     578: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     583: ifeq          779
     586: aload         8
     588: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     593: astore        9
     595: aload         9
     597: checkcast     #200                // class kotlin/Pair
     600: astore        10
     602: iconst_0
     603: istore        11
     605: aload         10
     607: invokevirtual #203                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     610: checkcast     #120                // class java/util/List
     613: astore        12
     615: aload         10
     617: invokevirtual #205                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     620: checkcast     #207                // class java/lang/Number
     623: invokevirtual #210                // Method java/lang/Number.intValue:()I
     626: istore        13
     628: aload         12
     630: checkcast     #31                 // class java/lang/Iterable
     633: astore        14
     635: iconst_0
     636: istore        15
     638: aload         14
     640: astore        16
     642: new           #82                 // class java/util/ArrayList
     645: dup
     646: aload         14
     648: bipush        10
     650: invokestatic  #37                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     653: invokespecial #292                // Method java/util/ArrayList."<init>":(I)V
     656: checkcast     #85                 // class java/util/Collection
     659: astore        17
     661: iconst_0
     662: istore        18
     664: aload         16
     666: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     671: astore        19
     673: aload         19
     675: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     680: ifeq          756
     683: aload         19
     685: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     690: astore        20
     692: aload         17
     694: aload         20
     696: checkcast     #200                // class kotlin/Pair
     699: astore        21
     701: astore        22
     703: iconst_0
     704: istore        23
     706: new           #72                 // class Day3$Symbol
     709: dup
     710: aload         21
     712: invokevirtual #295                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     715: checkcast     #239                // class java/lang/Character
     718: invokevirtual #243                // Method java/lang/Character.charValue:()C
     721: new           #109                // class Day3$Coordinate
     724: dup
     725: aload         21
     727: invokevirtual #301                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     730: checkcast     #207                // class java/lang/Number
     733: invokevirtual #210                // Method java/lang/Number.intValue:()I
     736: iload         13
     738: invokespecial #110                // Method Day3$Coordinate."<init>":(II)V
     741: invokespecial #304                // Method Day3$Symbol."<init>":(CLDay3$Coordinate;)V
     744: aload         22
     746: swap
     747: invokeinterface #134,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     752: pop
     753: goto          673
     756: aload         17
     758: checkcast     #120                // class java/util/List
     761: nop
     762: checkcast     #31                 // class java/lang/Iterable
     765: nop
     766: astore        10
     768: aload         6
     770: aload         10
     772: invokestatic  #118                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     775: pop
     776: goto          576
     779: aload         6
     781: checkcast     #120                // class java/util/List
     784: nop
     785: areturn

  public final java.lang.String part2(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #16                 // String input
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: invokespecial #26                 // Method parseNumbers:(Ljava/util/List;)Ljava/util/List;
      11: astore_2
      12: aload_0
      13: aload_1
      14: invokespecial #29                 // Method parseSpecialCharacters:(Ljava/util/List;)Ljava/util/List;
      17: astore_3
      18: aload_3
      19: checkcast     #31                 // class java/lang/Iterable
      22: astore        5
      24: iconst_0
      25: istore        6
      27: aload         5
      29: astore        7
      31: new           #82                 // class java/util/ArrayList
      34: dup
      35: invokespecial #83                 // Method java/util/ArrayList."<init>":()V
      38: checkcast     #85                 // class java/util/Collection
      41: astore        8
      43: iconst_0
      44: istore        9
      46: aload         7
      48: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      53: astore        10
      55: aload         10
      57: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      62: ifeq          115
      65: aload         10
      67: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      72: astore        11
      74: aload         11
      76: checkcast     #72                 // class Day3$Symbol
      79: astore        12
      81: iconst_0
      82: istore        13
      84: aload         12
      86: invokevirtual #322                // Method Day3$Symbol.getSymbol:()C
      89: bipush        42
      91: if_icmpne     98
      94: iconst_1
      95: goto          99
      98: iconst_0
      99: ifeq          55
     102: aload         8
     104: aload         11
     106: invokeinterface #134,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     111: pop
     112: goto          55
     115: aload         8
     117: checkcast     #120                // class java/util/List
     120: nop
     121: checkcast     #31                 // class java/lang/Iterable
     124: astore        5
     126: nop
     127: iconst_0
     128: istore        6
     130: aload         5
     132: bipush        10
     134: invokestatic  #37                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     137: invokestatic  #43                 // Method kotlin/collections/MapsKt.mapCapacity:(I)I
     140: bipush        16
     142: invokestatic  #49                 // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I
     145: istore        7
     147: aload         5
     149: astore        8
     151: new           #51                 // class java/util/LinkedHashMap
     154: dup
     155: iload         7
     157: invokespecial #54                 // Method java/util/LinkedHashMap."<init>":(I)V
     160: checkcast     #56                 // class java/util/Map
     163: astore        9
     165: iconst_0
     166: istore        10
     168: aload         8
     170: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     175: astore        11
     177: aload         11
     179: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     184: ifeq          229
     187: aload         11
     189: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     194: astore        12
     196: aload         9
     198: aload         12
     200: checkcast     #72                 // class Day3$Symbol
     203: astore        13
     205: astore        24
     207: iconst_0
     208: istore        14
     210: aload         13
     212: invokevirtual #76                 // Method Day3$Symbol.getCoordinate:()LDay3$Coordinate;
     215: aload         24
     217: swap
     218: aload         12
     220: invokeinterface #80,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     225: pop
     226: goto          177
     229: aload         9
     231: nop
     232: astore        4
     234: aload         4
     236: astore        5
     238: iconst_0
     239: istore        6
     241: aload         5
     243: astore        7
     245: new           #82                 // class java/util/ArrayList
     248: dup
     249: aload         5
     251: invokeinterface #325,  1          // InterfaceMethod java/util/Map.size:()I
     256: invokespecial #292                // Method java/util/ArrayList."<init>":(I)V
     259: checkcast     #85                 // class java/util/Collection
     262: astore        8
     264: iconst_0
     265: istore        9
     267: aload         7
     269: invokeinterface #329,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     274: invokeinterface #332,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     279: astore        10
     281: aload         10
     283: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     288: ifeq          343
     291: aload         10
     293: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     298: checkcast     #334                // class java/util/Map$Entry
     301: astore        11
     303: aload         8
     305: aload         11
     307: astore        12
     309: astore        24
     311: iconst_0
     312: istore        13
     314: getstatic     #337                // Field INSTANCE:LDay3;
     317: aload         12
     319: invokeinterface #340,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     324: checkcast     #109                // class Day3$Coordinate
     327: aload_2
     328: invokespecial #344                // Method adjacent:(LDay3$Coordinate;Ljava/util/List;)Ljava/util/List;
     331: aload         24
     333: swap
     334: invokeinterface #134,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     339: pop
     340: goto          281
     343: aload         8
     345: checkcast     #120                // class java/util/List
     348: nop
     349: checkcast     #31                 // class java/lang/Iterable
     352: astore        5
     354: nop
     355: iconst_0
     356: istore        6
     358: aload         5
     360: astore        7
     362: new           #82                 // class java/util/ArrayList
     365: dup
     366: invokespecial #83                 // Method java/util/ArrayList."<init>":()V
     369: checkcast     #85                 // class java/util/Collection
     372: astore        8
     374: iconst_0
     375: istore        9
     377: aload         7
     379: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     384: astore        10
     386: aload         10
     388: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     393: ifeq          447
     396: aload         10
     398: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     403: astore        11
     405: aload         11
     407: checkcast     #120                // class java/util/List
     410: astore        12
     412: iconst_0
     413: istore        13
     415: aload         12
     417: invokeinterface #345,  1          // InterfaceMethod java/util/List.size:()I
     422: iconst_2
     423: if_icmpne     430
     426: iconst_1
     427: goto          431
     430: iconst_0
     431: ifeq          386
     434: aload         8
     436: aload         11
     438: invokeinterface #134,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     443: pop
     444: goto          386
     447: aload         8
     449: checkcast     #120                // class java/util/List
     452: nop
     453: checkcast     #31                 // class java/lang/Iterable
     456: astore        5
     458: nop
     459: iconst_0
     460: istore        6
     462: aload         5
     464: astore        7
     466: new           #82                 // class java/util/ArrayList
     469: dup
     470: aload         5
     472: bipush        10
     474: invokestatic  #37                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     477: invokespecial #292                // Method java/util/ArrayList."<init>":(I)V
     480: checkcast     #85                 // class java/util/Collection
     483: astore        8
     485: iconst_0
     486: istore        9
     488: aload         7
     490: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     495: astore        10
     497: aload         10
     499: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     504: ifeq          757
     507: aload         10
     509: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     514: astore        11
     516: aload         8
     518: aload         11
     520: checkcast     #120                // class java/util/List
     523: astore        12
     525: astore        24
     527: iconst_0
     528: istore        13
     530: aload         12
     532: checkcast     #31                 // class java/lang/Iterable
     535: astore        14
     537: iconst_0
     538: istore        15
     540: aload         14
     542: astore        16
     544: new           #82                 // class java/util/ArrayList
     547: dup
     548: aload         14
     550: bipush        10
     552: invokestatic  #37                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     555: invokespecial #292                // Method java/util/ArrayList."<init>":(I)V
     558: checkcast     #85                 // class java/util/Collection
     561: astore        17
     563: iconst_0
     564: istore        18
     566: aload         16
     568: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     573: astore        19
     575: aload         19
     577: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     582: ifeq          628
     585: aload         19
     587: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     592: astore        20
     594: aload         17
     596: aload         20
     598: checkcast     #87                 // class Day3$NumberPosition
     601: astore        21
     603: astore        22
     605: iconst_0
     606: istore        23
     608: aload         21
     610: invokevirtual #137                // Method Day3$NumberPosition.getNumber:()I
     613: invokestatic  #348                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     616: aload         22
     618: swap
     619: invokeinterface #134,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     624: pop
     625: goto          575
     628: aload         17
     630: checkcast     #120                // class java/util/List
     633: nop
     634: checkcast     #31                 // class java/lang/Iterable
     637: astore        14
     639: nop
     640: iconst_0
     641: istore        15
     643: aload         14
     645: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     650: astore        16
     652: aload         16
     654: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     659: ifne          673
     662: new           #350                // class java/lang/UnsupportedOperationException
     665: dup
     666: ldc_w         #352                // String Empty collection can\'t be reduced.
     669: invokespecial #355                // Method java/lang/UnsupportedOperationException."<init>":(Ljava/lang/String;)V
     672: athrow
     673: aload         16
     675: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     680: astore        17
     682: aload         16
     684: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     689: ifeq          733
     692: aload         17
     694: aload         16
     696: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     701: checkcast     #207                // class java/lang/Number
     704: invokevirtual #210                // Method java/lang/Number.intValue:()I
     707: istore        18
     709: checkcast     #207                // class java/lang/Number
     712: invokevirtual #210                // Method java/lang/Number.intValue:()I
     715: istore        19
     717: iconst_0
     718: istore        20
     720: iload         19
     722: iload         18
     724: imul
     725: invokestatic  #348                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     728: astore        17
     730: goto          682
     733: aload         17
     735: checkcast     #207                // class java/lang/Number
     738: invokevirtual #210                // Method java/lang/Number.intValue:()I
     741: nop
     742: invokestatic  #348                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     745: aload         24
     747: swap
     748: invokeinterface #134,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     753: pop
     754: goto          497
     757: aload         8
     759: checkcast     #120                // class java/util/List
     762: nop
     763: checkcast     #31                 // class java/lang/Iterable
     766: invokestatic  #359                // Method kotlin/collections/CollectionsKt.sumOfInt:(Ljava/lang/Iterable;)I
     769: invokestatic  #143                // Method java/lang/String.valueOf:(I)Ljava/lang/String;
     772: areturn

  private final java.util.List<Day3$NumberPosition> adjacent(Day3$Coordinate, java.util.List<Day3$NumberPosition>);
    Code:
       0: new           #109                // class Day3$Coordinate
       3: dup
       4: aload_1
       5: invokevirtual #379                // Method Day3$Coordinate.getX:()I
       8: aload_1
       9: invokevirtual #382                // Method Day3$Coordinate.getY:()I
      12: iconst_1
      13: isub
      14: invokespecial #110                // Method Day3$Coordinate."<init>":(II)V
      17: astore_3
      18: new           #109                // class Day3$Coordinate
      21: dup
      22: aload_1
      23: invokevirtual #379                // Method Day3$Coordinate.getX:()I
      26: aload_1
      27: invokevirtual #382                // Method Day3$Coordinate.getY:()I
      30: iconst_1
      31: iadd
      32: invokespecial #110                // Method Day3$Coordinate."<init>":(II)V
      35: astore        4
      37: new           #109                // class Day3$Coordinate
      40: dup
      41: aload_1
      42: invokevirtual #379                // Method Day3$Coordinate.getX:()I
      45: iconst_1
      46: isub
      47: aload_1
      48: invokevirtual #382                // Method Day3$Coordinate.getY:()I
      51: invokespecial #110                // Method Day3$Coordinate."<init>":(II)V
      54: astore        5
      56: new           #109                // class Day3$Coordinate
      59: dup
      60: aload_1
      61: invokevirtual #379                // Method Day3$Coordinate.getX:()I
      64: iconst_1
      65: iadd
      66: aload_1
      67: invokevirtual #382                // Method Day3$Coordinate.getY:()I
      70: invokespecial #110                // Method Day3$Coordinate."<init>":(II)V
      73: astore        6
      75: new           #109                // class Day3$Coordinate
      78: dup
      79: aload_1
      80: invokevirtual #379                // Method Day3$Coordinate.getX:()I
      83: iconst_1
      84: isub
      85: aload_1
      86: invokevirtual #382                // Method Day3$Coordinate.getY:()I
      89: iconst_1
      90: isub
      91: invokespecial #110                // Method Day3$Coordinate."<init>":(II)V
      94: astore        7
      96: new           #109                // class Day3$Coordinate
      99: dup
     100: aload_1
     101: invokevirtual #379                // Method Day3$Coordinate.getX:()I
     104: iconst_1
     105: iadd
     106: aload_1
     107: invokevirtual #382                // Method Day3$Coordinate.getY:()I
     110: iconst_1
     111: isub
     112: invokespecial #110                // Method Day3$Coordinate."<init>":(II)V
     115: astore        8
     117: new           #109                // class Day3$Coordinate
     120: dup
     121: aload_1
     122: invokevirtual #379                // Method Day3$Coordinate.getX:()I
     125: iconst_1
     126: isub
     127: aload_1
     128: invokevirtual #382                // Method Day3$Coordinate.getY:()I
     131: iconst_1
     132: iadd
     133: invokespecial #110                // Method Day3$Coordinate."<init>":(II)V
     136: astore        9
     138: new           #109                // class Day3$Coordinate
     141: dup
     142: aload_1
     143: invokevirtual #379                // Method Day3$Coordinate.getX:()I
     146: iconst_1
     147: iadd
     148: aload_1
     149: invokevirtual #382                // Method Day3$Coordinate.getY:()I
     152: iconst_1
     153: iadd
     154: invokespecial #110                // Method Day3$Coordinate."<init>":(II)V
     157: astore        10
     159: bipush        8
     161: anewarray     #109                // class Day3$Coordinate
     164: astore        12
     166: aload         12
     168: iconst_0
     169: aload_3
     170: aastore
     171: aload         12
     173: iconst_1
     174: aload         4
     176: aastore
     177: aload         12
     179: iconst_2
     180: aload         5
     182: aastore
     183: aload         12
     185: iconst_3
     186: aload         6
     188: aastore
     189: aload         12
     191: iconst_4
     192: aload         7
     194: aastore
     195: aload         12
     197: iconst_5
     198: aload         8
     200: aastore
     201: aload         12
     203: bipush        6
     205: aload         9
     207: aastore
     208: aload         12
     210: bipush        7
     212: aload         10
     214: aastore
     215: aload         12
     217: invokestatic  #114                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     220: astore        11
     222: aload_2
     223: checkcast     #31                 // class java/lang/Iterable
     226: astore        12
     228: iconst_0
     229: istore        13
     231: aload         12
     233: astore        14
     235: new           #82                 // class java/util/ArrayList
     238: dup
     239: invokespecial #83                 // Method java/util/ArrayList."<init>":()V
     242: checkcast     #85                 // class java/util/Collection
     245: astore        15
     247: iconst_0
     248: istore        16
     250: aload         14
     252: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     257: astore        17
     259: aload         17
     261: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     266: ifeq          430
     269: aload         17
     271: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     276: astore        18
     278: aload         18
     280: checkcast     #87                 // class Day3$NumberPosition
     283: astore        19
     285: iconst_0
     286: istore        20
     288: aload         11
     290: checkcast     #31                 // class java/lang/Iterable
     293: astore        21
     295: iconst_0
     296: istore        22
     298: aload         21
     300: instanceof    #85                 // class java/util/Collection
     303: ifeq          323
     306: aload         21
     308: checkcast     #85                 // class java/util/Collection
     311: invokeinterface #127,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     316: ifeq          323
     319: iconst_0
     320: goto          413
     323: aload         21
     325: invokeinterface #60,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     330: astore        23
     332: aload         23
     334: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     339: ifeq          412
     342: aload         23
     344: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     349: astore        24
     351: aload         24
     353: checkcast     #109                // class Day3$Coordinate
     356: astore        25
     358: iconst_0
     359: istore        26
     361: aload         25
     363: invokevirtual #379                // Method Day3$Coordinate.getX:()I
     366: aload         19
     368: invokevirtual #385                // Method Day3$NumberPosition.getEnd:()I
     371: if_icmpgt     404
     374: aload         25
     376: invokevirtual #379                // Method Day3$Coordinate.getX:()I
     379: aload         19
     381: invokevirtual #388                // Method Day3$NumberPosition.getStart:()I
     384: if_icmplt     404
     387: aload         25
     389: invokevirtual #382                // Method Day3$Coordinate.getY:()I
     392: aload         19
     394: invokevirtual #391                // Method Day3$NumberPosition.getRow:()I
     397: if_icmpne     404
     400: iconst_1
     401: goto          405
     404: iconst_0
     405: ifeq          332
     408: iconst_1
     409: goto          413
     412: iconst_0
     413: nop
     414: ifeq          259
     417: aload         15
     419: aload         18
     421: invokeinterface #134,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     426: pop
     427: goto          259
     430: aload         15
     432: checkcast     #120                // class java/util/List
     435: nop
     436: areturn

  static {};
    Code:
       0: new           #2                  // class Day3
       3: dup
       4: invokespecial #401                // Method "<init>":()V
       7: putstatic     #337                // Field INSTANCE:LDay3;
      10: ldc_w         #403                // String .
      13: checkcast     #263                // class java/lang/CharSequence
      16: invokestatic  #409                // Method kotlin/text/StringsKt.first:(Ljava/lang/CharSequence;)C
      19: putstatic     #298                // Field reservedSymbol:C
      22: return
}

Compiled from "Day3.kt"
public final class Day3$Symbol {
  private final char symbol;

  private final Day3$Coordinate coordinate;

  public Day3$Symbol(char, Day3$Coordinate);
    Code:
       0: aload_2
       1: ldc           #9                  // String coordinate
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokespecial #18                 // Method java/lang/Object."<init>":()V
      10: aload_0
      11: iload_1
      12: putfield      #22                 // Field symbol:C
      15: aload_0
      16: aload_2
      17: putfield      #25                 // Field coordinate:LDay3$Coordinate;
      20: return

  public final char getSymbol();
    Code:
       0: aload_0
       1: getfield      #22                 // Field symbol:C
       4: ireturn

  public final Day3$Coordinate getCoordinate();
    Code:
       0: aload_0
       1: getfield      #25                 // Field coordinate:LDay3$Coordinate;
       4: areturn

  public final char component1();
    Code:
       0: aload_0
       1: getfield      #22                 // Field symbol:C
       4: ireturn

  public final Day3$Coordinate component2();
    Code:
       0: aload_0
       1: getfield      #25                 // Field coordinate:LDay3$Coordinate;
       4: areturn

  public final Day3$Symbol copy(char, Day3$Coordinate);
    Code:
       0: aload_2
       1: ldc           #9                  // String coordinate
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #2                  // class Day3$Symbol
       9: dup
      10: iload_1
      11: aload_2
      12: invokespecial #37                 // Method "<init>":(CLDay3$Coordinate;)V
      15: areturn

  public static Day3$Symbol copy$default(Day3$Symbol, char, Day3$Coordinate, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #22                 // Field symbol:C
      10: istore_1
      11: iload_3
      12: iconst_2
      13: iand
      14: ifeq          22
      17: aload_0
      18: getfield      #25                 // Field coordinate:LDay3$Coordinate;
      21: astore_2
      22: aload_0
      23: iload_1
      24: aload_2
      25: invokevirtual #41                 // Method copy:(CLDay3$Coordinate;)LDay3$Symbol;
      28: areturn

  public java.lang.String toString();
    Code:
       0: new           #45                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #46                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #48                 // String Symbol(symbol=
       9: invokevirtual #52                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #22                 // Field symbol:C
      16: invokevirtual #55                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      19: ldc           #57                 // String , coordinate=
      21: invokevirtual #52                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #25                 // Field coordinate:LDay3$Coordinate;
      28: invokevirtual #60                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #55                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #62                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      39: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #22                 // Field symbol:C
       4: invokestatic  #69                 // Method java/lang/Character.hashCode:(C)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #25                 // Field coordinate:LDay3$Coordinate;
      16: invokevirtual #73                 // Method Day3$Coordinate.hashCode:()I
      19: iadd
      20: istore_1
      21: iload_1
      22: ireturn

  public boolean equals(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: if_acmpne     7
       5: iconst_1
       6: ireturn
       7: aload_1
       8: instanceof    #2                  // class Day3$Symbol
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day3$Symbol
      20: astore_2
      21: aload_0
      22: getfield      #22                 // Field symbol:C
      25: aload_2
      26: getfield      #22                 // Field symbol:C
      29: if_icmpeq     34
      32: iconst_0
      33: ireturn
      34: aload_0
      35: getfield      #25                 // Field coordinate:LDay3$Coordinate;
      38: aload_2
      39: getfield      #25                 // Field coordinate:LDay3$Coordinate;
      42: invokestatic  #82                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      45: ifne          50
      48: iconst_0
      49: ireturn
      50: iconst_1
      51: ireturn
}

Compiled from "Day3.kt"
public final class Day3$NumberPosition {
  private final int number;

  private final int start;

  private final int end;

  private final int row;

  public Day3$NumberPosition(int, int, int, int);
    Code:
       0: aload_0
       1: invokespecial #9                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: iload_1
       6: putfield      #13                 // Field number:I
       9: aload_0
      10: iload_2
      11: putfield      #16                 // Field start:I
      14: aload_0
      15: iload_3
      16: putfield      #19                 // Field end:I
      19: aload_0
      20: iload         4
      22: putfield      #22                 // Field row:I
      25: return

  public final int getNumber();
    Code:
       0: aload_0
       1: getfield      #13                 // Field number:I
       4: ireturn

  public final int getStart();
    Code:
       0: aload_0
       1: getfield      #16                 // Field start:I
       4: ireturn

  public final int getEnd();
    Code:
       0: aload_0
       1: getfield      #19                 // Field end:I
       4: ireturn

  public final int getRow();
    Code:
       0: aload_0
       1: getfield      #22                 // Field row:I
       4: ireturn

  public final int component1();
    Code:
       0: aload_0
       1: getfield      #13                 // Field number:I
       4: ireturn

  public final int component2();
    Code:
       0: aload_0
       1: getfield      #16                 // Field start:I
       4: ireturn

  public final int component3();
    Code:
       0: aload_0
       1: getfield      #19                 // Field end:I
       4: ireturn

  public final int component4();
    Code:
       0: aload_0
       1: getfield      #22                 // Field row:I
       4: ireturn

  public final Day3$NumberPosition copy(int, int, int, int);
    Code:
       0: new           #2                  // class Day3$NumberPosition
       3: dup
       4: iload_1
       5: iload_2
       6: iload_3
       7: iload         4
       9: invokespecial #38                 // Method "<init>":(IIII)V
      12: areturn

  public static Day3$NumberPosition copy$default(Day3$NumberPosition, int, int, int, int, int, java.lang.Object);
    Code:
       0: iload         5
       2: iconst_1
       3: iand
       4: ifeq          12
       7: aload_0
       8: getfield      #13                 // Field number:I
      11: istore_1
      12: iload         5
      14: iconst_2
      15: iand
      16: ifeq          24
      19: aload_0
      20: getfield      #16                 // Field start:I
      23: istore_2
      24: iload         5
      26: iconst_4
      27: iand
      28: ifeq          36
      31: aload_0
      32: getfield      #19                 // Field end:I
      35: istore_3
      36: iload         5
      38: bipush        8
      40: iand
      41: ifeq          50
      44: aload_0
      45: getfield      #22                 // Field row:I
      48: istore        4
      50: aload_0
      51: iload_1
      52: iload_2
      53: iload_3
      54: iload         4
      56: invokevirtual #42                 // Method copy:(IIII)LDay3$NumberPosition;
      59: areturn

  public java.lang.String toString();
    Code:
       0: new           #46                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #47                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #49                 // String NumberPosition(number=
       9: invokevirtual #53                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field number:I
      16: invokevirtual #56                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #58                 // String , start=
      21: invokevirtual #53                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #16                 // Field start:I
      28: invokevirtual #56                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: ldc           #60                 // String , end=
      33: invokevirtual #53                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      36: aload_0
      37: getfield      #19                 // Field end:I
      40: invokevirtual #56                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      43: ldc           #62                 // String , row=
      45: invokevirtual #53                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      48: aload_0
      49: getfield      #22                 // Field row:I
      52: invokevirtual #56                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      55: bipush        41
      57: invokevirtual #65                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      60: invokevirtual #67                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      63: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #13                 // Field number:I
       4: invokestatic  #73                 // Method java/lang/Integer.hashCode:(I)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #16                 // Field start:I
      16: invokestatic  #73                 // Method java/lang/Integer.hashCode:(I)I
      19: iadd
      20: istore_1
      21: iload_1
      22: bipush        31
      24: imul
      25: aload_0
      26: getfield      #19                 // Field end:I
      29: invokestatic  #73                 // Method java/lang/Integer.hashCode:(I)I
      32: iadd
      33: istore_1
      34: iload_1
      35: bipush        31
      37: imul
      38: aload_0
      39: getfield      #22                 // Field row:I
      42: invokestatic  #73                 // Method java/lang/Integer.hashCode:(I)I
      45: iadd
      46: istore_1
      47: iload_1
      48: ireturn

  public boolean equals(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: if_acmpne     7
       5: iconst_1
       6: ireturn
       7: aload_1
       8: instanceof    #2                  // class Day3$NumberPosition
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day3$NumberPosition
      20: astore_2
      21: aload_0
      22: getfield      #13                 // Field number:I
      25: aload_2
      26: getfield      #13                 // Field number:I
      29: if_icmpeq     34
      32: iconst_0
      33: ireturn
      34: aload_0
      35: getfield      #16                 // Field start:I
      38: aload_2
      39: getfield      #16                 // Field start:I
      42: if_icmpeq     47
      45: iconst_0
      46: ireturn
      47: aload_0
      48: getfield      #19                 // Field end:I
      51: aload_2
      52: getfield      #19                 // Field end:I
      55: if_icmpeq     60
      58: iconst_0
      59: ireturn
      60: aload_0
      61: getfield      #22                 // Field row:I
      64: aload_2
      65: getfield      #22                 // Field row:I
      68: if_icmpeq     73
      71: iconst_0
      72: ireturn
      73: iconst_1
      74: ireturn
}