fun main() {
    val input = readInput("Day04")
    println(Day04.part1(input))
    println(Day04.part2(input))
}

class Day04 {
    companion object {
        fun part1(input: List<String>): Int {
            return input.filter { it: String ->
                val (a1, a2, b1, b2) = it.split(",")
                    .map { it.split("-").map { point -> point.toInt() } }.flatten()
                a1 in b1..b2 || b2 in a1..a2
            }.size
        }

        fun part2(input: List<String>): Int {
            return input.filter { it: String ->
                val (a1, a2, b1, b2) = it.split(",")
                    .map { it.split("-").map { point -> point.toInt() } }.flatten()
                a1 in b1..b2 || b1 in a1..a2

            }.size
        }

    }
}

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

  public final int 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_1
       7: checkcast     #24                 // class java/lang/Iterable
      10: astore_2
      11: iconst_0
      12: istore_3
      13: aload_2
      14: astore        4
      16: new           #26                 // class java/util/ArrayList
      19: dup
      20: invokespecial #27                 // Method java/util/ArrayList."<init>":()V
      23: checkcast     #29                 // class java/util/Collection
      26: astore        5
      28: iconst_0
      29: istore        6
      31: aload         4
      33: invokeinterface #33,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      38: astore        7
      40: aload         7
      42: invokeinterface #39,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      47: ifeq          467
      50: aload         7
      52: invokeinterface #43,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: astore        8
      59: aload         8
      61: checkcast     #45                 // class java/lang/String
      64: astore        9
      66: iconst_0
      67: istore        10
      69: aload         9
      71: checkcast     #47                 // class java/lang/CharSequence
      74: iconst_1
      75: anewarray     #45                 // class java/lang/String
      78: astore        11
      80: aload         11
      82: iconst_0
      83: ldc           #49                 // String ,
      85: aastore
      86: aload         11
      88: iconst_0
      89: iconst_0
      90: bipush        6
      92: aconst_null
      93: invokestatic  #55                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      96: checkcast     #24                 // class java/lang/Iterable
      99: astore        11
     101: nop
     102: iconst_0
     103: istore        12
     105: aload         11
     107: astore        13
     109: new           #26                 // class java/util/ArrayList
     112: dup
     113: aload         11
     115: bipush        10
     117: invokestatic  #61                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     120: invokespecial #64                 // Method java/util/ArrayList."<init>":(I)V
     123: checkcast     #29                 // class java/util/Collection
     126: astore        14
     128: iconst_0
     129: istore        15
     131: aload         13
     133: invokeinterface #33,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     138: astore        16
     140: aload         16
     142: invokeinterface #39,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     147: ifeq          316
     150: aload         16
     152: invokeinterface #43,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     157: astore        17
     159: aload         14
     161: aload         17
     163: checkcast     #45                 // class java/lang/String
     166: astore        18
     168: astore        19
     170: iconst_0
     171: istore        20
     173: aload         18
     175: checkcast     #47                 // class java/lang/CharSequence
     178: iconst_1
     179: anewarray     #45                 // class java/lang/String
     182: astore        21
     184: aload         21
     186: iconst_0
     187: ldc           #66                 // String -
     189: aastore
     190: aload         21
     192: iconst_0
     193: iconst_0
     194: bipush        6
     196: aconst_null
     197: invokestatic  #55                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     200: checkcast     #24                 // class java/lang/Iterable
     203: astore        21
     205: iconst_0
     206: istore        22
     208: aload         21
     210: astore        23
     212: new           #26                 // class java/util/ArrayList
     215: dup
     216: aload         21
     218: bipush        10
     220: invokestatic  #61                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     223: invokespecial #64                 // Method java/util/ArrayList."<init>":(I)V
     226: checkcast     #29                 // class java/util/Collection
     229: astore        24
     231: iconst_0
     232: istore        25
     234: aload         23
     236: invokeinterface #33,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     241: astore        26
     243: aload         26
     245: invokeinterface #39,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     250: ifeq          297
     253: aload         26
     255: invokeinterface #43,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     260: astore        27
     262: aload         24
     264: aload         27
     266: checkcast     #45                 // class java/lang/String
     269: astore        28
     271: astore        29
     273: iconst_0
     274: istore        30
     276: aload         28
     278: invokestatic  #72                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     281: nop
     282: invokestatic  #76                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     285: aload         29
     287: swap
     288: invokeinterface #80,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     293: pop
     294: goto          243
     297: aload         24
     299: checkcast     #82                 // class java/util/List
     302: nop
     303: nop
     304: aload         19
     306: swap
     307: invokeinterface #80,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     312: pop
     313: goto          140
     316: aload         14
     318: checkcast     #82                 // class java/util/List
     321: nop
     322: checkcast     #24                 // class java/lang/Iterable
     325: invokestatic  #86                 // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;
     328: astore        31
     330: aload         31
     332: iconst_0
     333: invokeinterface #90,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     338: checkcast     #92                 // class java/lang/Number
     341: invokevirtual #96                 // Method java/lang/Number.intValue:()I
     344: istore        11
     346: aload         31
     348: iconst_1
     349: invokeinterface #90,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     354: checkcast     #92                 // class java/lang/Number
     357: invokevirtual #96                 // Method java/lang/Number.intValue:()I
     360: istore        12
     362: aload         31
     364: iconst_2
     365: invokeinterface #90,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     370: checkcast     #92                 // class java/lang/Number
     373: invokevirtual #96                 // Method java/lang/Number.intValue:()I
     376: istore        13
     378: aload         31
     380: iconst_3
     381: invokeinterface #90,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     386: checkcast     #92                 // class java/lang/Number
     389: invokevirtual #96                 // Method java/lang/Number.intValue:()I
     392: istore        14
     394: iload         13
     396: iload         11
     398: if_icmpgt     416
     401: iload         11
     403: iload         14
     405: if_icmpgt     412
     408: iconst_1
     409: goto          417
     412: iconst_0
     413: goto          417
     416: iconst_0
     417: ifne          446
     420: iload         11
     422: iload         14
     424: if_icmpgt     442
     427: iload         14
     429: iload         12
     431: if_icmpgt     438
     434: iconst_1
     435: goto          443
     438: iconst_0
     439: goto          443
     442: iconst_0
     443: ifeq          450
     446: iconst_1
     447: goto          451
     450: iconst_0
     451: ifeq          40
     454: aload         5
     456: aload         8
     458: invokeinterface #80,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     463: pop
     464: goto          40
     467: aload         5
     469: checkcast     #82                 // class java/util/List
     472: nop
     473: invokeinterface #99,  1           // InterfaceMethod java/util/List.size:()I
     478: ireturn

  public final int 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_1
       7: checkcast     #24                 // class java/lang/Iterable
      10: astore_2
      11: iconst_0
      12: istore_3
      13: aload_2
      14: astore        4
      16: new           #26                 // class java/util/ArrayList
      19: dup
      20: invokespecial #27                 // Method java/util/ArrayList."<init>":()V
      23: checkcast     #29                 // class java/util/Collection
      26: astore        5
      28: iconst_0
      29: istore        6
      31: aload         4
      33: invokeinterface #33,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      38: astore        7
      40: aload         7
      42: invokeinterface #39,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      47: ifeq          467
      50: aload         7
      52: invokeinterface #43,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: astore        8
      59: aload         8
      61: checkcast     #45                 // class java/lang/String
      64: astore        9
      66: iconst_0
      67: istore        10
      69: aload         9
      71: checkcast     #47                 // class java/lang/CharSequence
      74: iconst_1
      75: anewarray     #45                 // class java/lang/String
      78: astore        11
      80: aload         11
      82: iconst_0
      83: ldc           #49                 // String ,
      85: aastore
      86: aload         11
      88: iconst_0
      89: iconst_0
      90: bipush        6
      92: aconst_null
      93: invokestatic  #55                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      96: checkcast     #24                 // class java/lang/Iterable
      99: astore        11
     101: nop
     102: iconst_0
     103: istore        12
     105: aload         11
     107: astore        13
     109: new           #26                 // class java/util/ArrayList
     112: dup
     113: aload         11
     115: bipush        10
     117: invokestatic  #61                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     120: invokespecial #64                 // Method java/util/ArrayList."<init>":(I)V
     123: checkcast     #29                 // class java/util/Collection
     126: astore        14
     128: iconst_0
     129: istore        15
     131: aload         13
     133: invokeinterface #33,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     138: astore        16
     140: aload         16
     142: invokeinterface #39,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     147: ifeq          316
     150: aload         16
     152: invokeinterface #43,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     157: astore        17
     159: aload         14
     161: aload         17
     163: checkcast     #45                 // class java/lang/String
     166: astore        18
     168: astore        19
     170: iconst_0
     171: istore        20
     173: aload         18
     175: checkcast     #47                 // class java/lang/CharSequence
     178: iconst_1
     179: anewarray     #45                 // class java/lang/String
     182: astore        21
     184: aload         21
     186: iconst_0
     187: ldc           #66                 // String -
     189: aastore
     190: aload         21
     192: iconst_0
     193: iconst_0
     194: bipush        6
     196: aconst_null
     197: invokestatic  #55                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     200: checkcast     #24                 // class java/lang/Iterable
     203: astore        21
     205: iconst_0
     206: istore        22
     208: aload         21
     210: astore        23
     212: new           #26                 // class java/util/ArrayList
     215: dup
     216: aload         21
     218: bipush        10
     220: invokestatic  #61                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     223: invokespecial #64                 // Method java/util/ArrayList."<init>":(I)V
     226: checkcast     #29                 // class java/util/Collection
     229: astore        24
     231: iconst_0
     232: istore        25
     234: aload         23
     236: invokeinterface #33,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     241: astore        26
     243: aload         26
     245: invokeinterface #39,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     250: ifeq          297
     253: aload         26
     255: invokeinterface #43,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     260: astore        27
     262: aload         24
     264: aload         27
     266: checkcast     #45                 // class java/lang/String
     269: astore        28
     271: astore        29
     273: iconst_0
     274: istore        30
     276: aload         28
     278: invokestatic  #72                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     281: nop
     282: invokestatic  #76                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     285: aload         29
     287: swap
     288: invokeinterface #80,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     293: pop
     294: goto          243
     297: aload         24
     299: checkcast     #82                 // class java/util/List
     302: nop
     303: nop
     304: aload         19
     306: swap
     307: invokeinterface #80,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     312: pop
     313: goto          140
     316: aload         14
     318: checkcast     #82                 // class java/util/List
     321: nop
     322: checkcast     #24                 // class java/lang/Iterable
     325: invokestatic  #86                 // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;
     328: astore        31
     330: aload         31
     332: iconst_0
     333: invokeinterface #90,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     338: checkcast     #92                 // class java/lang/Number
     341: invokevirtual #96                 // Method java/lang/Number.intValue:()I
     344: istore        11
     346: aload         31
     348: iconst_1
     349: invokeinterface #90,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     354: checkcast     #92                 // class java/lang/Number
     357: invokevirtual #96                 // Method java/lang/Number.intValue:()I
     360: istore        12
     362: aload         31
     364: iconst_2
     365: invokeinterface #90,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     370: checkcast     #92                 // class java/lang/Number
     373: invokevirtual #96                 // Method java/lang/Number.intValue:()I
     376: istore        13
     378: aload         31
     380: iconst_3
     381: invokeinterface #90,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     386: checkcast     #92                 // class java/lang/Number
     389: invokevirtual #96                 // Method java/lang/Number.intValue:()I
     392: istore        14
     394: iload         13
     396: iload         11
     398: if_icmpgt     416
     401: iload         11
     403: iload         14
     405: if_icmpgt     412
     408: iconst_1
     409: goto          417
     412: iconst_0
     413: goto          417
     416: iconst_0
     417: ifne          446
     420: iload         11
     422: iload         13
     424: if_icmpgt     442
     427: iload         13
     429: iload         12
     431: if_icmpgt     438
     434: iconst_1
     435: goto          443
     438: iconst_0
     439: goto          443
     442: iconst_0
     443: ifeq          450
     446: iconst_1
     447: goto          451
     450: iconst_0
     451: ifeq          40
     454: aload         5
     456: aload         8
     458: invokeinterface #80,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     463: pop
     464: goto          40
     467: aload         5
     469: checkcast     #82                 // class java/util/List
     472: nop
     473: invokeinterface #99,  1           // InterfaceMethod java/util/List.size:()I
     478: ireturn

  public Day04$Companion(kotlin.jvm.internal.DefaultConstructorMarker);
    Code:
       0: aload_0
       1: invokespecial #131                // Method "<init>":()V
       4: return
}

