import java.util.*
import kotlin.String
import kotlin.collections.List

object Day18 {
    data class Segment(val coordinates: Set<Day17.Coordinate>) {
        val minX = coordinates.minOf { it.x }
        val maxX = coordinates.maxOf { it.x }
        val minY = coordinates.minOf { it.y }
        val maxY = coordinates.maxOf { it.y }

        fun crosses(coordinate: Day17.Coordinate): Boolean {
            return if (minX == maxX && minX == coordinate.x) {
                coordinate.y in minY..maxY
            } else if (minY == maxY && minY == coordinate.y) {
                coordinate.x in minX..maxX
            } else {
                false
            }
        }

        fun crosses(y: Int): Boolean {
            return y in minY..maxY
        }

        fun length(): Int {
            return if (minX == maxX) {
                maxY - minY + 1
            } else {
                maxX - minX + 1
            }
        }

        /**
         * Returns true if the segment is vertical, false otherwise
         */
        fun isVertical(): Boolean {
            return minX == maxX
        }

        /**
         * Returns true if the segment is horizontal, false otherwise
         */
        fun isHorizontal(): Boolean {
            return minY == maxY
        }

        override fun hashCode(): Int {
            return Objects.hash(minX, maxX, minY, maxY)
        }

        override fun equals(other: Any?): Boolean {
            if (this === other) return true
            if (javaClass != other?.javaClass) return false

            other as Segment

            if (coordinates != other.coordinates) return false
            if (minX != other.minX) return false
            if (maxX != other.maxX) return false
            if (minY != other.minY) return false
            if (maxY != other.maxY) return false

            return true
        }
    }

    enum class Direction {
        UP,
        DOWN,
        LEFT,
        RIGHT
    }

    data class Instruction(val direction: Direction, val steps: Int, val colorCode: String) {

        fun toTrueInstruction(): Instruction {
            val directionCode = colorCode.last()
            val hexSteps = colorCode.drop(1).dropLast(1)
            val steps = hexSteps.toInt(16)
            val direction = when (directionCode) {
                '0' -> Direction.RIGHT
                '1' -> Direction.DOWN
                '2' -> Direction.LEFT
                '3' -> Direction.UP
                else -> throw IllegalStateException("Should not happen")
            }
            return Instruction(direction, steps, colorCode)
        }

        companion object {
            fun parse(input: String): Instruction {
                val pattern = "([U|L|D|R]) ([0-9]+) \\((#[a-z0-9]+)\\)".toRegex()
                val (rawDirection, rawSteps, rawColorCode) = pattern.matchEntire(input)!!.destructured

                val direction = when (rawDirection) {
                    "U" -> Direction.UP
                    "D" -> Direction.DOWN
                    "L" -> Direction.LEFT
                    "R" -> Direction.RIGHT
                    else -> throw IllegalStateException("Should not happen")
                }
                val steps = rawSteps.toInt()
                return Instruction(direction, steps, rawColorCode)
            }
        }
    }

    fun part1(input: List<String>): String {
        val instructions = input.map { Instruction.parse(it) }
        return cubicMetersEnclosed(instructions).toString()
    }

    fun cubicMetersEnclosed(instructions: List<Instruction>): Long {
        val segments = dig(instructions)

        val minY = segments.minOf { it.minY }
        val maxY = segments.maxOf { it.maxY }
        val minX = segments.minOf { it.minX }
        val maxX = segments.maxOf { it.maxX }
        val delta = maxY - minY
        var current = 0
        var mySegments = segments.sortedWith(compareBy({ it.minY }, { it.maxY }))
        val enclosedCoordinates = (minY..maxY).sumOf { y ->
            val startCoordinate = Day17.Coordinate(minX, y)
            val endCoordinate = Day17.Coordinate(maxX, y)
            val ret = rayCast(startCoordinate, endCoordinate, mySegments)
            current += 1
            if (current % 1000000 == 0) {
                mySegments = mySegments.filter { it.maxY >= y }
                println("Progress: ${String.format("%.2f", current.toDouble() / delta * 100)}%")
            }
            ret
        }

        val segmentSizes = segments.sumOf { it.length() }
        val duplicateSegments =
            segments.flatMap { it.coordinates.toList() }.groupBy { it }.filter { it.value.size > 1 }.keys.size
        return (enclosedCoordinates + segmentSizes - duplicateSegments)
    }

    private fun rayCast(
        startCoordinate: Day17.Coordinate,
        endCoordinate: Day17.Coordinate,
        segments: List<Segment>
    ): Long {
        var segmentsEncountered = 0
        var cellsWithinPolygon = 0L
        val runningSegmentsCrossed = mutableSetOf<Segment>()
        var currentX = startCoordinate.x
        val segmentsCrossedByRay = segments
            .takeWhile { it.minY <= endCoordinate.y }
            .filter { it.crosses(startCoordinate.y) }
        while (currentX <= endCoordinate.x) {
            val currentCoordinate = Day17.Coordinate(currentX, startCoordinate.y)
            val segmentCrosses = segmentsCrossedByRay.filter { it.crosses(currentCoordinate) }
            val sizeBefore = runningSegmentsCrossed.size
            runningSegmentsCrossed.addAll(segmentCrosses)
            val sizeAfter = runningSegmentsCrossed.size
            val touchedAnotherSegment = sizeAfter > sizeBefore

            if (segmentCrosses.isNotEmpty()) {
                // Advance the current position to the max x value of the segment we crossed
                currentX = segmentCrosses.maxOf { it.maxX }
                // This is an odd edge case
                // where there are overlapping segments that are connected
                // but we encountered the last one
                if (!touchedAnotherSegment) {
                    currentX += 1
                }
            } else {
                if (isSingleOrSnakeShaped(runningSegmentsCrossed)) {
                    segmentsEncountered += 1
                }
                runningSegmentsCrossed.clear()
                val nextSegmentToBeCrossed = segmentsCrossedByRay
                    .minOfOrNull { if (it.minX > currentX) it.minX else Int.MAX_VALUE }
                val nextX = nextSegmentToBeCrossed ?: (endCoordinate.x + 1)
                // If the number of segments encountered is odd, then we are within the polygon
                val isWithinPolygon = segmentsEncountered % 2 == 1
                if (isWithinPolygon) {
                    val lengthOfEmptySpace = nextX - currentX
                    cellsWithinPolygon += lengthOfEmptySpace
                }
                // Advance the current position to the next segment crossing since all of
                // these are filled or ignored
                currentX = nextX
            }
        }
        return cellsWithinPolygon
    }

    /**
     * An annoying case in which we can run into
     * is when we have a single segment or a snake shaped segment
     *
     * #
     * #
     * #
     * # # #
     *     #
     *     #
     *     #
     *
     * This counts as one segment
     */
    private fun isSingleOrSnakeShaped(crossedSegments: Set<Segment>): Boolean {
        if (crossedSegments.isEmpty()) {
            return false
        }
        if (crossedSegments.size == 1) {
            return true
        }
        if (crossedSegments.size == 2) {
            return false
        }

        val verticalSegments = crossedSegments.count { it.isVertical() }
        val horizontalSegments = crossedSegments.count { it.isHorizontal() }
        return if (verticalSegments > horizontalSegments) {
            // This means that the segments are vertical but share a same y coordinte, like
            //
            //  #
            //  #
            //  #
            //  # # #
            //      #
            //      #
            //      #
            val sorted = crossedSegments.sortedWith(
                compareBy({ it.minX }, { it.maxX })
            )
            val start = sorted.first()
            val end = sorted.last()
            val ys = start.coordinates.map { it.y }.toList() + end.coordinates.map { it.y }.toList()
            val grouped = ys.groupBy { it }
            val ysThatAppearTwice = grouped.filter { it.value.size == 2 }.keys.first()
            ysThatAppearTwice > ys.min() && ysThatAppearTwice < ys.max()
        } else {
            // This means that the segments are horizontal but share a same x coordinate, like
            //
            //  # # # #
            //  #
            //  #
            //  #
            //  #
            //  #
            //  # # # #
            val sorted = crossedSegments.sortedWith(compareBy({ it.minY }, { it.maxY }))
            val start = sorted.first()
            val end = sorted.last()
            val xs = start.coordinates.map { it.x }.toList() + end.coordinates.map { it.x }.toList()
            val grouped = xs.groupBy { it }
            val xsThatAppearTwice = grouped.filter { it.value.size == 2 }.keys.first()
            xsThatAppearTwice > xs.min() && xsThatAppearTwice < xs.max()
        }
    }

    /**
     * Take a list of instructions that take a starting point and a direction to "dig", which
     * will then be represented as line segments
     */
    fun dig(instructions: List<Instruction>): List<Segment> {
        val currentCoordinate = Day17.Coordinate(0, 0)
        return instructions.fold(currentCoordinate to emptyList<Segment>()) { (currentCoordinate, segments), instruction ->
            val direction = instruction.direction
            val steps = instruction.steps
            val nextCoordinate = when (direction) {
                Direction.UP -> Day17.Coordinate(currentCoordinate.x, currentCoordinate.y - steps)
                Direction.DOWN -> Day17.Coordinate(currentCoordinate.x, currentCoordinate.y + steps)
                Direction.LEFT -> Day17.Coordinate(currentCoordinate.x - steps, currentCoordinate.y)
                Direction.RIGHT -> Day17.Coordinate(currentCoordinate.x + steps, currentCoordinate.y)
            }
            val segment = Segment(setOf(currentCoordinate, nextCoordinate))
            nextCoordinate to (segments + listOf(segment))
        }.second
    }

    fun part2(input: List<String>): String {
        val instructions = input.map { Instruction.parse(it) }.map { it.toTrueInstruction() }
        return cubicMetersEnclosed(instructions).toString()
    }
}

Compiled from "Day18.kt"
public final class Day18$Direction extends java.lang.Enum<Day18$Direction> {
  public static final Day18$Direction UP;

  public static final Day18$Direction DOWN;

  public static final Day18$Direction LEFT;

  public static final Day18$Direction RIGHT;

  private static final Day18$Direction[] $VALUES;

  private static final kotlin.enums.EnumEntries $ENTRIES;

  private Day18$Direction();
    Code:
       0: aload_0
       1: aload_1
       2: iload_2
       3: invokespecial #10                 // Method java/lang/Enum."<init>":(Ljava/lang/String;I)V
       6: return

  public static Day18$Direction[] values();
    Code:
       0: getstatic     #22                 // Field $VALUES:[LDay18$Direction;
       3: invokevirtual #28                 // Method java/lang/Object.clone:()Ljava/lang/Object;
       6: checkcast     #29                 // class "[LDay18$Direction;"
       9: areturn

  public static Day18$Direction valueOf(java.lang.String);
    Code:
       0: ldc           #2                  // class Day18$Direction
       2: aload_0
       3: invokestatic  #34                 // Method java/lang/Enum.valueOf:(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
       6: checkcast     #2                  // class Day18$Direction
       9: areturn

  public static kotlin.enums.EnumEntries<Day18$Direction> getEntries();
    Code:
       0: getstatic     #43                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
       3: areturn

  private static final Day18$Direction[] $values();
    Code:
       0: iconst_4
       1: anewarray     #2                  // class Day18$Direction
       4: astore_0
       5: aload_0
       6: iconst_0
       7: getstatic     #47                 // Field UP:LDay18$Direction;
      10: aastore
      11: aload_0
      12: iconst_1
      13: getstatic     #50                 // Field DOWN:LDay18$Direction;
      16: aastore
      17: aload_0
      18: iconst_2
      19: getstatic     #53                 // Field LEFT:LDay18$Direction;
      22: aastore
      23: aload_0
      24: iconst_3
      25: getstatic     #56                 // Field RIGHT:LDay18$Direction;
      28: aastore
      29: aload_0
      30: areturn

