fun main() {
    val aCode = 'a'.code
    val (startCode, endCode) = arrayOf('S'.code - aCode, 'E'.code - aCode)

    fun neighbours(cell: GridCell<Int>, grid: Grid<Int>) = grid.crossNeighbours(cell.position).filter {
        it.value < cell.value + 2
    }

    fun prepareData(input: List<String>): Triple<Grid<Int>, GridCell<Int>, GridCell<Int>> {
        val grid = Grid(input.map { it.toCharArray().asList().map { char -> char.code - aCode } })
        val start = grid.data.flatten().first { it.value == startCode }.also { it.value = 0 }
        val end = grid.data.flatten().first { it.value == endCode }.also { it.value = 26 }

        return Triple(grid, start, end)
    }

    fun part1(input: List<String>) = prepareData(input).let { (grid, start, end) ->
        grid.path(start, end, neighbours = { neighbours(it, grid) }).size - 1
    }

    fun part2(input: List<String>) = prepareData(input).let { (grid, _, end) ->
        grid.data.asSequence().flatten().filter { it.value == 0 }.map { cell ->
            grid.path(cell, end, neighbours = { neighbours(it, grid) })
        }.filter { it.isNotEmpty() }.minOf { it.size - 1 }
    }

    test(
        day = 12,
        testTarget1 = 31,
        testTarget2 = 29,
        part1 = ::part1,
        part2 = ::part2,
    )
}

Compiled from "Day12.kt"
final class Day12Kt$main$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<java.util.List<? extends java.lang.String>, java.lang.Integer> {
  final int $aCode;

  final int $startCode;

  final int $endCode;

  Day12Kt$main$1(int, int, int);
    Code:
       0: aload_0
       1: iload_1
       2: putfield      #13                 // Field $aCode:I
       5: aload_0
       6: iload_2
       7: putfield      #16                 // Field $startCode:I
      10: aload_0
      11: iload_3
      12: putfield      #19                 // Field $endCode:I
      15: aload_0
      16: iconst_1
      17: ldc           #21                 // class kotlin/jvm/internal/Intrinsics$Kotlin
      19: ldc           #23                 // String part1
      21: ldc           #25                 // String main$part1(IIILjava/util/List;)I
      23: iconst_0
      24: invokespecial #28                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      27: return

  public final java.lang.Integer invoke(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #35                 // String p0
       3: invokestatic  #41                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #13                 // Field $aCode:I
      10: aload_0
      11: getfield      #16                 // Field $startCode:I
      14: aload_0
      15: getfield      #19                 // Field $endCode:I
      18: aload_1
      19: invokestatic  #47                 // Method Day12Kt.access$main$part1:(IIILjava/util/List;)I
      22: invokestatic  #53                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      25: areturn

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #57                 // class java/util/List
       5: invokevirtual #59                 // Method invoke:(Ljava/util/List;)Ljava/lang/Integer;
       8: areturn
}

Compiled from "Day12.kt"
public final class Day12Kt {
  public static final void main();
    Code:
       0: bipush        97
       2: istore_0
       3: iconst_2
       4: anewarray     #8                  // class java/lang/Integer
       7: astore_2
       8: aload_2
       9: iconst_0
      10: bipush        83
      12: iload_0
      13: isub
      14: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      17: aastore
      18: aload_2
      19: iconst_1
      20: bipush        69
      22: iload_0
      23: isub
      24: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      27: aastore
      28: aload_2
      29: astore_1
      30: aload_1
      31: iconst_0
      32: aaload
      33: checkcast     #14                 // class java/lang/Number
      36: invokevirtual #18                 // Method java/lang/Number.intValue:()I
      39: istore_2
      40: aload_1
      41: iconst_1
      42: aaload
      43: checkcast     #14                 // class java/lang/Number
      46: invokevirtual #18                 // Method java/lang/Number.intValue:()I
      49: istore_3
      50: bipush        12
      52: bipush        31
      54: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      57: bipush        29
      59: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      62: new           #20                 // class Day12Kt$main$1
      65: dup
      66: iload_0
      67: iload_2
      68: iload_3
      69: invokespecial #24                 // Method Day12Kt$main$1."<init>":(III)V
      72: checkcast     #26                 // class kotlin/jvm/functions/Function1
      75: new           #28                 // class Day12Kt$main$2
      78: dup
      79: iload_0
      80: iload_2
      81: iload_3
      82: invokespecial #29                 // Method Day12Kt$main$2."<init>":(III)V
      85: checkcast     #26                 // class kotlin/jvm/functions/Function1
      88: invokestatic  #35                 // Method UtilsKt.test:(ILjava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
      91: return

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

  private static final java.util.List<GridCell<java.lang.Integer>> main$neighbours(GridCell<java.lang.Integer>, Grid<java.lang.Integer>);
    Code:
       0: aload_1
       1: aload_0
       2: invokevirtual #53                 // Method GridCell.getPosition:()LVector2d;
       5: invokevirtual #59                 // Method Grid.crossNeighbours:(LVector2d;)Ljava/util/List;
       8: checkcast     #61                 // class java/lang/Iterable
      11: astore_2
      12: iconst_0
      13: istore_3
      14: aload_2
      15: astore        4
      17: new           #63                 // class java/util/ArrayList
      20: dup
      21: invokespecial #65                 // Method java/util/ArrayList."<init>":()V
      24: checkcast     #67                 // class java/util/Collection
      27: astore        5
      29: iconst_0
      30: istore        6
      32: aload         4
      34: invokeinterface #71,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      39: astore        7
      41: aload         7
      43: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      48: ifeq          117
      51: aload         7
      53: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      58: astore        8
      60: aload         8
      62: checkcast     #49                 // class GridCell
      65: astore        9
      67: iconst_0
      68: istore        10
      70: aload         9
      72: invokevirtual #84                 // Method GridCell.getValue:()Ljava/lang/Object;
      75: checkcast     #14                 // class java/lang/Number
      78: invokevirtual #18                 // Method java/lang/Number.intValue:()I
      81: aload_0
      82: invokevirtual #84                 // Method GridCell.getValue:()Ljava/lang/Object;
      85: checkcast     #14                 // class java/lang/Number
      88: invokevirtual #18                 // Method java/lang/Number.intValue:()I
      91: iconst_2
      92: iadd
      93: if_icmpge     100
      96: iconst_1
      97: goto          101
     100: iconst_0
     101: ifeq          41
     104: aload         5
     106: aload         8
     108: invokeinterface #88,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     113: pop
     114: goto          41
     117: aload         5
     119: checkcast     #90                 // class java/util/List
     122: nop
     123: areturn

