fun main() {
    println("Hello World")
    println(averageArray(arrayOf(1, 2, 2, 4, 4)))
    println(averageArray(arrayOf(1, -2, -2, 4, 4)))
    println(checkValueExistence(arrayOf(1, 2, 2, 4, 4), 8))
    println(reverseArray(arrayOf(1, 2, 3, 4, 5, 6, 7, 34, 28)))
    val ciphertext = caesarCipherFunc()
    println(ciphertext)
    println(findMaxValue(arrayOf(-1, -2, -3, -4, -5)))
}

/**
 * Find the average of an array
 * @param inputArray contains the array to be averaged
 * @return the average of type Double
 */

fun averageArray(inputArray: Array<Int>): Double {
    var listSum = 0.0
    for (datax in inputArray) {
        listSum += datax
    }
    return listSum / inputArray.size
}

/**
 * Check if a value exist in an array
 * @param valueList contains an array of string
 * @param value is the value to check if it exist in the array
 * @return A boolean value if the value exists or not
 */

fun checkValueExistence(valueList: Array<Int>, value: Int): Boolean {
    for (x in valueList) {
        if (x == value) {
            return true
        }
    }
    return false
}

/**
 * Reverse an array
 * @param inputArray contains the array to be reversed
 * @return A mutable list of the reversed array
 */

fun reverseArray(inputArray: Array<Int>): MutableList<Int> {
    var reversedList = MutableList<Int>(inputArray.size) { 0 }
    var index = inputArray.size - 1
    println(index)
    for (num in inputArray) {
        reversedList[index] = num
        index--
    }
    return reversedList
}

/**
 * Caeser Cipher function encrypts the string entered by the user by a specific shift value
 * @return An encrypted string
 */

fun caesarCipherFunc(): String {
    try {
        val shiftedText = StringBuilder()
        println("Enter input string to encrypt")
        val stringValue = readLine()
        println("Enter the shift value")
        val shift = readLine()?.toInt()
        if (!stringValue.isNullOrEmpty() && shift != null) {
            for (char in stringValue) {
                if (char.isLetter()) {
                    val startOffset = if (char.isUpperCase()) 'A' else 'a'
                    val shiftedChar = (((char.toInt() - startOffset.toInt()) + shift) % 26 + startOffset.toInt()).toChar()
                    shiftedText.append(shiftedChar)
                } else {
                    shiftedText.append(char)
                }
            }
        }

        return shiftedText.toString()
    } catch (e: NumberFormatException) {
        return "Invalid input entered"
    }
}

fun findMaxValue(inputList: Array<Int>): Int {
    var maxValue = Int.MIN_VALUE
    for (value in inputList) {
        if (value > maxValue) {
            maxValue = value
        }
    }
    return maxValue
}

Compiled from "ArrayTools.kt"
public final class ArrayToolsKt {
  public static final void main();
    Code:
       0: ldc           #8                  // String Hello World
       2: getstatic     #14                 // Field java/lang/System.out:Ljava/io/PrintStream;
       5: swap
       6: invokevirtual #20                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
       9: iconst_5
      10: anewarray     #22                 // class java/lang/Integer
      13: astore_0
      14: aload_0
      15: iconst_0
      16: iconst_1
      17: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      20: aastore
      21: aload_0
      22: iconst_1
      23: iconst_2
      24: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      27: aastore
      28: aload_0
      29: iconst_2
      30: iconst_2
      31: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      34: aastore
      35: aload_0
      36: iconst_3
      37: iconst_4
      38: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      41: aastore
      42: aload_0
      43: iconst_4
      44: iconst_4
      45: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      48: aastore
      49: aload_0
      50: invokestatic  #30                 // Method averageArray:([Ljava/lang/Integer;)D
      53: dstore_0
      54: getstatic     #14                 // Field java/lang/System.out:Ljava/io/PrintStream;
      57: dload_0
      58: invokevirtual #33                 // Method java/io/PrintStream.println:(D)V
      61: iconst_5
      62: anewarray     #22                 // class java/lang/Integer
      65: astore_0
      66: aload_0
      67: iconst_0
      68: iconst_1
      69: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      72: aastore
      73: aload_0
      74: iconst_1
      75: bipush        -2
      77: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      80: aastore
      81: aload_0
      82: iconst_2
      83: bipush        -2
      85: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      88: aastore
      89: aload_0
      90: iconst_3
      91: iconst_4
      92: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      95: aastore
      96: aload_0
      97: iconst_4
      98: iconst_4
      99: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     102: aastore
     103: aload_0
     104: invokestatic  #30                 // Method averageArray:([Ljava/lang/Integer;)D
     107: dstore_0
     108: getstatic     #14                 // Field java/lang/System.out:Ljava/io/PrintStream;
     111: dload_0
     112: invokevirtual #33                 // Method java/io/PrintStream.println:(D)V
     115: iconst_5
     116: anewarray     #22                 // class java/lang/Integer
     119: astore_0
     120: aload_0
     121: iconst_0
     122: iconst_1
     123: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     126: aastore
     127: aload_0
     128: iconst_1
     129: iconst_2
     130: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     133: aastore
     134: aload_0
     135: iconst_2
     136: iconst_2
     137: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     140: aastore
     141: aload_0
     142: iconst_3
     143: iconst_4
     144: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     147: aastore
     148: aload_0
     149: iconst_4
     150: iconst_4
     151: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     154: aastore
     155: aload_0
     156: bipush        8
     158: invokestatic  #37                 // Method checkValueExistence:([Ljava/lang/Integer;I)Z
     161: istore_0
     162: getstatic     #14                 // Field java/lang/System.out:Ljava/io/PrintStream;
     165: iload_0
     166: invokevirtual #40                 // Method java/io/PrintStream.println:(Z)V
     169: bipush        9
     171: anewarray     #22                 // class java/lang/Integer
     174: astore_0
     175: aload_0
     176: iconst_0
     177: iconst_1
     178: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     181: aastore
     182: aload_0
     183: iconst_1
     184: iconst_2
     185: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     188: aastore
     189: aload_0
     190: iconst_2
     191: iconst_3
     192: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     195: aastore
     196: aload_0
     197: iconst_3
     198: iconst_4
     199: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     202: aastore
     203: aload_0
     204: iconst_4
     205: iconst_5
     206: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     209: aastore
     210: aload_0
     211: iconst_5
     212: bipush        6
     214: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     217: aastore
     218: aload_0
     219: bipush        6
     221: bipush        7
     223: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     226: aastore
     227: aload_0
     228: bipush        7
     230: bipush        34
     232: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     235: aastore
     236: aload_0
     237: bipush        8
     239: bipush        28
     241: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     244: aastore
     245: aload_0
     246: invokestatic  #44                 // Method reverseArray:([Ljava/lang/Integer;)Ljava/util/List;
     249: getstatic     #14                 // Field java/lang/System.out:Ljava/io/PrintStream;
     252: swap
     253: invokevirtual #20                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     256: invokestatic  #48                 // Method caesarCipherFunc:()Ljava/lang/String;
     259: astore_0
     260: getstatic     #14                 // Field java/lang/System.out:Ljava/io/PrintStream;
     263: aload_0
     264: invokevirtual #20                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     267: iconst_5
     268: anewarray     #22                 // class java/lang/Integer
     271: astore_1
     272: aload_1
     273: iconst_0
     274: iconst_m1
     275: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     278: aastore
     279: aload_1
     280: iconst_1
     281: bipush        -2
     283: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     286: aastore
     287: aload_1
     288: iconst_2
     289: bipush        -3
     291: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     294: aastore
     295: aload_1
     296: iconst_3
     297: bipush        -4
     299: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     302: aastore
     303: aload_1
     304: iconst_4
     305: bipush        -5
     307: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     310: aastore
     311: aload_1
     312: invokestatic  #52                 // Method findMaxValue:([Ljava/lang/Integer;)I
     315: istore_1
     316: getstatic     #14                 // Field java/lang/System.out:Ljava/io/PrintStream;
     319: iload_1
     320: invokevirtual #55                 // Method java/io/PrintStream.println:(I)V
     323: return