Compiled from "Day04.kt"
public final class Day04Kt {
  public static final void main();
    Code:
       0: ldc           #8                  // String Day04
       2: invokestatic  #14                 // Method UtilsKt.readInput:(Ljava/lang/String;)Ljava/util/List;
       5: astore_0
       6: getstatic     #19                 // Field Day04.Companion:LDay04$Companion;
       9: aload_0
      10: invokevirtual #25                 // Method Day04$Companion.part1:(Ljava/util/List;)I
      13: istore_1
      14: getstatic     #31                 // Field java/lang/System.out:Ljava/io/PrintStream;
      17: iload_1
      18: invokevirtual #37                 // Method java/io/PrintStream.println:(I)V
      21: getstatic     #19                 // Field Day04.Companion:LDay04$Companion;
      24: aload_0
      25: invokevirtual #40                 // Method Day04$Companion.part2:(Ljava/util/List;)I
      28: istore_1
      29: getstatic     #31                 // Field java/lang/System.out:Ljava/io/PrintStream;
      32: iload_1
      33: invokevirtual #37                 // Method java/io/PrintStream.println:(I)V
      36: return

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

Compiled from "Day04.kt"
public final class Day04 {
  public static final Day04$Companion Companion;

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

  static {};
    Code:
       0: new           #13                 // class Day04$Companion
       3: dup
       4: aconst_null
       5: invokespecial #16                 // Method Day04$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #20                 // Field Companion:LDay04$Companion;
      11: return
}


import kotlin.math.absoluteValue

fun main() {
    val input = readInput("Day15")
    printTime { print(Day15.part1(input, 2_000_000)) }
    printTime { print(Day15.part2(input, 4_000_000)) }
}

class Day15 {
    companion object {
        fun part1(input: List<String>, targetY: Int): Int {
            val sensorsAndBeacons = input.map {
                it.substring(10).split(": closest beacon is at ").map { it.split(", ").map { it.substring(2).toInt() } }
                    .map { (x, y) -> Point(x, y) }
            }

            val blockedRanges: List<IntRange> = sensorsAndBeacons.mapNotNull {
                scannerRangeOnRow(it, targetY)
            }.merge()

            val blockedXsInYTarget = sensorsAndBeacons.flatten().filter { it.y == targetY }.map { it.x }.toSet()
            return blockedRanges.sumOf { it.size } - blockedXsInYTarget.size
        }

        fun part2(input: List<String>, side: Int): Long {
            val sensorsAndBeacons = input.map {
                it.substring(10).split(": closest beacon is at ").map { it.split(", ").map { it.substring(2).toInt() } }
                    .map { (x, y) -> Point(x, y) }
            }
            val validRange = 0..side

            for (y in validRange) {

                val blockedRanges: List<IntRange> = sensorsAndBeacons.mapNotNull {
                    scannerRangeOnRow(it, y)
                }
                val unblocked = validRange.subtract(blockedRanges)
                if (unblocked.isNotEmpty()) {
                    return unblocked.first().first * 4_000_000L + y
                }
            }
            error("Not Found")
        }

        private fun scannerRangeOnRow(points: List<Point>, targetY: Int): IntRange? {
            val (sensor, beacon) = points
            val sensorCoverage = sensor.rectilinearDistanceTo(beacon)
            val yDistanceToYTarget = (targetY - sensor.y).absoluteValue
            val yOverlapBy = sensorCoverage - yDistanceToYTarget
            return if (yOverlapBy <= 0) null
            else (sensor.x - yOverlapBy..sensor.x + yOverlapBy)
        }

//        fun part1withArray(input: List<String>, targetY: Int): Int {
//            val sensorsAndBeacons = input.map {
//                it.substring(10).split(": closest beacon is at ").map { it.split(", ").map { it.substring(2).toInt() } }
//                    .map { (x, y) -> Point(x, y) }
//            }
//
//            val offset = sensorsAndBeacons.maxOf { it[0].rectilinearDistanceTo(it[1]) } * 2
//            val beaconMaxX = sensorsAndBeacons.maxOf { it[1].x }
//            val blockedXsInTargetY = BooleanArray(beaconMaxX + offset)
//
//            for ((sensor, beacon) in sensorsAndBeacons) {
//                val sensorCoverage = sensor.rectilinearDistanceTo(beacon)
//                val yDistanceToYTarget = (targetY - sensor.y).absoluteValue
//                val yOverlapBy = sensorCoverage - yDistanceToYTarget
//                if (yOverlapBy > 0) {
//                    for (x in (sensor.x - (yOverlapBy)) towards (sensor.x + (yOverlapBy))) {
//                        blockedXsInTargetY[x + offset] = true
//                    }
//                }
//            }
//
//            val beaconXsInYTarget = sensorsAndBeacons.map { it[1] }.filter { it.y == targetY }.map { it.x }
//            for (beaconX in beaconXsInYTarget) {
//                blockedXsInTargetY[beaconX + offset] = false
//            }
//
//            return blockedXsInTargetY.count { it }
//        }
//
//        fun part2WithArray(input: List<String>, side: Int): Int {
//            val sensorsAndBeacons = input.map {
//                it.substring(10).split(": closest beacon is at ").map { it.split(", ").map { it.substring(2).toInt() } }
//                    .map { (x, y) -> Point(x, y) }
//            }
//            val validRange = 0..side
//
//            for (y in validRange) {
//                val blockedXsInTargetY = BooleanArray(side + 1)
//                for ((sensor, beacon) in sensorsAndBeacons) {
//                    val sensorCoverage = sensor.rectilinearDistanceTo(beacon)
//                    val yDistanceToYTarget = (y - sensor.y).absoluteValue
//                    val yOverlapBy = sensorCoverage - yDistanceToYTarget
//                    if (yOverlapBy > 0) {
//                        for (x in (sensor.x - (yOverlapBy)) towards (sensor.x + (yOverlapBy))) {
//                            if (x in validRange && y in validRange) blockedXsInTargetY[x] = true
//                        }
//                    }
//                }
//                if (blockedXsInTargetY.any { !it }) return blockedXsInTargetY.indexOfFirst { !it } * 4_000_000 + y
//            }
//            error("Not Found")
//        }
    }