  private static final kotlin.Triple<Grid<java.lang.Integer>, GridCell<java.lang.Integer>, GridCell<java.lang.Integer>> main$prepareData(int, int, int, java.util.List<java.lang.String>);
    Code:
       0: aload_3
       1: checkcast     #61                 // class java/lang/Iterable
       4: astore        5
       6: iconst_0
       7: istore        6
       9: aload         5
      11: astore        7
      13: new           #63                 // class java/util/ArrayList
      16: dup
      17: aload         5
      19: bipush        10
      21: invokestatic  #114                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      24: invokespecial #117                // Method java/util/ArrayList."<init>":(I)V
      27: checkcast     #67                 // class java/util/Collection
      30: astore        8
      32: iconst_0
      33: istore        9
      35: aload         7
      37: invokeinterface #71,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      42: astore        10
      44: aload         10
      46: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      51: ifeq          208
      54: aload         10
      56: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      61: astore        11
      63: aload         8
      65: aload         11
      67: checkcast     #119                // class java/lang/String
      70: astore        12
      72: astore        24
      74: iconst_0
      75: istore        13
      77: aload         12
      79: invokevirtual #123                // Method java/lang/String.toCharArray:()[C
      82: dup
      83: ldc           #125                // String toCharArray(...)
      85: invokestatic  #131                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      88: invokestatic  #137                // Method kotlin/collections/ArraysKt.asList:([C)Ljava/util/List;
      91: checkcast     #61                 // class java/lang/Iterable
      94: astore        14
      96: iconst_0
      97: istore        15
      99: aload         14
     101: astore        16
     103: new           #63                 // class java/util/ArrayList
     106: dup
     107: aload         14
     109: bipush        10
     111: invokestatic  #114                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     114: invokespecial #117                // Method java/util/ArrayList."<init>":(I)V
     117: checkcast     #67                 // class java/util/Collection
     120: astore        17
     122: iconst_0
     123: istore        18
     125: aload         16
     127: invokeinterface #71,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     132: astore        19
     134: aload         19
     136: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     141: ifeq          189
     144: aload         19
     146: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     151: astore        20
     153: aload         17
     155: aload         20
     157: checkcast     #139                // class java/lang/Character
     160: invokevirtual #143                // Method java/lang/Character.charValue:()C
     163: istore        21
     165: astore        22
     167: iconst_0
     168: istore        23
     170: iload         21
     172: iload_0
     173: isub
     174: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     177: aload         22
     179: swap
     180: invokeinterface #88,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     185: pop
     186: goto          134
     189: aload         17
     191: checkcast     #90                 // class java/util/List
     194: nop
     195: nop
     196: aload         24
     198: swap
     199: invokeinterface #88,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     204: pop
     205: goto          44
     208: aload         8
     210: checkcast     #90                 // class java/util/List
     213: nop
     214: astore        25
     216: new           #55                 // class Grid
     219: dup
     220: aload         25
     222: invokespecial #146                // Method Grid."<init>":(Ljava/util/List;)V
     225: astore        4
     227: aload         4
     229: invokevirtual #150                // Method Grid.getData:()Ljava/util/List;
     232: checkcast     #61                 // class java/lang/Iterable
     235: invokestatic  #154                // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;
     238: checkcast     #61                 // class java/lang/Iterable
     241: astore        6
     243: iconst_0
     244: istore        7
     246: aload         6
     248: invokeinterface #71,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     253: astore        8
     255: aload         8
     257: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     262: ifeq          312
     265: aload         8
     267: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     272: astore        9
     274: aload         9
     276: checkcast     #49                 // class GridCell
     279: astore        10
     281: iconst_0
     282: istore        11
     284: aload         10
     286: invokevirtual #84                 // Method GridCell.getValue:()Ljava/lang/Object;
     289: checkcast     #14                 // class java/lang/Number
     292: invokevirtual #18                 // Method java/lang/Number.intValue:()I
     295: iload_1
     296: if_icmpne     303
     299: iconst_1
     300: goto          304
     303: iconst_0
     304: ifeq          255
     307: aload         9
     309: goto          322
     312: new           #156                // class java/util/NoSuchElementException
     315: dup
     316: ldc           #158                // String Collection contains no element matching the predicate.
     318: invokespecial #161                // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
     321: athrow
     322: astore        6
     324: aload         6
     326: checkcast     #49                 // class GridCell
     329: astore        7
     331: iconst_0
     332: istore        8
     334: aload         7
     336: iconst_0
     337: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     340: invokevirtual #165                // Method GridCell.setValue:(Ljava/lang/Object;)V
     343: aload         6
     345: checkcast     #49                 // class GridCell
     348: astore        5
     350: aload         4
     352: invokevirtual #150                // Method Grid.getData:()Ljava/util/List;
     355: checkcast     #61                 // class java/lang/Iterable
     358: invokestatic  #154                // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;
     361: checkcast     #61                 // class java/lang/Iterable
     364: astore        7
     366: iconst_0
     367: istore        8
     369: aload         7
     371: invokeinterface #71,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     376: astore        9
     378: aload         9
     380: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     385: ifeq          435
     388: aload         9
     390: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     395: astore        10
     397: aload         10
     399: checkcast     #49                 // class GridCell
     402: astore        11
     404: iconst_0
     405: istore        12
     407: aload         11
     409: invokevirtual #84                 // Method GridCell.getValue:()Ljava/lang/Object;
     412: checkcast     #14                 // class java/lang/Number
     415: invokevirtual #18                 // Method java/lang/Number.intValue:()I
     418: iload_2
     419: if_icmpne     426
     422: iconst_1
     423: goto          427
     426: iconst_0
     427: ifeq          378
     430: aload         10
     432: goto          445
     435: new           #156                // class java/util/NoSuchElementException
     438: dup
     439: ldc           #158                // String Collection contains no element matching the predicate.
     441: invokespecial #161                // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
     444: athrow
     445: astore        7
     447: aload         7
     449: checkcast     #49                 // class GridCell
     452: astore        8
     454: iconst_0
     455: istore        9
     457: aload         8
     459: bipush        26
     461: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     464: invokevirtual #165                // Method GridCell.setValue:(Ljava/lang/Object;)V
     467: aload         7
     469: checkcast     #49                 // class GridCell
     472: astore        6
     474: new           #167                // class kotlin/Triple
     477: dup
     478: aload         4
     480: aload         5
     482: aload         6
     484: invokespecial #170                // Method kotlin/Triple."<init>":(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
     487: areturn

  private static final java.util.Collection main$part1$lambda$8$lambda$7(Grid, GridCell);
    Code:
       0: aload_1
       1: ldc           #194                // String it
       3: invokestatic  #197                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: aload_0
       8: invokestatic  #199                // Method main$neighbours:(LGridCell;LGrid;)Ljava/util/List;
      11: checkcast     #67                 // class java/util/Collection
      14: areturn

  private static final int main$part1(int, int, int, java.util.List<java.lang.String>);
    Code:
       0: iload_0
       1: iload_1
       2: iload_2
       3: aload_3
       4: invokestatic  #205                // Method main$prepareData:(IIILjava/util/List;)Lkotlin/Triple;
       7: astore        4
       9: iconst_0
      10: istore        5
      12: aload         4
      14: invokevirtual #208                // Method kotlin/Triple.component1:()Ljava/lang/Object;
      17: checkcast     #55                 // class Grid
      20: astore        6
      22: aload         4
      24: invokevirtual #211                // Method kotlin/Triple.component2:()Ljava/lang/Object;
      27: checkcast     #49                 // class GridCell
      30: astore        7
      32: aload         4
      34: invokevirtual #214                // Method kotlin/Triple.component3:()Ljava/lang/Object;
      37: checkcast     #49                 // class GridCell
      40: astore        8
      42: aload         6
      44: aload         7
      46: aload         8
      48: aconst_null
      49: aload         6
      51: invokedynamic #232,  0            // InvokeDynamic #0:invoke:(LGrid;)Lkotlin/jvm/functions/Function1;
      56: iconst_4
      57: aconst_null
      58: invokestatic  #236                // Method Grid.path$default:(LGrid;LGridCell;LGridCell;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/util/List;
      61: invokeinterface #239,  1          // InterfaceMethod java/util/List.size:()I
      66: iconst_1
      67: isub
      68: nop
      69: ireturn

  private static final boolean main$part2$lambda$14$lambda$9(GridCell);
    Code:
       0: aload_0
       1: ldc           #194                // String it
       3: invokestatic  #197                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokevirtual #84                 // Method GridCell.getValue:()Ljava/lang/Object;
      10: checkcast     #14                 // class java/lang/Number
      13: invokevirtual #18                 // Method java/lang/Number.intValue:()I
      16: ifne          23
      19: iconst_1
      20: goto          24
      23: iconst_0
      24: ireturn

  private static final java.util.Collection main$part2$lambda$14$lambda$11$lambda$10(Grid, GridCell);
    Code:
       0: aload_1
       1: ldc           #194                // String it
       3: invokestatic  #197                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: aload_0
       8: invokestatic  #199                // Method main$neighbours:(LGridCell;LGrid;)Ljava/util/List;
      11: checkcast     #67                 // class java/util/Collection
      14: areturn

  private static final java.util.List main$part2$lambda$14$lambda$11(Grid, GridCell, GridCell);
    Code:
       0: aload_2
       1: ldc           #246                // String cell
       3: invokestatic  #197                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_2
       8: aload_1
       9: aconst_null
      10: aload_0
      11: invokedynamic #250,  0            // InvokeDynamic #1:invoke:(LGrid;)Lkotlin/jvm/functions/Function1;
      16: iconst_4
      17: aconst_null
      18: invokestatic  #236                // Method Grid.path$default:(LGrid;LGridCell;LGridCell;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/util/List;
      21: areturn