  public static final double averageArray(java.lang.Integer[]);
    Code:
       0: aload_0
       1: ldc           #60                 // String inputArray
       3: invokestatic  #66                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: dconst_0
       7: dstore_1
       8: iconst_0
       9: istore_3
      10: aload_0
      11: arraylength
      12: istore        4
      14: iload_3
      15: iload         4
      17: if_icmpge     40
      20: aload_0
      21: iload_3
      22: aaload
      23: invokevirtual #70                 // Method java/lang/Integer.intValue:()I
      26: istore        5
      28: dload_1
      29: iload         5
      31: i2d
      32: dadd
      33: dstore_1
      34: iinc          3, 1
      37: goto          14
      40: dload_1
      41: aload_0
      42: arraylength
      43: i2d
      44: ddiv
      45: dreturn

  public static final boolean checkValueExistence(java.lang.Integer[], int);
    Code:
       0: aload_0
       1: ldc           #77                 // String valueList
       3: invokestatic  #66                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: iconst_0
       7: istore_2
       8: aload_0
       9: arraylength
      10: istore_3
      11: iload_2
      12: iload_3
      13: if_icmpge     38
      16: aload_0
      17: iload_2
      18: aaload
      19: invokevirtual #70                 // Method java/lang/Integer.intValue:()I
      22: istore        4
      24: iload         4
      26: iload_1
      27: if_icmpne     32
      30: iconst_1
      31: ireturn
      32: iinc          2, 1
      35: goto          11
      38: iconst_0
      39: ireturn

  public static final java.util.List<java.lang.Integer> reverseArray(java.lang.Integer[]);
    Code:
       0: aload_0
       1: ldc           #60                 // String inputArray
       3: invokestatic  #66                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: arraylength
       8: istore_2
       9: new           #82                 // class java/util/ArrayList
      12: dup
      13: iload_2
      14: invokespecial #85                 // Method java/util/ArrayList."<init>":(I)V
      17: astore_3
      18: iconst_0
      19: istore        4
      21: iload         4
      23: iload_2
      24: if_icmpge     58
      27: iload         4
      29: istore        5
      31: aload_3
      32: iload         5
      34: istore        6
      36: astore        8
      38: iconst_0
      39: istore        7
      41: iconst_0
      42: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      45: aload         8
      47: swap
      48: invokevirtual #89                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      51: pop
      52: iinc          4, 1
      55: goto          21
      58: aload_3
      59: checkcast     #91                 // class java/util/List
      62: astore_1
      63: aload_0
      64: arraylength
      65: iconst_1
      66: isub
      67: istore_2
      68: getstatic     #14                 // Field java/lang/System.out:Ljava/io/PrintStream;
      71: iload_2
      72: invokevirtual #55                 // Method java/io/PrintStream.println:(I)V
      75: iconst_0
      76: istore_3
      77: aload_0
      78: arraylength
      79: istore        4
      81: iload_3
      82: iload         4
      84: if_icmpge     117
      87: aload_0
      88: iload_3
      89: aaload
      90: invokevirtual #70                 // Method java/lang/Integer.intValue:()I
      93: istore        5
      95: aload_1
      96: iload_2
      97: iload         5
      99: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     102: invokeinterface #95,  3           // InterfaceMethod java/util/List.set:(ILjava/lang/Object;)Ljava/lang/Object;
     107: pop
     108: iinc          2, -1
     111: iinc          3, 1
     114: goto          81
     117: aload_1
     118: areturn