    class Point(var x: Int = 0, var y: Int = 0) {
        fun rectilinearDistanceTo(point: Point): Int {
            return (this.x - point.x).absoluteValue + (this.y - point.y).absoluteValue
        }

        override fun toString(): String {
            return "Point(x=$x, y=$y)"
        }

        operator fun component1() = x
        operator fun component2() = y
    }
}

Compiled from "Day15.kt"
public final class Day15 {
  public static final Day15$Companion Companion;

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

  static {};
    Code:
       0: new           #13                 // class Day15$Companion
       3: dup
       4: aconst_null
       5: invokespecial #16                 // Method Day15$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #20                 // Field Companion:LDay15$Companion;
      11: return
}

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

  public final int part1(java.util.List<java.lang.String>, int);
    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_1
       7: checkcast     #24                 // class java/lang/Iterable
      10: astore        4
      12: iconst_0
      13: istore        5
      15: aload         4
      17: astore        6
      19: new           #26                 // class java/util/ArrayList
      22: dup
      23: aload         4
      25: bipush        10
      27: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      30: invokespecial #35                 // Method java/util/ArrayList."<init>":(I)V
      33: checkcast     #37                 // class java/util/Collection
      36: astore        7
      38: iconst_0
      39: istore        8
      41: aload         6
      43: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      48: astore        9
      50: aload         9
      52: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      57: ifeq          508
      60: aload         9
      62: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      67: astore        10
      69: aload         7
      71: aload         10
      73: checkcast     #53                 // class java/lang/String
      76: astore        11
      78: astore        33
      80: iconst_0
      81: istore        12
      83: aload         11
      85: bipush        10
      87: invokevirtual #57                 // Method java/lang/String.substring:(I)Ljava/lang/String;
      90: dup
      91: ldc           #59                 // String substring(...)
      93: invokestatic  #62                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      96: checkcast     #64                 // class java/lang/CharSequence
      99: iconst_1
     100: anewarray     #53                 // class java/lang/String
     103: astore        13
     105: aload         13
     107: iconst_0
     108: ldc           #66                 // String : closest beacon is at
     110: aastore
     111: aload         13
     113: iconst_0
     114: iconst_0
     115: bipush        6
     117: aconst_null
     118: invokestatic  #72                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     121: checkcast     #24                 // class java/lang/Iterable
     124: astore        13
     126: iconst_0
     127: istore        14
     129: aload         13
     131: astore        15
     133: new           #26                 // class java/util/ArrayList
     136: dup
     137: aload         13
     139: bipush        10
     141: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     144: invokespecial #35                 // Method java/util/ArrayList."<init>":(I)V
     147: checkcast     #37                 // class java/util/Collection
     150: astore        16
     152: iconst_0
     153: istore        17
     155: aload         15
     157: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     162: astore        18
     164: aload         18
     166: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     171: ifeq          351
     174: aload         18
     176: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     181: astore        19
     183: aload         16
     185: aload         19
     187: checkcast     #53                 // class java/lang/String
     190: astore        20
     192: astore        21
     194: iconst_0
     195: istore        22
     197: aload         20
     199: checkcast     #64                 // class java/lang/CharSequence
     202: iconst_1
     203: anewarray     #53                 // class java/lang/String
     206: astore        23
     208: aload         23
     210: iconst_0
     211: ldc           #74                 // String ,
     213: aastore
     214: aload         23
     216: iconst_0
     217: iconst_0
     218: bipush        6
     220: aconst_null
     221: invokestatic  #72                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     224: checkcast     #24                 // class java/lang/Iterable
     227: astore        23
     229: iconst_0
     230: istore        24
     232: aload         23
     234: astore        25
     236: new           #26                 // class java/util/ArrayList
     239: dup
     240: aload         23
     242: bipush        10
     244: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     247: invokespecial #35                 // Method java/util/ArrayList."<init>":(I)V
     250: checkcast     #37                 // class java/util/Collection
     253: astore        26
     255: iconst_0
     256: istore        27
     258: aload         25
     260: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     265: astore        28
     267: aload         28
     269: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     274: ifeq          332
     277: aload         28
     279: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     284: astore        29
     286: aload         26
     288: aload         29
     290: checkcast     #53                 // class java/lang/String
     293: astore        30
     295: astore        31
     297: iconst_0
     298: istore        32
     300: nop
     301: aload         30
     303: iconst_2
     304: invokevirtual #57                 // Method java/lang/String.substring:(I)Ljava/lang/String;
     307: dup
     308: ldc           #59                 // String substring(...)
     310: invokestatic  #62                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     313: invokestatic  #80                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     316: nop
     317: invokestatic  #84                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     320: aload         31
     322: swap
     323: invokeinterface #88,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     328: pop
     329: goto          267
     332: aload         26
     334: checkcast     #90                 // class java/util/List
     337: nop
     338: nop
     339: aload         21
     341: swap
     342: invokeinterface #88,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     347: pop
     348: goto          164
     351: aload         16
     353: checkcast     #90                 // class java/util/List
     356: nop
     357: checkcast     #24                 // class java/lang/Iterable
     360: astore        13
     362: nop
     363: iconst_0
     364: istore        14
     366: aload         13
     368: astore        15
     370: new           #26                 // class java/util/ArrayList
     373: dup
     374: aload         13
     376: bipush        10
     378: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     381: invokespecial #35                 // Method java/util/ArrayList."<init>":(I)V
     384: checkcast     #37                 // class java/util/Collection
     387: astore        16
     389: iconst_0
     390: istore        17
     392: aload         15
     394: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     399: astore        18
     401: aload         18
     403: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     408: ifeq          489
     411: aload         18
     413: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     418: astore        19
     420: aload         16
     422: aload         19
     424: checkcast     #90                 // class java/util/List
     427: astore        20
     429: astore        21
     431: iconst_0
     432: istore        22
     434: aload         20
     436: iconst_0
     437: invokeinterface #94,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     442: checkcast     #96                 // class java/lang/Number
     445: invokevirtual #100                // Method java/lang/Number.intValue:()I
     448: istore        23
     450: aload         20
     452: iconst_1
     453: invokeinterface #94,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     458: checkcast     #96                 // class java/lang/Number
     461: invokevirtual #100                // Method java/lang/Number.intValue:()I
     464: istore        24
     466: new           #102                // class Day15$Point
     469: dup
     470: iload         23
     472: iload         24
     474: invokespecial #105                // Method Day15$Point."<init>":(II)V
     477: aload         21
     479: swap
     480: invokeinterface #88,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     485: pop
     486: goto          401
     489: aload         16
     491: checkcast     #90                 // class java/util/List
     494: nop
     495: nop
     496: aload         33
     498: swap
     499: invokeinterface #88,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     504: pop
     505: goto          50
     508: aload         7
     510: checkcast     #90                 // class java/util/List
     513: nop
     514: astore_3
     515: aload_3
     516: checkcast     #24                 // class java/lang/Iterable
     519: astore        5
     521: iconst_0
     522: istore        6
     524: aload         5
     526: astore        7
     528: new           #26                 // class java/util/ArrayList
     531: dup
     532: invokespecial #106                // Method java/util/ArrayList."<init>":()V
     535: checkcast     #37                 // class java/util/Collection
     538: astore        8
     540: iconst_0
     541: istore        9
     543: aload         7
     545: astore        10
     547: iconst_0
     548: istore        11
     550: aload         10
     552: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     557: astore        12
     559: aload         12
     561: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     566: ifeq          631
     569: aload         12
     571: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     576: astore        13
     578: aload         13
     580: astore        14
     582: iconst_0
     583: istore        15
     585: aload         14
     587: checkcast     #90                 // class java/util/List
     590: astore        16
     592: iconst_0
     593: istore        17
     595: getstatic     #111                // Field Day15.Companion:LDay15$Companion;
     598: aload         16
     600: iload_2
     601: invokespecial #115                // Method scannerRangeOnRow:(Ljava/util/List;I)Lkotlin/ranges/IntRange;
     604: dup
     605: ifnull        626
     608: astore        18
     610: iconst_0
     611: istore        19
     613: aload         8
     615: aload         18
     617: invokeinterface #88,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     622: pop
     623: goto          627
     626: pop
     627: nop
     628: goto          559
     631: nop
     632: aload         8
     634: checkcast     #90                 // class java/util/List
     637: nop
     638: checkcast     #24                 // class java/lang/Iterable
     641: invokestatic  #121                // Method UtilsKt.merge:(Ljava/lang/Iterable;)Ljava/util/List;
     644: astore        4
     646: aload_3
     647: checkcast     #24                 // class java/lang/Iterable
     650: invokestatic  #124                // Method kotlin/collections/CollectionsKt.flatten:(Ljava/lang/Iterable;)Ljava/util/List;
     653: checkcast     #24                 // class java/lang/Iterable
     656: astore        6
     658: iconst_0
     659: istore        7
     661: aload         6
     663: astore        8
     665: new           #26                 // class java/util/ArrayList
     668: dup
     669: invokespecial #106                // Method java/util/ArrayList."<init>":()V
     672: checkcast     #37                 // class java/util/Collection
     675: astore        9
     677: iconst_0
     678: istore        10
     680: aload         8
     682: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     687: astore        11
     689: aload         11
     691: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     696: ifeq          748
     699: aload         11
     701: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     706: astore        12
     708: aload         12
     710: checkcast     #102                // class Day15$Point
     713: astore        13
     715: iconst_0
     716: istore        14
     718: aload         13
     720: invokevirtual #127                // Method Day15$Point.getY:()I
     723: iload_2
     724: if_icmpne     731
     727: iconst_1
     728: goto          732
     731: iconst_0
     732: ifeq          689
     735: aload         9
     737: aload         12
     739: invokeinterface #88,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     744: pop
     745: goto          689
     748: aload         9
     750: checkcast     #90                 // class java/util/List
     753: nop
     754: checkcast     #24                 // class java/lang/Iterable
     757: astore        6
     759: nop
     760: iconst_0
     761: istore        7
     763: aload         6
     765: astore        8
     767: new           #26                 // class java/util/ArrayList
     770: dup
     771: aload         6
     773: bipush        10
     775: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     778: invokespecial #35                 // Method java/util/ArrayList."<init>":(I)V
     781: checkcast     #37                 // class java/util/Collection
     784: astore        9
     786: iconst_0
     787: istore        10
     789: aload         8
     791: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     796: astore        11
     798: aload         11
     800: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     805: ifeq          851
     808: aload         11
     810: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     815: astore        12
     817: aload         9
     819: aload         12
     821: checkcast     #102                // class Day15$Point
     824: astore        13
     826: astore        33
     828: iconst_0
     829: istore        14
     831: aload         13
     833: invokevirtual #130                // Method Day15$Point.getX:()I
     836: invokestatic  #84                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     839: aload         33
     841: swap
     842: invokeinterface #88,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     847: pop
     848: goto          798
     851: aload         9
     853: checkcast     #90                 // class java/util/List
     856: nop
     857: checkcast     #24                 // class java/lang/Iterable
     860: invokestatic  #134                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
     863: astore        5
     865: aload         4
     867: checkcast     #24                 // class java/lang/Iterable
     870: astore        6
     872: iconst_0
     873: istore        7
     875: aload         6
     877: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     882: astore        8
     884: aload         8
     886: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     891: ifeq          934
     894: aload         8
     896: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     901: astore        9
     903: iload         7
     905: aload         9
     907: checkcast     #136                // class kotlin/ranges/IntRange
     910: astore        10
     912: istore        33
     914: iconst_0
     915: istore        11
     917: aload         10
     919: invokestatic  #140                // Method UtilsKt.getSize:(Lkotlin/ranges/IntRange;)I
     922: istore        34
     924: iload         33
     926: iload         34
     928: iadd
     929: istore        7
     931: goto          884
     934: iload         7
     936: aload         5
     938: invokeinterface #145,  1          // InterfaceMethod java/util/Set.size:()I
     943: isub
     944: ireturn

