import java.lang.Long.min
import kotlin.String
import kotlin.collections.List

object Day5 {
    data class Range(val start: Long, val end: Long)
    data class RangeMapping(val destinationRangeStart: Long, val sourceRangeStart: Long, val rangeLength: Long) {
        fun next(id: Long): Long {
            return if (sourceRangeStart <= id && id <= sourceRangeStart + rangeLength) {
                val offset = id - sourceRangeStart
                destinationRangeStart + offset
            } else {
                id
            }
        }

        fun next(range: Range): Range {
            val offset = range.start - sourceRangeStart
            return Range(destinationRangeStart + offset, destinationRangeStart + offset + range.end - range.start)
        }

        fun overlaps(id: Long): Boolean {
            return sourceRangeStart <= id && id < sourceRangeStart + rangeLength
        }

        fun overlaps(range: Range): Boolean {
            return sourceRangeStart <= range.start && range.end <= sourceRangeStart + rangeLength - 1
        }
    }

    data class Mapping(
        val category: String,
        val rangeMappings: List<RangeMapping>
    ) {

        fun fork(range: Range): List<Range> {
            if (rangeMappings.any { it.overlaps(range) }) {
                return listOf(range)
            }
            var start = range.start
            val end = range.end

            val ranges = mutableListOf<Range>()
            while (start <= end) {
                val closestWithoutGoingOver =
                    rangeMappings.filter { it.sourceRangeStart <= start && start < it.sourceRangeStart + it.rangeLength }
                        .minByOrNull { it.sourceRangeStart - range.start }
                if (closestWithoutGoingOver != null) {
                    val newEnd =
                        min(end, closestWithoutGoingOver.sourceRangeStart + closestWithoutGoingOver.rangeLength - 1)
                    ranges.add(Range(start, newEnd))
                    start = newEnd + 1
                } else {
                    val closestWithGoingOver =
                        rangeMappings.filter { it.sourceRangeStart + it.rangeLength > start }
                            .minByOrNull { it.sourceRangeStart - start }
                    if (closestWithGoingOver == null) {
                        ranges.add(Range(start, end))
                        start = end + 1
                    } else {
                        val newEnd = min(end, closestWithGoingOver.sourceRangeStart - 1)
                        ranges.add(Range(start, newEnd))
                        start = newEnd + 1
                    }
                }
            }
            return ranges
        }

        companion object {
            fun parseMappings(input: List<String>): List<Mapping> {
                var remainingInput = input
                val mappings = mutableListOf<Mapping>()
                while (remainingInput.isNotEmpty()) {
                    val category = remainingInput.first().split(" ").first()
                    val ranges = remainingInput.drop(1).takeWhile { it.isNotEmpty() }.map {
                        val (destinationRangeStart, sourceRangeStart, rangeLength) = it.split(" ")
                        RangeMapping(
                            destinationRangeStart.toLong(),
                            sourceRangeStart.toLong(),
                            rangeLength.toLong()
                        )
                    }
                    mappings.add(Mapping(category, ranges))
                    remainingInput = remainingInput.drop(ranges.size + 2)
                }
                return mappings
            }
        }
    }

    fun part1(input: List<String>): String {
        val seeds = input.first().replace("seeds: ", "")
            .split(" ")
            .map { it.toLong() }
        val mappings = Mapping.parseMappings(input.drop(2))
        val finalMappings = mappings.fold(seeds) { acc, mapping ->
            acc.map { id ->
                val range = mapping.rangeMappings.find { it.overlaps(id) }
                range?.next(id) ?: id
            }
        }
        return finalMappings.min().toString()
    }