  public static final java.lang.String caesarCipherFunc();
    Code:
       0: nop
       1: new           #106                // class java/lang/StringBuilder
       4: dup
       5: invokespecial #108                // Method java/lang/StringBuilder."<init>":()V
       8: astore_0
       9: ldc           #110                // String Enter input string to encrypt
      11: getstatic     #14                 // Field java/lang/System.out:Ljava/io/PrintStream;
      14: swap
      15: invokevirtual #20                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      18: invokestatic  #115                // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
      21: astore_1
      22: ldc           #117                // String Enter the shift value
      24: getstatic     #14                 // Field java/lang/System.out:Ljava/io/PrintStream;
      27: swap
      28: invokevirtual #20                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      31: invokestatic  #115                // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
      34: dup
      35: ifnull        47
      38: invokestatic  #121                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      41: invokestatic  #26                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      44: goto          49
      47: pop
      48: aconst_null
      49: astore_2
      50: aload_1
      51: checkcast     #123                // class java/lang/CharSequence
      54: astore_3
      55: aload_3
      56: ifnull        68
      59: aload_3
      60: invokeinterface #126,  1          // InterfaceMethod java/lang/CharSequence.length:()I
      65: ifne          72
      68: iconst_1
      69: goto          73
      72: iconst_0
      73: ifne          173
      76: aload_2
      77: ifnull        173
      80: iconst_0
      81: istore_3
      82: iload_3
      83: aload_1
      84: checkcast     #123                // class java/lang/CharSequence
      87: invokeinterface #126,  1          // InterfaceMethod java/lang/CharSequence.length:()I
      92: if_icmpge     173
      95: aload_1
      96: checkcast     #123                // class java/lang/CharSequence
      99: iload_3
     100: invokeinterface #130,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     105: istore        4
     107: iload         4
     109: invokestatic  #136                // Method java/lang/Character.isLetter:(C)Z
     112: ifeq          160
     115: iload         4
     117: invokestatic  #139                // Method java/lang/Character.isUpperCase:(C)Z
     120: ifeq          128
     123: bipush        65
     125: goto          130
     128: bipush        97
     130: istore        5
     132: iload         4
     134: iload         5
     136: isub
     137: aload_2
     138: invokevirtual #70                 // Method java/lang/Integer.intValue:()I
     141: iadd
     142: bipush        26
     144: irem
     145: iload         5
     147: iadd
     148: i2c
     149: istore        6
     151: aload_0
     152: iload         6
     154: invokevirtual #143                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     157: goto          166
     160: aload_0
     161: iload         4
     163: invokevirtual #143                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     166: pop
     167: iinc          3, 1
     170: goto          82
     173: aload_0
     174: invokevirtual #146                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     177: dup
     178: ldc           #148                // String toString(...)
     180: invokestatic  #151                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     183: areturn
     184: astore_1
     185: ldc           #153                // String Invalid input entered
     187: areturn
    Exception table:
       from    to  target type
           0   184   184   Class java/lang/NumberFormatException

  public static final int findMaxValue(java.lang.Integer[]);
    Code:
       0: aload_0
       1: ldc           #168                // String inputList
       3: invokestatic  #66                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: ldc           #169                // int -2147483648
       8: istore_1
       9: iconst_0
      10: istore_2
      11: aload_0
      12: arraylength
      13: istore_3
      14: iload_2
      15: iload_3
      16: if_icmpge     42
      19: aload_0
      20: iload_2
      21: aaload
      22: invokevirtual #70                 // Method java/lang/Integer.intValue:()I
      25: istore        4
      27: iload         4
      29: iload_1
      30: if_icmple     36
      33: iload         4
      35: istore_1
      36: iinc          2, 1
      39: goto          14
      42: iload_1
      43: ireturn

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


import kotlin.math.abs

object Day15 {

    fun part1(input: String): Long = numberOfNonBeacon(input, 2000000).toLong()

    fun part2(input: String, searchScope: Int): Long {
        val scan = Scan.parse(input)
        val beacon = (0..searchScope)
            .asSequence()
            .map { y -> y to scan.uncoveredRange(y, 0..searchScope) }
            .first { (_, range) -> range.size > 0 }
            .let { (y, range) -> range.asSequence().map { Position(it, y) } }
            .first()
        return beacon.x.toLong() * 4_000_000 + beacon.y.toLong()
    }

    private val LINE_REGEX = Regex("Sensor at x=(-?\\d+), y=(-?\\d+): closest beacon is at x=(-?\\d+), y=(-?\\d+)")

    fun numberOfNonBeacon(input: String, y: Int): Int {
        val scan = Scan.parse(input)
        val searchRange = scan.minX..scan.maxX
        val uncovered = scan.uncoveredRange(y, scan.minX..scan.maxX)
        return searchRange.size - uncovered.size - scan.beacons.count { it.y == y }
    }

    private class Scan private constructor(val beacons: Set<Position>, private val sensors: List<Sensor>) {

        val minX get() = sensors.minOf { it.minX }
        val maxX get() = sensors.maxOf { it.maxX }

        fun uncoveredRange(y: Int, initialRange: IntRange): SearchRange =
            sensors.fold(SearchRange(initialRange)) { range, sensor ->
                sensor.coverage(y)?.let(range::remove) ?: range
            }

        companion object {
            fun parse(input: String): Scan {
                val beacons = mutableSetOf<Position>()
                val sensors = mutableListOf<Sensor>()
                input.lineSequence()
                    .forEach { line ->
                        val (sensorPosition, beaconPosition) = parseLine(line)
                        beacons.add(beaconPosition)
                        sensors.add(Sensor(sensorPosition, sensorPosition.distanceTo(beaconPosition)))
                    }
                return Scan(beacons, sensors)
            }
        }
    }

    private fun parseLine(line: String): Pair<Position, Position> {
        val (_, sx, sy, bx, by) = LINE_REGEX.find(line)!!.groupValues
        return Position(sx.toInt(), sy.toInt()) to Position(bx.toInt(), by.toInt())
    }

    private data class Position(val x: Int, val y: Int) {
        fun distanceTo(other: Position): Int {
            return abs(x - other.x) + abs(y - other.y)
        }
    }

    private data class Sensor(val position: Position, val range: Int) {
        val minX = position.x - range
        val maxX = position.x + range

        operator fun contains(otherPosition: Position) =
            coverage(otherPosition.y)?.let { otherPosition.x in it } ?: false

        fun coverage(y: Int): IntRange? {
            val vDist = abs(y - position.y)
            if (vDist > range) return null
            val extent = range - vDist
            return (position.x - extent)..(position.x + extent)
        }
    }

    private class SearchRange private constructor(val ranges: List<IntRange>) {
        constructor(range: IntRange) : this(listOf(range))

        val size: Int get() = ranges.sumOf { it.size }

        fun asSequence() = ranges.asSequence().flatMap { it.asSequence() }

        fun remove(range: IntRange): SearchRange {
            if (ranges.isEmpty()) return this
            return SearchRange(ranges.flatMap { it.remove(range) })
        }

        private fun IntRange.remove(other: IntRange): List<IntRange> = buildList {
            (first .. minOf(other.first - 1, last))
                .takeUnless { it.isEmpty() }
                ?.let(::add)
            (maxOf(other.last + 1, first)..endInclusive)
                .takeUnless { it.isEmpty() }
                ?.let(::add)
        }
    }

    val IntRange.size: Int get() = last - first + 1
}

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

  private static final kotlin.text.Regex LINE_REGEX;

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