  public final long part2(java.util.List<java.lang.String>, int);
    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_1
       7: checkcast     #24                 // class java/lang/Iterable
      10: astore        4
      12: iconst_0
      13: istore        5
      15: aload         4
      17: astore        6
      19: new           #26                 // class java/util/ArrayList
      22: dup
      23: aload         4
      25: bipush        10
      27: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      30: invokespecial #35                 // Method java/util/ArrayList."<init>":(I)V
      33: checkcast     #37                 // class java/util/Collection
      36: astore        7
      38: iconst_0
      39: istore        8
      41: aload         6
      43: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      48: astore        9
      50: aload         9
      52: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      57: ifeq          508
      60: aload         9
      62: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      67: astore        10
      69: aload         7
      71: aload         10
      73: checkcast     #53                 // class java/lang/String
      76: astore        11
      78: astore        33
      80: iconst_0
      81: istore        12
      83: aload         11
      85: bipush        10
      87: invokevirtual #57                 // Method java/lang/String.substring:(I)Ljava/lang/String;
      90: dup
      91: ldc           #59                 // String substring(...)
      93: invokestatic  #62                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      96: checkcast     #64                 // class java/lang/CharSequence
      99: iconst_1
     100: anewarray     #53                 // class java/lang/String
     103: astore        13
     105: aload         13
     107: iconst_0
     108: ldc           #66                 // String : closest beacon is at
     110: aastore
     111: aload         13
     113: iconst_0
     114: iconst_0
     115: bipush        6
     117: aconst_null
     118: invokestatic  #72                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     121: checkcast     #24                 // class java/lang/Iterable
     124: astore        13
     126: iconst_0
     127: istore        14
     129: aload         13
     131: astore        15
     133: new           #26                 // class java/util/ArrayList
     136: dup
     137: aload         13
     139: bipush        10
     141: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     144: invokespecial #35                 // Method java/util/ArrayList."<init>":(I)V
     147: checkcast     #37                 // class java/util/Collection
     150: astore        16
     152: iconst_0
     153: istore        17
     155: aload         15
     157: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     162: astore        18
     164: aload         18
     166: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     171: ifeq          351
     174: aload         18
     176: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     181: astore        19
     183: aload         16
     185: aload         19
     187: checkcast     #53                 // class java/lang/String
     190: astore        20
     192: astore        21
     194: iconst_0
     195: istore        22
     197: aload         20
     199: checkcast     #64                 // class java/lang/CharSequence
     202: iconst_1
     203: anewarray     #53                 // class java/lang/String
     206: astore        23
     208: aload         23
     210: iconst_0
     211: ldc           #74                 // String ,
     213: aastore
     214: aload         23
     216: iconst_0
     217: iconst_0
     218: bipush        6
     220: aconst_null
     221: invokestatic  #72                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     224: checkcast     #24                 // class java/lang/Iterable
     227: astore        23
     229: iconst_0
     230: istore        24
     232: aload         23
     234: astore        25
     236: new           #26                 // class java/util/ArrayList
     239: dup
     240: aload         23
     242: bipush        10
     244: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     247: invokespecial #35                 // Method java/util/ArrayList."<init>":(I)V
     250: checkcast     #37                 // class java/util/Collection
     253: astore        26
     255: iconst_0
     256: istore        27
     258: aload         25
     260: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     265: astore        28
     267: aload         28
     269: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     274: ifeq          332
     277: aload         28
     279: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     284: astore        29
     286: aload         26
     288: aload         29
     290: checkcast     #53                 // class java/lang/String
     293: astore        30
     295: astore        31
     297: iconst_0
     298: istore        32
     300: nop
     301: aload         30
     303: iconst_2
     304: invokevirtual #57                 // Method java/lang/String.substring:(I)Ljava/lang/String;
     307: dup
     308: ldc           #59                 // String substring(...)
     310: invokestatic  #62                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     313: invokestatic  #80                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     316: nop
     317: invokestatic  #84                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     320: aload         31
     322: swap
     323: invokeinterface #88,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     328: pop
     329: goto          267
     332: aload         26
     334: checkcast     #90                 // class java/util/List
     337: nop
     338: nop
     339: aload         21
     341: swap
     342: invokeinterface #88,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     347: pop
     348: goto          164
     351: aload         16
     353: checkcast     #90                 // class java/util/List
     356: nop
     357: checkcast     #24                 // class java/lang/Iterable
     360: astore        13
     362: nop
     363: iconst_0
     364: istore        14
     366: aload         13
     368: astore        15
     370: new           #26                 // class java/util/ArrayList
     373: dup
     374: aload         13
     376: bipush        10
     378: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     381: invokespecial #35                 // Method java/util/ArrayList."<init>":(I)V
     384: checkcast     #37                 // class java/util/Collection
     387: astore        16
     389: iconst_0
     390: istore        17
     392: aload         15
     394: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     399: astore        18
     401: aload         18
     403: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     408: ifeq          489
     411: aload         18
     413: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     418: astore        19
     420: aload         16
     422: aload         19
     424: checkcast     #90                 // class java/util/List
     427: astore        20
     429: astore        21
     431: iconst_0
     432: istore        22
     434: aload         20
     436: iconst_0
     437: invokeinterface #94,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     442: checkcast     #96                 // class java/lang/Number
     445: invokevirtual #100                // Method java/lang/Number.intValue:()I
     448: istore        23
     450: aload         20
     452: iconst_1
     453: invokeinterface #94,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     458: checkcast     #96                 // class java/lang/Number
     461: invokevirtual #100                // Method java/lang/Number.intValue:()I
     464: istore        24
     466: new           #102                // class Day15$Point
     469: dup
     470: iload         23
     472: iload         24
     474: invokespecial #105                // Method Day15$Point."<init>":(II)V
     477: aload         21
     479: swap
     480: invokeinterface #88,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     485: pop
     486: goto          401
     489: aload         16
     491: checkcast     #90                 // class java/util/List
     494: nop
     495: nop
     496: aload         33
     498: swap
     499: invokeinterface #88,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     504: pop
     505: goto          50
     508: aload         7
     510: checkcast     #90                 // class java/util/List
     513: nop
     514: astore_3
     515: new           #136                // class kotlin/ranges/IntRange
     518: dup
     519: iconst_0
     520: iload_2
     521: invokespecial #194                // Method kotlin/ranges/IntRange."<init>":(II)V
     524: astore        4
     526: aload         4
     528: invokevirtual #197                // Method kotlin/ranges/IntRange.getFirst:()I
     531: istore        5
     533: aload         4
     535: invokevirtual #200                // Method kotlin/ranges/IntRange.getLast:()I
     538: istore        6
     540: iload         5
     542: iload         6
     544: if_icmpgt     740
     547: aload_3
     548: checkcast     #24                 // class java/lang/Iterable
     551: astore        8
     553: iconst_0
     554: istore        9
     556: aload         8
     558: astore        10
     560: new           #26                 // class java/util/ArrayList
     563: dup
     564: invokespecial #106                // Method java/util/ArrayList."<init>":()V
     567: checkcast     #37                 // class java/util/Collection
     570: astore        11
     572: iconst_0
     573: istore        12
     575: aload         10
     577: astore        13
     579: iconst_0
     580: istore        14
     582: aload         13
     584: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     589: astore        15
     591: aload         15
     593: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     598: ifeq          664
     601: aload         15
     603: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     608: astore        16
     610: aload         16
     612: astore        17
     614: iconst_0
     615: istore        18
     617: aload         17
     619: checkcast     #90                 // class java/util/List
     622: astore        19
     624: iconst_0
     625: istore        20
     627: getstatic     #111                // Field Day15.Companion:LDay15$Companion;
     630: aload         19
     632: iload         5
     634: invokespecial #115                // Method scannerRangeOnRow:(Ljava/util/List;I)Lkotlin/ranges/IntRange;
     637: dup
     638: ifnull        659
     641: astore        21
     643: iconst_0
     644: istore        22
     646: aload         11
     648: aload         21
     650: invokeinterface #88,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     655: pop
     656: goto          660
     659: pop
     660: nop
     661: goto          591
     664: nop
     665: aload         11
     667: checkcast     #90                 // class java/util/List
     670: nop
     671: astore        7
     673: aload         4
     675: aload         7
     677: checkcast     #24                 // class java/lang/Iterable
     680: invokestatic  #204                // Method UtilsKt.subtract:(Lkotlin/ranges/IntRange;Ljava/lang/Iterable;)Ljava/util/List;
     683: astore        8
     685: aload         8
     687: checkcast     #37                 // class java/util/Collection
     690: invokeinterface #207,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     695: ifne          702
     698: iconst_1
     699: goto          703
     702: iconst_0
     703: ifeq          727
     706: aload         8
     708: invokestatic  #211                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     711: checkcast     #136                // class kotlin/ranges/IntRange
     714: invokevirtual #197                // Method kotlin/ranges/IntRange.getFirst:()I
     717: i2l
     718: ldc2_w        #212                // long 4000000l
     721: lmul
     722: iload         5
     724: i2l
     725: ladd
     726: lreturn
     727: iload         5
     729: iload         6
     731: if_icmpeq     740
     734: iinc          5, 1
     737: goto          547
     740: new           #215                // class java/lang/IllegalStateException
     743: dup
     744: ldc           #217                // String Not Found
     746: invokevirtual #221                // Method java/lang/Object.toString:()Ljava/lang/String;
     749: invokespecial #224                // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     752: athrow