  private static final boolean main$part2$lambda$14$lambda$12(java.util.List);
    Code:
       0: aload_0
       1: ldc           #194                // String it
       3: invokestatic  #197                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: checkcast     #67                 // class java/util/Collection
      10: invokeinterface #256,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
      15: ifne          22
      18: iconst_1
      19: goto          23
      22: iconst_0
      23: ireturn

  private static final int main$part2(int, int, int, java.util.List<java.lang.String>);
    Code:
       0: iload_0
       1: iload_1
       2: iload_2
       3: aload_3
       4: invokestatic  #205                // Method main$prepareData:(IIILjava/util/List;)Lkotlin/Triple;
       7: astore        4
       9: iconst_0
      10: istore        5
      12: aload         4
      14: invokevirtual #208                // Method kotlin/Triple.component1:()Ljava/lang/Object;
      17: checkcast     #55                 // class Grid
      20: astore        6
      22: aload         4
      24: invokevirtual #214                // Method kotlin/Triple.component3:()Ljava/lang/Object;
      27: checkcast     #49                 // class GridCell
      30: astore        7
      32: aload         6
      34: invokevirtual #150                // Method Grid.getData:()Ljava/util/List;
      37: checkcast     #61                 // class java/lang/Iterable
      40: invokestatic  #261                // Method kotlin/collections/CollectionsKt.asSequence:(Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;
      43: invokestatic  #267                // Method kotlin/sequences/SequencesKt.flattenSequenceOfIterable:(Lkotlin/sequences/Sequence;)Lkotlin/sequences/Sequence;
      46: invokedynamic #275,  0            // InvokeDynamic #2:invoke:()Lkotlin/jvm/functions/Function1;
      51: invokestatic  #279                // Method kotlin/sequences/SequencesKt.filter:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      54: aload         6
      56: aload         7
      58: invokedynamic #287,  0            // InvokeDynamic #3:invoke:(LGrid;LGridCell;)Lkotlin/jvm/functions/Function1;
      63: invokestatic  #290                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      66: invokedynamic #296,  0            // InvokeDynamic #4:invoke:()Lkotlin/jvm/functions/Function1;
      71: invokestatic  #279                // Method kotlin/sequences/SequencesKt.filter:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      74: invokeinterface #299,  1          // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
      79: astore        8
      81: aload         8
      83: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      88: ifne          99
      91: new           #156                // class java/util/NoSuchElementException
      94: dup
      95: invokespecial #300                // Method java/util/NoSuchElementException."<init>":()V
      98: athrow
      99: aload         8
     101: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     106: checkcast     #90                 // class java/util/List
     109: astore        9
     111: iconst_0
     112: istore        10
     114: aload         9
     116: invokeinterface #239,  1          // InterfaceMethod java/util/List.size:()I
     121: iconst_1
     122: isub
     123: istore        9
     125: aload         8
     127: invokeinterface #77,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     132: ifeq          175
     135: aload         8
     137: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     142: checkcast     #90                 // class java/util/List
     145: astore        10
     147: iconst_0
     148: istore        11
     150: aload         10
     152: invokeinterface #239,  1          // InterfaceMethod java/util/List.size:()I
     157: iconst_1
     158: isub
     159: istore        10
     161: iload         9
     163: iload         10
     165: if_icmple     125
     168: iload         10
     170: istore        9
     172: goto          125
     175: iload         9
     177: nop
     178: nop
     179: ireturn

  public static final int access$main$part1(int, int, int, java.util.List);
    Code:
       0: iload_0
       1: iload_1
       2: iload_2
       3: aload_3
       4: invokestatic  #305                // Method main$part1:(IIILjava/util/List;)I
       7: ireturn

  public static final int access$main$part2(int, int, int, java.util.List);
    Code:
       0: iload_0
       1: iload_1
       2: iload_2
       3: aload_3
       4: invokestatic  #308                // Method main$part2:(IIILjava/util/List;)I
       7: ireturn
}

Compiled from "Day12.kt"
final class Day12Kt$main$2 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<java.util.List<? extends java.lang.String>, java.lang.Integer> {
  final int $aCode;

  final int $startCode;

  final int $endCode;

  Day12Kt$main$2(int, int, int);
    Code:
       0: aload_0
       1: iload_1
       2: putfield      #13                 // Field $aCode:I
       5: aload_0
       6: iload_2
       7: putfield      #16                 // Field $startCode:I
      10: aload_0
      11: iload_3
      12: putfield      #19                 // Field $endCode:I
      15: aload_0
      16: iconst_1
      17: ldc           #21                 // class kotlin/jvm/internal/Intrinsics$Kotlin
      19: ldc           #23                 // String part2
      21: ldc           #25                 // String main$part2(IIILjava/util/List;)I
      23: iconst_0
      24: invokespecial #28                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      27: return

  public final java.lang.Integer invoke(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #35                 // String p0
       3: invokestatic  #41                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #13                 // Field $aCode:I
      10: aload_0
      11: getfield      #16                 // Field $startCode:I
      14: aload_0
      15: getfield      #19                 // Field $endCode:I
      18: aload_1
      19: invokestatic  #47                 // Method Day12Kt.access$main$part2:(IIILjava/util/List;)I
      22: invokestatic  #53                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      25: areturn

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #57                 // class java/util/List
       5: invokevirtual #59                 // Method invoke:(Ljava/util/List;)Ljava/lang/Integer;
       8: areturn
}


fun main() {
    data class ListOrValue(val value: Int? = null, val list: List<ListOrValue>? = null)

    fun parseLine(line: String): ListOrValue = when {
        line.startsWith("[") -> { // find the end
            val list = mutableListOf<ListOrValue>()
            var stackSize = 0
            var accumulator = ""

            for (n in 1 until line.length - 1) {
                accumulator += line[n]

                when {
                    line[n] == '[' -> stackSize++
                    line[n] == ']' -> stackSize--
                    line[n] == ',' && stackSize == 0 -> {
                        list.add(parseLine(accumulator.dropLast(1)))
                        accumulator = ""
                    }
                }
            }

            if (accumulator.isNotBlank())
                list.add(parseLine(accumulator))

            ListOrValue(list = list)
        }

        else -> ListOrValue(value = line.toInt())
    }

    fun compare(left: ListOrValue, right: ListOrValue): Int {
        if (left.value != null && right.value != null) // both are ints
            return left.value.compareTo(right.value)
        else if (left.list != null && right.list != null) {
            for (n in 0 until left.list.size) {
                if (right.list.size < n + 1)
                    return 1

                when (val itemComparison = compare(left.list[n], right.list[n])) {
                    0 -> continue
                    else -> return itemComparison
                }
            }

            if (left.list.size < right.list.size)
                return -1

            return 0
        } else {
            val leftConverted = if (left.value != null) ListOrValue(list = listOf(left)) else left
            val rightConverted = if (right.value != null) ListOrValue(list = listOf(right)) else right

            return compare(leftConverted, rightConverted)
        }
    }

    fun compareStrings(left: String, right: String) = compare(parseLine(left), parseLine(right))

    fun part1(input: List<String>) = input.chunked(3)
        .mapIndexed { index, lines -> Pair(index, compare(parseLine(lines[0]), parseLine(lines[1]))) }
        .filter { it.second < 0 }
        .sumOf { it.first + 1 }

    val dividers = arrayOf("[[2]]", "[[6]]")

    fun part2(input: List<String>) = (input + dividers).asSequence()
        .filter { it.isNotBlank() }
        .sortedWith(::compareStrings)
        .mapIndexed { index, line -> Pair(index + 1, line) }
        .filter { it.second in dividers }
        .map { it.first }
        .reduce(Int::times)

    test(
        day = 13,
        testTarget1 = 13,
        testTarget2 = 140,
        part1 = ::part1,
        part2 = ::part2,
    )
}

Compiled from "Day13.kt"
public final class Day13Kt {
  public static final void main();
    Code:
       0: iconst_2
       1: anewarray     #8                  // class java/lang/String
       4: astore_1
       5: aload_1
       6: iconst_0
       7: ldc           #10                 // String [[2]]
       9: aastore
      10: aload_1
      11: iconst_1
      12: ldc           #12                 // String [[6]]
      14: aastore
      15: aload_1
      16: astore_0
      17: bipush        13
      19: bipush        13
      21: invokestatic  #18                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      24: sipush        140
      27: invokestatic  #18                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      30: getstatic     #24                 // Field Day13Kt$main$1.INSTANCE:LDay13Kt$main$1;
      33: checkcast     #26                 // class kotlin/jvm/functions/Function1
      36: new           #28                 // class Day13Kt$main$2
      39: dup
      40: aload_0
      41: invokespecial #32                 // Method Day13Kt$main$2."<init>":([Ljava/lang/String;)V
      44: checkcast     #26                 // class kotlin/jvm/functions/Function1
      47: invokestatic  #38                 // Method UtilsKt.test:(ILjava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
      50: return

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