  public final long part1(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #15                 // String input
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: ldc           #22                 // int 2000000
      10: invokevirtual #26                 // Method numberOfNonBeacon:(Ljava/lang/String;I)I
      13: i2l
      14: lreturn

  public final long part2(java.lang.String, int);
    Code:
       0: aload_1
       1: ldc           #15                 // String input
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: getstatic     #35                 // Field Day15$Scan.Companion:LDay15$Scan$Companion;
       9: aload_1
      10: invokevirtual #41                 // Method Day15$Scan$Companion.parse:(Ljava/lang/String;)LDay15$Scan;
      13: astore_3
      14: new           #43                 // class kotlin/ranges/IntRange
      17: dup
      18: iconst_0
      19: iload_2
      20: invokespecial #46                 // Method kotlin/ranges/IntRange."<init>":(II)V
      23: checkcast     #48                 // class java/lang/Iterable
      26: invokestatic  #54                 // Method kotlin/collections/CollectionsKt.asSequence:(Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;
      29: aload_3
      30: iload_2
      31: invokedynamic #74,  0             // InvokeDynamic #0:invoke:(LDay15$Scan;I)Lkotlin/jvm/functions/Function1;
      36: invokestatic  #80                 // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      39: astore        5
      41: nop
      42: iconst_0
      43: istore        6
      45: aload         5
      47: invokeinterface #86,  1           // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
      52: astore        7
      54: aload         7
      56: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      61: ifeq          114
      64: aload         7
      66: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      71: astore        8
      73: aload         8
      75: checkcast     #98                 // class kotlin/Pair
      78: astore        9
      80: iconst_0
      81: istore        10
      83: aload         9
      85: invokevirtual #101                // Method kotlin/Pair.component2:()Ljava/lang/Object;
      88: checkcast     #103                // class Day15$SearchRange
      91: astore        11
      93: aload         11
      95: invokevirtual #107                // Method Day15$SearchRange.getSize:()I
      98: ifle          105
     101: iconst_1
     102: goto          106
     105: iconst_0
     106: ifeq          54
     109: aload         8
     111: goto          124
     114: new           #109                // class java/util/NoSuchElementException
     117: dup
     118: ldc           #111                // String Sequence contains no element matching the predicate.
     120: invokespecial #114                // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
     123: athrow
     124: checkcast     #98                 // class kotlin/Pair
     127: astore        6
     129: iconst_0
     130: istore        7
     132: aload         6
     134: invokevirtual #117                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     137: checkcast     #119                // class java/lang/Number
     140: invokevirtual #122                // Method java/lang/Number.intValue:()I
     143: istore        8
     145: aload         6
     147: invokevirtual #101                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     150: checkcast     #103                // class Day15$SearchRange
     153: astore        9
     155: aload         9
     157: invokevirtual #125                // Method Day15$SearchRange.asSequence:()Lkotlin/sequences/Sequence;
     160: iload         8
     162: invokedynamic #135,  0            // InvokeDynamic #1:invoke:(I)Lkotlin/jvm/functions/Function1;
     167: invokestatic  #80                 // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
     170: nop
     171: invokestatic  #139                // Method kotlin/sequences/SequencesKt.first:(Lkotlin/sequences/Sequence;)Ljava/lang/Object;
     174: checkcast     #141                // class Day15$Position
     177: astore        4
     179: aload         4
     181: invokevirtual #144                // Method Day15$Position.getX:()I
     184: i2l
     185: ldc           #145                // int 4000000
     187: i2l
     188: lmul
     189: aload         4
     191: invokevirtual #148                // Method Day15$Position.getY:()I
     194: i2l
     195: ladd
     196: lreturn

  public final int numberOfNonBeacon(java.lang.String, int);
    Code:
       0: aload_1
       1: ldc           #15                 // String input
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: getstatic     #35                 // Field Day15$Scan.Companion:LDay15$Scan$Companion;
       9: aload_1
      10: invokevirtual #41                 // Method Day15$Scan$Companion.parse:(Ljava/lang/String;)LDay15$Scan;
      13: astore_3
      14: new           #43                 // class kotlin/ranges/IntRange
      17: dup
      18: aload_3
      19: invokevirtual #169                // Method Day15$Scan.getMinX:()I
      22: aload_3
      23: invokevirtual #172                // Method Day15$Scan.getMaxX:()I
      26: invokespecial #46                 // Method kotlin/ranges/IntRange."<init>":(II)V
      29: astore        4
      31: aload_3
      32: iload_2
      33: new           #43                 // class kotlin/ranges/IntRange
      36: dup
      37: aload_3
      38: invokevirtual #169                // Method Day15$Scan.getMinX:()I
      41: aload_3
      42: invokevirtual #172                // Method Day15$Scan.getMaxX:()I
      45: invokespecial #46                 // Method kotlin/ranges/IntRange."<init>":(II)V
      48: invokevirtual #176                // Method Day15$Scan.uncoveredRange:(ILkotlin/ranges/IntRange;)LDay15$SearchRange;
      51: astore        5
      53: aload_0
      54: aload         4
      56: invokevirtual #179                // Method getSize:(Lkotlin/ranges/IntRange;)I
      59: aload         5
      61: invokevirtual #107                // Method Day15$SearchRange.getSize:()I
      64: isub
      65: aload_3
      66: invokevirtual #183                // Method Day15$Scan.getBeacons:()Ljava/util/Set;
      69: checkcast     #48                 // class java/lang/Iterable
      72: astore        6
      74: istore        13
      76: iconst_0
      77: istore        7
      79: aload         6
      81: instanceof    #185                // class java/util/Collection
      84: ifeq          104
      87: aload         6
      89: checkcast     #185                // class java/util/Collection
      92: invokeinterface #188,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
      97: ifeq          104
     100: iconst_0
     101: goto          178
     104: iconst_0
     105: istore        8
     107: aload         6
     109: invokeinterface #189,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     114: astore        9
     116: aload         9
     118: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     123: ifeq          176
     126: aload         9
     128: invokeinterface #96,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     133: astore        10
     135: aload         10
     137: checkcast     #141                // class Day15$Position
     140: astore        11
     142: iconst_0
     143: istore        12
     145: aload         11
     147: invokevirtual #148                // Method Day15$Position.getY:()I
     150: iload_2
     151: if_icmpne     158
     154: iconst_1
     155: goto          159
     158: iconst_0
     159: ifeq          116
     162: iinc          8, 1
     165: iload         8
     167: ifge          116
     170: invokestatic  #192                // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V
     173: goto          116
     176: iload         8
     178: istore        14
     180: iload         13
     182: iload         14
     184: isub
     185: ireturn

  private final kotlin.Pair<Day15$Position, Day15$Position> parseLine(java.lang.String);
    Code:
       0: getstatic     #208                // Field LINE_REGEX:Lkotlin/text/Regex;
       3: aload_1
       4: checkcast     #210                // class java/lang/CharSequence
       7: iconst_0
       8: iconst_2
       9: aconst_null
      10: invokestatic  #216                // Method kotlin/text/Regex.find$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/text/MatchResult;
      13: dup
      14: invokestatic  #220                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      17: invokeinterface #226,  1          // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;
      22: astore_2
      23: aload_2
      24: iconst_1
      25: invokeinterface #232,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      30: checkcast     #166                // class java/lang/String
      33: astore_3
      34: aload_2
      35: iconst_2
      36: invokeinterface #232,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      41: checkcast     #166                // class java/lang/String
      44: astore        4
      46: aload_2
      47: iconst_3
      48: invokeinterface #232,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      53: checkcast     #166                // class java/lang/String
      56: astore        5
      58: aload_2
      59: iconst_4
      60: invokeinterface #232,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      65: checkcast     #166                // class java/lang/String
      68: astore        6
      70: new           #141                // class Day15$Position
      73: dup
      74: aload_3
      75: invokestatic  #238                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      78: aload         4
      80: invokestatic  #238                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      83: invokespecial #239                // Method Day15$Position."<init>":(II)V
      86: new           #141                // class Day15$Position
      89: dup
      90: aload         5
      92: invokestatic  #238                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      95: aload         6
      97: invokestatic  #238                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     100: invokespecial #239                // Method Day15$Position."<init>":(II)V
     103: invokestatic  #245                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     106: areturn

  public final int getSize(kotlin.ranges.IntRange);
    Code:
       0: aload_1
       1: ldc           #252                // String <this>
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokevirtual #255                // Method kotlin/ranges/IntRange.getLast:()I
      10: aload_1
      11: invokevirtual #258                // Method kotlin/ranges/IntRange.getFirst:()I
      14: isub
      15: iconst_1
      16: iadd
      17: ireturn

  private static final kotlin.Pair part2$lambda$0(Day15$Scan, int, int);
    Code:
       0: iload_2
       1: invokestatic  #263                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
       4: aload_0
       5: iload_2
       6: new           #43                 // class kotlin/ranges/IntRange
       9: dup
      10: iconst_0
      11: iload_1
      12: invokespecial #46                 // Method kotlin/ranges/IntRange."<init>":(II)V
      15: invokevirtual #176                // Method Day15$Scan.uncoveredRange:(ILkotlin/ranges/IntRange;)LDay15$SearchRange;
      18: invokestatic  #245                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      21: areturn

  private static final Day15$Position part2$lambda$3$lambda$2(int, int);
    Code:
       0: new           #141                // class Day15$Position
       3: dup
       4: iload_1
       5: iload_0
       6: invokespecial #239                // Method Day15$Position."<init>":(II)V
       9: areturn

  public static final kotlin.Pair access$parseLine(Day15, java.lang.String);
    Code:
       0: aload_0
       1: aload_1
       2: invokespecial #270                // Method parseLine:(Ljava/lang/String;)Lkotlin/Pair;
       5: areturn

  static {};
    Code:
       0: new           #2                  // class Day15
       3: dup
       4: invokespecial #273                // Method "<init>":()V
       7: putstatic     #276                // Field INSTANCE:LDay15;
      10: new           #212                // class kotlin/text/Regex
      13: dup
      14: ldc_w         #278                // String Sensor at x=(-?\\d+), y=(-?\\d+): closest beacon is at x=(-?\\d+), y=(-?\\d+)
      17: invokespecial #279                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
      20: putstatic     #208                // Field LINE_REGEX:Lkotlin/text/Regex;
      23: return
}

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