  private final kotlin.ranges.IntRange scannerRangeOnRow(java.util.List<Day15$Point>, int);
    Code:
       0: aload_1
       1: iconst_0
       2: invokeinterface #94,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
       7: checkcast     #102                // class Day15$Point
      10: astore_3
      11: aload_1
      12: iconst_1
      13: invokeinterface #94,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      18: checkcast     #102                // class Day15$Point
      21: astore        4
      23: aload_3
      24: aload         4
      26: invokevirtual #237                // Method Day15$Point.rectilinearDistanceTo:(LDay15$Point;)I
      29: istore        5
      31: iload_2
      32: aload_3
      33: invokevirtual #127                // Method Day15$Point.getY:()I
      36: isub
      37: invokestatic  #243                // Method java/lang/Math.abs:(I)I
      40: istore        6
      42: iload         5
      44: iload         6
      46: isub
      47: istore        7
      49: iload         7
      51: ifgt          58
      54: aconst_null
      55: goto          79
      58: new           #136                // class kotlin/ranges/IntRange
      61: dup
      62: aload_3
      63: invokevirtual #130                // Method Day15$Point.getX:()I
      66: iload         7
      68: isub
      69: aload_3
      70: invokevirtual #130                // Method Day15$Point.getX:()I
      73: iload         7
      75: iadd
      76: invokespecial #194                // Method kotlin/ranges/IntRange."<init>":(II)V
      79: areturn