  private static final Day13Kt$main$ListOrValue main$parseLine(java.lang.String);
    Code:
       0: nop
       1: aload_0
       2: ldc           #47                 // String [
       4: iconst_0
       5: iconst_2
       6: aconst_null
       7: invokestatic  #53                 // Method kotlin/text/StringsKt.startsWith$default:(Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Z
      10: ifeq          188
      13: new           #55                 // class java/util/ArrayList
      16: dup
      17: invokespecial #57                 // Method java/util/ArrayList."<init>":()V
      20: checkcast     #59                 // class java/util/List
      23: astore_1
      24: iconst_0
      25: istore_2
      26: ldc           #61                 // String
      28: astore_3
      29: iconst_1
      30: istore        4
      32: aload_0
      33: invokevirtual #65                 // Method java/lang/String.length:()I
      36: iconst_1
      37: isub
      38: istore        5
      40: iload         4
      42: iload         5
      44: if_icmpge     145
      47: new           #67                 // class java/lang/StringBuilder
      50: dup
      51: invokespecial #68                 // Method java/lang/StringBuilder."<init>":()V
      54: aload_3
      55: invokevirtual #72                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      58: aload_0
      59: iload         4
      61: invokevirtual #76                 // Method java/lang/String.charAt:(I)C
      64: invokevirtual #79                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      67: invokevirtual #83                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      70: astore_3
      71: nop
      72: aload_0
      73: iload         4
      75: invokevirtual #76                 // Method java/lang/String.charAt:(I)C
      78: bipush        91
      80: if_icmpne     89
      83: iinc          2, 1
      86: goto          139
      89: aload_0
      90: iload         4
      92: invokevirtual #76                 // Method java/lang/String.charAt:(I)C
      95: bipush        93
      97: if_icmpne     106
     100: iinc          2, -1
     103: goto          139
     106: aload_0
     107: iload         4
     109: invokevirtual #76                 // Method java/lang/String.charAt:(I)C
     112: bipush        44
     114: if_icmpne     139
     117: iload_2
     118: ifne          139
     121: aload_1
     122: aload_3
     123: iconst_1
     124: invokestatic  #87                 // Method kotlin/text/StringsKt.dropLast:(Ljava/lang/String;I)Ljava/lang/String;
     127: invokestatic  #89                 // Method main$parseLine:(Ljava/lang/String;)LDay13Kt$main$ListOrValue;
     130: invokeinterface #93,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     135: pop
     136: ldc           #61                 // String
     138: astore_3
     139: iinc          4, 1
     142: goto          40
     145: aload_3
     146: checkcast     #95                 // class java/lang/CharSequence
     149: invokestatic  #99                 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
     152: ifne          159
     155: iconst_1
     156: goto          160
     159: iconst_0
     160: ifeq          174
     163: aload_1
     164: aload_3
     165: invokestatic  #89                 // Method main$parseLine:(Ljava/lang/String;)LDay13Kt$main$ListOrValue;
     168: invokeinterface #93,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     173: pop
     174: new           #101                // class Day13Kt$main$ListOrValue
     177: dup
     178: aconst_null
     179: aload_1
     180: iconst_1
     181: aconst_null
     182: invokespecial #104                // Method Day13Kt$main$ListOrValue."<init>":(Ljava/lang/Integer;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
     185: goto          205
     188: new           #101                // class Day13Kt$main$ListOrValue
     191: dup
     192: aload_0
     193: invokestatic  #108                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     196: invokestatic  #18                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     199: aconst_null
     200: iconst_2
     201: aconst_null
     202: invokespecial #104                // Method Day13Kt$main$ListOrValue."<init>":(Ljava/lang/Integer;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
     205: areturn

  private static final int main$compare(Day13Kt$main$ListOrValue, Day13Kt$main$ListOrValue);
    Code:
       0: aload_0
       1: invokevirtual #122                // Method Day13Kt$main$ListOrValue.getValue:()Ljava/lang/Integer;
       4: ifnull        32
       7: aload_1
       8: invokevirtual #122                // Method Day13Kt$main$ListOrValue.getValue:()Ljava/lang/Integer;
      11: ifnull        32
      14: aload_0
      15: invokevirtual #122                // Method Day13Kt$main$ListOrValue.getValue:()Ljava/lang/Integer;
      18: invokevirtual #125                // Method java/lang/Integer.intValue:()I
      21: aload_1
      22: invokevirtual #122                // Method Day13Kt$main$ListOrValue.getValue:()Ljava/lang/Integer;
      25: invokevirtual #125                // Method java/lang/Integer.intValue:()I
      28: invokestatic  #131                // Method kotlin/jvm/internal/Intrinsics.compare:(II)I
      31: ireturn
      32: aload_0
      33: invokevirtual #135                // Method Day13Kt$main$ListOrValue.getList:()Ljava/util/List;
      36: ifnull        150
      39: aload_1
      40: invokevirtual #135                // Method Day13Kt$main$ListOrValue.getList:()Ljava/util/List;
      43: ifnull        150
      46: iconst_0
      47: istore_2
      48: aload_0
      49: invokevirtual #135                // Method Day13Kt$main$ListOrValue.getList:()Ljava/util/List;
      52: invokeinterface #138,  1          // InterfaceMethod java/util/List.size:()I
      57: istore_3
      58: iload_2
      59: iload_3
      60: if_icmpge     125
      63: aload_1
      64: invokevirtual #135                // Method Day13Kt$main$ListOrValue.getList:()Ljava/util/List;
      67: invokeinterface #138,  1          // InterfaceMethod java/util/List.size:()I
      72: iload_2
      73: iconst_1
      74: iadd
      75: if_icmpge     80
      78: iconst_1
      79: ireturn
      80: aload_0
      81: invokevirtual #135                // Method Day13Kt$main$ListOrValue.getList:()Ljava/util/List;
      84: iload_2
      85: invokeinterface #142,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      90: checkcast     #101                // class Day13Kt$main$ListOrValue
      93: aload_1
      94: invokevirtual #135                // Method Day13Kt$main$ListOrValue.getList:()Ljava/util/List;
      97: iload_2
      98: invokeinterface #142,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     103: checkcast     #101                // class Day13Kt$main$ListOrValue
     106: invokestatic  #144                // Method main$compare:(LDay13Kt$main$ListOrValue;LDay13Kt$main$ListOrValue;)I
     109: istore        4
     111: iload         4
     113: ifeq          119
     116: iload         4
     118: ireturn
     119: iinc          2, 1
     122: goto          58
     125: aload_0
     126: invokevirtual #135                // Method Day13Kt$main$ListOrValue.getList:()Ljava/util/List;
     129: invokeinterface #138,  1          // InterfaceMethod java/util/List.size:()I
     134: aload_1
     135: invokevirtual #135                // Method Day13Kt$main$ListOrValue.getList:()Ljava/util/List;
     138: invokeinterface #138,  1          // InterfaceMethod java/util/List.size:()I
     143: if_icmpge     148
     146: iconst_m1
     147: ireturn
     148: iconst_0
     149: ireturn
     150: aload_0
     151: invokevirtual #122                // Method Day13Kt$main$ListOrValue.getValue:()Ljava/lang/Integer;
     154: ifnull        174
     157: new           #101                // class Day13Kt$main$ListOrValue
     160: dup
     161: aconst_null
     162: aload_0
     163: invokestatic  #150                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
     166: iconst_1
     167: aconst_null
     168: invokespecial #104                // Method Day13Kt$main$ListOrValue."<init>":(Ljava/lang/Integer;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
     171: goto          175
     174: aload_0
     175: astore_2
     176: aload_1
     177: invokevirtual #122                // Method Day13Kt$main$ListOrValue.getValue:()Ljava/lang/Integer;
     180: ifnull        200
     183: new           #101                // class Day13Kt$main$ListOrValue
     186: dup
     187: aconst_null
     188: aload_1
     189: invokestatic  #150                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
     192: iconst_1
     193: aconst_null
     194: invokespecial #104                // Method Day13Kt$main$ListOrValue."<init>":(Ljava/lang/Integer;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
     197: goto          201
     200: aload_1
     201: astore_3
     202: aload_2
     203: aload_3
     204: invokestatic  #144                // Method main$compare:(LDay13Kt$main$ListOrValue;LDay13Kt$main$ListOrValue;)I
     207: ireturn