  private final java.util.Set<Day15$Position> beacons;

  private final java.util.List<Day15$Sensor> sensors;

  private Day15$Scan(java.util.Set<Day15$Position>, java.util.List<Day15$Sensor>);
    Code:
       0: aload_0
       1: invokespecial #10                 // Method java/lang/Object."<init>":()V
       4: aload_0
       5: aload_1
       6: putfield      #14                 // Field beacons:Ljava/util/Set;
       9: aload_0
      10: aload_2
      11: putfield      #18                 // Field sensors:Ljava/util/List;
      14: return

  public final java.util.Set<Day15$Position> getBeacons();
    Code:
       0: aload_0
       1: getfield      #14                 // Field beacons:Ljava/util/Set;
       4: areturn

  public final int getMinX();
    Code:
       0: aload_0
       1: getfield      #18                 // Field sensors:Ljava/util/List;
       4: checkcast     #28                 // class java/lang/Iterable
       7: invokeinterface #32,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      12: astore_1
      13: aload_1
      14: invokeinterface #38,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      19: ifne          30
      22: new           #40                 // class java/util/NoSuchElementException
      25: dup
      26: invokespecial #41                 // Method java/util/NoSuchElementException."<init>":()V
      29: athrow
      30: aload_1
      31: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      36: checkcast     #47                 // class Day15$Sensor
      39: astore_2
      40: iconst_0
      41: istore_3
      42: aload_2
      43: invokevirtual #49                 // Method Day15$Sensor.getMinX:()I
      46: istore_2
      47: aload_1
      48: invokeinterface #38,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      53: ifeq          84
      56: aload_1
      57: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      62: checkcast     #47                 // class Day15$Sensor
      65: astore_3
      66: iconst_0
      67: istore        4
      69: aload_3
      70: invokevirtual #49                 // Method Day15$Sensor.getMinX:()I
      73: istore_3
      74: iload_2
      75: iload_3
      76: if_icmple     47
      79: iload_3
      80: istore_2
      81: goto          47
      84: iload_2
      85: ireturn

  public final int getMaxX();
    Code:
       0: aload_0
       1: getfield      #18                 // Field sensors:Ljava/util/List;
       4: checkcast     #28                 // class java/lang/Iterable
       7: invokeinterface #32,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      12: astore_1
      13: aload_1
      14: invokeinterface #38,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      19: ifne          30
      22: new           #40                 // class java/util/NoSuchElementException
      25: dup
      26: invokespecial #41                 // Method java/util/NoSuchElementException."<init>":()V
      29: athrow
      30: aload_1
      31: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      36: checkcast     #47                 // class Day15$Sensor
      39: astore_2
      40: iconst_0
      41: istore_3
      42: aload_2
      43: invokevirtual #56                 // Method Day15$Sensor.getMaxX:()I
      46: istore_2
      47: aload_1
      48: invokeinterface #38,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      53: ifeq          84
      56: aload_1
      57: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      62: checkcast     #47                 // class Day15$Sensor
      65: astore_3
      66: iconst_0
      67: istore        4
      69: aload_3
      70: invokevirtual #56                 // Method Day15$Sensor.getMaxX:()I
      73: istore_3
      74: iload_2
      75: iload_3
      76: if_icmpge     47
      79: iload_3
      80: istore_2
      81: goto          47
      84: iload_2
      85: ireturn