  static {};
    Code:
       0: new           #2                  // class Day18$Direction
       3: dup
       4: ldc           #58                 // String UP
       6: iconst_0
       7: invokespecial #59                 // Method "<init>":(Ljava/lang/String;I)V
      10: putstatic     #47                 // Field UP:LDay18$Direction;
      13: new           #2                  // class Day18$Direction
      16: dup
      17: ldc           #60                 // String DOWN
      19: iconst_1
      20: invokespecial #59                 // Method "<init>":(Ljava/lang/String;I)V
      23: putstatic     #50                 // Field DOWN:LDay18$Direction;
      26: new           #2                  // class Day18$Direction
      29: dup
      30: ldc           #61                 // String LEFT
      32: iconst_2
      33: invokespecial #59                 // Method "<init>":(Ljava/lang/String;I)V
      36: putstatic     #53                 // Field LEFT:LDay18$Direction;
      39: new           #2                  // class Day18$Direction
      42: dup
      43: ldc           #62                 // String RIGHT
      45: iconst_3
      46: invokespecial #59                 // Method "<init>":(Ljava/lang/String;I)V
      49: putstatic     #56                 // Field RIGHT:LDay18$Direction;
      52: invokestatic  #64                 // Method $values:()[LDay18$Direction;
      55: putstatic     #22                 // Field $VALUES:[LDay18$Direction;
      58: getstatic     #22                 // Field $VALUES:[LDay18$Direction;
      61: checkcast     #66                 // class "[Ljava/lang/Enum;"
      64: invokestatic  #72                 // Method kotlin/enums/EnumEntriesKt.enumEntries:([Ljava/lang/Enum;)Lkotlin/enums/EnumEntries;
      67: putstatic     #43                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
      70: return
}

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

  public final Day18$Instruction 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 kotlin/text/Regex
       9: dup
      10: ldc           #25                 // String ([U|L|D|R]) ([0-9]+) \\((#[a-z0-9]+)\\)
      12: invokespecial #28                 // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
      15: astore_2
      16: aload_2
      17: aload_1
      18: checkcast     #30                 // class java/lang/CharSequence
      21: invokevirtual #34                 // Method kotlin/text/Regex.matchEntire:(Ljava/lang/CharSequence;)Lkotlin/text/MatchResult;
      24: dup
      25: invokestatic  #38                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      28: invokeinterface #44,  1           // InterfaceMethod kotlin/text/MatchResult.getDestructured:()Lkotlin/text/MatchResult$Destructured;
      33: astore_3
      34: aload_3
      35: invokevirtual #50                 // Method kotlin/text/MatchResult$Destructured.getMatch:()Lkotlin/text/MatchResult;
      38: invokeinterface #54,  1           // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;
      43: iconst_1
      44: invokeinterface #60,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      49: checkcast     #62                 // class java/lang/String
      52: astore        4
      54: aload_3
      55: invokevirtual #50                 // Method kotlin/text/MatchResult$Destructured.getMatch:()Lkotlin/text/MatchResult;
      58: invokeinterface #54,  1           // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;
      63: iconst_2
      64: invokeinterface #60,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      69: checkcast     #62                 // class java/lang/String
      72: astore        5
      74: aload_3
      75: invokevirtual #50                 // Method kotlin/text/MatchResult$Destructured.getMatch:()Lkotlin/text/MatchResult;
      78: invokeinterface #54,  1           // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;
      83: iconst_3
      84: invokeinterface #60,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      89: checkcast     #62                 // class java/lang/String
      92: astore        6
      94: aload         4
      96: astore        8
      98: aload         8
     100: invokevirtual #66                 // Method java/lang/String.hashCode:()I
     103: lookupswitch  { // 4
                    68: 157
                    76: 183
                    82: 144
                    85: 170
               default: 220
          }
     144: aload         8
     146: ldc           #68                 // String R
     148: invokevirtual #72                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     151: ifne          214
     154: goto          220
     157: aload         8
     159: ldc           #74                 // String D
     161: invokevirtual #72                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     164: ifne          202
     167: goto          220
     170: aload         8
     172: ldc           #76                 // String U
     174: invokevirtual #72                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     177: ifne          196
     180: goto          220
     183: aload         8
     185: ldc           #78                 // String L
     187: invokevirtual #72                 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
     190: ifne          208
     193: goto          220
     196: getstatic     #84                 // Field Day18$Direction.UP:LDay18$Direction;
     199: goto          230
     202: getstatic     #87                 // Field Day18$Direction.DOWN:LDay18$Direction;
     205: goto          230
     208: getstatic     #90                 // Field Day18$Direction.LEFT:LDay18$Direction;
     211: goto          230
     214: getstatic     #93                 // Field Day18$Direction.RIGHT:LDay18$Direction;
     217: goto          230
     220: new           #95                 // class java/lang/IllegalStateException
     223: dup
     224: ldc           #97                 // String Should not happen
     226: invokespecial #98                 // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     229: athrow
     230: astore        7
     232: aload         5
     234: invokestatic  #104                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     237: istore        8
     239: new           #106                // class Day18$Instruction
     242: dup
     243: aload         7
     245: iload         8
     247: aload         6
     249: invokespecial #109                // Method Day18$Instruction."<init>":(LDay18$Direction;ILjava/lang/String;)V
     252: areturn

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

Compiled from "Day18.kt"
public final class Day18$Segment {
  private final java.util.Set<Day17$Coordinate> coordinates;

  private final int minX;

  private final int maxX;

  private final int minY;

  private final int maxY;

  public Day18$Segment(java.util.Set<Day17$Coordinate>);
    Code:
       0: aload_1
       1: ldc           #10                 // String coordinates
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokespecial #19                 // Method java/lang/Object."<init>":()V
      10: aload_0
      11: aload_1
      12: putfield      #22                 // Field coordinates:Ljava/util/Set;
      15: aload_0
      16: aload_0
      17: getfield      #22                 // Field coordinates:Ljava/util/Set;
      20: checkcast     #24                 // class java/lang/Iterable
      23: astore_2
      24: astore        7
      26: aload_2
      27: invokeinterface #28,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      32: astore_3
      33: aload_3
      34: invokeinterface #34,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      39: ifne          50
      42: new           #36                 // class java/util/NoSuchElementException
      45: dup
      46: invokespecial #37                 // Method java/util/NoSuchElementException."<init>":()V
      49: athrow
      50: aload_3
      51: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      56: checkcast     #43                 // class Day17$Coordinate
      59: astore        4
      61: iconst_0
      62: istore        5
      64: aload         4
      66: invokevirtual #47                 // Method Day17$Coordinate.getX:()I
      69: istore        4
      71: aload_3
      72: invokeinterface #34,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      77: ifeq          115
      80: aload_3
      81: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      86: checkcast     #43                 // class Day17$Coordinate
      89: astore        5
      91: iconst_0
      92: istore        6
      94: aload         5
      96: invokevirtual #47                 // Method Day17$Coordinate.getX:()I
      99: istore        5
     101: iload         4
     103: iload         5
     105: if_icmple     71
     108: iload         5
     110: istore        4
     112: goto          71
     115: iload         4
     117: istore        8
     119: aload         7
     121: iload         8
     123: putfield      #51                 // Field minX:I
     126: aload_0
     127: aload_0
     128: getfield      #22                 // Field coordinates:Ljava/util/Set;
     131: checkcast     #24                 // class java/lang/Iterable
     134: astore_2
     135: astore        7
     137: aload_2
     138: invokeinterface #28,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     143: astore_3
     144: aload_3
     145: invokeinterface #34,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     150: ifne          161
     153: new           #36                 // class java/util/NoSuchElementException
     156: dup
     157: invokespecial #37                 // Method java/util/NoSuchElementException."<init>":()V
     160: athrow
     161: aload_3
     162: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     167: checkcast     #43                 // class Day17$Coordinate
     170: astore        4
     172: iconst_0
     173: istore        5
     175: aload         4
     177: invokevirtual #47                 // Method Day17$Coordinate.getX:()I
     180: istore        4
     182: aload_3
     183: invokeinterface #34,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     188: ifeq          226
     191: aload_3
     192: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     197: checkcast     #43                 // class Day17$Coordinate
     200: astore        5
     202: iconst_0
     203: istore        6
     205: aload         5
     207: invokevirtual #47                 // Method Day17$Coordinate.getX:()I
     210: istore        5
     212: iload         4
     214: iload         5
     216: if_icmpge     182
     219: iload         5
     221: istore        4
     223: goto          182
     226: iload         4
     228: istore        8
     230: aload         7
     232: iload         8
     234: putfield      #54                 // Field maxX:I
     237: aload_0
     238: aload_0
     239: getfield      #22                 // Field coordinates:Ljava/util/Set;
     242: checkcast     #24                 // class java/lang/Iterable
     245: astore_2
     246: astore        7
     248: aload_2
     249: invokeinterface #28,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     254: astore_3
     255: aload_3
     256: invokeinterface #34,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     261: ifne          272
     264: new           #36                 // class java/util/NoSuchElementException
     267: dup
     268: invokespecial #37                 // Method java/util/NoSuchElementException."<init>":()V
     271: athrow
     272: aload_3
     273: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     278: checkcast     #43                 // class Day17$Coordinate
     281: astore        4
     283: iconst_0
     284: istore        5
     286: aload         4
     288: invokevirtual #57                 // Method Day17$Coordinate.getY:()I
     291: istore        4
     293: aload_3
     294: invokeinterface #34,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     299: ifeq          337
     302: aload_3
     303: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     308: checkcast     #43                 // class Day17$Coordinate
     311: astore        5
     313: iconst_0
     314: istore        6
     316: aload         5
     318: invokevirtual #57                 // Method Day17$Coordinate.getY:()I
     321: istore        5
     323: iload         4
     325: iload         5
     327: if_icmple     293
     330: iload         5
     332: istore        4
     334: goto          293
     337: iload         4
     339: istore        8
     341: aload         7
     343: iload         8
     345: putfield      #60                 // Field minY:I
     348: aload_0
     349: aload_0
     350: getfield      #22                 // Field coordinates:Ljava/util/Set;
     353: checkcast     #24                 // class java/lang/Iterable
     356: astore_2
     357: astore        7
     359: aload_2
     360: invokeinterface #28,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     365: astore_3
     366: aload_3
     367: invokeinterface #34,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     372: ifne          383
     375: new           #36                 // class java/util/NoSuchElementException
     378: dup
     379: invokespecial #37                 // Method java/util/NoSuchElementException."<init>":()V
     382: athrow
     383: aload_3
     384: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     389: checkcast     #43                 // class Day17$Coordinate
     392: astore        4
     394: iconst_0
     395: istore        5
     397: aload         4
     399: invokevirtual #57                 // Method Day17$Coordinate.getY:()I
     402: istore        4
     404: aload_3
     405: invokeinterface #34,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     410: ifeq          448
     413: aload_3
     414: invokeinterface #41,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     419: checkcast     #43                 // class Day17$Coordinate
     422: astore        5
     424: iconst_0
     425: istore        6
     427: aload         5
     429: invokevirtual #57                 // Method Day17$Coordinate.getY:()I
     432: istore        5
     434: iload         4
     436: iload         5
     438: if_icmpge     404
     441: iload         5
     443: istore        4
     445: goto          404
     448: iload         4
     450: istore        8
     452: aload         7
     454: iload         8
     456: putfield      #63                 // Field maxY:I
     459: return

  public final java.util.Set<Day17$Coordinate> getCoordinates();
    Code:
       0: aload_0
       1: getfield      #22                 // Field coordinates:Ljava/util/Set;
       4: areturn

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

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

  public final int getMinY();
    Code:
       0: aload_0
       1: getfield      #60                 // Field minY:I
       4: ireturn

  public final int getMaxY();
    Code:
       0: aload_0
       1: getfield      #63                 // Field maxY:I
       4: ireturn