  private static final int main$compareStrings(java.lang.String, java.lang.String);
    Code:
       0: aload_0
       1: invokestatic  #89                 // Method main$parseLine:(Ljava/lang/String;)LDay13Kt$main$ListOrValue;
       4: aload_1
       5: invokestatic  #89                 // Method main$parseLine:(Ljava/lang/String;)LDay13Kt$main$ListOrValue;
       8: invokestatic  #144                // Method main$compare:(LDay13Kt$main$ListOrValue;LDay13Kt$main$ListOrValue;)I
      11: ireturn

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: checkcast     #163                // class java/lang/Iterable
       4: iconst_3
       5: invokestatic  #167                // Method kotlin/collections/CollectionsKt.chunked:(Ljava/lang/Iterable;I)Ljava/util/List;
       8: checkcast     #163                // class java/lang/Iterable
      11: astore_1
      12: nop
      13: iconst_0
      14: istore_2
      15: aload_1
      16: astore_3
      17: new           #55                 // class java/util/ArrayList
      20: dup
      21: aload_1
      22: bipush        10
      24: invokestatic  #171                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      27: invokespecial #174                // Method java/util/ArrayList."<init>":(I)V
      30: checkcast     #176                // class java/util/Collection
      33: astore        4
      35: iconst_0
      36: istore        5
      38: iconst_0
      39: istore        6
      41: aload_3
      42: invokeinterface #180,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      47: astore        7
      49: aload         7
      51: invokeinterface #186,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      56: ifeq          159
      59: aload         7
      61: invokeinterface #190,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      66: astore        8
      68: aload         4
      70: iload         6
      72: iinc          6, 1
      75: istore        9
      77: iload         9
      79: ifge          85
      82: invokestatic  #193                // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
      85: iload         9
      87: aload         8
      89: checkcast     #59                 // class java/util/List
      92: astore        10
      94: istore        11
      96: astore        13
      98: iconst_0
      99: istore        12
     101: new           #195                // class kotlin/Pair
     104: dup
     105: iload         11
     107: invokestatic  #18                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     110: aload         10
     112: iconst_0
     113: invokeinterface #142,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     118: checkcast     #8                  // class java/lang/String
     121: invokestatic  #89                 // Method main$parseLine:(Ljava/lang/String;)LDay13Kt$main$ListOrValue;
     124: aload         10
     126: iconst_1
     127: invokeinterface #142,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     132: checkcast     #8                  // class java/lang/String
     135: invokestatic  #89                 // Method main$parseLine:(Ljava/lang/String;)LDay13Kt$main$ListOrValue;
     138: invokestatic  #144                // Method main$compare:(LDay13Kt$main$ListOrValue;LDay13Kt$main$ListOrValue;)I
     141: invokestatic  #18                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     144: invokespecial #198                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     147: aload         13
     149: swap
     150: invokeinterface #199,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     155: pop
     156: goto          49
     159: aload         4
     161: checkcast     #59                 // class java/util/List
     164: nop
     165: checkcast     #163                // class java/lang/Iterable
     168: astore_1
     169: nop
     170: iconst_0
     171: istore_2
     172: aload_1
     173: astore_3
     174: new           #55                 // class java/util/ArrayList
     177: dup
     178: invokespecial #57                 // Method java/util/ArrayList."<init>":()V
     181: checkcast     #176                // class java/util/Collection
     184: astore        4
     186: iconst_0
     187: istore        5
     189: aload_3
     190: invokeinterface #180,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     195: astore        6
     197: aload         6
     199: invokeinterface #186,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     204: ifeq          261
     207: aload         6
     209: invokeinterface #190,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     214: astore        7
     216: aload         7
     218: checkcast     #195                // class kotlin/Pair
     221: astore        8
     223: iconst_0
     224: istore        9
     226: aload         8
     228: invokevirtual #202                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     231: checkcast     #204                // class java/lang/Number
     234: invokevirtual #205                // Method java/lang/Number.intValue:()I
     237: ifge          244
     240: iconst_1
     241: goto          245
     244: iconst_0
     245: ifeq          197
     248: aload         4
     250: aload         7
     252: invokeinterface #199,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     257: pop
     258: goto          197
     261: aload         4
     263: checkcast     #59                 // class java/util/List
     266: nop
     267: checkcast     #163                // class java/lang/Iterable
     270: astore_1
     271: iconst_0
     272: istore_2
     273: aload_1
     274: invokeinterface #180,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     279: astore_3
     280: aload_3
     281: invokeinterface #186,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     286: ifeq          334
     289: aload_3
     290: invokeinterface #190,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     295: astore        4
     297: iload_2
     298: aload         4
     300: checkcast     #195                // class kotlin/Pair
     303: astore        5
     305: istore        13
     307: iconst_0
     308: istore        6
     310: aload         5
     312: invokevirtual #208                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     315: checkcast     #204                // class java/lang/Number
     318: invokevirtual #205                // Method java/lang/Number.intValue:()I
     321: iconst_1
     322: iadd
     323: istore        14
     325: iload         13
     327: iload         14
     329: iadd
     330: istore_2
     331: goto          280
     334: iload_2
     335: ireturn