  public final Day15$SearchRange uncoveredRange(int, kotlin.ranges.IntRange);
    Code:
       0: aload_2
       1: ldc           #61                 // String initialRange
       3: invokestatic  #67                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #18                 // Field sensors:Ljava/util/List;
      10: checkcast     #28                 // class java/lang/Iterable
      13: astore_3
      14: new           #69                 // class Day15$SearchRange
      17: dup
      18: aload_2
      19: invokespecial #72                 // Method Day15$SearchRange."<init>":(Lkotlin/ranges/IntRange;)V
      22: astore        4
      24: iconst_0
      25: istore        5
      27: aload         4
      29: astore        6
      31: aload_3
      32: invokeinterface #32,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      37: astore        7
      39: aload         7
      41: invokeinterface #38,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      46: ifeq          107
      49: aload         7
      51: invokeinterface #45,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      56: astore        8
      58: aload         6
      60: aload         8
      62: checkcast     #47                 // class Day15$Sensor
      65: astore        9
      67: astore        10
      69: iconst_0
      70: istore        11
      72: aload         9
      74: iload_1
      75: invokevirtual #76                 // Method Day15$Sensor.coverage:(I)Lkotlin/ranges/IntRange;
      78: dup
      79: ifnull        99
      82: astore        12
      84: iconst_0
      85: istore        13
      87: aload         10
      89: aload         12
      91: invokevirtual #80                 // Method Day15$SearchRange.remove:(Lkotlin/ranges/IntRange;)LDay15$SearchRange;
      94: nop
      95: dup
      96: ifnonnull     102
      99: pop
     100: aload         10
     102: astore        6
     104: goto          39
     107: aload         6
     109: areturn

  public Day15$Scan(java.util.Set, java.util.List, kotlin.jvm.internal.DefaultConstructorMarker);
    Code:
       0: aload_0
       1: aload_1
       2: aload_2
       3: invokespecial #100                // Method "<init>":(Ljava/util/Set;Ljava/util/List;)V
       6: return

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

Compiled from "Day15.kt"
final class Day15$Sensor {
  private final Day15$Position position;

  private final int range;

  private final int minX;

  private final int maxX;

  public Day15$Sensor(Day15$Position, int);
    Code:
       0: aload_1
       1: ldc           #9                  // String position
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokespecial #18                 // Method java/lang/Object."<init>":()V
      10: aload_0
      11: aload_1
      12: putfield      #21                 // Field position:LDay15$Position;
      15: aload_0
      16: iload_2
      17: putfield      #25                 // Field range:I
      20: aload_0
      21: aload_0
      22: getfield      #21                 // Field position:LDay15$Position;
      25: invokevirtual #31                 // Method Day15$Position.getX:()I
      28: aload_0
      29: getfield      #25                 // Field range:I
      32: isub
      33: putfield      #34                 // Field minX:I
      36: aload_0
      37: aload_0
      38: getfield      #21                 // Field position:LDay15$Position;
      41: invokevirtual #31                 // Method Day15$Position.getX:()I
      44: aload_0
      45: getfield      #25                 // Field range:I
      48: iadd
      49: putfield      #37                 // Field maxX:I
      52: return

  public final Day15$Position getPosition();
    Code:
       0: aload_0
       1: getfield      #21                 // Field position:LDay15$Position;
       4: areturn

  public final int getRange();
    Code:
       0: aload_0
       1: getfield      #25                 // Field range:I
       4: ireturn

  public final int getMinX();
    Code:
       0: aload_0
       1: getfield      #34                 // Field minX:I
       4: ireturn

  public final int getMaxX();
    Code:
       0: aload_0
       1: getfield      #37                 // Field maxX:I
       4: ireturn

  public final boolean contains(Day15$Position);
    Code:
       0: aload_1
       1: ldc           #48                 // String otherPosition
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: invokevirtual #51                 // Method Day15$Position.getY:()I
      11: invokevirtual #55                 // Method coverage:(I)Lkotlin/ranges/IntRange;
      14: dup
      15: ifnull        66
      18: astore_2
      19: iconst_0
      20: istore_3
      21: aload_2
      22: invokevirtual #60                 // Method kotlin/ranges/IntRange.getFirst:()I
      25: istore        4
      27: aload_2
      28: invokevirtual #63                 // Method kotlin/ranges/IntRange.getLast:()I
      31: istore        5
      33: aload_1
      34: invokevirtual #31                 // Method Day15$Position.getX:()I
      37: istore        6
      39: iload         4
      41: iload         6
      43: if_icmpgt     61
      46: iload         6
      48: iload         5
      50: if_icmpgt     57
      53: iconst_1
      54: goto          62
      57: iconst_0
      58: goto          62
      61: iconst_0
      62: nop
      63: goto          68
      66: pop
      67: iconst_0
      68: ireturn

  public final kotlin.ranges.IntRange coverage(int);
    Code:
       0: iload_1
       1: aload_0
       2: getfield      #21                 // Field position:LDay15$Position;
       5: invokevirtual #51                 // Method Day15$Position.getY:()I
       8: isub
       9: invokestatic  #73                 // Method java/lang/Math.abs:(I)I
      12: istore_2
      13: iload_2
      14: aload_0
      15: getfield      #25                 // Field range:I
      18: if_icmple     23
      21: aconst_null
      22: areturn
      23: aload_0
      24: getfield      #25                 // Field range:I
      27: iload_2
      28: isub
      29: istore_3
      30: new           #57                 // class kotlin/ranges/IntRange
      33: dup
      34: aload_0
      35: getfield      #21                 // Field position:LDay15$Position;
      38: invokevirtual #31                 // Method Day15$Position.getX:()I
      41: iload_3
      42: isub
      43: aload_0
      44: getfield      #21                 // Field position:LDay15$Position;
      47: invokevirtual #31                 // Method Day15$Position.getX:()I
      50: iload_3
      51: iadd
      52: invokespecial #76                 // Method kotlin/ranges/IntRange."<init>":(II)V
      55: areturn

  public final Day15$Position component1();
    Code:
       0: aload_0
       1: getfield      #21                 // Field position:LDay15$Position;
       4: areturn

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