  public final boolean crosses(Day17$Coordinate);
    Code:
       0: aload_1
       1: ldc           #84                 // String coordinate
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #51                 // Field minX:I
      10: aload_0
      11: getfield      #54                 // Field maxX:I
      14: if_icmpne     68
      17: aload_0
      18: getfield      #51                 // Field minX:I
      21: aload_1
      22: invokevirtual #47                 // Method Day17$Coordinate.getX:()I
      25: if_icmpne     68
      28: aload_0
      29: getfield      #60                 // Field minY:I
      32: istore_2
      33: aload_0
      34: getfield      #63                 // Field maxY:I
      37: istore_3
      38: aload_1
      39: invokevirtual #57                 // Method Day17$Coordinate.getY:()I
      42: istore        4
      44: iload_2
      45: iload         4
      47: if_icmpgt     64
      50: iload         4
      52: iload_3
      53: if_icmpgt     60
      56: iconst_1
      57: goto          131
      60: iconst_0
      61: goto          131
      64: iconst_0
      65: goto          131
      68: aload_0
      69: getfield      #60                 // Field minY:I
      72: aload_0
      73: getfield      #63                 // Field maxY:I
      76: if_icmpne     130
      79: aload_0
      80: getfield      #60                 // Field minY:I
      83: aload_1
      84: invokevirtual #57                 // Method Day17$Coordinate.getY:()I
      87: if_icmpne     130
      90: aload_0
      91: getfield      #51                 // Field minX:I
      94: istore_2
      95: aload_0
      96: getfield      #54                 // Field maxX:I
      99: istore_3
     100: aload_1
     101: invokevirtual #47                 // Method Day17$Coordinate.getX:()I
     104: istore        4
     106: iload_2
     107: iload         4
     109: if_icmpgt     126
     112: iload         4
     114: iload_3
     115: if_icmpgt     122
     118: iconst_1
     119: goto          131
     122: iconst_0
     123: goto          131
     126: iconst_0
     127: goto          131
     130: iconst_0
     131: ireturn

  public final boolean crosses(int);
    Code:
       0: aload_0
       1: getfield      #60                 // Field minY:I
       4: istore_2
       5: iload_1
       6: aload_0
       7: getfield      #63                 // Field maxY:I
      10: if_icmpgt     26
      13: iload_2
      14: iload_1
      15: if_icmpgt     22
      18: iconst_1
      19: goto          27
      22: iconst_0
      23: goto          27
      26: iconst_0
      27: ireturn

  public final int length();
    Code:
       0: aload_0
       1: getfield      #51                 // Field minX:I
       4: aload_0
       5: getfield      #54                 // Field maxX:I
       8: if_icmpne     25
      11: aload_0
      12: getfield      #63                 // Field maxY:I
      15: aload_0
      16: getfield      #60                 // Field minY:I
      19: isub
      20: iconst_1
      21: iadd
      22: goto          36
      25: aload_0
      26: getfield      #54                 // Field maxX:I
      29: aload_0
      30: getfield      #51                 // Field minX:I
      33: isub
      34: iconst_1
      35: iadd
      36: ireturn

  public final boolean isVertical();
    Code:
       0: aload_0
       1: getfield      #51                 // Field minX:I
       4: aload_0
       5: getfield      #54                 // Field maxX:I
       8: if_icmpne     15
      11: iconst_1
      12: goto          16
      15: iconst_0
      16: ireturn

  public final boolean isHorizontal();
    Code:
       0: aload_0
       1: getfield      #60                 // Field minY:I
       4: aload_0
       5: getfield      #63                 // Field maxY:I
       8: if_icmpne     15
      11: iconst_1
      12: goto          16
      15: iconst_0
      16: ireturn

  public int hashCode();
    Code:
       0: iconst_4
       1: anewarray     #4                  // class java/lang/Object
       4: astore_1
       5: aload_1
       6: iconst_0
       7: aload_0
       8: getfield      #51                 // Field minX:I
      11: invokestatic  #96                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      14: aastore
      15: aload_1
      16: iconst_1
      17: aload_0
      18: getfield      #54                 // Field maxX:I
      21: invokestatic  #96                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      24: aastore
      25: aload_1
      26: iconst_2
      27: aload_0
      28: getfield      #60                 // Field minY:I
      31: invokestatic  #96                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      34: aastore
      35: aload_1
      36: iconst_3
      37: aload_0
      38: getfield      #63                 // Field maxY:I
      41: invokestatic  #96                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      44: aastore
      45: aload_1
      46: invokestatic  #102                // Method java/util/Objects.hash:([Ljava/lang/Object;)I
      49: 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_0
       8: invokevirtual #109                // Method java/lang/Object.getClass:()Ljava/lang/Class;
      11: aload_1
      12: dup
      13: ifnull        22
      16: invokevirtual #109                // Method java/lang/Object.getClass:()Ljava/lang/Class;
      19: goto          24
      22: pop
      23: aconst_null
      24: invokestatic  #113                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      27: ifne          32
      30: iconst_0
      31: ireturn
      32: aload_1
      33: ldc           #115                // String null cannot be cast to non-null type <root>.Day18.Segment
      35: invokestatic  #118                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;Ljava/lang/String;)V
      38: aload_1
      39: checkcast     #2                  // class Day18$Segment
      42: pop
      43: aload_0
      44: getfield      #22                 // Field coordinates:Ljava/util/Set;
      47: aload_1
      48: checkcast     #2                  // class Day18$Segment
      51: getfield      #22                 // Field coordinates:Ljava/util/Set;
      54: invokestatic  #113                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      57: ifne          62
      60: iconst_0
      61: ireturn
      62: aload_0
      63: getfield      #51                 // Field minX:I
      66: aload_1
      67: checkcast     #2                  // class Day18$Segment
      70: getfield      #51                 // Field minX:I
      73: if_icmpeq     78
      76: iconst_0
      77: ireturn
      78: aload_0
      79: getfield      #54                 // Field maxX:I
      82: aload_1
      83: checkcast     #2                  // class Day18$Segment
      86: getfield      #54                 // Field maxX:I
      89: if_icmpeq     94
      92: iconst_0
      93: ireturn
      94: aload_0
      95: getfield      #60                 // Field minY:I
      98: aload_1
      99: checkcast     #2                  // class Day18$Segment
     102: getfield      #60                 // Field minY:I
     105: if_icmpeq     110
     108: iconst_0
     109: ireturn
     110: aload_0
     111: getfield      #63                 // Field maxY:I
     114: aload_1
     115: checkcast     #2                  // class Day18$Segment
     118: getfield      #63                 // Field maxY:I
     121: if_icmpeq     126
     124: iconst_0
     125: ireturn
     126: iconst_1
     127: ireturn

  public final java.util.Set<Day17$Coordinate> component1();
    Code:
       0: aload_0
       1: getfield      #22                 // Field coordinates:Ljava/util/Set;
       4: areturn

  public final Day18$Segment copy(java.util.Set<Day17$Coordinate>);
    Code:
       0: aload_1
       1: ldc           #10                 // String coordinates
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #2                  // class Day18$Segment
       9: dup
      10: aload_1
      11: invokespecial #128                // Method "<init>":(Ljava/util/Set;)V
      14: areturn

  public static Day18$Segment copy$default(Day18$Segment, java.util.Set, int, java.lang.Object);
    Code:
       0: iload_2
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #22                 // Field coordinates:Ljava/util/Set;
      10: astore_1
      11: aload_0
      12: aload_1
      13: invokevirtual #132                // Method copy:(Ljava/util/Set;)LDay18$Segment;
      16: areturn