  private static final boolean main$part2$lambda$3(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #234                // String it
       3: invokestatic  #238                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: checkcast     #95                 // class java/lang/CharSequence
      10: invokestatic  #99                 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
      13: ifne          20
      16: iconst_1
      17: goto          21
      20: iconst_0
      21: ireturn

  private static final int main$part2$lambda$4(kotlin.jvm.functions.Function2, java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: aload_2
       3: invokeinterface #246,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
       8: checkcast     #204                // class java/lang/Number
      11: invokevirtual #205                // Method java/lang/Number.intValue:()I
      14: ireturn

  private static final kotlin.Pair main$part2$lambda$5(int, java.lang.String);
    Code:
       0: aload_1
       1: ldc           #253                // String line
       3: invokestatic  #238                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #195                // class kotlin/Pair
       9: dup
      10: iload_0
      11: iconst_1
      12: iadd
      13: invokestatic  #18                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      16: aload_1
      17: invokespecial #198                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      20: areturn

  private static final boolean main$part2$lambda$6(java.lang.String[], kotlin.Pair);
    Code:
       0: aload_1
       1: ldc           #234                // String it
       3: invokestatic  #238                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: invokevirtual #202                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      11: invokestatic  #261                // Method kotlin/collections/ArraysKt.contains:([Ljava/lang/Object;Ljava/lang/Object;)Z
      14: ireturn

  private static final int main$part2$lambda$7(kotlin.Pair);
    Code:
       0: aload_0
       1: ldc           #234                // String it
       3: invokestatic  #238                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokevirtual #208                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      10: checkcast     #204                // class java/lang/Number
      13: invokevirtual #205                // Method java/lang/Number.intValue:()I
      16: ireturn

  private static final int main$part2(java.lang.String[], java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: checkcast     #176                // class java/util/Collection
       4: aload_0
       5: invokestatic  #271                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;[Ljava/lang/Object;)Ljava/util/List;
       8: checkcast     #163                // class java/lang/Iterable
      11: invokestatic  #275                // Method kotlin/collections/CollectionsKt.asSequence:(Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;
      14: invokedynamic #292,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      19: invokestatic  #298                // Method kotlin/sequences/SequencesKt.filter:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      22: getstatic     #303                // Field Day13Kt$main$part2$2.INSTANCE:LDay13Kt$main$part2$2;
      25: checkcast     #242                // class kotlin/jvm/functions/Function2
      28: invokedynamic #311,  0            // InvokeDynamic #1:compare:(Lkotlin/jvm/functions/Function2;)Ljava/util/Comparator;
      33: invokestatic  #315                // Method kotlin/sequences/SequencesKt.sortedWith:(Lkotlin/sequences/Sequence;Ljava/util/Comparator;)Lkotlin/sequences/Sequence;
      36: invokedynamic #324,  0            // InvokeDynamic #2:invoke:()Lkotlin/jvm/functions/Function2;
      41: invokestatic  #328                // Method kotlin/sequences/SequencesKt.mapIndexed:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function2;)Lkotlin/sequences/Sequence;
      44: aload_0
      45: invokedynamic #336,  0            // InvokeDynamic #3:invoke:([Ljava/lang/String;)Lkotlin/jvm/functions/Function1;
      50: invokestatic  #298                // Method kotlin/sequences/SequencesKt.filter:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      53: invokedynamic #342,  0            // InvokeDynamic #4:invoke:()Lkotlin/jvm/functions/Function1;
      58: invokestatic  #345                // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      61: astore_2
      62: nop
      63: iconst_0
      64: istore_3
      65: aload_2
      66: invokeinterface #348,  1          // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
      71: astore        4
      73: aload         4
      75: invokeinterface #186,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      80: ifne          94
      83: new           #350                // class java/lang/UnsupportedOperationException
      86: dup
      87: ldc_w         #352                // String Empty sequence can\'t be reduced.
      90: invokespecial #355                // Method java/lang/UnsupportedOperationException."<init>":(Ljava/lang/String;)V
      93: athrow
      94: aload         4
      96: invokeinterface #190,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     101: astore        5
     103: aload         4
     105: invokeinterface #186,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     110: ifeq          154
     113: aload         5
     115: aload         4
     117: invokeinterface #190,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     122: checkcast     #204                // class java/lang/Number
     125: invokevirtual #205                // Method java/lang/Number.intValue:()I
     128: istore        6
     130: checkcast     #204                // class java/lang/Number
     133: invokevirtual #205                // Method java/lang/Number.intValue:()I
     136: istore        7
     138: iconst_0
     139: istore        8
     141: iload         7
     143: iload         6
     145: imul
     146: invokestatic  #18                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     149: astore        5
     151: goto          103
     154: aload         5
     156: checkcast     #204                // class java/lang/Number
     159: invokevirtual #205                // Method java/lang/Number.intValue:()I
     162: ireturn

  public static final int access$main$part1(java.util.List);
    Code:
       0: aload_0
       1: invokestatic  #365                // Method main$part1:(Ljava/util/List;)I
       4: ireturn

  public static final int access$main$part2(java.lang.String[], java.util.List);
    Code:
       0: aload_0
       1: aload_1
       2: invokestatic  #368                // Method main$part2:([Ljava/lang/String;Ljava/util/List;)I
       5: ireturn

  public static final int access$main$compareStrings(java.lang.String, java.lang.String);
    Code:
       0: aload_0
       1: aload_1
       2: invokestatic  #371                // Method main$compareStrings:(Ljava/lang/String;Ljava/lang/String;)I
       5: ireturn
}

Compiled from "Day13.kt"
public final class Day13Kt$main$ListOrValue {
  private final java.lang.Integer value;

  private final java.util.List<Day13Kt$main$ListOrValue> list;

  public Day13Kt$main$ListOrValue(java.lang.Integer, java.util.List<Day13Kt$main$ListOrValue>);
    Code:
       0: aload_0
       1: invokespecial #10                 // Method java/lang/Object."<init>":()V
       4: aload_0
       5: aload_1
       6: putfield      #14                 // Field value:Ljava/lang/Integer;
       9: aload_0
      10: aload_2
      11: putfield      #18                 // Field list:Ljava/util/List;
      14: return

  public Day13Kt$main$ListOrValue(java.lang.Integer, java.util.List, int, kotlin.jvm.internal.DefaultConstructorMarker);
    Code:
       0: iload_3
       1: iconst_1
       2: iand
       3: ifeq          8
       6: aconst_null
       7: astore_1
       8: iload_3
       9: iconst_2
      10: iand
      11: ifeq          16
      14: aconst_null
      15: astore_2
      16: aload_0
      17: aload_1
      18: aload_2
      19: invokespecial #23                 // Method "<init>":(Ljava/lang/Integer;Ljava/util/List;)V
      22: return

  public final java.lang.Integer getValue();
    Code:
       0: aload_0
       1: getfield      #14                 // Field value:Ljava/lang/Integer;
       4: areturn

  public final java.util.List<Day13Kt$main$ListOrValue> getList();
    Code:
       0: aload_0
       1: getfield      #18                 // Field list:Ljava/util/List;
       4: areturn

  public final java.lang.Integer component1();
    Code:
       0: aload_0
       1: getfield      #14                 // Field value:Ljava/lang/Integer;
       4: areturn

  public final java.util.List<Day13Kt$main$ListOrValue> component2();
    Code:
       0: aload_0
       1: getfield      #18                 // Field list:Ljava/util/List;
       4: areturn

  public final Day13Kt$main$ListOrValue copy(java.lang.Integer, java.util.List<Day13Kt$main$ListOrValue>);
    Code:
       0: new           #2                  // class Day13Kt$main$ListOrValue
       3: dup
       4: aload_1
       5: aload_2
       6: invokespecial #23                 // Method "<init>":(Ljava/lang/Integer;Ljava/util/List;)V
       9: areturn

  public static Day13Kt$main$ListOrValue copy$default(Day13Kt$main$ListOrValue, java.lang.Integer, java.util.List, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #14                 // Field value:Ljava/lang/Integer;
      10: astore_1
      11: iload_3
      12: iconst_2
      13: iand
      14: ifeq          22
      17: aload_0
      18: getfield      #18                 // Field list:Ljava/util/List;
      21: astore_2
      22: aload_0
      23: aload_1
      24: aload_2
      25: invokevirtual #37                 // Method copy:(Ljava/lang/Integer;Ljava/util/List;)LDay13Kt$main$ListOrValue;
      28: areturn

  public java.lang.String toString();
    Code:
       0: new           #41                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #42                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #44                 // String ListOrValue(value=
       9: invokevirtual #48                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #14                 // Field value:Ljava/lang/Integer;
      16: invokevirtual #51                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      19: ldc           #53                 // String , list=
      21: invokevirtual #48                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #18                 // Field list:Ljava/util/List;
      28: invokevirtual #51                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #56                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #58                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      39: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #14                 // Field value:Ljava/lang/Integer;
       4: ifnonnull     11
       7: iconst_0
       8: goto          18
      11: aload_0
      12: getfield      #14                 // Field value:Ljava/lang/Integer;
      15: invokevirtual #62                 // Method java/lang/Object.hashCode:()I
      18: istore_1
      19: iload_1
      20: bipush        31
      22: imul
      23: aload_0
      24: getfield      #18                 // Field list:Ljava/util/List;
      27: ifnonnull     34
      30: iconst_0
      31: goto          41
      34: aload_0
      35: getfield      #18                 // Field list:Ljava/util/List;
      38: invokevirtual #62                 // Method java/lang/Object.hashCode:()I
      41: iadd
      42: istore_1
      43: iload_1
      44: 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 Day13Kt$main$ListOrValue
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day13Kt$main$ListOrValue
      20: astore_2
      21: aload_0
      22: getfield      #14                 // Field value:Ljava/lang/Integer;
      25: aload_2
      26: getfield      #14                 // Field value:Ljava/lang/Integer;
      29: invokestatic  #72                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      32: ifne          37
      35: iconst_0
      36: ireturn
      37: aload_0
      38: getfield      #18                 // Field list:Ljava/util/List;
      41: aload_2
      42: getfield      #18                 // Field list:Ljava/util/List;
      45: invokestatic  #72                 // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      48: ifne          53
      51: iconst_0
      52: ireturn
      53: iconst_1
      54: ireturn
}

Compiled from "Day13.kt"
final class Day13Kt$main$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<java.util.List<? extends java.lang.String>, java.lang.Integer> {
  public static final Day13Kt$main$1 INSTANCE;

  Day13Kt$main$1();
    Code:
       0: aload_0
       1: iconst_1
       2: ldc           #11                 // class kotlin/jvm/internal/Intrinsics$Kotlin
       4: ldc           #13                 // String part1
       6: ldc           #15                 // String main$part1(Ljava/util/List;)I
       8: iconst_0
       9: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      12: return

  public final java.lang.Integer invoke(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #25                 // String p0
       3: invokestatic  #31                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokestatic  #37                 // Method Day13Kt.access$main$part1:(Ljava/util/List;)I
      10: invokestatic  #43                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      13: areturn

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #47                 // class java/util/List
       5: invokevirtual #49                 // Method invoke:(Ljava/util/List;)Ljava/lang/Integer;
       8: areturn

  static {};
    Code:
       0: new           #2                  // class Day13Kt$main$1
       3: dup
       4: invokespecial #54                 // Method "<init>":()V
       7: putstatic     #57                 // Field INSTANCE:LDay13Kt$main$1;
      10: return
}

Compiled from "Day13.kt"
final class Day13Kt$main$part2$2 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function2<java.lang.String, java.lang.String, java.lang.Integer> {
  public static final Day13Kt$main$part2$2 INSTANCE;

  Day13Kt$main$part2$2();
    Code:
       0: aload_0
       1: iconst_2
       2: ldc           #11                 // class kotlin/jvm/internal/Intrinsics$Kotlin
       4: ldc           #13                 // String compareStrings
       6: ldc           #15                 // String main$compareStrings(Ljava/lang/String;Ljava/lang/String;)I
       8: iconst_0
       9: invokespecial #18                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      12: return

  public final java.lang.Integer invoke(java.lang.String, java.lang.String);
    Code:
       0: aload_1
       1: ldc           #24                 // String p0
       3: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #32                 // String p1
       9: invokestatic  #30                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_1
      13: aload_2
      14: invokestatic  #38                 // Method Day13Kt.access$main$compareStrings:(Ljava/lang/String;Ljava/lang/String;)I
      17: invokestatic  #44                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      20: areturn

  public java.lang.Object invoke(java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #48                 // class java/lang/String
       5: aload_2
       6: checkcast     #48                 // class java/lang/String
       9: invokevirtual #50                 // Method invoke:(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Integer;
      12: areturn

  static {};
    Code:
       0: new           #2                  // class Day13Kt$main$part2$2
       3: dup
       4: invokespecial #55                 // Method "<init>":()V
       7: putstatic     #58                 // Field INSTANCE:LDay13Kt$main$part2$2;
      10: return
}

Compiled from "Day13.kt"
final class Day13Kt$main$2 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<java.util.List<? extends java.lang.String>, java.lang.Integer> {
  final java.lang.String[] $dividers;

  Day13Kt$main$2(java.lang.String[]);
    Code:
       0: aload_0
       1: aload_1
       2: putfield      #13                 // Field $dividers:[Ljava/lang/String;
       5: aload_0
       6: iconst_1
       7: ldc           #15                 // class kotlin/jvm/internal/Intrinsics$Kotlin
       9: ldc           #17                 // String part2
      11: ldc           #19                 // String main$part2([Ljava/lang/String;Ljava/util/List;)I
      13: iconst_0
      14: invokespecial #22                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      17: return

  public final java.lang.Integer invoke(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #29                 // String p0
       3: invokestatic  #35                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #13                 // Field $dividers:[Ljava/lang/String;
      10: aload_1
      11: invokestatic  #41                 // Method Day13Kt.access$main$part2:([Ljava/lang/String;Ljava/util/List;)I
      14: invokestatic  #47                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      17: areturn

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #51                 // class java/util/List
       5: invokevirtual #53                 // Method invoke:(Ljava/util/List;)Ljava/lang/Integer;
       8: areturn
}


fun main() {
    val lowerScoreOffset = 'a'.code - 1
    val upperScoreOffset = 'A'.code - 1 - 26

    fun Char.priority(): Int = this.code - (if (this.code > lowerScoreOffset) lowerScoreOffset else upperScoreOffset)

    fun part1(input: List<String>): Int = input.sumOf { items ->
        items.chunked(items.length / 2)
            .map { it.toSet() }
            .reduce { a, b -> a.intersect(b) }
            .first()
            .priority()
    }

    fun part2(input: List<String>): Int = input.chunked(3).sumOf { group ->
        group.map { it.toSet() }
            .reduce { a, b -> a.intersect(b) }
            .first()
            .priority()
    }

    test(
        day = 3,
        testTarget1 = 157,
        testTarget2 = 70,
        part1 = ::part1,
        part2 = ::part2,
    )
}

Compiled from "Day03.kt"
public final class Day03Kt {
  public static final void main();
    Code:
       0: bipush        96
       2: istore_0
       3: bipush        38
       5: istore_1
       6: iconst_3
       7: sipush        157
      10: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      13: bipush        70
      15: invokestatic  #12                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      18: new           #14                 // class Day03Kt$main$1
      21: dup
      22: iload_0
      23: iload_1
      24: invokespecial #18                 // Method Day03Kt$main$1."<init>":(II)V
      27: checkcast     #20                 // class kotlin/jvm/functions/Function1
      30: new           #22                 // class Day03Kt$main$2
      33: dup
      34: iload_0
      35: iload_1
      36: invokespecial #23                 // Method Day03Kt$main$2."<init>":(II)V
      39: checkcast     #20                 // class kotlin/jvm/functions/Function1
      42: invokestatic  #29                 // Method UtilsKt.test:(ILjava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
      45: return

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

  private static final int main$priority(char, int, int);
    Code:
       0: iload_0
       1: iload_0
       2: iload_1
       3: if_icmple     10
       6: iload_1
       7: goto          11
      10: iload_2
      11: isub
      12: ireturn

  private static final int main$part1(int, int, java.util.List<java.lang.String>);
    Code:
       0: aload_2
       1: checkcast     #46                 // class java/lang/Iterable
       4: astore_3
       5: iconst_0
       6: istore        4
       8: aload_3
       9: invokeinterface #50,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      14: astore        5
      16: aload         5
      18: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      23: ifeq          295
      26: aload         5
      28: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      33: astore        6
      35: iload         4
      37: aload         6
      39: checkcast     #62                 // class java/lang/String
      42: astore        7
      44: istore        19
      46: iconst_0
      47: istore        8
      49: aload         7
      51: checkcast     #64                 // class java/lang/CharSequence
      54: aload         7
      56: invokevirtual #68                 // Method java/lang/String.length:()I
      59: iconst_2
      60: idiv
      61: invokestatic  #74                 // Method kotlin/text/StringsKt.chunked:(Ljava/lang/CharSequence;I)Ljava/util/List;
      64: checkcast     #46                 // class java/lang/Iterable
      67: astore        9
      69: nop
      70: iconst_0
      71: istore        10
      73: aload         9
      75: astore        11
      77: new           #76                 // class java/util/ArrayList
      80: dup
      81: aload         9
      83: bipush        10
      85: invokestatic  #82                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      88: invokespecial #85                 // Method java/util/ArrayList."<init>":(I)V
      91: checkcast     #87                 // class java/util/Collection
      94: astore        12
      96: iconst_0
      97: istore        13
      99: aload         11
     101: invokeinterface #50,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     106: astore        14
     108: aload         14
     110: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     115: ifeq          161
     118: aload         14
     120: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     125: astore        15
     127: aload         12
     129: aload         15
     131: checkcast     #62                 // class java/lang/String
     134: astore        16
     136: astore        17
     138: iconst_0
     139: istore        18
     141: aload         16
     143: checkcast     #64                 // class java/lang/CharSequence
     146: invokestatic  #91                 // Method kotlin/text/StringsKt.toSet:(Ljava/lang/CharSequence;)Ljava/util/Set;
     149: aload         17
     151: swap
     152: invokeinterface #95,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     157: pop
     158: goto          108
     161: aload         12
     163: checkcast     #97                 // class java/util/List
     166: nop
     167: checkcast     #46                 // class java/lang/Iterable
     170: astore        9
     172: nop
     173: iconst_0
     174: istore        10
     176: aload         9
     178: invokeinterface #50,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     183: astore        11
     185: aload         11
     187: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     192: ifne          205
     195: new           #99                 // class java/lang/UnsupportedOperationException
     198: dup
     199: ldc           #101                // String Empty collection can\'t be reduced.
     201: invokespecial #104                // Method java/lang/UnsupportedOperationException."<init>":(Ljava/lang/String;)V
     204: athrow
     205: aload         11
     207: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     212: astore        12
     214: aload         11
     216: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     221: ifeq          264
     224: aload         12
     226: aload         11
     228: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     233: checkcast     #106                // class java/util/Set
     236: astore        13
     238: checkcast     #106                // class java/util/Set
     241: astore        14
     243: iconst_0
     244: istore        15
     246: aload         14
     248: checkcast     #46                 // class java/lang/Iterable
     251: aload         13
     253: checkcast     #46                 // class java/lang/Iterable
     256: invokestatic  #110                // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;
     259: astore        12
     261: goto          214
     264: aload         12
     266: checkcast     #46                 // class java/lang/Iterable
     269: invokestatic  #114                // Method kotlin/collections/CollectionsKt.first:(Ljava/lang/Iterable;)Ljava/lang/Object;
     272: checkcast     #116                // class java/lang/Character
     275: invokevirtual #120                // Method java/lang/Character.charValue:()C
     278: iload_0
     279: iload_1
     280: invokestatic  #122                // Method main$priority:(CII)I
     283: istore        20
     285: iload         19
     287: iload         20
     289: iadd
     290: istore        4
     292: goto          16
     295: iload         4
     297: ireturn

  private static final int main$part2(int, int, java.util.List<java.lang.String>);
    Code:
       0: aload_2
       1: checkcast     #46                 // class java/lang/Iterable
       4: iconst_3
       5: invokestatic  #151                // Method kotlin/collections/CollectionsKt.chunked:(Ljava/lang/Iterable;I)Ljava/util/List;
       8: checkcast     #46                 // class java/lang/Iterable
      11: astore_3
      12: iconst_0
      13: istore        4
      15: aload_3
      16: invokeinterface #50,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      21: astore        5
      23: aload         5
      25: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      30: ifeq          288
      33: aload         5
      35: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      40: astore        6
      42: iload         4
      44: aload         6
      46: checkcast     #97                 // class java/util/List
      49: astore        7
      51: istore        19
      53: iconst_0
      54: istore        8
      56: aload         7
      58: checkcast     #46                 // class java/lang/Iterable
      61: astore        9
      63: iconst_0
      64: istore        10
      66: aload         9
      68: astore        11
      70: new           #76                 // class java/util/ArrayList
      73: dup
      74: aload         9
      76: bipush        10
      78: invokestatic  #82                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      81: invokespecial #85                 // Method java/util/ArrayList."<init>":(I)V
      84: checkcast     #87                 // class java/util/Collection
      87: astore        12
      89: iconst_0
      90: istore        13
      92: aload         11
      94: invokeinterface #50,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      99: astore        14
     101: aload         14
     103: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     108: ifeq          154
     111: aload         14
     113: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     118: astore        15
     120: aload         12
     122: aload         15
     124: checkcast     #62                 // class java/lang/String
     127: astore        16
     129: astore        17
     131: iconst_0
     132: istore        18
     134: aload         16
     136: checkcast     #64                 // class java/lang/CharSequence
     139: invokestatic  #91                 // Method kotlin/text/StringsKt.toSet:(Ljava/lang/CharSequence;)Ljava/util/Set;
     142: aload         17
     144: swap
     145: invokeinterface #95,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     150: pop
     151: goto          101
     154: aload         12
     156: checkcast     #97                 // class java/util/List
     159: nop
     160: checkcast     #46                 // class java/lang/Iterable
     163: astore        9
     165: nop
     166: iconst_0
     167: istore        10
     169: aload         9
     171: invokeinterface #50,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     176: astore        11
     178: aload         11
     180: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     185: ifne          198
     188: new           #99                 // class java/lang/UnsupportedOperationException
     191: dup
     192: ldc           #101                // String Empty collection can\'t be reduced.
     194: invokespecial #104                // Method java/lang/UnsupportedOperationException."<init>":(Ljava/lang/String;)V
     197: athrow
     198: aload         11
     200: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     205: astore        12
     207: aload         11
     209: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     214: ifeq          257
     217: aload         12
     219: aload         11
     221: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     226: checkcast     #106                // class java/util/Set
     229: astore        13
     231: checkcast     #106                // class java/util/Set
     234: astore        14
     236: iconst_0
     237: istore        15
     239: aload         14
     241: checkcast     #46                 // class java/lang/Iterable
     244: aload         13
     246: checkcast     #46                 // class java/lang/Iterable
     249: invokestatic  #110                // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;
     252: astore        12
     254: goto          207
     257: aload         12
     259: checkcast     #46                 // class java/lang/Iterable
     262: invokestatic  #114                // Method kotlin/collections/CollectionsKt.first:(Ljava/lang/Iterable;)Ljava/lang/Object;
     265: checkcast     #116                // class java/lang/Character
     268: invokevirtual #120                // Method java/lang/Character.charValue:()C
     271: iload_0
     272: iload_1
     273: invokestatic  #122                // Method main$priority:(CII)I
     276: istore        20
     278: iload         19
     280: iload         20
     282: iadd
     283: istore        4
     285: goto          23
     288: iload         4
     290: ireturn

  public static final int access$main$part1(int, int, java.util.List);
    Code:
       0: iload_0
       1: iload_1
       2: aload_2
       3: invokestatic  #158                // Method main$part1:(IILjava/util/List;)I
       6: ireturn

  public static final int access$main$part2(int, int, java.util.List);
    Code:
       0: iload_0
       1: iload_1
       2: aload_2
       3: invokestatic  #161                // Method main$part2:(IILjava/util/List;)I
       6: ireturn
}

Compiled from "Day03.kt"
final class Day03Kt$main$2 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<java.util.List<? extends java.lang.String>, java.lang.Integer> {
  final int $lowerScoreOffset;

  final int $upperScoreOffset;

  Day03Kt$main$2(int, int);
    Code:
       0: aload_0
       1: iload_1
       2: putfield      #13                 // Field $lowerScoreOffset:I
       5: aload_0
       6: iload_2
       7: putfield      #16                 // Field $upperScoreOffset:I
      10: aload_0
      11: iconst_1
      12: ldc           #18                 // class kotlin/jvm/internal/Intrinsics$Kotlin
      14: ldc           #20                 // String part2
      16: ldc           #22                 // String main$part2(IILjava/util/List;)I
      18: iconst_0
      19: invokespecial #25                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      22: return

  public final java.lang.Integer invoke(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #32                 // String p0
       3: invokestatic  #38                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #13                 // Field $lowerScoreOffset:I
      10: aload_0
      11: getfield      #16                 // Field $upperScoreOffset:I
      14: aload_1
      15: invokestatic  #44                 // Method Day03Kt.access$main$part2:(IILjava/util/List;)I
      18: invokestatic  #50                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      21: areturn

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #54                 // class java/util/List
       5: invokevirtual #56                 // Method invoke:(Ljava/util/List;)Ljava/lang/Integer;
       8: areturn
}

Compiled from "Day03.kt"
final class Day03Kt$main$1 extends kotlin.jvm.internal.FunctionReferenceImpl implements kotlin.jvm.functions.Function1<java.util.List<? extends java.lang.String>, java.lang.Integer> {
  final int $lowerScoreOffset;

  final int $upperScoreOffset;

  Day03Kt$main$1(int, int);
    Code:
       0: aload_0
       1: iload_1
       2: putfield      #13                 // Field $lowerScoreOffset:I
       5: aload_0
       6: iload_2
       7: putfield      #16                 // Field $upperScoreOffset:I
      10: aload_0
      11: iconst_1
      12: ldc           #18                 // class kotlin/jvm/internal/Intrinsics$Kotlin
      14: ldc           #20                 // String part1
      16: ldc           #22                 // String main$part1(IILjava/util/List;)I
      18: iconst_0
      19: invokespecial #25                 // Method kotlin/jvm/internal/FunctionReferenceImpl."<init>":(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
      22: return

  public final java.lang.Integer invoke(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #32                 // String p0
       3: invokestatic  #38                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #13                 // Field $lowerScoreOffset:I
      10: aload_0
      11: getfield      #16                 // Field $upperScoreOffset:I
      14: aload_1
      15: invokestatic  #44                 // Method Day03Kt.access$main$part1:(IILjava/util/List;)I
      18: invokestatic  #50                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      21: areturn

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: checkcast     #54                 // class java/util/List
       5: invokevirtual #56                 // Method invoke:(Ljava/util/List;)Ljava/lang/Integer;
       8: areturn
}