  public final Day15$Sensor copy(Day15$Position, int);
    Code:
       0: aload_1
       1: ldc           #9                  // String position
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #2                  // class Day15$Sensor
       9: dup
      10: aload_1
      11: iload_2
      12: invokespecial #85                 // Method "<init>":(LDay15$Position;I)V
      15: areturn

  public static Day15$Sensor copy$default(Day15$Sensor, Day15$Position, int, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #21                 // Field position:LDay15$Position;
      10: astore_1
      11: iload_3
      12: iconst_2
      13: iand
      14: ifeq          22
      17: aload_0
      18: getfield      #25                 // Field range:I
      21: istore_2
      22: aload_0
      23: aload_1
      24: iload_2
      25: invokevirtual #89                 // Method copy:(LDay15$Position;I)LDay15$Sensor;
      28: areturn

  public java.lang.String toString();
    Code:
       0: new           #93                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #94                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #96                 // String Sensor(position=
       9: invokevirtual #100                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #21                 // Field position:LDay15$Position;
      16: invokevirtual #103                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      19: ldc           #105                // String , range=
      21: invokevirtual #100                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #25                 // Field range:I
      28: invokevirtual #108                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #111                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #113                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      39: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #21                 // Field position:LDay15$Position;
       4: invokevirtual #116                // Method Day15$Position.hashCode:()I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #25                 // Field range:I
      16: invokestatic  #120                // Method java/lang/Integer.hashCode:(I)I
      19: iadd
      20: istore_1
      21: iload_1
      22: ireturn

  public boolean equals(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: if_acmpne     7
       5: iconst_1
       6: ireturn
       7: aload_1
       8: instanceof    #2                  // class Day15$Sensor
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day15$Sensor
      20: astore_2
      21: aload_0
      22: getfield      #21                 // Field position:LDay15$Position;
      25: aload_2
      26: getfield      #21                 // Field position:LDay15$Position;
      29: invokestatic  #127                // 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      #25                 // Field range:I
      41: aload_2
      42: getfield      #25                 // Field range:I
      45: if_icmpeq     50
      48: iconst_0
      49: ireturn
      50: iconst_1
      51: ireturn
}

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

  public final Day15$Scan parse(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #15                 // String input
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #23                 // class java/util/LinkedHashSet
       9: dup
      10: invokespecial #24                 // Method java/util/LinkedHashSet."<init>":()V
      13: checkcast     #26                 // class java/util/Set
      16: astore_2
      17: new           #28                 // class java/util/ArrayList
      20: dup
      21: invokespecial #29                 // Method java/util/ArrayList."<init>":()V
      24: checkcast     #31                 // class java/util/List
      27: astore_3
      28: aload_1
      29: checkcast     #33                 // class java/lang/CharSequence
      32: invokestatic  #39                 // Method kotlin/text/StringsKt.lineSequence:(Ljava/lang/CharSequence;)Lkotlin/sequences/Sequence;
      35: astore        4
      37: nop
      38: iconst_0
      39: istore        5
      41: aload         4
      43: invokeinterface #45,  1           // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
      48: astore        6
      50: aload         6
      52: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      57: ifeq          146
      60: aload         6
      62: invokeinterface #55,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      67: astore        7
      69: aload         7
      71: checkcast     #57                 // class java/lang/String
      74: astore        8
      76: iconst_0
      77: istore        9
      79: getstatic     #63                 // Field Day15.INSTANCE:LDay15;
      82: aload         8
      84: invokestatic  #67                 // Method Day15.access$parseLine:(LDay15;Ljava/lang/String;)Lkotlin/Pair;
      87: astore        10
      89: aload         10
      91: invokevirtual #72                 // Method kotlin/Pair.component1:()Ljava/lang/Object;
      94: checkcast     #74                 // class Day15$Position
      97: astore        11
      99: aload         10
     101: invokevirtual #77                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
     104: checkcast     #74                 // class Day15$Position
     107: astore        12
     109: aload_2
     110: aload         12
     112: invokeinterface #81,  2           // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
     117: pop
     118: aload_3
     119: new           #83                 // class Day15$Sensor
     122: dup
     123: aload         11
     125: aload         11
     127: aload         12
     129: invokevirtual #87                 // Method Day15$Position.distanceTo:(LDay15$Position;)I
     132: invokespecial #90                 // Method Day15$Sensor."<init>":(LDay15$Position;I)V
     135: invokeinterface #91,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     140: pop
     141: nop
     142: nop
     143: goto          50
     146: nop
     147: new           #93                 // class Day15$Scan
     150: dup
     151: aload_2
     152: aload_3
     153: aconst_null
     154: invokespecial #96                 // Method Day15$Scan."<init>":(Ljava/util/Set;Ljava/util/List;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
     157: areturn

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

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

  private final int y;

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

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

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

  public final int distanceTo(Day15$Position);
    Code:
       0: aload_1
       1: ldc           #26                 // String other
       3: invokestatic  #32                 // 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  #38                 // 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  #38                 // Method java/lang/Math.abs:(I)I
      30: iadd
      31: ireturn

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

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

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

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

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

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

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

Compiled from "Day15.kt"
final class Day15$SearchRange {
  private final java.util.List<kotlin.ranges.IntRange> ranges;

  private Day15$SearchRange(java.util.List<kotlin.ranges.IntRange>);
    Code:
       0: aload_0
       1: invokespecial #10                 // Method java/lang/Object."<init>":()V
       4: aload_0
       5: aload_1
       6: putfield      #14                 // Field ranges:Ljava/util/List;
       9: return

  public final java.util.List<kotlin.ranges.IntRange> getRanges();
    Code:
       0: aload_0
       1: getfield      #14                 // Field ranges:Ljava/util/List;
       4: areturn

  public Day15$SearchRange(kotlin.ranges.IntRange);
    Code:
       0: aload_1
       1: ldc           #23                 // String range
       3: invokestatic  #29                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: invokestatic  #35                 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
      11: invokespecial #37                 // Method "<init>":(Ljava/util/List;)V
      14: return

  public final int getSize();
    Code:
       0: aload_0
       1: getfield      #14                 // Field ranges:Ljava/util/List;
       4: checkcast     #42                 // class java/lang/Iterable
       7: astore_1
       8: iconst_0
       9: istore_2
      10: aload_1
      11: invokeinterface #46,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      16: astore_3
      17: aload_3
      18: invokeinterface #52,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      23: ifeq          66
      26: aload_3
      27: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      32: astore        4
      34: iload_2
      35: aload         4
      37: checkcast     #58                 // class kotlin/ranges/IntRange
      40: astore        5
      42: istore        7
      44: iconst_0
      45: istore        6
      47: getstatic     #64                 // Field Day15.INSTANCE:LDay15;
      50: aload         5
      52: invokevirtual #67                 // Method Day15.getSize:(Lkotlin/ranges/IntRange;)I
      55: istore        8
      57: iload         7
      59: iload         8
      61: iadd
      62: istore_2
      63: goto          17
      66: iload_2
      67: ireturn

  public final kotlin.sequences.Sequence<java.lang.Integer> asSequence();
    Code:
       0: aload_0
       1: getfield      #14                 // Field ranges:Ljava/util/List;
       4: checkcast     #42                 // class java/lang/Iterable
       7: invokestatic  #76                 // Method kotlin/collections/CollectionsKt.asSequence:(Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;
      10: invokedynamic #95,  0             // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      15: invokestatic  #101                // Method kotlin/sequences/SequencesKt.flatMap:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      18: areturn

  public final Day15$SearchRange remove(kotlin.ranges.IntRange);
    Code:
       0: aload_1
       1: ldc           #23                 // String range
       3: invokestatic  #29                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #14                 // Field ranges:Ljava/util/List;
      10: invokeinterface #108,  1          // InterfaceMethod java/util/List.isEmpty:()Z
      15: ifeq          20
      18: aload_0
      19: areturn
      20: aload_0
      21: getfield      #14                 // Field ranges:Ljava/util/List;
      24: checkcast     #42                 // class java/lang/Iterable
      27: astore_2
      28: iconst_0
      29: istore_3
      30: aload_2
      31: astore        4
      33: new           #110                // class java/util/ArrayList
      36: dup
      37: invokespecial #111                // Method java/util/ArrayList."<init>":()V
      40: checkcast     #113                // class java/util/Collection
      43: astore        5
      45: iconst_0
      46: istore        6
      48: aload         4
      50: invokeinterface #46,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      55: astore        7
      57: aload         7
      59: invokeinterface #52,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      64: ifeq          109
      67: aload         7
      69: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      74: astore        8
      76: aload         8
      78: checkcast     #58                 // class kotlin/ranges/IntRange
      81: astore        9
      83: iconst_0
      84: istore        10
      86: aload_0
      87: aload         9
      89: aload_1
      90: invokespecial #116                // Method remove:(Lkotlin/ranges/IntRange;Lkotlin/ranges/IntRange;)Ljava/util/List;
      93: checkcast     #42                 // class java/lang/Iterable
      96: astore        9
      98: aload         5
     100: aload         9
     102: invokestatic  #120                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     105: pop
     106: goto          57
     109: aload         5
     111: checkcast     #105                // class java/util/List
     114: nop
     115: astore        11
     117: new           #2                  // class Day15$SearchRange
     120: dup
     121: aload         11
     123: invokespecial #37                 // Method "<init>":(Ljava/util/List;)V
     126: areturn

  private final java.util.List<kotlin.ranges.IntRange> remove(kotlin.ranges.IntRange, kotlin.ranges.IntRange);
    Code:
       0: invokestatic  #135                // Method kotlin/collections/CollectionsKt.createListBuilder:()Ljava/util/List;
       3: astore_3
       4: aload_3
       5: astore        4
       7: iconst_0
       8: istore        5
      10: new           #58                 // class kotlin/ranges/IntRange
      13: dup
      14: aload_1
      15: invokevirtual #138                // Method kotlin/ranges/IntRange.getFirst:()I
      18: aload_2
      19: invokevirtual #138                // Method kotlin/ranges/IntRange.getFirst:()I
      22: iconst_1
      23: isub
      24: aload_1
      25: invokevirtual #141                // Method kotlin/ranges/IntRange.getLast:()I
      28: invokestatic  #147                // Method java/lang/Math.min:(II)I
      31: invokespecial #150                // Method kotlin/ranges/IntRange."<init>":(II)V
      34: astore        6
      36: aload         6
      38: astore        7
      40: iconst_0
      41: istore        8
      43: aload         7
      45: invokevirtual #151                // Method kotlin/ranges/IntRange.isEmpty:()Z
      48: ifne          56
      51: aload         6
      53: goto          57
      56: aconst_null
      57: astore        9
      59: aload         9
      61: ifnull        84
      64: aload         9
      66: astore        7
      68: iconst_0
      69: istore        8
      71: aload         4
      73: aload         7
      75: invokeinterface #155,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      80: pop
      81: goto          85
      84: nop
      85: new           #58                 // class kotlin/ranges/IntRange
      88: dup
      89: aload_2
      90: invokevirtual #141                // Method kotlin/ranges/IntRange.getLast:()I
      93: iconst_1
      94: iadd
      95: aload_1
      96: invokevirtual #138                // Method kotlin/ranges/IntRange.getFirst:()I
      99: invokestatic  #158                // Method java/lang/Math.max:(II)I
     102: aload_1
     103: invokevirtual #162                // Method kotlin/ranges/IntRange.getEndInclusive:()Ljava/lang/Integer;
     106: invokevirtual #167                // Method java/lang/Integer.intValue:()I
     109: invokespecial #150                // Method kotlin/ranges/IntRange."<init>":(II)V
     112: astore        6
     114: aload         6
     116: astore        7
     118: iconst_0
     119: istore        8
     121: aload         7
     123: invokevirtual #151                // Method kotlin/ranges/IntRange.isEmpty:()Z
     126: ifne          134
     129: aload         6
     131: goto          135
     134: aconst_null
     135: astore        9
     137: aload         9
     139: ifnull        162
     142: aload         9
     144: astore        7
     146: iconst_0
     147: istore        8
     149: aload         4
     151: aload         7
     153: invokeinterface #155,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     158: pop
     159: goto          163
     162: nop
     163: nop
     164: aload_3
     165: invokestatic  #171                // Method kotlin/collections/CollectionsKt.build:(Ljava/util/List;)Ljava/util/List;
     168: areturn

  private static final kotlin.sequences.Sequence asSequence$lambda$1(kotlin.ranges.IntRange);
    Code:
       0: aload_0
       1: ldc           #181                // String it
       3: invokestatic  #29                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: checkcast     #42                 // class java/lang/Iterable
      10: invokestatic  #76                 // Method kotlin/collections/CollectionsKt.asSequence:(Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;
      13: areturn
}