  public Day15$Companion(kotlin.jvm.internal.DefaultConstructorMarker);
    Code:
       0: aload_0
       1: invokespecial #251                // Method "<init>":()V
       4: return
}

Compiled from "Day15.kt"
public final class Day15Kt {
  public static final void main();
    Code:
       0: ldc           #8                  // String Day15
       2: invokestatic  #14                 // Method UtilsKt.readInput:(Ljava/lang/String;)Ljava/util/List;
       5: astore_0
       6: aconst_null
       7: aconst_null
       8: aload_0
       9: invokedynamic #34,  0             // InvokeDynamic #0:invoke:(Ljava/util/List;)Lkotlin/jvm/functions/Function0;
      14: iconst_3
      15: aconst_null
      16: invokestatic  #38                 // Method UtilsKt.printTime$default:(Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
      19: aconst_null
      20: aconst_null
      21: aload_0
      22: invokedynamic #43,  0             // InvokeDynamic #1:invoke:(Ljava/util/List;)Lkotlin/jvm/functions/Function0;
      27: iconst_3
      28: aconst_null
      29: invokestatic  #38                 // Method UtilsKt.printTime$default:(Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
      32: return

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

  private static final kotlin.Unit main$lambda$0(java.util.List);
    Code:
       0: getstatic     #55                 // Field Day15.Companion:LDay15$Companion;
       3: aload_0
       4: ldc           #56                 // int 2000000
       6: invokevirtual #62                 // Method Day15$Companion.part1:(Ljava/util/List;I)I
       9: istore_1
      10: getstatic     #68                 // Field java/lang/System.out:Ljava/io/PrintStream;
      13: iload_1
      14: invokevirtual #74                 // Method java/io/PrintStream.print:(I)V
      17: getstatic     #80                 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      20: areturn