  public java.lang.String toString();
    Code:
       0: new           #136                // class java/lang/StringBuilder
       3: dup
       4: invokespecial #137                // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #139                // String Segment(coordinates=
       9: invokevirtual #143                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #22                 // Field coordinates:Ljava/util/Set;
      16: invokevirtual #146                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      19: bipush        41
      21: invokevirtual #149                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      24: invokevirtual #151                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      27: areturn
}

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

  private final Day18$Direction direction;

  private final int steps;

  private final java.lang.String colorCode;

  public Day18$Instruction(Day18$Direction, int, java.lang.String);
    Code:
       0: aload_1
       1: ldc           #9                  // String direction
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_3
       7: ldc           #17                 // String colorCode
       9: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_0
      13: invokespecial #20                 // Method java/lang/Object."<init>":()V
      16: aload_0
      17: aload_1
      18: putfield      #23                 // Field direction:LDay18$Direction;
      21: aload_0
      22: iload_2
      23: putfield      #27                 // Field steps:I
      26: aload_0
      27: aload_3
      28: putfield      #30                 // Field colorCode:Ljava/lang/String;
      31: return

  public final Day18$Direction getDirection();
    Code:
       0: aload_0
       1: getfield      #23                 // Field direction:LDay18$Direction;
       4: areturn

  public final int getSteps();
    Code:
       0: aload_0
       1: getfield      #27                 // Field steps:I
       4: ireturn

  public final java.lang.String getColorCode();
    Code:
       0: aload_0
       1: getfield      #30                 // Field colorCode:Ljava/lang/String;
       4: areturn

  public final Day18$Instruction toTrueInstruction();
    Code:
       0: aload_0
       1: getfield      #30                 // Field colorCode:Ljava/lang/String;
       4: checkcast     #42                 // class java/lang/CharSequence
       7: invokestatic  #48                 // Method kotlin/text/StringsKt.last:(Ljava/lang/CharSequence;)C
      10: istore_1
      11: aload_0
      12: getfield      #30                 // Field colorCode:Ljava/lang/String;
      15: iconst_1
      16: invokestatic  #52                 // Method kotlin/text/StringsKt.drop:(Ljava/lang/String;I)Ljava/lang/String;
      19: iconst_1
      20: invokestatic  #55                 // Method kotlin/text/StringsKt.dropLast:(Ljava/lang/String;I)Ljava/lang/String;
      23: astore_2
      24: aload_2
      25: bipush        16
      27: invokestatic  #61                 // Method kotlin/text/CharsKt.checkRadix:(I)I
      30: invokestatic  #67                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;I)I
      33: istore_3
      34: iload_1
      35: tableswitch   { // 48 to 51
                    48: 64
                    49: 70
                    50: 76
                    51: 82
               default: 88
          }
      64: getstatic     #72                 // Field Day18$Direction.RIGHT:LDay18$Direction;
      67: goto          98
      70: getstatic     #75                 // Field Day18$Direction.DOWN:LDay18$Direction;
      73: goto          98
      76: getstatic     #78                 // Field Day18$Direction.LEFT:LDay18$Direction;
      79: goto          98
      82: getstatic     #81                 // Field Day18$Direction.UP:LDay18$Direction;
      85: goto          98
      88: new           #83                 // class java/lang/IllegalStateException
      91: dup
      92: ldc           #85                 // String Should not happen
      94: invokespecial #88                 // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
      97: athrow
      98: astore        4
     100: new           #2                  // class Day18$Instruction
     103: dup
     104: aload         4
     106: iload_3
     107: aload_0
     108: getfield      #30                 // Field colorCode:Ljava/lang/String;
     111: invokespecial #90                 // Method "<init>":(LDay18$Direction;ILjava/lang/String;)V
     114: areturn

  public final Day18$Direction component1();
    Code:
       0: aload_0
       1: getfield      #23                 // Field direction:LDay18$Direction;
       4: areturn

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

  public final java.lang.String component3();
    Code:
       0: aload_0
       1: getfield      #30                 // Field colorCode:Ljava/lang/String;
       4: areturn

  public final Day18$Instruction copy(Day18$Direction, int, java.lang.String);
    Code:
       0: aload_1
       1: ldc           #9                  // String direction
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_3
       7: ldc           #17                 // String colorCode
       9: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: new           #2                  // class Day18$Instruction
      15: dup
      16: aload_1
      17: iload_2
      18: aload_3
      19: invokespecial #90                 // Method "<init>":(LDay18$Direction;ILjava/lang/String;)V
      22: areturn

  public static Day18$Instruction copy$default(Day18$Instruction, Day18$Direction, int, java.lang.String, int, java.lang.Object);
    Code:
       0: iload         4
       2: iconst_1
       3: iand
       4: ifeq          12
       7: aload_0
       8: getfield      #23                 // Field direction:LDay18$Direction;
      11: astore_1
      12: iload         4
      14: iconst_2
      15: iand
      16: ifeq          24
      19: aload_0
      20: getfield      #27                 // Field steps:I
      23: istore_2
      24: iload         4
      26: iconst_4
      27: iand
      28: ifeq          36
      31: aload_0
      32: getfield      #30                 // Field colorCode:Ljava/lang/String;
      35: astore_3
      36: aload_0
      37: aload_1
      38: iload_2
      39: aload_3
      40: invokevirtual #104                // Method copy:(LDay18$Direction;ILjava/lang/String;)LDay18$Instruction;
      43: areturn

  public java.lang.String toString();
    Code:
       0: new           #107                // class java/lang/StringBuilder
       3: dup
       4: invokespecial #108                // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #110                // String Instruction(direction=
       9: invokevirtual #114                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #23                 // Field direction:LDay18$Direction;
      16: invokevirtual #117                // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      19: ldc           #119                // String , steps=
      21: invokevirtual #114                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #27                 // Field steps:I
      28: invokevirtual #122                // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: ldc           #124                // String , colorCode=
      33: invokevirtual #114                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      36: aload_0
      37: getfield      #30                 // Field colorCode:Ljava/lang/String;
      40: invokevirtual #114                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      43: bipush        41
      45: invokevirtual #127                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      48: invokevirtual #129                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      51: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #23                 // Field direction:LDay18$Direction;
       4: invokevirtual #132                // Method Day18$Direction.hashCode:()I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #27                 // Field steps:I
      16: invokestatic  #134                // Method java/lang/Integer.hashCode:(I)I
      19: iadd
      20: istore_1
      21: iload_1
      22: bipush        31
      24: imul
      25: aload_0
      26: getfield      #30                 // Field colorCode:Ljava/lang/String;
      29: invokevirtual #135                // Method java/lang/String.hashCode:()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 Day18$Instruction
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class Day18$Instruction
      20: astore_2
      21: aload_0
      22: getfield      #23                 // Field direction:LDay18$Direction;
      25: aload_2
      26: getfield      #23                 // Field direction:LDay18$Direction;
      29: if_acmpeq     34
      32: iconst_0
      33: ireturn
      34: aload_0
      35: getfield      #27                 // Field steps:I
      38: aload_2
      39: getfield      #27                 // Field steps:I
      42: if_icmpeq     47
      45: iconst_0
      46: ireturn
      47: aload_0
      48: getfield      #30                 // Field colorCode:Ljava/lang/String;
      51: aload_2
      52: getfield      #30                 // Field colorCode:Ljava/lang/String;
      55: invokestatic  #143                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      58: ifne          63
      61: iconst_0
      62: ireturn
      63: iconst_1
      64: ireturn

  static {};
    Code:
       0: new           #148                // class Day18$Instruction$Companion
       3: dup
       4: aconst_null
       5: invokespecial #151                // Method Day18$Instruction$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #155                // Field Companion:LDay18$Instruction$Companion;
      11: return
}

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

  private Day18();
    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: checkcast     #24                 // class java/lang/Iterable
      10: astore_3
      11: iconst_0
      12: istore        4
      14: aload_3
      15: astore        5
      17: new           #26                 // class java/util/ArrayList
      20: dup
      21: aload_3
      22: bipush        10
      24: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      27: invokespecial #35                 // Method java/util/ArrayList."<init>":(I)V
      30: checkcast     #37                 // class java/util/Collection
      33: astore        6
      35: iconst_0
      36: istore        7
      38: aload         5
      40: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      45: astore        8
      47: aload         8
      49: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      54: ifeq          100
      57: aload         8
      59: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      64: astore        9
      66: aload         6
      68: aload         9
      70: checkcast     #53                 // class java/lang/String
      73: astore        10
      75: astore        12
      77: iconst_0
      78: istore        11
      80: getstatic     #59                 // Field Day18$Instruction.Companion:LDay18$Instruction$Companion;
      83: aload         10
      85: invokevirtual #65                 // Method Day18$Instruction$Companion.parse:(Ljava/lang/String;)LDay18$Instruction;
      88: aload         12
      90: swap
      91: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      96: pop
      97: goto          47
     100: aload         6
     102: checkcast     #71                 // class java/util/List
     105: nop
     106: astore_2
     107: aload_0
     108: aload_2
     109: invokevirtual #75                 // Method cubicMetersEnclosed:(Ljava/util/List;)J
     112: invokestatic  #79                 // Method java/lang/String.valueOf:(J)Ljava/lang/String;
     115: areturn

  public final long cubicMetersEnclosed(java.util.List<Day18$Instruction>);
    Code:
       0: aload_1
       1: ldc           #96                 // String instructions
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: invokevirtual #100                // Method dig:(Ljava/util/List;)Ljava/util/List;
      11: astore_2
      12: aload_2
      13: checkcast     #24                 // class java/lang/Iterable
      16: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      21: astore        5
      23: aload         5
      25: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      30: ifne          41
      33: new           #102                // class java/util/NoSuchElementException
      36: dup
      37: invokespecial #103                // Method java/util/NoSuchElementException."<init>":()V
      40: athrow
      41: aload         5
      43: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      48: checkcast     #105                // class Day18$Segment
      51: astore        6
      53: iconst_0
      54: istore        7
      56: aload         6
      58: invokevirtual #109                // Method Day18$Segment.getMinY:()I
      61: istore        6
      63: aload         5
      65: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      70: ifeq          109
      73: aload         5
      75: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      80: checkcast     #105                // class Day18$Segment
      83: astore        7
      85: iconst_0
      86: istore        8
      88: aload         7
      90: invokevirtual #109                // Method Day18$Segment.getMinY:()I
      93: istore        7
      95: iload         6
      97: iload         7
      99: if_icmple     63
     102: iload         7
     104: istore        6
     106: goto          63
     109: iload         6
     111: istore_3
     112: aload_2
     113: checkcast     #24                 // class java/lang/Iterable
     116: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     121: astore        6
     123: aload         6
     125: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     130: ifne          141
     133: new           #102                // class java/util/NoSuchElementException
     136: dup
     137: invokespecial #103                // Method java/util/NoSuchElementException."<init>":()V
     140: athrow
     141: aload         6
     143: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     148: checkcast     #105                // class Day18$Segment
     151: astore        7
     153: iconst_0
     154: istore        8
     156: aload         7
     158: invokevirtual #112                // Method Day18$Segment.getMaxY:()I
     161: istore        7
     163: aload         6
     165: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     170: ifeq          209
     173: aload         6
     175: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     180: checkcast     #105                // class Day18$Segment
     183: astore        8
     185: iconst_0
     186: istore        9
     188: aload         8
     190: invokevirtual #112                // Method Day18$Segment.getMaxY:()I
     193: istore        8
     195: iload         7
     197: iload         8
     199: if_icmpge     163
     202: iload         8
     204: istore        7
     206: goto          163
     209: iload         7
     211: istore        4
     213: aload_2
     214: checkcast     #24                 // class java/lang/Iterable
     217: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     222: astore        7
     224: aload         7
     226: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     231: ifne          242
     234: new           #102                // class java/util/NoSuchElementException
     237: dup
     238: invokespecial #103                // Method java/util/NoSuchElementException."<init>":()V
     241: athrow
     242: aload         7
     244: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     249: checkcast     #105                // class Day18$Segment
     252: astore        8
     254: iconst_0
     255: istore        9
     257: aload         8
     259: invokevirtual #115                // Method Day18$Segment.getMinX:()I
     262: istore        8
     264: aload         7
     266: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     271: ifeq          310
     274: aload         7
     276: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     281: checkcast     #105                // class Day18$Segment
     284: astore        9
     286: iconst_0
     287: istore        10
     289: aload         9
     291: invokevirtual #115                // Method Day18$Segment.getMinX:()I
     294: istore        9
     296: iload         8
     298: iload         9
     300: if_icmple     264
     303: iload         9
     305: istore        8
     307: goto          264
     310: iload         8
     312: istore        5
     314: aload_2
     315: checkcast     #24                 // class java/lang/Iterable
     318: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     323: astore        8
     325: aload         8
     327: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     332: ifne          343
     335: new           #102                // class java/util/NoSuchElementException
     338: dup
     339: invokespecial #103                // Method java/util/NoSuchElementException."<init>":()V
     342: athrow
     343: aload         8
     345: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     350: checkcast     #105                // class Day18$Segment
     353: astore        9
     355: iconst_0
     356: istore        10
     358: aload         9
     360: invokevirtual #118                // Method Day18$Segment.getMaxX:()I
     363: istore        9
     365: aload         8
     367: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     372: ifeq          411
     375: aload         8
     377: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     382: checkcast     #105                // class Day18$Segment
     385: astore        10
     387: iconst_0
     388: istore        11
     390: aload         10
     392: invokevirtual #118                // Method Day18$Segment.getMaxX:()I
     395: istore        10
     397: iload         9
     399: iload         10
     401: if_icmpge     365
     404: iload         10
     406: istore        9
     408: goto          365
     411: iload         9
     413: istore        6
     415: iload         4
     417: iload_3
     418: isub
     419: istore        7
     421: iconst_0
     422: istore        8
     424: new           #120                // class kotlin/jvm/internal/Ref$ObjectRef
     427: dup
     428: invokespecial #121                // Method kotlin/jvm/internal/Ref$ObjectRef."<init>":()V
     431: astore        9
     433: aload         9
     435: aload_2
     436: checkcast     #24                 // class java/lang/Iterable
     439: iconst_2
     440: anewarray     #123                // class kotlin/jvm/functions/Function1
     443: astore        10
     445: aload         10
     447: iconst_0
     448: invokedynamic #142,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
     453: aastore
     454: aload         10
     456: iconst_1
     457: invokedynamic #147,  0            // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function1;
     462: aastore
     463: aload         10
     465: invokestatic  #153                // Method kotlin/comparisons/ComparisonsKt.compareBy:([Lkotlin/jvm/functions/Function1;)Ljava/util/Comparator;
     468: invokestatic  #157                // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;
     471: putfield      #160                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     474: new           #162                // class kotlin/ranges/IntRange
     477: dup
     478: iload_3
     479: iload         4
     481: invokespecial #165                // Method kotlin/ranges/IntRange."<init>":(II)V
     484: checkcast     #24                 // class java/lang/Iterable
     487: astore        12
     489: lconst_0
     490: lstore        13
     492: aload         12
     494: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     499: astore        15
     501: aload         15
     503: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     508: ifeq          808
     511: aload         15
     513: checkcast     #167                // class kotlin/collections/IntIterator
     516: invokevirtual #170                // Method kotlin/collections/IntIterator.nextInt:()I
     519: istore        16
     521: lload         13
     523: iload         16
     525: istore        17
     527: lstore        33
     529: iconst_0
     530: istore        18
     532: new           #172                // class Day17$Coordinate
     535: dup
     536: iload         5
     538: iload         17
     540: invokespecial #173                // Method Day17$Coordinate."<init>":(II)V
     543: astore        19
     545: new           #172                // class Day17$Coordinate
     548: dup
     549: iload         6
     551: iload         17
     553: invokespecial #173                // Method Day17$Coordinate."<init>":(II)V
     556: astore        20
     558: getstatic     #176                // Field INSTANCE:LDay18;
     561: aload         19
     563: aload         20
     565: aload         9
     567: getfield      #160                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     570: checkcast     #71                 // class java/util/List
     573: invokespecial #180                // Method rayCast:(LDay17$Coordinate;LDay17$Coordinate;Ljava/util/List;)J
     576: lstore        21
     578: iload         8
     580: iconst_1
     581: iadd
     582: istore        8
     584: iload         8
     586: ldc           #181                // int 1000000
     588: irem
     589: ifne          794
     592: aload         9
     594: aload         9
     596: getfield      #160                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     599: checkcast     #24                 // class java/lang/Iterable
     602: astore        23
     604: astore        24
     606: iconst_0
     607: istore        25
     609: aload         23
     611: astore        26
     613: new           #26                 // class java/util/ArrayList
     616: dup
     617: invokespecial #182                // Method java/util/ArrayList."<init>":()V
     620: checkcast     #37                 // class java/util/Collection
     623: astore        27
     625: iconst_0
     626: istore        28
     628: aload         26
     630: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     635: astore        29
     637: aload         29
     639: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     644: ifeq          697
     647: aload         29
     649: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     654: astore        30
     656: aload         30
     658: checkcast     #105                // class Day18$Segment
     661: astore        31
     663: iconst_0
     664: istore        32
     666: aload         31
     668: invokevirtual #112                // Method Day18$Segment.getMaxY:()I
     671: iload         17
     673: if_icmplt     680
     676: iconst_1
     677: goto          681
     680: iconst_0
     681: ifeq          637
     684: aload         27
     686: aload         30
     688: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     693: pop
     694: goto          637
     697: aload         27
     699: checkcast     #71                 // class java/util/List
     702: nop
     703: aload         24
     705: swap
     706: putfield      #160                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     709: new           #184                // class java/lang/StringBuilder
     712: dup
     713: invokespecial #185                // Method java/lang/StringBuilder."<init>":()V
     716: ldc           #187                // String Progress:
     718: invokevirtual #191                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     721: getstatic     #196                // Field kotlin/jvm/internal/StringCompanionObject.INSTANCE:Lkotlin/jvm/internal/StringCompanionObject;
     724: pop
     725: ldc           #198                // String %.2f
     727: astore        25
     729: iconst_1
     730: anewarray     #4                  // class java/lang/Object
     733: astore        26
     735: aload         26
     737: iconst_0
     738: iload         8
     740: i2d
     741: iload         7
     743: i2d
     744: ddiv
     745: bipush        100
     747: i2d
     748: dmul
     749: invokestatic  #203                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     752: aastore
     753: aload         26
     755: astore        26
     757: aload         25
     759: aload         26
     761: aload         26
     763: arraylength
     764: invokestatic  #209                // Method java/util/Arrays.copyOf:([Ljava/lang/Object;I)[Ljava/lang/Object;
     767: invokestatic  #213                // Method java/lang/String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
     770: dup
     771: ldc           #215                // String format(...)
     773: invokestatic  #218                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     776: invokevirtual #191                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     779: bipush        37
     781: invokevirtual #221                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     784: invokevirtual #225                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     787: getstatic     #231                // Field java/lang/System.out:Ljava/io/PrintStream;
     790: swap
     791: invokevirtual #237                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     794: lload         21
     796: lstore        35
     798: lload         33
     800: lload         35
     802: ladd
     803: lstore        13
     805: goto          501
     808: lload         13
     810: lstore        10
     812: aload_2
     813: checkcast     #24                 // class java/lang/Iterable
     816: astore        13
     818: iconst_0
     819: istore        14
     821: aload         13
     823: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     828: astore        15
     830: aload         15
     832: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     837: ifeq          880
     840: aload         15
     842: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     847: astore        16
     849: iload         14
     851: aload         16
     853: checkcast     #105                // class Day18$Segment
     856: astore        17
     858: istore        33
     860: iconst_0
     861: istore        18
     863: aload         17
     865: invokevirtual #240                // Method Day18$Segment.length:()I
     868: istore        34
     870: iload         33
     872: iload         34
     874: iadd
     875: istore        14
     877: goto          830
     880: iload         14
     882: istore        12
     884: aload_2
     885: checkcast     #24                 // class java/lang/Iterable
     888: astore        14
     890: iconst_0
     891: istore        15
     893: aload         14
     895: astore        16
     897: new           #26                 // class java/util/ArrayList
     900: dup
     901: invokespecial #182                // Method java/util/ArrayList."<init>":()V
     904: checkcast     #37                 // class java/util/Collection
     907: astore        17
     909: iconst_0
     910: istore        18
     912: aload         16
     914: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     919: astore        19
     921: aload         19
     923: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     928: ifeq          977
     931: aload         19
     933: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     938: astore        20
     940: aload         20
     942: checkcast     #105                // class Day18$Segment
     945: astore        21
     947: iconst_0
     948: istore        22
     950: aload         21
     952: invokevirtual #244                // Method Day18$Segment.getCoordinates:()Ljava/util/Set;
     955: checkcast     #24                 // class java/lang/Iterable
     958: invokestatic  #248                // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;
     961: checkcast     #24                 // class java/lang/Iterable
     964: astore        21
     966: aload         17
     968: aload         21
     970: invokestatic  #252                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     973: pop
     974: goto          921
     977: aload         17
     979: checkcast     #71                 // class java/util/List
     982: nop
     983: checkcast     #24                 // class java/lang/Iterable
     986: astore        14
     988: nop
     989: iconst_0
     990: istore        15
     992: aload         14
     994: astore        16
     996: new           #254                // class java/util/LinkedHashMap
     999: dup
    1000: invokespecial #255                // Method java/util/LinkedHashMap."<init>":()V
    1003: checkcast     #257                // class java/util/Map
    1006: astore        17
    1008: iconst_0
    1009: istore        18
    1011: aload         16
    1013: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1018: astore        19
    1020: aload         19
    1022: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1027: ifeq          1129
    1030: aload         19
    1032: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1037: astore        20
    1039: aload         20
    1041: checkcast     #172                // class Day17$Coordinate
    1044: astore        21
    1046: iconst_0
    1047: istore        22
    1049: aload         21
    1051: astore        23
    1053: aload         17
    1055: astore        24
    1057: iconst_0
    1058: istore        25
    1060: aload         24
    1062: aload         23
    1064: invokeinterface #260,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
    1069: astore        26
    1071: aload         26
    1073: ifnonnull     1108
    1076: iconst_0
    1077: istore        27
    1079: new           #26                 // class java/util/ArrayList
    1082: dup
    1083: invokespecial #182                // Method java/util/ArrayList."<init>":()V
    1086: checkcast     #71                 // class java/util/List
    1089: astore        27
    1091: aload         24
    1093: aload         23
    1095: aload         27
    1097: invokeinterface #264,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    1102: pop
    1103: aload         27
    1105: goto          1110
    1108: aload         26
    1110: nop
    1111: checkcast     #71                 // class java/util/List
    1114: astore        21
    1116: aload         21
    1118: aload         20
    1120: invokeinterface #265,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
    1125: pop
    1126: goto          1020
    1129: aload         17
    1131: nop
    1132: astore        14
    1134: nop
    1135: iconst_0
    1136: istore        15
    1138: aload         14
    1140: astore        16
    1142: new           #254                // class java/util/LinkedHashMap
    1145: dup
    1146: invokespecial #255                // Method java/util/LinkedHashMap."<init>":()V
    1149: checkcast     #257                // class java/util/Map
    1152: astore        17
    1154: iconst_0
    1155: istore        18
    1157: aload         16
    1159: invokeinterface #268,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
    1164: invokeinterface #271,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
    1169: astore        19
    1171: aload         19
    1173: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1178: ifeq          1252
    1181: aload         19
    1183: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1188: checkcast     #273                // class java/util/Map$Entry
    1191: astore        20
    1193: aload         20
    1195: astore        21
    1197: iconst_0
    1198: istore        22
    1200: aload         21
    1202: invokeinterface #276,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
    1207: checkcast     #71                 // class java/util/List
    1210: invokeinterface #279,  1          // InterfaceMethod java/util/List.size:()I
    1215: iconst_1
    1216: if_icmple     1223
    1219: iconst_1
    1220: goto          1224
    1223: iconst_0
    1224: ifeq          1171
    1227: aload         17
    1229: aload         20
    1231: invokeinterface #282,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
    1236: aload         20
    1238: invokeinterface #276,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
    1243: invokeinterface #264,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    1248: pop
    1249: goto          1171
    1252: aload         17
    1254: nop
    1255: invokeinterface #285,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
    1260: invokeinterface #286,  1          // InterfaceMethod java/util/Set.size:()I
    1265: istore        13
    1267: lload         10
    1269: iload         12
    1271: i2l
    1272: ladd
    1273: iload         13
    1275: i2l
    1276: lsub
    1277: lreturn

  private final long rayCast(Day17$Coordinate, Day17$Coordinate, java.util.List<Day18$Segment>);
    Code:
       0: iconst_0
       1: istore        4
       3: lconst_0
       4: lstore        5
       6: new           #342                // class java/util/LinkedHashSet
       9: dup
      10: invokespecial #343                // Method java/util/LinkedHashSet."<init>":()V
      13: checkcast     #270                // class java/util/Set
      16: astore        7
      18: iconst_0
      19: istore        8
      21: aload_1
      22: invokevirtual #346                // Method Day17$Coordinate.getX:()I
      25: istore        8
      27: aload_3
      28: checkcast     #24                 // class java/lang/Iterable
      31: astore        10
      33: nop
      34: iconst_0
      35: istore        11
      37: new           #26                 // class java/util/ArrayList
      40: dup
      41: invokespecial #182                // Method java/util/ArrayList."<init>":()V
      44: astore        12
      46: aload         10
      48: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      53: astore        13
      55: aload         13
      57: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      62: ifeq          118
      65: aload         13
      67: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      72: astore        14
      74: aload         14
      76: checkcast     #105                // class Day18$Segment
      79: astore        15
      81: iconst_0
      82: istore        16
      84: aload         15
      86: invokevirtual #109                // Method Day18$Segment.getMinY:()I
      89: aload_2
      90: invokevirtual #349                // Method Day17$Coordinate.getY:()I
      93: if_icmpgt     100
      96: iconst_1
      97: goto          101
     100: iconst_0
     101: ifne          107
     104: goto          118
     107: aload         12
     109: aload         14
     111: invokevirtual #350                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     114: pop
     115: goto          55
     118: aload         12
     120: checkcast     #71                 // class java/util/List
     123: checkcast     #24                 // class java/lang/Iterable
     126: astore        10
     128: nop
     129: iconst_0
     130: istore        11
     132: aload         10
     134: astore        12
     136: new           #26                 // class java/util/ArrayList
     139: dup
     140: invokespecial #182                // Method java/util/ArrayList."<init>":()V
     143: checkcast     #37                 // class java/util/Collection
     146: astore        13
     148: iconst_0
     149: istore        14
     151: aload         12
     153: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     158: astore        15
     160: aload         15
     162: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     167: ifeq          214
     170: aload         15
     172: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     177: astore        16
     179: aload         16
     181: checkcast     #105                // class Day18$Segment
     184: astore        17
     186: iconst_0
     187: istore        18
     189: aload         17
     191: aload_1
     192: invokevirtual #349                // Method Day17$Coordinate.getY:()I
     195: invokevirtual #354                // Method Day18$Segment.crosses:(I)Z
     198: ifeq          160
     201: aload         13
     203: aload         16
     205: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     210: pop
     211: goto          160
     214: aload         13
     216: checkcast     #71                 // class java/util/List
     219: nop
     220: astore        9
     222: iload         8
     224: aload_2
     225: invokevirtual #346                // Method Day17$Coordinate.getX:()I
     228: if_icmpgt     758
     231: new           #172                // class Day17$Coordinate
     234: dup
     235: iload         8
     237: aload_1
     238: invokevirtual #349                // Method Day17$Coordinate.getY:()I
     241: invokespecial #173                // Method Day17$Coordinate."<init>":(II)V
     244: astore        10
     246: aload         9
     248: checkcast     #24                 // class java/lang/Iterable
     251: astore        12
     253: iconst_0
     254: istore        13
     256: aload         12
     258: astore        14
     260: new           #26                 // class java/util/ArrayList
     263: dup
     264: invokespecial #182                // Method java/util/ArrayList."<init>":()V
     267: checkcast     #37                 // class java/util/Collection
     270: astore        15
     272: iconst_0
     273: istore        16
     275: aload         14
     277: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     282: astore        17
     284: aload         17
     286: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     291: ifeq          336
     294: aload         17
     296: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     301: astore        18
     303: aload         18
     305: checkcast     #105                // class Day18$Segment
     308: astore        19
     310: iconst_0
     311: istore        20
     313: aload         19
     315: aload         10
     317: invokevirtual #357                // Method Day18$Segment.crosses:(LDay17$Coordinate;)Z
     320: ifeq          284
     323: aload         15
     325: aload         18
     327: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     332: pop
     333: goto          284
     336: aload         15
     338: checkcast     #71                 // class java/util/List
     341: nop
     342: astore        11
     344: aload         7
     346: invokeinterface #286,  1          // InterfaceMethod java/util/Set.size:()I
     351: istore        12
     353: aload         7
     355: aload         11
     357: checkcast     #37                 // class java/util/Collection
     360: invokeinterface #360,  2          // InterfaceMethod java/util/Set.addAll:(Ljava/util/Collection;)Z
     365: pop
     366: aload         7
     368: invokeinterface #286,  1          // InterfaceMethod java/util/Set.size:()I
     373: istore        13
     375: iload         13
     377: iload         12
     379: if_icmple     386
     382: iconst_1
     383: goto          387
     386: iconst_0
     387: istore        14
     389: aload         11
     391: checkcast     #37                 // class java/util/Collection
     394: invokeinterface #363,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     399: ifne          406
     402: iconst_1
     403: goto          407
     406: iconst_0
     407: ifeq          526
     410: aload         11
     412: checkcast     #24                 // class java/lang/Iterable
     415: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     420: astore        16
     422: aload         16
     424: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     429: ifne          440
     432: new           #102                // class java/util/NoSuchElementException
     435: dup
     436: invokespecial #103                // Method java/util/NoSuchElementException."<init>":()V
     439: athrow
     440: aload         16
     442: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     447: checkcast     #105                // class Day18$Segment
     450: astore        17
     452: iconst_0
     453: istore        18
     455: aload         17
     457: invokevirtual #118                // Method Day18$Segment.getMaxX:()I
     460: istore        17
     462: aload         16
     464: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     469: ifeq          508
     472: aload         16
     474: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     479: checkcast     #105                // class Day18$Segment
     482: astore        18
     484: iconst_0
     485: istore        19
     487: aload         18
     489: invokevirtual #118                // Method Day18$Segment.getMaxX:()I
     492: istore        18
     494: iload         17
     496: iload         18
     498: if_icmpge     462
     501: iload         18
     503: istore        17
     505: goto          462
     508: iload         17
     510: istore        8
     512: iload         14
     514: ifne          222
     517: iload         8
     519: iconst_1
     520: iadd
     521: istore        8
     523: goto          222
     526: aload_0
     527: aload         7
     529: invokespecial #367                // Method isSingleOrSnakeShaped:(Ljava/util/Set;)Z
     532: ifeq          538
     535: iinc          4, 1
     538: aload         7
     540: invokeinterface #370,  1          // InterfaceMethod java/util/Set.clear:()V
     545: aload         9
     547: checkcast     #24                 // class java/lang/Iterable
     550: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     555: astore        17
     557: aload         17
     559: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     564: ifne          571
     567: aconst_null
     568: goto          690
     571: aload         17
     573: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     578: checkcast     #105                // class Day18$Segment
     581: astore        18
     583: iconst_0
     584: istore        19
     586: aload         18
     588: invokevirtual #115                // Method Day18$Segment.getMinX:()I
     591: iload         8
     593: if_icmple     604
     596: aload         18
     598: invokevirtual #115                // Method Day18$Segment.getMinX:()I
     601: goto          607
     604: ldc_w         #371                // int 2147483647
     607: invokestatic  #376                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     610: checkcast     #378                // class java/lang/Comparable
     613: astore        18
     615: aload         17
     617: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     622: ifeq          688
     625: aload         17
     627: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     632: checkcast     #105                // class Day18$Segment
     635: astore        19
     637: iconst_0
     638: istore        20
     640: aload         19
     642: invokevirtual #115                // Method Day18$Segment.getMinX:()I
     645: iload         8
     647: if_icmple     658
     650: aload         19
     652: invokevirtual #115                // Method Day18$Segment.getMinX:()I
     655: goto          661
     658: ldc_w         #371                // int 2147483647
     661: invokestatic  #376                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     664: checkcast     #378                // class java/lang/Comparable
     667: astore        19
     669: aload         18
     671: aload         19
     673: invokeinterface #382,  2          // InterfaceMethod java/lang/Comparable.compareTo:(Ljava/lang/Object;)I
     678: ifle          615
     681: aload         19
     683: astore        18
     685: goto          615
     688: aload         18
     690: checkcast     #373                // class java/lang/Integer
     693: astore        15
     695: aload         15
     697: dup
     698: ifnull        707
     701: invokevirtual #385                // Method java/lang/Integer.intValue:()I
     704: goto          714
     707: pop
     708: aload_2
     709: invokevirtual #346                // Method Day17$Coordinate.getX:()I
     712: iconst_1
     713: iadd
     714: istore        16
     716: iload         4
     718: iconst_2
     719: irem
     720: iconst_1
     721: if_icmpne     728
     724: iconst_1
     725: goto          729
     728: iconst_0
     729: istore        17
     731: iload         17
     733: ifeq          751
     736: iload         16
     738: iload         8
     740: isub
     741: istore        18
     743: lload         5
     745: iload         18
     747: i2l
     748: ladd
     749: lstore        5
     751: iload         16
     753: istore        8
     755: goto          222
     758: lload         5
     760: lreturn

  private final boolean isSingleOrSnakeShaped(java.util.Set<Day18$Segment>);
    Code:
       0: aload_1
       1: invokeinterface #414,  1          // InterfaceMethod java/util/Set.isEmpty:()Z
       6: ifeq          11
       9: iconst_0
      10: ireturn
      11: aload_1
      12: invokeinterface #286,  1          // InterfaceMethod java/util/Set.size:()I
      17: iconst_1
      18: if_icmpne     23
      21: iconst_1
      22: ireturn
      23: aload_1
      24: invokeinterface #286,  1          // InterfaceMethod java/util/Set.size:()I
      29: iconst_2
      30: if_icmpne     35
      33: iconst_0
      34: ireturn
      35: aload_1
      36: checkcast     #24                 // class java/lang/Iterable
      39: astore_3
      40: iconst_0
      41: istore        4
      43: aload_3
      44: instanceof    #37                 // class java/util/Collection
      47: ifeq          66
      50: aload_3
      51: checkcast     #37                 // class java/util/Collection
      54: invokeinterface #363,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
      59: ifeq          66
      62: iconst_0
      63: goto          130
      66: iconst_0
      67: istore        5
      69: aload_3
      70: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      75: astore        6
      77: aload         6
      79: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      84: ifeq          128
      87: aload         6
      89: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      94: astore        7
      96: aload         7
      98: checkcast     #105                // class Day18$Segment
     101: astore        8
     103: iconst_0
     104: istore        9
     106: aload         8
     108: invokevirtual #417                // Method Day18$Segment.isVertical:()Z
     111: ifeq          77
     114: iinc          5, 1
     117: iload         5
     119: ifge          77
     122: invokestatic  #420                // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V
     125: goto          77
     128: iload         5
     130: istore_2
     131: aload_1
     132: checkcast     #24                 // class java/lang/Iterable
     135: astore        4
     137: iconst_0
     138: istore        5
     140: aload         4
     142: instanceof    #37                 // class java/util/Collection
     145: ifeq          165
     148: aload         4
     150: checkcast     #37                 // class java/util/Collection
     153: invokeinterface #363,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     158: ifeq          165
     161: iconst_0
     162: goto          230
     165: iconst_0
     166: istore        6
     168: aload         4
     170: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     175: astore        7
     177: aload         7
     179: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     184: ifeq          228
     187: aload         7
     189: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     194: astore        8
     196: aload         8
     198: checkcast     #105                // class Day18$Segment
     201: astore        9
     203: iconst_0
     204: istore        10
     206: aload         9
     208: invokevirtual #423                // Method Day18$Segment.isHorizontal:()Z
     211: ifeq          177
     214: iinc          6, 1
     217: iload         6
     219: ifge          177
     222: invokestatic  #420                // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V
     225: goto          177
     228: iload         6
     230: istore_3
     231: iload_2
     232: iload_3
     233: if_icmple     883
     236: aload_1
     237: checkcast     #24                 // class java/lang/Iterable
     240: iconst_2
     241: anewarray     #123                // class kotlin/jvm/functions/Function1
     244: astore        5
     246: aload         5
     248: iconst_0
     249: invokedynamic #428,  0            // InvokeDynamic #2:invoke:()Lkotlin/jvm/functions/Function1;
     254: aastore
     255: aload         5
     257: iconst_1
     258: invokedynamic #433,  0            // InvokeDynamic #3:invoke:()Lkotlin/jvm/functions/Function1;
     263: aastore
     264: aload         5
     266: invokestatic  #153                // Method kotlin/comparisons/ComparisonsKt.compareBy:([Lkotlin/jvm/functions/Function1;)Ljava/util/Comparator;
     269: invokestatic  #157                // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;
     272: astore        4
     274: aload         4
     276: invokestatic  #437                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     279: checkcast     #105                // class Day18$Segment
     282: astore        5
     284: aload         4
     286: invokestatic  #440                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     289: checkcast     #105                // class Day18$Segment
     292: astore        6
     294: aload         5
     296: invokevirtual #244                // Method Day18$Segment.getCoordinates:()Ljava/util/Set;
     299: checkcast     #24                 // class java/lang/Iterable
     302: astore        8
     304: iconst_0
     305: istore        9
     307: aload         8
     309: astore        10
     311: new           #26                 // class java/util/ArrayList
     314: dup
     315: aload         8
     317: bipush        10
     319: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     322: invokespecial #35                 // Method java/util/ArrayList."<init>":(I)V
     325: checkcast     #37                 // class java/util/Collection
     328: astore        11
     330: iconst_0
     331: istore        12
     333: aload         10
     335: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     340: astore        13
     342: aload         13
     344: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     349: ifeq          395
     352: aload         13
     354: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     359: astore        14
     361: aload         11
     363: aload         14
     365: checkcast     #172                // class Day17$Coordinate
     368: astore        15
     370: astore        23
     372: iconst_0
     373: istore        16
     375: aload         15
     377: invokevirtual #349                // Method Day17$Coordinate.getY:()I
     380: invokestatic  #376                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     383: aload         23
     385: swap
     386: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     391: pop
     392: goto          342
     395: aload         11
     397: checkcast     #71                 // class java/util/List
     400: nop
     401: checkcast     #24                 // class java/lang/Iterable
     404: invokestatic  #248                // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;
     407: checkcast     #37                 // class java/util/Collection
     410: aload         6
     412: invokevirtual #244                // Method Day18$Segment.getCoordinates:()Ljava/util/Set;
     415: checkcast     #24                 // class java/lang/Iterable
     418: astore        8
     420: astore        23
     422: iconst_0
     423: istore        9
     425: aload         8
     427: astore        10
     429: new           #26                 // class java/util/ArrayList
     432: dup
     433: aload         8
     435: bipush        10
     437: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     440: invokespecial #35                 // Method java/util/ArrayList."<init>":(I)V
     443: checkcast     #37                 // class java/util/Collection
     446: astore        11
     448: iconst_0
     449: istore        12
     451: aload         10
     453: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     458: astore        13
     460: aload         13
     462: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     467: ifeq          513
     470: aload         13
     472: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     477: astore        14
     479: aload         11
     481: aload         14
     483: checkcast     #172                // class Day17$Coordinate
     486: astore        15
     488: astore        24
     490: iconst_0
     491: istore        16
     493: aload         15
     495: invokevirtual #349                // Method Day17$Coordinate.getY:()I
     498: invokestatic  #376                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     501: aload         24
     503: swap
     504: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     509: pop
     510: goto          460
     513: aload         11
     515: checkcast     #71                 // class java/util/List
     518: nop
     519: aload         23
     521: swap
     522: checkcast     #24                 // class java/lang/Iterable
     525: invokestatic  #248                // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;
     528: checkcast     #24                 // class java/lang/Iterable
     531: invokestatic  #444                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     534: astore        7
     536: aload         7
     538: checkcast     #24                 // class java/lang/Iterable
     541: astore        9
     543: iconst_0
     544: istore        10
     546: aload         9
     548: astore        11
     550: new           #254                // class java/util/LinkedHashMap
     553: dup
     554: invokespecial #255                // Method java/util/LinkedHashMap."<init>":()V
     557: checkcast     #257                // class java/util/Map
     560: astore        12
     562: iconst_0
     563: istore        13
     565: aload         11
     567: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     572: astore        14
     574: aload         14
     576: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     581: ifeq          689
     584: aload         14
     586: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     591: astore        15
     593: aload         15
     595: checkcast     #446                // class java/lang/Number
     598: invokevirtual #447                // Method java/lang/Number.intValue:()I
     601: istore        16
     603: iconst_0
     604: istore        17
     606: iload         16
     608: invokestatic  #376                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     611: astore        18
     613: aload         12
     615: astore        19
     617: iconst_0
     618: istore        20
     620: aload         19
     622: aload         18
     624: invokeinterface #260,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     629: astore        21
     631: aload         21
     633: ifnonnull     668
     636: iconst_0
     637: istore        22
     639: new           #26                 // class java/util/ArrayList
     642: dup
     643: invokespecial #182                // Method java/util/ArrayList."<init>":()V
     646: checkcast     #71                 // class java/util/List
     649: astore        22
     651: aload         19
     653: aload         18
     655: aload         22
     657: invokeinterface #264,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     662: pop
     663: aload         22
     665: goto          670
     668: aload         21
     670: nop
     671: checkcast     #71                 // class java/util/List
     674: astore        16
     676: aload         16
     678: aload         15
     680: invokeinterface #265,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     685: pop
     686: goto          574
     689: aload         12
     691: nop
     692: astore        8
     694: aload         8
     696: astore        10
     698: iconst_0
     699: istore        11
     701: aload         10
     703: astore        12
     705: new           #254                // class java/util/LinkedHashMap
     708: dup
     709: invokespecial #255                // Method java/util/LinkedHashMap."<init>":()V
     712: checkcast     #257                // class java/util/Map
     715: astore        13
     717: iconst_0
     718: istore        14
     720: aload         12
     722: invokeinterface #268,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     727: invokeinterface #271,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     732: astore        15
     734: aload         15
     736: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     741: ifeq          815
     744: aload         15
     746: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     751: checkcast     #273                // class java/util/Map$Entry
     754: astore        16
     756: aload         16
     758: astore        17
     760: iconst_0
     761: istore        18
     763: aload         17
     765: invokeinterface #276,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     770: checkcast     #71                 // class java/util/List
     773: invokeinterface #279,  1          // InterfaceMethod java/util/List.size:()I
     778: iconst_2
     779: if_icmpne     786
     782: iconst_1
     783: goto          787
     786: iconst_0
     787: ifeq          734
     790: aload         13
     792: aload         16
     794: invokeinterface #282,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     799: aload         16
     801: invokeinterface #276,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     806: invokeinterface #264,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     811: pop
     812: goto          734
     815: aload         13
     817: nop
     818: invokeinterface #285,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
     823: checkcast     #24                 // class java/lang/Iterable
     826: invokestatic  #450                // Method kotlin/collections/CollectionsKt.first:(Ljava/lang/Iterable;)Ljava/lang/Object;
     829: checkcast     #446                // class java/lang/Number
     832: invokevirtual #447                // Method java/lang/Number.intValue:()I
     835: istore        9
     837: iload         9
     839: aload         7
     841: checkcast     #24                 // class java/lang/Iterable
     844: invokestatic  #454                // Method kotlin/collections/CollectionsKt.minOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;
     847: checkcast     #446                // class java/lang/Number
     850: invokevirtual #447                // Method java/lang/Number.intValue:()I
     853: if_icmple     879
     856: iload         9
     858: aload         7
     860: checkcast     #24                 // class java/lang/Iterable
     863: invokestatic  #457                // Method kotlin/collections/CollectionsKt.maxOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;
     866: checkcast     #446                // class java/lang/Number
     869: invokevirtual #447                // Method java/lang/Number.intValue:()I
     872: if_icmpge     879
     875: iconst_1
     876: goto          1527
     879: iconst_0
     880: goto          1527
     883: aload_1
     884: checkcast     #24                 // class java/lang/Iterable
     887: iconst_2
     888: anewarray     #123                // class kotlin/jvm/functions/Function1
     891: astore        5
     893: aload         5
     895: iconst_0
     896: invokedynamic #462,  0            // InvokeDynamic #4:invoke:()Lkotlin/jvm/functions/Function1;
     901: aastore
     902: aload         5
     904: iconst_1
     905: invokedynamic #467,  0            // InvokeDynamic #5:invoke:()Lkotlin/jvm/functions/Function1;
     910: aastore
     911: aload         5
     913: invokestatic  #153                // Method kotlin/comparisons/ComparisonsKt.compareBy:([Lkotlin/jvm/functions/Function1;)Ljava/util/Comparator;
     916: invokestatic  #157                // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;
     919: astore        4
     921: aload         4
     923: invokestatic  #437                // Method kotlin/collections/CollectionsKt.first:(Ljava/util/List;)Ljava/lang/Object;
     926: checkcast     #105                // class Day18$Segment
     929: astore        5
     931: aload         4
     933: invokestatic  #440                // Method kotlin/collections/CollectionsKt.last:(Ljava/util/List;)Ljava/lang/Object;
     936: checkcast     #105                // class Day18$Segment
     939: astore        6
     941: aload         5
     943: invokevirtual #244                // Method Day18$Segment.getCoordinates:()Ljava/util/Set;
     946: checkcast     #24                 // class java/lang/Iterable
     949: astore        8
     951: iconst_0
     952: istore        9
     954: aload         8
     956: astore        10
     958: new           #26                 // class java/util/ArrayList
     961: dup
     962: aload         8
     964: bipush        10
     966: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     969: invokespecial #35                 // Method java/util/ArrayList."<init>":(I)V
     972: checkcast     #37                 // class java/util/Collection
     975: astore        11
     977: iconst_0
     978: istore        12
     980: aload         10
     982: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     987: astore        13
     989: aload         13
     991: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     996: ifeq          1042
     999: aload         13
    1001: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1006: astore        14
    1008: aload         11
    1010: aload         14
    1012: checkcast     #172                // class Day17$Coordinate
    1015: astore        15
    1017: astore        23
    1019: iconst_0
    1020: istore        16
    1022: aload         15
    1024: invokevirtual #346                // Method Day17$Coordinate.getX:()I
    1027: invokestatic  #376                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
    1030: aload         23
    1032: swap
    1033: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1038: pop
    1039: goto          989
    1042: aload         11
    1044: checkcast     #71                 // class java/util/List
    1047: nop
    1048: checkcast     #24                 // class java/lang/Iterable
    1051: invokestatic  #248                // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;
    1054: checkcast     #37                 // class java/util/Collection
    1057: aload         6
    1059: invokevirtual #244                // Method Day18$Segment.getCoordinates:()Ljava/util/Set;
    1062: checkcast     #24                 // class java/lang/Iterable
    1065: astore        8
    1067: astore        23
    1069: iconst_0
    1070: istore        9
    1072: aload         8
    1074: astore        10
    1076: new           #26                 // class java/util/ArrayList
    1079: dup
    1080: aload         8
    1082: bipush        10
    1084: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
    1087: invokespecial #35                 // Method java/util/ArrayList."<init>":(I)V
    1090: checkcast     #37                 // class java/util/Collection
    1093: astore        11
    1095: iconst_0
    1096: istore        12
    1098: aload         10
    1100: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1105: astore        13
    1107: aload         13
    1109: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1114: ifeq          1160
    1117: aload         13
    1119: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1124: astore        14
    1126: aload         11
    1128: aload         14
    1130: checkcast     #172                // class Day17$Coordinate
    1133: astore        15
    1135: astore        24
    1137: iconst_0
    1138: istore        16
    1140: aload         15
    1142: invokevirtual #346                // Method Day17$Coordinate.getX:()I
    1145: invokestatic  #376                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
    1148: aload         24
    1150: swap
    1151: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1156: pop
    1157: goto          1107
    1160: aload         11
    1162: checkcast     #71                 // class java/util/List
    1165: nop
    1166: aload         23
    1168: swap
    1169: checkcast     #24                 // class java/lang/Iterable
    1172: invokestatic  #248                // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;
    1175: checkcast     #24                 // class java/lang/Iterable
    1178: invokestatic  #444                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
    1181: astore        7
    1183: aload         7
    1185: checkcast     #24                 // class java/lang/Iterable
    1188: astore        9
    1190: iconst_0
    1191: istore        10
    1193: aload         9
    1195: astore        11
    1197: new           #254                // class java/util/LinkedHashMap
    1200: dup
    1201: invokespecial #255                // Method java/util/LinkedHashMap."<init>":()V
    1204: checkcast     #257                // class java/util/Map
    1207: astore        12
    1209: iconst_0
    1210: istore        13
    1212: aload         11
    1214: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1219: astore        14
    1221: aload         14
    1223: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1228: ifeq          1336
    1231: aload         14
    1233: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1238: astore        15
    1240: aload         15
    1242: checkcast     #446                // class java/lang/Number
    1245: invokevirtual #447                // Method java/lang/Number.intValue:()I
    1248: istore        16
    1250: iconst_0
    1251: istore        17
    1253: iload         16
    1255: invokestatic  #376                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
    1258: astore        18
    1260: aload         12
    1262: astore        19
    1264: iconst_0
    1265: istore        20
    1267: aload         19
    1269: aload         18
    1271: invokeinterface #260,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
    1276: astore        21
    1278: aload         21
    1280: ifnonnull     1315
    1283: iconst_0
    1284: istore        22
    1286: new           #26                 // class java/util/ArrayList
    1289: dup
    1290: invokespecial #182                // Method java/util/ArrayList."<init>":()V
    1293: checkcast     #71                 // class java/util/List
    1296: astore        22
    1298: aload         19
    1300: aload         18
    1302: aload         22
    1304: invokeinterface #264,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    1309: pop
    1310: aload         22
    1312: goto          1317
    1315: aload         21
    1317: nop
    1318: checkcast     #71                 // class java/util/List
    1321: astore        16
    1323: aload         16
    1325: aload         15
    1327: invokeinterface #265,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
    1332: pop
    1333: goto          1221
    1336: aload         12
    1338: nop
    1339: astore        8
    1341: aload         8
    1343: astore        10
    1345: iconst_0
    1346: istore        11
    1348: aload         10
    1350: astore        12
    1352: new           #254                // class java/util/LinkedHashMap
    1355: dup
    1356: invokespecial #255                // Method java/util/LinkedHashMap."<init>":()V
    1359: checkcast     #257                // class java/util/Map
    1362: astore        13
    1364: iconst_0
    1365: istore        14
    1367: aload         12
    1369: invokeinterface #268,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
    1374: invokeinterface #271,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
    1379: astore        15
    1381: aload         15
    1383: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1388: ifeq          1462
    1391: aload         15
    1393: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1398: checkcast     #273                // class java/util/Map$Entry
    1401: astore        16
    1403: aload         16
    1405: astore        17
    1407: iconst_0
    1408: istore        18
    1410: aload         17
    1412: invokeinterface #276,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
    1417: checkcast     #71                 // class java/util/List
    1420: invokeinterface #279,  1          // InterfaceMethod java/util/List.size:()I
    1425: iconst_2
    1426: if_icmpne     1433
    1429: iconst_1
    1430: goto          1434
    1433: iconst_0
    1434: ifeq          1381
    1437: aload         13
    1439: aload         16
    1441: invokeinterface #282,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
    1446: aload         16
    1448: invokeinterface #276,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
    1453: invokeinterface #264,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    1458: pop
    1459: goto          1381
    1462: aload         13
    1464: nop
    1465: invokeinterface #285,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
    1470: checkcast     #24                 // class java/lang/Iterable
    1473: invokestatic  #450                // Method kotlin/collections/CollectionsKt.first:(Ljava/lang/Iterable;)Ljava/lang/Object;
    1476: checkcast     #446                // class java/lang/Number
    1479: invokevirtual #447                // Method java/lang/Number.intValue:()I
    1482: istore        9
    1484: iload         9
    1486: aload         7
    1488: checkcast     #24                 // class java/lang/Iterable
    1491: invokestatic  #454                // Method kotlin/collections/CollectionsKt.minOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;
    1494: checkcast     #446                // class java/lang/Number
    1497: invokevirtual #447                // Method java/lang/Number.intValue:()I
    1500: if_icmple     1526
    1503: iload         9
    1505: aload         7
    1507: checkcast     #24                 // class java/lang/Iterable
    1510: invokestatic  #457                // Method kotlin/collections/CollectionsKt.maxOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;
    1513: checkcast     #446                // class java/lang/Number
    1516: invokevirtual #447                // Method java/lang/Number.intValue:()I
    1519: if_icmpge     1526
    1522: iconst_1
    1523: goto          1527
    1526: iconst_0
    1527: ireturn

  public final java.util.List<Day18$Segment> dig(java.util.List<Day18$Instruction>);
    Code:
       0: aload_1
       1: ldc           #96                 // String instructions
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #172                // class Day17$Coordinate
       9: dup
      10: iconst_0
      11: iconst_0
      12: invokespecial #173                // Method Day17$Coordinate."<init>":(II)V
      15: astore_2
      16: aload_1
      17: checkcast     #24                 // class java/lang/Iterable
      20: astore_3
      21: aload_2
      22: invokestatic  #497                // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
      25: invokestatic  #503                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      28: astore        4
      30: iconst_0
      31: istore        5
      33: aload         4
      35: astore        6
      37: aload_3
      38: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      43: astore        7
      45: aload         7
      47: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      52: ifeq          312
      55: aload         7
      57: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      62: astore        8
      64: aload         6
      66: aload         8
      68: checkcast     #55                 // class Day18$Instruction
      71: astore        9
      73: astore        10
      75: iconst_0
      76: istore        11
      78: aload         10
      80: invokevirtual #508                // Method kotlin/Pair.component1:()Ljava/lang/Object;
      83: checkcast     #172                // class Day17$Coordinate
      86: astore        12
      88: aload         10
      90: invokevirtual #511                // Method kotlin/Pair.component2:()Ljava/lang/Object;
      93: checkcast     #71                 // class java/util/List
      96: astore        13
      98: aload         9
     100: invokevirtual #515                // Method Day18$Instruction.getDirection:()LDay18$Direction;
     103: astore        14
     105: aload         9
     107: invokevirtual #518                // Method Day18$Instruction.getSteps:()I
     110: istore        15
     112: aload         14
     114: getstatic     #524                // Field Day18$WhenMappings.$EnumSwitchMapping$0:[I
     117: swap
     118: invokevirtual #529                // Method Day18$Direction.ordinal:()I
     121: iaload
     122: tableswitch   { // 1 to 4
                     1: 152
                     2: 175
                     3: 198
                     4: 221
               default: 244
          }
     152: new           #172                // class Day17$Coordinate
     155: dup
     156: aload         12
     158: invokevirtual #346                // Method Day17$Coordinate.getX:()I
     161: aload         12
     163: invokevirtual #349                // Method Day17$Coordinate.getY:()I
     166: iload         15
     168: isub
     169: invokespecial #173                // Method Day17$Coordinate."<init>":(II)V
     172: goto          252
     175: new           #172                // class Day17$Coordinate
     178: dup
     179: aload         12
     181: invokevirtual #346                // Method Day17$Coordinate.getX:()I
     184: aload         12
     186: invokevirtual #349                // Method Day17$Coordinate.getY:()I
     189: iload         15
     191: iadd
     192: invokespecial #173                // Method Day17$Coordinate."<init>":(II)V
     195: goto          252
     198: new           #172                // class Day17$Coordinate
     201: dup
     202: aload         12
     204: invokevirtual #346                // Method Day17$Coordinate.getX:()I
     207: iload         15
     209: isub
     210: aload         12
     212: invokevirtual #349                // Method Day17$Coordinate.getY:()I
     215: invokespecial #173                // Method Day17$Coordinate."<init>":(II)V
     218: goto          252
     221: new           #172                // class Day17$Coordinate
     224: dup
     225: aload         12
     227: invokevirtual #346                // Method Day17$Coordinate.getX:()I
     230: iload         15
     232: iadd
     233: aload         12
     235: invokevirtual #349                // Method Day17$Coordinate.getY:()I
     238: invokespecial #173                // Method Day17$Coordinate."<init>":(II)V
     241: goto          252
     244: new           #531                // class kotlin/NoWhenBranchMatchedException
     247: dup
     248: invokespecial #532                // Method kotlin/NoWhenBranchMatchedException."<init>":()V
     251: athrow
     252: astore        16
     254: new           #105                // class Day18$Segment
     257: dup
     258: iconst_2
     259: anewarray     #172                // class Day17$Coordinate
     262: astore        17
     264: aload         17
     266: iconst_0
     267: aload         12
     269: aastore
     270: aload         17
     272: iconst_1
     273: aload         16
     275: aastore
     276: aload         17
     278: invokestatic  #538                // Method kotlin/collections/SetsKt.setOf:([Ljava/lang/Object;)Ljava/util/Set;
     281: invokespecial #541                // Method Day18$Segment."<init>":(Ljava/util/Set;)V
     284: astore        18
     286: aload         16
     288: aload         13
     290: checkcast     #37                 // class java/util/Collection
     293: aload         18
     295: invokestatic  #545                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
     298: checkcast     #24                 // class java/lang/Iterable
     301: invokestatic  #444                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     304: invokestatic  #503                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     307: astore        6
     309: goto          45
     312: aload         6
     314: invokevirtual #548                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     317: checkcast     #71                 // class java/util/List
     320: 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: checkcast     #24                 // class java/lang/Iterable
      10: astore_3
      11: iconst_0
      12: istore        4
      14: aload_3
      15: astore        5
      17: new           #26                 // class java/util/ArrayList
      20: dup
      21: aload_3
      22: bipush        10
      24: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      27: invokespecial #35                 // Method java/util/ArrayList."<init>":(I)V
      30: checkcast     #37                 // class java/util/Collection
      33: astore        6
      35: iconst_0
      36: istore        7
      38: aload         5
      40: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      45: astore        8
      47: aload         8
      49: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      54: ifeq          100
      57: aload         8
      59: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      64: astore        9
      66: aload         6
      68: aload         9
      70: checkcast     #53                 // class java/lang/String
      73: astore        10
      75: astore        12
      77: iconst_0
      78: istore        11
      80: getstatic     #59                 // Field Day18$Instruction.Companion:LDay18$Instruction$Companion;
      83: aload         10
      85: invokevirtual #65                 // Method Day18$Instruction$Companion.parse:(Ljava/lang/String;)LDay18$Instruction;
      88: aload         12
      90: swap
      91: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      96: pop
      97: goto          47
     100: aload         6
     102: checkcast     #71                 // class java/util/List
     105: nop
     106: checkcast     #24                 // class java/lang/Iterable
     109: astore_3
     110: nop
     111: iconst_0
     112: istore        4
     114: aload_3
     115: astore        5
     117: new           #26                 // class java/util/ArrayList
     120: dup
     121: aload_3
     122: bipush        10
     124: invokestatic  #32                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     127: invokespecial #35                 // Method java/util/ArrayList."<init>":(I)V
     130: checkcast     #37                 // class java/util/Collection
     133: astore        6
     135: iconst_0
     136: istore        7
     138: aload         5
     140: invokeinterface #41,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     145: astore        8
     147: aload         8
     149: invokeinterface #47,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     154: ifeq          197
     157: aload         8
     159: invokeinterface #51,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     164: astore        9
     166: aload         6
     168: aload         9
     170: checkcast     #55                 // class Day18$Instruction
     173: astore        10
     175: astore        12
     177: iconst_0
     178: istore        11
     180: aload         10
     182: invokevirtual #565                // Method Day18$Instruction.toTrueInstruction:()LDay18$Instruction;
     185: aload         12
     187: swap
     188: invokeinterface #69,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     193: pop
     194: goto          147
     197: aload         6
     199: checkcast     #71                 // class java/util/List
     202: nop
     203: astore_2
     204: aload_0
     205: aload_2
     206: invokevirtual #75                 // Method cubicMetersEnclosed:(Ljava/util/List;)J
     209: invokestatic  #79                 // Method java/lang/String.valueOf:(J)Ljava/lang/String;
     212: areturn

  private static final java.lang.Comparable cubicMetersEnclosed$lambda$5(Day18$Segment);
    Code:
       0: aload_0
       1: ldc_w         #568                // String it
       4: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokevirtual #109                // Method Day18$Segment.getMinY:()I
      11: invokestatic  #376                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      14: checkcast     #378                // class java/lang/Comparable
      17: areturn

  private static final java.lang.Comparable cubicMetersEnclosed$lambda$6(Day18$Segment);
    Code:
       0: aload_0
       1: ldc_w         #568                // String it
       4: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokevirtual #112                // Method Day18$Segment.getMaxY:()I
      11: invokestatic  #376                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      14: checkcast     #378                // class java/lang/Comparable
      17: areturn

  private static final java.lang.Comparable isSingleOrSnakeShaped$lambda$20(Day18$Segment);
    Code:
       0: aload_0
       1: ldc_w         #568                // String it
       4: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokevirtual #115                // Method Day18$Segment.getMinX:()I
      11: invokestatic  #376                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      14: checkcast     #378                // class java/lang/Comparable
      17: areturn

  private static final java.lang.Comparable isSingleOrSnakeShaped$lambda$21(Day18$Segment);
    Code:
       0: aload_0
       1: ldc_w         #568                // String it
       4: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokevirtual #118                // Method Day18$Segment.getMaxX:()I
      11: invokestatic  #376                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      14: checkcast     #378                // class java/lang/Comparable
      17: areturn

  private static final java.lang.Comparable isSingleOrSnakeShaped$lambda$26(Day18$Segment);
    Code:
       0: aload_0
       1: ldc_w         #568                // String it
       4: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokevirtual #109                // Method Day18$Segment.getMinY:()I
      11: invokestatic  #376                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      14: checkcast     #378                // class java/lang/Comparable
      17: areturn

  private static final java.lang.Comparable isSingleOrSnakeShaped$lambda$27(Day18$Segment);
    Code:
       0: aload_0
       1: ldc_w         #568                // String it
       4: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokevirtual #112                // Method Day18$Segment.getMaxY:()I
      11: invokestatic  #376                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      14: checkcast     #378                // class java/lang/Comparable
      17: areturn

  static {};
    Code:
       0: new           #2                  // class Day18
       3: dup
       4: invokespecial #570                // Method "<init>":()V
       7: putstatic     #176                // Field INSTANCE:LDay18;
      10: return
}