    fun part2(input: List<String>): String {
        val ranges = input.first().replace("seeds: ", "")
            .split(" ")
            .map { it.toLong() }
            .chunked(2)
            .map { Range(it.first(), it.first() + it.last()) }
        val mappings = Mapping.parseMappings(input.drop(2))
        val finalRanges = mappings.fold(ranges) { transformedRanges, mapping ->
            transformedRanges.flatMap { range ->
                val nextRanges = mapping.fork(range).map { forkedRange ->
                    val overlaps = mapping.rangeMappings.filter { it.overlaps(forkedRange) }
                        .minByOrNull { it.sourceRangeStart - forkedRange.start }
                    overlaps?.next(forkedRange) ?: forkedRange
                }
                nextRanges
            }
        }
        return finalRanges.minBy { it.start }.start.toString()
    }
}

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

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

  public final java.lang.String part1(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #16                 // String input
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokestatic  #28                 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
      10: checkcast     #30                 // class java/lang/String
      13: ldc           #32                 // String seeds:
      15: ldc           #34                 // String
      17: iconst_0
      18: iconst_4
      19: aconst_null
      20: invokestatic  #40                 // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;
      23: checkcast     #42                 // class java/lang/CharSequence
      26: iconst_1
      27: anewarray     #30                 // class java/lang/String
      30: astore_3
      31: aload_3
      32: iconst_0
      33: ldc           #44                 // String
      35: aastore
      36: aload_3
      37: iconst_0
      38: iconst_0
      39: bipush        6
      41: aconst_null
      42: invokestatic  #48                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      45: checkcast     #50                 // class java/lang/Iterable
      48: astore_3
      49: nop
      50: iconst_0
      51: istore        4
      53: aload_3
      54: astore        5
      56: new           #52                 // class java/util/ArrayList
      59: dup
      60: aload_3
      61: bipush        10
      63: invokestatic  #56                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      66: invokespecial #59                 // Method java/util/ArrayList."<init>":(I)V
      69: checkcast     #61                 // class java/util/Collection
      72: astore        6
      74: iconst_0
      75: istore        7
      77: aload         5
      79: invokeinterface #65,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      84: astore        8
      86: aload         8
      88: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      93: ifeq          140
      96: aload         8
      98: invokeinterface #75,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     103: astore        9
     105: aload         6
     107: aload         9
     109: checkcast     #30                 // class java/lang/String
     112: astore        10
     114: astore        30
     116: iconst_0
     117: istore        11
     119: aload         10
     121: invokestatic  #81                 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
     124: nop
     125: invokestatic  #85                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     128: aload         30
     130: swap
     131: invokeinterface #89,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     136: pop
     137: goto          86
     140: aload         6
     142: checkcast     #91                 // class java/util/List
     145: nop
     146: astore_2
     147: getstatic     #97                 // Field Day5$Mapping.Companion:LDay5$Mapping$Companion;
     150: aload_1
     151: checkcast     #50                 // class java/lang/Iterable
     154: iconst_2
     155: invokestatic  #101                // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
     158: invokevirtual #107                // Method Day5$Mapping$Companion.parseMappings:(Ljava/util/List;)Ljava/util/List;
     161: astore_3
     162: aload_3
     163: checkcast     #50                 // class java/lang/Iterable
     166: astore        5
     168: iconst_0
     169: istore        6
     171: aload_2
     172: astore        7
     174: aload         5
     176: invokeinterface #65,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     181: astore        8
     183: aload         8
     185: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     190: ifeq          410
     193: aload         8
     195: invokeinterface #75,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     200: astore        9
     202: aload         7
     204: aload         9
     206: checkcast     #93                 // class Day5$Mapping
     209: astore        10
     211: astore        11
     213: iconst_0
     214: istore        12
     216: aload         11
     218: checkcast     #50                 // class java/lang/Iterable
     221: astore        13
     223: iconst_0
     224: istore        14
     226: aload         13
     228: astore        15
     230: new           #52                 // class java/util/ArrayList
     233: dup
     234: aload         13
     236: bipush        10
     238: invokestatic  #56                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     241: invokespecial #59                 // Method java/util/ArrayList."<init>":(I)V
     244: checkcast     #61                 // class java/util/Collection
     247: astore        16
     249: iconst_0
     250: istore        17
     252: aload         15
     254: invokeinterface #65,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     259: astore        18
     261: aload         18
     263: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     268: ifeq          398
     271: aload         18
     273: invokeinterface #75,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     278: astore        19
     280: aload         16
     282: aload         19
     284: checkcast     #109                // class java/lang/Number
     287: invokevirtual #113                // Method java/lang/Number.longValue:()J
     290: lstore        20
     292: astore        22
     294: iconst_0
     295: istore        23
     297: aload         10
     299: invokevirtual #117                // Method Day5$Mapping.getRangeMappings:()Ljava/util/List;
     302: checkcast     #50                 // class java/lang/Iterable
     305: astore        24
     307: aload         24
     309: invokeinterface #65,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     314: astore        25
     316: aload         25
     318: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     323: ifeq          360
     326: aload         25
     328: invokeinterface #75,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     333: astore        26
     335: aload         26
     337: checkcast     #119                // class Day5$RangeMapping
     340: astore        27
     342: iconst_0
     343: istore        28
     345: aload         27
     347: lload         20
     349: invokevirtual #123                // Method Day5$RangeMapping.overlaps:(J)Z
     352: ifeq          316
     355: aload         26
     357: goto          361
     360: aconst_null
     361: checkcast     #119                // class Day5$RangeMapping
     364: astore        29
     366: aload         29
     368: dup
     369: ifnull        380
     372: lload         20
     374: invokevirtual #126                // Method Day5$RangeMapping.next:(J)J
     377: goto          383
     380: pop
     381: lload         20
     383: invokestatic  #85                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     386: aload         22
     388: swap
     389: invokeinterface #89,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     394: pop
     395: goto          261
     398: aload         16
     400: checkcast     #91                 // class java/util/List
     403: nop
     404: nop
     405: astore        7
     407: goto          183
     410: aload         7
     412: astore        4
     414: aload         4
     416: checkcast     #50                 // class java/lang/Iterable
     419: invokestatic  #130                // Method kotlin/collections/CollectionsKt.minOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;
     422: checkcast     #109                // class java/lang/Number
     425: invokevirtual #113                // Method java/lang/Number.longValue:()J
     428: invokestatic  #133                // Method java/lang/String.valueOf:(J)Ljava/lang/String;
     431: areturn

  public final java.lang.String part2(java.util.List<java.lang.String>);
    Code:
       0: aload_1
       1: ldc           #16                 // String input
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokestatic  #28                 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
      10: checkcast     #30                 // class java/lang/String
      13: ldc           #32                 // String seeds:
      15: ldc           #34                 // String
      17: iconst_0
      18: iconst_4
      19: aconst_null
      20: invokestatic  #40                 // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;
      23: checkcast     #42                 // class java/lang/CharSequence
      26: iconst_1
      27: anewarray     #30                 // class java/lang/String
      30: astore_3
      31: aload_3
      32: iconst_0
      33: ldc           #44                 // String
      35: aastore
      36: aload_3
      37: iconst_0
      38: iconst_0
      39: bipush        6
      41: aconst_null
      42: invokestatic  #48                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      45: checkcast     #50                 // class java/lang/Iterable
      48: astore_3
      49: nop
      50: iconst_0
      51: istore        4
      53: aload_3
      54: astore        5
      56: new           #52                 // class java/util/ArrayList
      59: dup
      60: aload_3
      61: bipush        10
      63: invokestatic  #56                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      66: invokespecial #59                 // Method java/util/ArrayList."<init>":(I)V
      69: checkcast     #61                 // class java/util/Collection
      72: astore        6
      74: iconst_0
      75: istore        7
      77: aload         5
      79: invokeinterface #65,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      84: astore        8
      86: aload         8
      88: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      93: ifeq          140
      96: aload         8
      98: invokeinterface #75,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     103: astore        9
     105: aload         6
     107: aload         9
     109: checkcast     #30                 // class java/lang/String
     112: astore        11
     114: astore        47
     116: iconst_0
     117: istore        12
     119: aload         11
     121: invokestatic  #81                 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
     124: nop
     125: invokestatic  #85                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     128: aload         47
     130: swap
     131: invokeinterface #89,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     136: pop
     137: goto          86
     140: aload         6
     142: checkcast     #91                 // class java/util/List
     145: nop
     146: checkcast     #50                 // class java/lang/Iterable
     149: iconst_2
     150: invokestatic  #168                // Method kotlin/collections/CollectionsKt.chunked:(Ljava/lang/Iterable;I)Ljava/util/List;
     153: checkcast     #50                 // class java/lang/Iterable
     156: astore_3
     157: nop
     158: iconst_0
     159: istore        4
     161: aload_3
     162: astore        5
     164: new           #52                 // class java/util/ArrayList
     167: dup
     168: aload_3
     169: bipush        10
     171: invokestatic  #56                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     174: invokespecial #59                 // Method java/util/ArrayList."<init>":(I)V
     177: checkcast     #61                 // class java/util/Collection
     180: astore        6
     182: iconst_0
     183: istore        7
     185: aload         5
     187: invokeinterface #65,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     192: astore        8
     194: aload         8
     196: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     201: ifeq          280
     204: aload         8
     206: invokeinterface #75,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     211: astore        9
     213: aload         6
     215: aload         9
     217: checkcast     #91                 // class java/util/List
     220: astore        11
     222: astore        47
     224: iconst_0
     225: istore        12
     227: new           #170                // class Day5$Range
     230: dup
     231: aload         11
     233: invokestatic  #28                 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     236: checkcast     #109                // class java/lang/Number
     239: invokevirtual #113                // Method java/lang/Number.longValue:()J
     242: aload         11
     244: invokestatic  #28                 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     247: checkcast     #109                // class java/lang/Number
     250: invokevirtual #113                // Method java/lang/Number.longValue:()J
     253: aload         11
     255: invokestatic  #173                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     258: checkcast     #109                // class java/lang/Number
     261: invokevirtual #113                // Method java/lang/Number.longValue:()J
     264: ladd
     265: invokespecial #176                // Method Day5$Range."<init>":(JJ)V
     268: aload         47
     270: swap
     271: invokeinterface #89,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     276: pop
     277: goto          194
     280: aload         6
     282: checkcast     #91                 // class java/util/List
     285: nop
     286: astore_2
     287: getstatic     #97                 // Field Day5$Mapping.Companion:LDay5$Mapping$Companion;
     290: aload_1
     291: checkcast     #50                 // class java/lang/Iterable
     294: iconst_2
     295: invokestatic  #101                // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
     298: invokevirtual #107                // Method Day5$Mapping$Companion.parseMappings:(Ljava/util/List;)Ljava/util/List;
     301: astore_3
     302: aload_3
     303: checkcast     #50                 // class java/lang/Iterable
     306: astore        5
     308: iconst_0
     309: istore        6
     311: aload_2
     312: astore        7
     314: aload         5
     316: invokeinterface #65,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     321: astore        8
     323: aload         8
     325: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     330: ifeq          817
     333: aload         8
     335: invokeinterface #75,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     340: astore        9
     342: aload         7
     344: aload         9
     346: checkcast     #93                 // class Day5$Mapping
     349: astore        11
     351: astore        12
     353: iconst_0
     354: istore        14
     356: aload         12
     358: checkcast     #50                 // class java/lang/Iterable
     361: astore        15
     363: iconst_0
     364: istore        16
     366: aload         15
     368: astore        17
     370: new           #52                 // class java/util/ArrayList
     373: dup
     374: invokespecial #177                // Method java/util/ArrayList."<init>":()V
     377: checkcast     #61                 // class java/util/Collection
     380: astore        18
     382: iconst_0
     383: istore        19
     385: aload         17
     387: invokeinterface #65,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     392: astore        20
     394: aload         20
     396: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     401: ifeq          805
     404: aload         20
     406: invokeinterface #75,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     411: astore        21
     413: aload         21
     415: checkcast     #170                // class Day5$Range
     418: astore        22
     420: iconst_0
     421: istore        23
     423: aload         11
     425: aload         22
     427: invokevirtual #181                // Method Day5$Mapping.fork:(LDay5$Range;)Ljava/util/List;
     430: checkcast     #50                 // class java/lang/Iterable
     433: astore        24
     435: iconst_0
     436: istore        25
     438: aload         24
     440: astore        26
     442: new           #52                 // class java/util/ArrayList
     445: dup
     446: aload         24
     448: bipush        10
     450: invokestatic  #56                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     453: invokespecial #59                 // Method java/util/ArrayList."<init>":(I)V
     456: checkcast     #61                 // class java/util/Collection
     459: astore        27
     461: iconst_0
     462: istore        28
     464: aload         26
     466: invokeinterface #65,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     471: astore        29
     473: aload         29
     475: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     480: ifeq          779
     483: aload         29
     485: invokeinterface #75,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     490: astore        30
     492: aload         27
     494: aload         30
     496: checkcast     #170                // class Day5$Range
     499: astore        31
     501: astore        32
     503: iconst_0
     504: istore        33
     506: aload         11
     508: invokevirtual #117                // Method Day5$Mapping.getRangeMappings:()Ljava/util/List;
     511: checkcast     #50                 // class java/lang/Iterable
     514: astore        34
     516: iconst_0
     517: istore        35
     519: aload         34
     521: astore        36
     523: new           #52                 // class java/util/ArrayList
     526: dup
     527: invokespecial #177                // Method java/util/ArrayList."<init>":()V
     530: checkcast     #61                 // class java/util/Collection
     533: astore        37
     535: iconst_0
     536: istore        38
     538: aload         36
     540: invokeinterface #65,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     545: astore        40
     547: aload         40
     549: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     554: ifeq          599
     557: aload         40
     559: invokeinterface #75,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     564: astore        41
     566: aload         41
     568: checkcast     #119                // class Day5$RangeMapping
     571: astore        43
     573: iconst_0
     574: istore        44
     576: aload         43
     578: aload         31
     580: invokevirtual #184                // Method Day5$RangeMapping.overlaps:(LDay5$Range;)Z
     583: ifeq          547
     586: aload         37
     588: aload         41
     590: invokeinterface #89,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     595: pop
     596: goto          547
     599: aload         37
     601: checkcast     #91                 // class java/util/List
     604: nop
     605: checkcast     #50                 // class java/lang/Iterable
     608: astore        34
     610: nop
     611: iconst_0
     612: istore        35
     614: aload         34
     616: invokeinterface #65,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     621: astore        36
     623: aload         36
     625: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     630: ifne          637
     633: aconst_null
     634: goto          744
     637: aload         36
     639: invokeinterface #75,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     644: astore        37
     646: aload         36
     648: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     653: ifne          661
     656: aload         37
     658: goto          744
     661: aload         37
     663: checkcast     #119                // class Day5$RangeMapping
     666: astore        38
     668: iconst_0
     669: istore        40
     671: aload         38
     673: invokevirtual #187                // Method Day5$RangeMapping.getSourceRangeStart:()J
     676: aload         31
     678: invokevirtual #190                // Method Day5$Range.getStart:()J
     681: lsub
     682: lstore        38
     684: aload         36
     686: invokeinterface #75,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     691: astore        40
     693: aload         40
     695: checkcast     #119                // class Day5$RangeMapping
     698: astore        41
     700: iconst_0
     701: istore        43
     703: aload         41
     705: invokevirtual #187                // Method Day5$RangeMapping.getSourceRangeStart:()J
     708: aload         31
     710: invokevirtual #190                // Method Day5$Range.getStart:()J
     713: lsub
     714: lstore        41
     716: lload         38
     718: lload         41
     720: lcmp
     721: ifle          732
     724: aload         40
     726: astore        37
     728: lload         41
     730: lstore        38
     732: aload         36
     734: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     739: ifne          684
     742: aload         37
     744: checkcast     #119                // class Day5$RangeMapping
     747: astore        45
     749: aload         45
     751: dup
     752: ifnull        764
     755: aload         31
     757: invokevirtual #193                // Method Day5$RangeMapping.next:(LDay5$Range;)LDay5$Range;
     760: dup
     761: ifnonnull     767
     764: pop
     765: aload         31
     767: aload         32
     769: swap
     770: invokeinterface #89,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     775: pop
     776: goto          473
     779: aload         27
     781: checkcast     #91                 // class java/util/List
     784: nop
     785: astore        46
     787: aload         46
     789: checkcast     #50                 // class java/lang/Iterable
     792: astore        22
     794: aload         18
     796: aload         22
     798: invokestatic  #197                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     801: pop
     802: goto          394
     805: aload         18
     807: checkcast     #91                 // class java/util/List
     810: nop
     811: nop
     812: astore        7
     814: goto          323
     817: aload         7
     819: astore        4
     821: aload         4
     823: checkcast     #50                 // class java/lang/Iterable
     826: astore        5
     828: iconst_0
     829: istore        6
     831: aload         5
     833: invokeinterface #65,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     838: astore        7
     840: aload         7
     842: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     847: ifne          858
     850: new           #199                // class java/util/NoSuchElementException
     853: dup
     854: invokespecial #200                // Method java/util/NoSuchElementException."<init>":()V
     857: athrow
     858: aload         7
     860: invokeinterface #75,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     865: astore        8
     867: aload         7
     869: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     874: ifne          882
     877: aload         8
     879: goto          953
     882: aload         8
     884: checkcast     #170                // class Day5$Range
     887: astore        9
     889: iconst_0
     890: istore        11
     892: aload         9
     894: invokevirtual #190                // Method Day5$Range.getStart:()J
     897: lstore        9
     899: aload         7
     901: invokeinterface #75,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     906: astore        11
     908: aload         11
     910: checkcast     #170                // class Day5$Range
     913: astore        12
     915: iconst_0
     916: istore        14
     918: aload         12
     920: invokevirtual #190                // Method Day5$Range.getStart:()J
     923: lstore        12
     925: lload         9
     927: lload         12
     929: lcmp
     930: ifle          941
     933: aload         11
     935: astore        8
     937: lload         12
     939: lstore        9
     941: aload         7
     943: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     948: ifne          899
     951: aload         8
     953: checkcast     #170                // class Day5$Range
     956: invokevirtual #190                // Method Day5$Range.getStart:()J
     959: invokestatic  #133                // Method java/lang/String.valueOf:(J)Ljava/lang/String;
     962: areturn

  static {};
    Code:
       0: new           #2                  // class Day5
       3: dup
       4: invokespecial #236                // Method "<init>":()V
       7: putstatic     #239                // Field INSTANCE:LDay5;
      10: return
}

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

  private final java.lang.String category;

  private final java.util.List<Day5$RangeMapping> rangeMappings;

  public Day5$Mapping(java.lang.String, java.util.List<Day5$RangeMapping>);
    Code:
       0: aload_1
       1: ldc           #10                 // String category
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #18                 // String rangeMappings
       9: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_0
      13: invokespecial #21                 // Method java/lang/Object."<init>":()V
      16: aload_0
      17: aload_1
      18: putfield      #24                 // Field category:Ljava/lang/String;
      21: aload_0
      22: aload_2
      23: putfield      #27                 // Field rangeMappings:Ljava/util/List;
      26: return

  public final java.lang.String getCategory();
    Code:
       0: aload_0
       1: getfield      #24                 // Field category:Ljava/lang/String;
       4: areturn

  public final java.util.List<Day5$RangeMapping> getRangeMappings();
    Code:
       0: aload_0
       1: getfield      #27                 // Field rangeMappings:Ljava/util/List;
       4: areturn

  public final java.util.List<Day5$Range> fork(Day5$Range);
    Code:
       0: aload_1
       1: ldc           #39                 // String range
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #27                 // Field rangeMappings:Ljava/util/List;
      10: checkcast     #41                 // class java/lang/Iterable
      13: astore_2
      14: iconst_0
      15: istore_3
      16: aload_2
      17: instanceof    #43                 // class java/util/Collection
      20: ifeq          39
      23: aload_2
      24: checkcast     #43                 // class java/util/Collection
      27: invokeinterface #47,  1           // InterfaceMethod java/util/Collection.isEmpty:()Z
      32: ifeq          39
      35: iconst_0
      36: goto          90
      39: aload_2
      40: invokeinterface #51,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      45: astore        4
      47: aload         4
      49: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      54: ifeq          89
      57: aload         4
      59: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      64: astore        5
      66: aload         5
      68: checkcast     #62                 // class Day5$RangeMapping
      71: astore        6
      73: iconst_0
      74: istore        7
      76: aload         6
      78: aload_1
      79: invokevirtual #66                 // Method Day5$RangeMapping.overlaps:(LDay5$Range;)Z
      82: ifeq          47
      85: iconst_1
      86: goto          90
      89: iconst_0
      90: ifeq          98
      93: aload_1
      94: invokestatic  #72                 // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
      97: areturn
      98: lconst_0
      99: lstore        21
     101: aload_1
     102: invokevirtual #78                 // Method Day5$Range.getStart:()J
     105: lstore        21
     107: aload_1
     108: invokevirtual #81                 // Method Day5$Range.getEnd:()J
     111: lstore_3
     112: new           #83                 // class java/util/ArrayList
     115: dup
     116: invokespecial #84                 // Method java/util/ArrayList."<init>":()V
     119: checkcast     #86                 // class java/util/List
     122: astore        5
     124: lload         21
     126: lload_3
     127: lcmp
     128: ifgt          772
     131: aload_0
     132: getfield      #27                 // Field rangeMappings:Ljava/util/List;
     135: checkcast     #41                 // class java/lang/Iterable
     138: astore        7
     140: iconst_0
     141: istore        8
     143: aload         7
     145: astore        9
     147: new           #83                 // class java/util/ArrayList
     150: dup
     151: invokespecial #84                 // Method java/util/ArrayList."<init>":()V
     154: checkcast     #43                 // class java/util/Collection
     157: astore        10
     159: iconst_0
     160: istore        11
     162: aload         9
     164: invokeinterface #51,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     169: astore        13
     171: aload         13
     173: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     178: ifeq          249
     181: aload         13
     183: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     188: astore        15
     190: aload         15
     192: checkcast     #62                 // class Day5$RangeMapping
     195: astore        17
     197: iconst_0
     198: istore        19
     200: aload         17
     202: invokevirtual #89                 // Method Day5$RangeMapping.getSourceRangeStart:()J
     205: lload         21
     207: lcmp
     208: ifgt          232
     211: lload         21
     213: aload         17
     215: invokevirtual #89                 // Method Day5$RangeMapping.getSourceRangeStart:()J
     218: aload         17
     220: invokevirtual #92                 // Method Day5$RangeMapping.getRangeLength:()J
     223: ladd
     224: lcmp
     225: ifge          232
     228: iconst_1
     229: goto          233
     232: iconst_0
     233: ifeq          171
     236: aload         10
     238: aload         15
     240: invokeinterface #96,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     245: pop
     246: goto          171
     249: aload         10
     251: checkcast     #86                 // class java/util/List
     254: nop
     255: checkcast     #41                 // class java/lang/Iterable
     258: astore        7
     260: nop
     261: iconst_0
     262: istore        8
     264: aload         7
     266: invokeinterface #51,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     271: astore        9
     273: aload         9
     275: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     280: ifne          287
     283: aconst_null
     284: goto          392
     287: aload         9
     289: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     294: astore        10
     296: aload         9
     298: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     303: ifne          311
     306: aload         10
     308: goto          392
     311: aload         10
     313: checkcast     #62                 // class Day5$RangeMapping
     316: astore        11
     318: iconst_0
     319: istore        13
     321: aload         11
     323: invokevirtual #89                 // Method Day5$RangeMapping.getSourceRangeStart:()J
     326: aload_1
     327: invokevirtual #78                 // Method Day5$Range.getStart:()J
     330: lsub
     331: lstore        11
     333: aload         9
     335: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     340: astore        13
     342: aload         13
     344: checkcast     #62                 // class Day5$RangeMapping
     347: astore        15
     349: iconst_0
     350: istore        17
     352: aload         15
     354: invokevirtual #89                 // Method Day5$RangeMapping.getSourceRangeStart:()J
     357: aload_1
     358: invokevirtual #78                 // Method Day5$Range.getStart:()J
     361: lsub
     362: lstore        15
     364: lload         11
     366: lload         15
     368: lcmp
     369: ifle          380
     372: aload         13
     374: astore        10
     376: lload         15
     378: lstore        11
     380: aload         9
     382: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     387: ifne          333
     390: aload         10
     392: checkcast     #62                 // class Day5$RangeMapping
     395: astore        6
     397: aload         6
     399: ifnull        449
     402: lload_3
     403: aload         6
     405: invokevirtual #89                 // Method Day5$RangeMapping.getSourceRangeStart:()J
     408: aload         6
     410: invokevirtual #92                 // Method Day5$RangeMapping.getRangeLength:()J
     413: ladd
     414: lconst_1
     415: lsub
     416: invokestatic  #102                // Method java/lang/Long.min:(JJ)J
     419: lstore        7
     421: aload         5
     423: new           #74                 // class Day5$Range
     426: dup
     427: lload         21
     429: lload         7
     431: invokespecial #105                // Method Day5$Range."<init>":(JJ)V
     434: invokeinterface #106,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     439: pop
     440: lload         7
     442: lconst_1
     443: ladd
     444: lstore        21
     446: goto          124
     449: aload_0
     450: getfield      #27                 // Field rangeMappings:Ljava/util/List;
     453: checkcast     #41                 // class java/lang/Iterable
     456: astore        8
     458: iconst_0
     459: istore        9
     461: aload         8
     463: astore        10
     465: new           #83                 // class java/util/ArrayList
     468: dup
     469: invokespecial #84                 // Method java/util/ArrayList."<init>":()V
     472: checkcast     #43                 // class java/util/Collection
     475: astore        11
     477: iconst_0
     478: istore        13
     480: aload         10
     482: invokeinterface #51,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     487: astore        15
     489: aload         15
     491: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     496: ifeq          556
     499: aload         15
     501: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     506: astore        17
     508: aload         17
     510: checkcast     #62                 // class Day5$RangeMapping
     513: astore        19
     515: iconst_0
     516: istore        20
     518: aload         19
     520: invokevirtual #89                 // Method Day5$RangeMapping.getSourceRangeStart:()J
     523: aload         19
     525: invokevirtual #92                 // Method Day5$RangeMapping.getRangeLength:()J
     528: ladd
     529: lload         21
     531: lcmp
     532: ifle          539
     535: iconst_1
     536: goto          540
     539: iconst_0
     540: ifeq          489
     543: aload         11
     545: aload         17
     547: invokeinterface #96,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     552: pop
     553: goto          489
     556: aload         11
     558: checkcast     #86                 // class java/util/List
     561: nop
     562: checkcast     #41                 // class java/lang/Iterable
     565: astore        8
     567: nop
     568: iconst_0
     569: istore        9
     571: aload         8
     573: invokeinterface #51,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     578: astore        10
     580: aload         10
     582: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     587: ifne          594
     590: aconst_null
     591: goto          695
     594: aload         10
     596: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     601: astore        11
     603: aload         10
     605: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     610: ifne          618
     613: aload         11
     615: goto          695
     618: aload         11
     620: checkcast     #62                 // class Day5$RangeMapping
     623: astore        13
     625: iconst_0
     626: istore        15
     628: aload         13
     630: invokevirtual #89                 // Method Day5$RangeMapping.getSourceRangeStart:()J
     633: lload         21
     635: lsub
     636: lstore        13
     638: aload         10
     640: invokeinterface #60,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     645: astore        15
     647: aload         15
     649: checkcast     #62                 // class Day5$RangeMapping
     652: astore        17
     654: iconst_0
     655: istore        19
     657: aload         17
     659: invokevirtual #89                 // Method Day5$RangeMapping.getSourceRangeStart:()J
     662: lload         21
     664: lsub
     665: lstore        17
     667: lload         13
     669: lload         17
     671: lcmp
     672: ifle          683
     675: aload         15
     677: astore        11
     679: lload         17
     681: lstore        13
     683: aload         10
     685: invokeinterface #56,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     690: ifne          638
     693: aload         11
     695: checkcast     #62                 // class Day5$RangeMapping
     698: astore        7
     700: aload         7
     702: ifnonnull     731
     705: aload         5
     707: new           #74                 // class Day5$Range
     710: dup
     711: lload         21
     713: lload_3
     714: invokespecial #105                // Method Day5$Range."<init>":(JJ)V
     717: invokeinterface #106,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     722: pop
     723: lload_3
     724: lconst_1
     725: ladd
     726: lstore        21
     728: goto          124
     731: lload_3
     732: aload         7
     734: invokevirtual #89                 // Method Day5$RangeMapping.getSourceRangeStart:()J
     737: lconst_1
     738: lsub
     739: invokestatic  #102                // Method java/lang/Long.min:(JJ)J
     742: lstore        8
     744: aload         5
     746: new           #74                 // class Day5$Range
     749: dup
     750: lload         21
     752: lload         8
     754: invokespecial #105                // Method Day5$Range."<init>":(JJ)V
     757: invokeinterface #106,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     762: pop
     763: lload         8
     765: lconst_1
     766: ladd
     767: lstore        21
     769: goto          124
     772: aload         5
     774: areturn

  public final java.lang.String component1();
    Code:
       0: aload_0
       1: getfield      #24                 // Field category:Ljava/lang/String;
       4: areturn

  public final java.util.List<Day5$RangeMapping> component2();
    Code:
       0: aload_0
       1: getfield      #27                 // Field rangeMappings:Ljava/util/List;
       4: areturn

  public final Day5$Mapping copy(java.lang.String, java.util.List<Day5$RangeMapping>);
    Code:
       0: aload_1
       1: ldc           #10                 // String category
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #18                 // String rangeMappings
       9: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: new           #2                  // class Day5$Mapping
      15: dup
      16: aload_1
      17: aload_2
      18: invokespecial #149                // Method "<init>":(Ljava/lang/String;Ljava/util/List;)V
      21: areturn

  public static Day5$Mapping copy$default(Day5$Mapping, java.lang.String, java.util.List, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #24                 // Field category:Ljava/lang/String;
      10: astore_1
      11: iload_3
      12: iconst_2
      13: iand
      14: ifeq          22
      17: aload_0
      18: getfield      #27                 // Field rangeMappings:Ljava/util/List;
      21: astore_2
      22: aload_0
      23: aload_1
      24: aload_2
      25: invokevirtual #153                // Method copy:(Ljava/lang/String;Ljava/util/List;)LDay5$Mapping;
      28: areturn

  public java.lang.String toString();
    Code:
       0: new           #156                // class java/lang/StringBuilder
       3: dup
       4: invokespecial #157                // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #159                // String Mapping(category=
       9: invokevirtual #163                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #24                 // Field category:Ljava/lang/String;
      16: invokevirtual #163                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      19: ldc           #165                // String , rangeMappings=
      21: invokevirtual #163                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #27                 // Field rangeMappings:Ljava/util/List;
      28: invokevirtual #168                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      31: bipush        41
      33: invokevirtual #171                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      36: invokevirtual #173                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      39: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #24                 // Field category:Ljava/lang/String;
       4: invokevirtual #179                // Method java/lang/String.hashCode:()I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #27                 // Field rangeMappings:Ljava/util/List;
      16: invokevirtual #180                // Method java/lang/Object.hashCode:()I
      19: iadd
      20: istore_1
      21: iload_1
      22: ireturn

  public boolean equals(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: if_acmpne     7
       5: iconst_1
       6: ireturn
       7: aload_1
       8: instanceof    #2                  // class Day5$Mapping
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day5$Mapping
      20: astore_2
      21: aload_0
      22: getfield      #24                 // Field category:Ljava/lang/String;
      25: aload_2
      26: getfield      #24                 // Field category:Ljava/lang/String;
      29: invokestatic  #187                // 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      #27                 // Field rangeMappings:Ljava/util/List;
      41: aload_2
      42: getfield      #27                 // Field rangeMappings:Ljava/util/List;
      45: invokestatic  #187                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      48: ifne          53
      51: iconst_0
      52: ireturn
      53: iconst_1
      54: ireturn

  static {};
    Code:
       0: new           #191                // class Day5$Mapping$Companion
       3: dup
       4: aconst_null
       5: invokespecial #194                // Method Day5$Mapping$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #198                // Field Companion:LDay5$Mapping$Companion;
      11: return
}

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

  public final java.util.List<Day5$Mapping> parseMappings(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: astore_2
       8: new           #24                 // class java/util/ArrayList
      11: dup
      12: invokespecial #25                 // Method java/util/ArrayList."<init>":()V
      15: checkcast     #27                 // class java/util/List
      18: astore_3
      19: aload_2
      20: checkcast     #29                 // class java/util/Collection
      23: invokeinterface #33,  1           // InterfaceMethod java/util/Collection.isEmpty:()Z
      28: ifne          35
      31: iconst_1
      32: goto          36
      35: iconst_0
      36: ifeq          406
      39: aload_2
      40: invokestatic  #39                 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
      43: checkcast     #41                 // class java/lang/CharSequence
      46: iconst_1
      47: anewarray     #43                 // class java/lang/String
      50: astore        5
      52: aload         5
      54: iconst_0
      55: ldc           #45                 // String
      57: aastore
      58: aload         5
      60: iconst_0
      61: iconst_0
      62: bipush        6
      64: aconst_null
      65: invokestatic  #51                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      68: invokestatic  #39                 // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
      71: checkcast     #43                 // class java/lang/String
      74: astore        4
      76: aload_2
      77: checkcast     #53                 // class java/lang/Iterable
      80: iconst_1
      81: invokestatic  #57                 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
      84: checkcast     #53                 // class java/lang/Iterable
      87: astore        6
      89: iconst_0
      90: istore        7
      92: new           #24                 // class java/util/ArrayList
      95: dup
      96: invokespecial #25                 // Method java/util/ArrayList."<init>":()V
      99: astore        8
     101: aload         6
     103: invokeinterface #61,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     108: astore        9
     110: aload         9
     112: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     117: ifeq          175
     120: aload         9
     122: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     127: astore        10
     129: aload         10
     131: checkcast     #43                 // class java/lang/String
     134: astore        11
     136: iconst_0
     137: istore        12
     139: aload         11
     141: checkcast     #41                 // class java/lang/CharSequence
     144: invokeinterface #74,  1           // InterfaceMethod java/lang/CharSequence.length:()I
     149: ifle          156
     152: iconst_1
     153: goto          157
     156: iconst_0
     157: nop
     158: ifne          164
     161: goto          175
     164: aload         8
     166: aload         10
     168: invokevirtual #78                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     171: pop
     172: goto          110
     175: aload         8
     177: checkcast     #27                 // class java/util/List
     180: checkcast     #53                 // class java/lang/Iterable
     183: astore        6
     185: nop
     186: iconst_0
     187: istore        7
     189: aload         6
     191: astore        8
     193: new           #24                 // class java/util/ArrayList
     196: dup
     197: aload         6
     199: bipush        10
     201: invokestatic  #82                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     204: invokespecial #85                 // Method java/util/ArrayList."<init>":(I)V
     207: checkcast     #29                 // class java/util/Collection
     210: astore        9
     212: iconst_0
     213: istore        10
     215: aload         8
     217: invokeinterface #61,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     222: astore        11
     224: aload         11
     226: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     231: ifeq          360
     234: aload         11
     236: invokeinterface #70,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     241: astore        12
     243: aload         9
     245: aload         12
     247: checkcast     #43                 // class java/lang/String
     250: astore        13
     252: astore        19
     254: iconst_0
     255: istore        14
     257: aload         13
     259: checkcast     #41                 // class java/lang/CharSequence
     262: iconst_1
     263: anewarray     #43                 // class java/lang/String
     266: astore        15
     268: aload         15
     270: iconst_0
     271: ldc           #45                 // String
     273: aastore
     274: aload         15
     276: iconst_0
     277: iconst_0
     278: bipush        6
     280: aconst_null
     281: invokestatic  #51                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     284: astore        16
     286: aload         16
     288: iconst_0
     289: invokeinterface #89,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     294: checkcast     #43                 // class java/lang/String
     297: astore        15
     299: aload         16
     301: iconst_1
     302: invokeinterface #89,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     307: checkcast     #43                 // class java/lang/String
     310: astore        17
     312: aload         16
     314: iconst_2
     315: invokeinterface #89,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     320: checkcast     #43                 // class java/lang/String
     323: astore        18
     325: new           #91                 // class Day5$RangeMapping
     328: dup
     329: aload         15
     331: invokestatic  #97                 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
     334: aload         17
     336: invokestatic  #97                 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
     339: aload         18
     341: invokestatic  #97                 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
     344: invokespecial #100                // Method Day5$RangeMapping."<init>":(JJJ)V
     347: nop
     348: aload         19
     350: swap
     351: invokeinterface #101,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     356: pop
     357: goto          224
     360: aload         9
     362: checkcast     #27                 // class java/util/List
     365: nop
     366: astore        5
     368: aload_3
     369: new           #103                // class Day5$Mapping
     372: dup
     373: aload         4
     375: aload         5
     377: invokespecial #106                // Method Day5$Mapping."<init>":(Ljava/lang/String;Ljava/util/List;)V
     380: invokeinterface #107,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     385: pop
     386: aload_2
     387: checkcast     #53                 // class java/lang/Iterable
     390: aload         5
     392: invokeinterface #110,  1          // InterfaceMethod java/util/List.size:()I
     397: iconst_2
     398: iadd
     399: invokestatic  #57                 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
     402: astore_2
     403: goto          19
     406: aload_3
     407: areturn

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

Compiled from "Day5.kt"
public final class Day5$RangeMapping {
  private final long destinationRangeStart;

  private final long sourceRangeStart;

  private final long rangeLength;

  public Day5$RangeMapping(long, long, long);
    Code:
       0: aload_0
       1: invokespecial #9                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: lload_1
       6: putfield      #13                 // Field destinationRangeStart:J
       9: aload_0
      10: lload_3
      11: putfield      #16                 // Field sourceRangeStart:J
      14: aload_0
      15: lload         5
      17: putfield      #19                 // Field rangeLength:J
      20: return

  public final long getDestinationRangeStart();
    Code:
       0: aload_0
       1: getfield      #13                 // Field destinationRangeStart:J
       4: lreturn

  public final long getSourceRangeStart();
    Code:
       0: aload_0
       1: getfield      #16                 // Field sourceRangeStart:J
       4: lreturn

  public final long getRangeLength();
    Code:
       0: aload_0
       1: getfield      #19                 // Field rangeLength:J
       4: lreturn

  public final long next(long);
    Code:
       0: aload_0
       1: getfield      #16                 // Field sourceRangeStart:J
       4: lload_1
       5: lcmp
       6: ifgt          39
       9: lload_1
      10: aload_0
      11: getfield      #16                 // Field sourceRangeStart:J
      14: aload_0
      15: getfield      #19                 // Field rangeLength:J
      18: ladd
      19: lcmp
      20: ifgt          39
      23: lload_1
      24: aload_0
      25: getfield      #16                 // Field sourceRangeStart:J
      28: lsub
      29: lstore_3
      30: aload_0
      31: getfield      #13                 // Field destinationRangeStart:J
      34: lload_3
      35: ladd
      36: goto          40
      39: lload_1
      40: lreturn

  public final Day5$Range next(Day5$Range);
    Code:
       0: aload_1
       1: ldc           #33                 // String range
       3: invokestatic  #39                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: invokevirtual #44                 // Method Day5$Range.getStart:()J
      10: aload_0
      11: getfield      #16                 // Field sourceRangeStart:J
      14: lsub
      15: lstore_2
      16: new           #41                 // class Day5$Range
      19: dup
      20: aload_0
      21: getfield      #13                 // Field destinationRangeStart:J
      24: lload_2
      25: ladd
      26: aload_0
      27: getfield      #13                 // Field destinationRangeStart:J
      30: lload_2
      31: ladd
      32: aload_1
      33: invokevirtual #47                 // Method Day5$Range.getEnd:()J
      36: ladd
      37: aload_1
      38: invokevirtual #44                 // Method Day5$Range.getStart:()J
      41: lsub
      42: invokespecial #50                 // Method Day5$Range."<init>":(JJ)V
      45: areturn

  public final boolean overlaps(long);
    Code:
       0: aload_0
       1: getfield      #16                 // Field sourceRangeStart:J
       4: lload_1
       5: lcmp
       6: ifgt          27
       9: lload_1
      10: aload_0
      11: getfield      #16                 // Field sourceRangeStart:J
      14: aload_0
      15: getfield      #19                 // Field rangeLength:J
      18: ladd
      19: lcmp
      20: ifge          27
      23: iconst_1
      24: goto          28
      27: iconst_0
      28: ireturn

  public final boolean overlaps(Day5$Range);
    Code:
       0: aload_1
       1: ldc           #33                 // String range
       3: invokestatic  #39                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #16                 // Field sourceRangeStart:J
      10: aload_1
      11: invokevirtual #44                 // Method Day5$Range.getStart:()J
      14: lcmp
      15: ifgt          41
      18: aload_1
      19: invokevirtual #47                 // Method Day5$Range.getEnd:()J
      22: aload_0
      23: getfield      #16                 // Field sourceRangeStart:J
      26: aload_0
      27: getfield      #19                 // Field rangeLength:J
      30: ladd
      31: lconst_1
      32: lsub
      33: lcmp
      34: ifgt          41
      37: iconst_1
      38: goto          42
      41: iconst_0
      42: ireturn

  public final long component1();
    Code:
       0: aload_0
       1: getfield      #13                 // Field destinationRangeStart:J
       4: lreturn

  public final long component2();
    Code:
       0: aload_0
       1: getfield      #16                 // Field sourceRangeStart:J
       4: lreturn

  public final long component3();
    Code:
       0: aload_0
       1: getfield      #19                 // Field rangeLength:J
       4: lreturn

  public final Day5$RangeMapping copy(long, long, long);
    Code:
       0: new           #2                  // class Day5$RangeMapping
       3: dup
       4: lload_1
       5: lload_3
       6: lload         5
       8: invokespecial #61                 // Method "<init>":(JJJ)V
      11: areturn

  public static Day5$RangeMapping copy$default(Day5$RangeMapping, long, long, long, int, java.lang.Object);
    Code:
       0: iload         7
       2: iconst_1
       3: iand
       4: ifeq          12
       7: aload_0
       8: getfield      #13                 // Field destinationRangeStart:J
      11: lstore_1
      12: iload         7
      14: iconst_2
      15: iand
      16: ifeq          24
      19: aload_0
      20: getfield      #16                 // Field sourceRangeStart:J
      23: lstore_3
      24: iload         7
      26: iconst_4
      27: iand
      28: ifeq          37
      31: aload_0
      32: getfield      #19                 // Field rangeLength:J
      35: lstore        5
      37: aload_0
      38: lload_1
      39: lload_3
      40: lload         5
      42: invokevirtual #65                 // Method copy:(JJJ)LDay5$RangeMapping;
      45: areturn

  public java.lang.String toString();
    Code:
       0: new           #69                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #70                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #72                 // String RangeMapping(destinationRangeStart=
       9: invokevirtual #76                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field destinationRangeStart:J
      16: invokevirtual #79                 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
      19: ldc           #81                 // String , sourceRangeStart=
      21: invokevirtual #76                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #16                 // Field sourceRangeStart:J
      28: invokevirtual #79                 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
      31: ldc           #83                 // String , rangeLength=
      33: invokevirtual #76                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      36: aload_0
      37: getfield      #19                 // Field rangeLength:J
      40: invokevirtual #79                 // Method java/lang/StringBuilder.append:(J)Ljava/lang/StringBuilder;
      43: bipush        41
      45: invokevirtual #86                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      48: invokevirtual #88                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      51: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #13                 // Field destinationRangeStart:J
       4: invokestatic  #95                 // Method java/lang/Long.hashCode:(J)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #16                 // Field sourceRangeStart:J
      16: invokestatic  #95                 // Method java/lang/Long.hashCode:(J)I
      19: iadd
      20: istore_1
      21: iload_1
      22: bipush        31
      24: imul
      25: aload_0
      26: getfield      #19                 // Field rangeLength:J
      29: invokestatic  #95                 // Method java/lang/Long.hashCode:(J)I
      32: iadd
      33: istore_1
      34: iload_1
      35: 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 Day5$RangeMapping
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day5$RangeMapping
      20: astore_2
      21: aload_0
      22: getfield      #13                 // Field destinationRangeStart:J
      25: aload_2
      26: getfield      #13                 // Field destinationRangeStart:J
      29: lcmp
      30: ifeq          35
      33: iconst_0
      34: ireturn
      35: aload_0
      36: getfield      #16                 // Field sourceRangeStart:J
      39: aload_2
      40: getfield      #16                 // Field sourceRangeStart:J
      43: lcmp
      44: ifeq          49
      47: iconst_0
      48: ireturn
      49: aload_0
      50: getfield      #19                 // Field rangeLength:J
      53: aload_2
      54: getfield      #19                 // Field rangeLength:J
      57: lcmp
      58: ifeq          63
      61: iconst_0
      62: ireturn
      63: iconst_1
      64: ireturn
}

Compiled from "Day5.kt"
public final class Day5$Range {
  private final long start;

  private final long end;

  public Day5$Range(long, long);
    Code:
       0: aload_0
       1: invokespecial #9                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: lload_1
       6: putfield      #13                 // Field start:J
       9: aload_0
      10: lload_3
      11: putfield      #16                 // Field end:J
      14: return

  public final long getStart();
    Code:
       0: aload_0
       1: getfield      #13                 // Field start:J
       4: lreturn

  public final long getEnd();
    Code:
       0: aload_0
       1: getfield      #16                 // Field end:J
       4: lreturn

  public final long component1();
    Code:
       0: aload_0
       1: getfield      #13                 // Field start:J
       4: lreturn

  public final long component2();
    Code:
       0: aload_0
       1: getfield      #16                 // Field end:J
       4: lreturn

  public final Day5$Range copy(long, long);
    Code:
       0: new           #2                  // class Day5$Range
       3: dup
       4: lload_1
       5: lload_3
       6: invokespecial #28                 // Method "<init>":(JJ)V
       9: areturn

  public static Day5$Range copy$default(Day5$Range, long, long, int, java.lang.Object);
    Code:
       0: iload         5
       2: iconst_1
       3: iand
       4: ifeq          12
       7: aload_0
       8: getfield      #13                 // Field start:J
      11: lstore_1
      12: iload         5
      14: iconst_2
      15: iand
      16: ifeq          24
      19: aload_0
      20: getfield      #16                 // Field end:J
      23: lstore_3
      24: aload_0
      25: lload_1
      26: lload_3
      27: invokevirtual #32                 // Method copy:(JJ)LDay5$Range;
      30: areturn

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

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #13                 // Field start:J
       4: invokestatic  #60                 // Method java/lang/Long.hashCode:(J)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #16                 // Field end:J
      16: invokestatic  #60                 // Method java/lang/Long.hashCode:(J)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 Day5$Range
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day5$Range
      20: astore_2
      21: aload_0
      22: getfield      #13                 // Field start:J
      25: aload_2
      26: getfield      #13                 // Field start:J
      29: lcmp
      30: ifeq          35
      33: iconst_0
      34: ireturn
      35: aload_0
      36: getfield      #16                 // Field end:J
      39: aload_2
      40: getfield      #16                 // Field end:J
      43: lcmp
      44: ifeq          49
      47: iconst_0
      48: ireturn
      49: iconst_1
      50: ireturn
}