  private static final kotlin.Unit main$lambda$1(java.util.List);
    Code:
       0: getstatic     #55                 // Field Day15.Companion:LDay15$Companion;
       3: aload_0
       4: ldc           #82                 // int 4000000
       6: invokevirtual #86                 // Method Day15$Companion.part2:(Ljava/util/List;I)J
       9: lstore_1
      10: getstatic     #68                 // Field java/lang/System.out:Ljava/io/PrintStream;
      13: lload_1
      14: invokevirtual #89                 // Method java/io/PrintStream.print:(J)V
      17: getstatic     #80                 // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      20: areturn
}

Compiled from "Day15.kt"
public final class Day15$Point {
  private int x;

  private int y;

  public Day15$Point(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 Day15$Point(int, int, int, kotlin.jvm.internal.DefaultConstructorMarker);
    Code:
       0: iload_3
       1: iconst_1
       2: iand
       3: ifeq          8
       6: iconst_0
       7: istore_1
       8: iload_3
       9: iconst_2
      10: iand
      11: ifeq          16
      14: iconst_0
      15: istore_2
      16: aload_0
      17: iload_1
      18: iload_2
      19: invokespecial #21                 // Method "<init>":(II)V
      22: return

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

  public final void setX(int);
    Code:
       0: aload_0
       1: iload_1
       2: putfield      #13                 // Field x:I
       5: return

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

  public final void setY(int);
    Code:
       0: aload_0
       1: iload_1
       2: putfield      #16                 // Field y:I
       5: return

  public final int rectilinearDistanceTo(Day15$Point);
    Code:
       0: aload_1
       1: ldc           #33                 // String point
       3: invokestatic  #39                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #13                 // Field x:I
      10: aload_1
      11: getfield      #13                 // Field x:I
      14: isub
      15: invokestatic  #45                 // Method java/lang/Math.abs:(I)I
      18: aload_0
      19: getfield      #16                 // Field y:I
      22: aload_1
      23: getfield      #16                 // Field y:I
      26: isub
      27: invokestatic  #45                 // Method java/lang/Math.abs:(I)I
      30: iadd
      31: ireturn

  public java.lang.String toString();
    Code:
       0: new           #49                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #50                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #52                 // String Point(x=
       9: invokevirtual #56                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field x:I
      16: invokevirtual #59                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #61                 // String , y=
      21: invokevirtual #56                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #16                 // Field y:I
      28: invokevirtual #59                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #64                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #66                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      39: areturn

  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 Day15$Point();
    Code:
       0: aload_0
       1: iconst_0
       2: iconst_0
       3: iconst_3
       4: aconst_null
       5: invokespecial #70                 // Method "<init>":(IIILkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: return
}