Compiled from "Day18.kt"
public final class Day18$WhenMappings {
  public static final int[] $EnumSwitchMapping$0;

  static {};
    Code:
       0: invokestatic  #14                 // Method Day18$Direction.values:()[LDay18$Direction;
       3: arraylength
       4: newarray       int
       6: astore_0
       7: nop
       8: aload_0
       9: getstatic     #18                 // Field Day18$Direction.UP:LDay18$Direction;
      12: invokevirtual #22                 // Method Day18$Direction.ordinal:()I
      15: iconst_1
      16: iastore
      17: goto          21
      20: astore_1
      21: nop
      22: aload_0
      23: getstatic     #25                 // Field Day18$Direction.DOWN:LDay18$Direction;
      26: invokevirtual #22                 // Method Day18$Direction.ordinal:()I
      29: iconst_2
      30: iastore
      31: goto          35
      34: astore_1
      35: nop
      36: aload_0
      37: getstatic     #28                 // Field Day18$Direction.LEFT:LDay18$Direction;
      40: invokevirtual #22                 // Method Day18$Direction.ordinal:()I
      43: iconst_3
      44: iastore
      45: goto          49
      48: astore_1
      49: nop
      50: aload_0
      51: getstatic     #31                 // Field Day18$Direction.RIGHT:LDay18$Direction;
      54: invokevirtual #22                 // Method Day18$Direction.ordinal:()I
      57: iconst_4
      58: iastore
      59: goto          63
      62: astore_1
      63: aload_0
      64: putstatic     #35                 // Field $EnumSwitchMapping$0:[I
      67: return
    Exception table:
       from    to  target type
           7    17    20   Class java/lang/NoSuchFieldError
          21    31    34   Class java/lang/NoSuchFieldError
          35    45    48   Class java/lang/NoSuchFieldError
          49    59    62   Class java/lang/NoSuchFieldError
}