package com.github.brpeterman.advent2022

class ForestSurvey(input: String) {
    data class Coords(val row: Int, val column: Int)
    data class TreeMap(val width: Int, val height: Int, val trees: Map<Coords, Int>)
    enum class Offset(val rowOffset: Int, val colOffset: Int) {
        NORTH(-1, 0),
        SOUTH(1, 0),
        WEST(0, -1),
        EAST(0, 1)
    }

    var map: TreeMap

    init {
        map = parseInput(input)
    }

    fun countVisible(): Int {
        return map.trees.keys
            .filter { isVisible(it) }
            .count()
    }

    fun findBestTree(): Int {
        return map.trees.keys
            .filter { it.row != 0 &&
                    it.row != map.height-1 &&
                    it.column != 0 &&
                    it.column != map.width-1 }
            .maxOf { scenicScore(it) }
    }

    fun isVisible(coords: Coords): Boolean {
        val height = map.trees[coords]!!
        return ((0..coords.row-1).all { map.trees[Coords(it, coords.column)]!! < height }) ||
                (coords.row+1..map.height-1).all { map.trees[Coords(it, coords.column)]!! < height } ||
                (0..coords.column-1).all { map.trees[Coords(coords.row, it)]!! < height } ||
                (coords.column+1..map.width-1).all { map.trees[Coords(coords.row, it)]!! < height }
    }

    fun scenicScore(coords: Coords): Int {
        val height = map.trees[coords]!!
        val score = Offset.values()
            .map { offset ->
                var current = Coords(coords.row + offset.rowOffset, coords.column + offset.colOffset)
                var count = 1
                while (map.trees[current] != null && map.trees[current]!! < height) {
                    current = Coords(current.row + offset.rowOffset, current.column + offset.colOffset)
                    if (map.trees[current] != null) {
                        count++
                    }
                }
                count
            }
            .reduce { product, i -> product * i }
        return score
    }

    companion object {
        fun parseInput(input: String): TreeMap {
            val lines = input.split("\n")
                .filter { it.isNotBlank() }
            val height = lines.size
            val width = lines[0].length
            val trees = lines.withIndex()
                .fold(mutableMapOf<Coords, Int>()) { map, (lineIndex, line) ->
                    line.toCharArray()
                        .withIndex()
                        .forEach { (charIndex, char) ->
                            map[Coords(lineIndex, charIndex)] = char.toString().toInt()
                        }
                    map
                }
            return TreeMap(width, height, trees)
        }
    }
}

Compiled from "ForestSurvey.kt"
public final class com.github.brpeterman.advent2022.ForestSurvey$Offset extends java.lang.Enum<com.github.brpeterman.advent2022.ForestSurvey$Offset> {
  private final int rowOffset;

  private final int colOffset;

  public static final com.github.brpeterman.advent2022.ForestSurvey$Offset NORTH;

  public static final com.github.brpeterman.advent2022.ForestSurvey$Offset SOUTH;

  public static final com.github.brpeterman.advent2022.ForestSurvey$Offset WEST;

  public static final com.github.brpeterman.advent2022.ForestSurvey$Offset EAST;

  private static final com.github.brpeterman.advent2022.ForestSurvey$Offset[] $VALUES;

  private static final kotlin.enums.EnumEntries $ENTRIES;

  private com.github.brpeterman.advent2022.ForestSurvey$Offset(int, int);
    Code:
       0: aload_0
       1: aload_1
       2: iload_2
       3: invokespecial #11                 // Method java/lang/Enum."<init>":(Ljava/lang/String;I)V
       6: aload_0
       7: iload_3
       8: putfield      #15                 // Field rowOffset:I
      11: aload_0
      12: iload         4
      14: putfield      #18                 // Field colOffset:I
      17: return

  public final int getRowOffset();
    Code:
       0: aload_0
       1: getfield      #15                 // Field rowOffset:I
       4: ireturn

  public final int getColOffset();
    Code:
       0: aload_0
       1: getfield      #18                 // Field colOffset:I
       4: ireturn

  public static com.github.brpeterman.advent2022.ForestSurvey$Offset[] values();
    Code:
       0: getstatic     #32                 // Field $VALUES:[Lcom/github/brpeterman/advent2022/ForestSurvey$Offset;
       3: invokevirtual #38                 // Method java/lang/Object.clone:()Ljava/lang/Object;
       6: checkcast     #39                 // class "[Lcom/github/brpeterman/advent2022/ForestSurvey$Offset;"
       9: areturn

  public static com.github.brpeterman.advent2022.ForestSurvey$Offset valueOf(java.lang.String);
    Code:
       0: ldc           #2                  // class com/github/brpeterman/advent2022/ForestSurvey$Offset
       2: aload_0
       3: invokestatic  #44                 // Method java/lang/Enum.valueOf:(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
       6: checkcast     #2                  // class com/github/brpeterman/advent2022/ForestSurvey$Offset
       9: areturn

  public static kotlin.enums.EnumEntries<com.github.brpeterman.advent2022.ForestSurvey$Offset> getEntries();
    Code:
       0: getstatic     #53                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
       3: areturn

  private static final com.github.brpeterman.advent2022.ForestSurvey$Offset[] $values();
    Code:
       0: iconst_4
       1: anewarray     #2                  // class com/github/brpeterman/advent2022/ForestSurvey$Offset
       4: astore_0
       5: aload_0
       6: iconst_0
       7: getstatic     #57                 // Field NORTH:Lcom/github/brpeterman/advent2022/ForestSurvey$Offset;
      10: aastore
      11: aload_0
      12: iconst_1
      13: getstatic     #60                 // Field SOUTH:Lcom/github/brpeterman/advent2022/ForestSurvey$Offset;
      16: aastore
      17: aload_0
      18: iconst_2
      19: getstatic     #63                 // Field WEST:Lcom/github/brpeterman/advent2022/ForestSurvey$Offset;
      22: aastore
      23: aload_0
      24: iconst_3
      25: getstatic     #66                 // Field EAST:Lcom/github/brpeterman/advent2022/ForestSurvey$Offset;
      28: aastore
      29: aload_0
      30: areturn

  static {};
    Code:
       0: new           #2                  // class com/github/brpeterman/advent2022/ForestSurvey$Offset
       3: dup
       4: ldc           #69                 // String NORTH
       6: iconst_0
       7: iconst_m1
       8: iconst_0
       9: invokespecial #71                 // Method "<init>":(Ljava/lang/String;III)V
      12: putstatic     #57                 // Field NORTH:Lcom/github/brpeterman/advent2022/ForestSurvey$Offset;
      15: new           #2                  // class com/github/brpeterman/advent2022/ForestSurvey$Offset
      18: dup
      19: ldc           #72                 // String SOUTH
      21: iconst_1
      22: iconst_1
      23: iconst_0
      24: invokespecial #71                 // Method "<init>":(Ljava/lang/String;III)V
      27: putstatic     #60                 // Field SOUTH:Lcom/github/brpeterman/advent2022/ForestSurvey$Offset;
      30: new           #2                  // class com/github/brpeterman/advent2022/ForestSurvey$Offset
      33: dup
      34: ldc           #73                 // String WEST
      36: iconst_2
      37: iconst_0
      38: iconst_m1
      39: invokespecial #71                 // Method "<init>":(Ljava/lang/String;III)V
      42: putstatic     #63                 // Field WEST:Lcom/github/brpeterman/advent2022/ForestSurvey$Offset;
      45: new           #2                  // class com/github/brpeterman/advent2022/ForestSurvey$Offset
      48: dup
      49: ldc           #74                 // String EAST
      51: iconst_3
      52: iconst_0
      53: iconst_1
      54: invokespecial #71                 // Method "<init>":(Ljava/lang/String;III)V
      57: putstatic     #66                 // Field EAST:Lcom/github/brpeterman/advent2022/ForestSurvey$Offset;
      60: invokestatic  #76                 // Method $values:()[Lcom/github/brpeterman/advent2022/ForestSurvey$Offset;
      63: putstatic     #32                 // Field $VALUES:[Lcom/github/brpeterman/advent2022/ForestSurvey$Offset;
      66: getstatic     #32                 // Field $VALUES:[Lcom/github/brpeterman/advent2022/ForestSurvey$Offset;
      69: checkcast     #78                 // class "[Ljava/lang/Enum;"
      72: invokestatic  #84                 // Method kotlin/enums/EnumEntriesKt.enumEntries:([Ljava/lang/Enum;)Lkotlin/enums/EnumEntries;
      75: putstatic     #53                 // Field $ENTRIES:Lkotlin/enums/EnumEntries;
      78: return
}

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

  public final com.github.brpeterman.advent2022.ForestSurvey$TreeMap parseInput(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #15                 // String input
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: checkcast     #23                 // class java/lang/CharSequence
      10: iconst_1
      11: anewarray     #25                 // class java/lang/String
      14: astore_3
      15: aload_3
      16: iconst_0
      17: ldc           #27                 // String \n
      19: aastore
      20: aload_3
      21: iconst_0
      22: iconst_0
      23: bipush        6
      25: aconst_null
      26: invokestatic  #33                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      29: checkcast     #35                 // class java/lang/Iterable
      32: astore_3
      33: nop
      34: iconst_0
      35: istore        4
      37: aload_3
      38: astore        5
      40: new           #37                 // class java/util/ArrayList
      43: dup
      44: invokespecial #38                 // Method java/util/ArrayList."<init>":()V
      47: checkcast     #40                 // class java/util/Collection
      50: astore        6
      52: iconst_0
      53: istore        7
      55: aload         5
      57: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      62: astore        8
      64: aload         8
      66: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      71: ifeq          126
      74: aload         8
      76: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      81: astore        9
      83: aload         9
      85: checkcast     #25                 // class java/lang/String
      88: astore        10
      90: iconst_0
      91: istore        11
      93: aload         10
      95: checkcast     #23                 // class java/lang/CharSequence
      98: invokestatic  #58                 // Method kotlin/text/StringsKt.isBlank:(Ljava/lang/CharSequence;)Z
     101: ifne          108
     104: iconst_1
     105: goto          109
     108: iconst_0
     109: nop
     110: ifeq          64
     113: aload         6
     115: aload         9
     117: invokeinterface #62,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     122: pop
     123: goto          64
     126: aload         6
     128: checkcast     #64                 // class java/util/List
     131: nop
     132: astore_2
     133: aload_2
     134: invokeinterface #68,  1           // InterfaceMethod java/util/List.size:()I
     139: istore_3
     140: aload_2
     141: iconst_0
     142: invokeinterface #72,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     147: checkcast     #25                 // class java/lang/String
     150: invokevirtual #75                 // Method java/lang/String.length:()I
     153: istore        4
     155: aload_2
     156: checkcast     #35                 // class java/lang/Iterable
     159: invokestatic  #81                 // Method kotlin/collections/CollectionsKt.withIndex:(Ljava/lang/Iterable;)Ljava/lang/Iterable;
     162: astore        6
     164: new           #83                 // class java/util/LinkedHashMap
     167: dup
     168: invokespecial #84                 // Method java/util/LinkedHashMap."<init>":()V
     171: checkcast     #86                 // class java/util/Map
     174: astore        7
     176: nop
     177: iconst_0
     178: istore        8
     180: aload         7
     182: astore        9
     184: aload         6
     186: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     191: astore        10
     193: aload         10
     195: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     200: ifeq          365
     203: aload         10
     205: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     210: astore        11
     212: aload         9
     214: aload         11
     216: checkcast     #88                 // class kotlin/collections/IndexedValue
     219: astore        12
     221: astore        13
     223: iconst_0
     224: istore        14
     226: aload         12
     228: invokevirtual #91                 // Method kotlin/collections/IndexedValue.component1:()I
     231: istore        15
     233: aload         12
     235: invokevirtual #94                 // Method kotlin/collections/IndexedValue.component2:()Ljava/lang/Object;
     238: checkcast     #25                 // class java/lang/String
     241: astore        16
     243: aload         16
     245: invokevirtual #98                 // Method java/lang/String.toCharArray:()[C
     248: dup
     249: ldc           #100                // String toCharArray(...)
     251: invokestatic  #103                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     254: invokestatic  #108                // Method kotlin/collections/ArraysKt.withIndex:([C)Ljava/lang/Iterable;
     257: astore        17
     259: nop
     260: iconst_0
     261: istore        18
     263: aload         17
     265: invokeinterface #44,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     270: astore        19
     272: aload         19
     274: invokeinterface #50,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     279: ifeq          357
     282: aload         19
     284: invokeinterface #54,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     289: astore        20
     291: aload         20
     293: checkcast     #88                 // class kotlin/collections/IndexedValue
     296: astore        21
     298: iconst_0
     299: istore        22
     301: aload         21
     303: invokevirtual #91                 // Method kotlin/collections/IndexedValue.component1:()I
     306: istore        23
     308: aload         21
     310: invokevirtual #94                 // Method kotlin/collections/IndexedValue.component2:()Ljava/lang/Object;
     313: checkcast     #110                // class java/lang/Character
     316: invokevirtual #114                // Method java/lang/Character.charValue:()C
     319: istore        24
     321: nop
     322: aload         13
     324: new           #116                // class com/github/brpeterman/advent2022/ForestSurvey$Coords
     327: dup
     328: iload         15
     330: iload         23
     332: invokespecial #119                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords."<init>":(II)V
     335: iload         24
     337: invokestatic  #123                // Method java/lang/String.valueOf:(C)Ljava/lang/String;
     340: invokestatic  #129                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     343: invokestatic  #132                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     346: invokeinterface #136,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     351: pop
     352: nop
     353: nop
     354: goto          272
     357: nop
     358: aload         13
     360: astore        9
     362: goto          193
     365: aload         9
     367: astore        5
     369: new           #138                // class com/github/brpeterman/advent2022/ForestSurvey$TreeMap
     372: dup
     373: iload         4
     375: iload_3
     376: aload         5
     378: invokespecial #141                // Method com/github/brpeterman/advent2022/ForestSurvey$TreeMap."<init>":(IILjava/util/Map;)V
     381: areturn

  public com.github.brpeterman.advent2022.ForestSurvey$Companion(kotlin.jvm.internal.DefaultConstructorMarker);
    Code:
       0: aload_0
       1: invokespecial #177                // Method "<init>":()V
       4: return
}

Compiled from "ForestSurvey.kt"
public final class com.github.brpeterman.advent2022.ForestSurvey {
  public static final com.github.brpeterman.advent2022.ForestSurvey$Companion Companion;

  private com.github.brpeterman.advent2022.ForestSurvey$TreeMap map;

  public com.github.brpeterman.advent2022.ForestSurvey(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #9                  // String input
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokespecial #18                 // Method java/lang/Object."<init>":()V
      10: nop
      11: aload_0
      12: getstatic     #22                 // Field Companion:Lcom/github/brpeterman/advent2022/ForestSurvey$Companion;
      15: aload_1
      16: invokevirtual #28                 // Method com/github/brpeterman/advent2022/ForestSurvey$Companion.parseInput:(Ljava/lang/String;)Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
      19: putfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
      22: nop
      23: return

  public final com.github.brpeterman.advent2022.ForestSurvey$TreeMap getMap();
    Code:
       0: aload_0
       1: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
       4: areturn

  public final void setMap(com.github.brpeterman.advent2022.ForestSurvey$TreeMap);
    Code:
       0: aload_1
       1: ldc           #41                 // String <set-?>
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_1
       8: putfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
      11: return

  public final int countVisible();
    Code:
       0: aload_0
       1: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
       4: invokevirtual #49                 // Method com/github/brpeterman/advent2022/ForestSurvey$TreeMap.getTrees:()Ljava/util/Map;
       7: invokeinterface #55,  1           // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
      12: checkcast     #57                 // class java/lang/Iterable
      15: astore_1
      16: nop
      17: iconst_0
      18: istore_2
      19: aload_1
      20: astore_3
      21: new           #59                 // class java/util/ArrayList
      24: dup
      25: invokespecial #60                 // Method java/util/ArrayList."<init>":()V
      28: checkcast     #62                 // class java/util/Collection
      31: astore        4
      33: iconst_0
      34: istore        5
      36: aload_3
      37: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      42: astore        6
      44: aload         6
      46: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      51: ifeq          95
      54: aload         6
      56: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      61: astore        7
      63: aload         7
      65: checkcast     #78                 // class com/github/brpeterman/advent2022/ForestSurvey$Coords
      68: astore        8
      70: iconst_0
      71: istore        9
      73: aload_0
      74: aload         8
      76: invokevirtual #82                 // Method isVisible:(Lcom/github/brpeterman/advent2022/ForestSurvey$Coords;)Z
      79: ifeq          44
      82: aload         4
      84: aload         7
      86: invokeinterface #86,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      91: pop
      92: goto          44
      95: aload         4
      97: checkcast     #88                 // class java/util/List
     100: nop
     101: checkcast     #62                 // class java/util/Collection
     104: invokeinterface #91,  1           // InterfaceMethod java/util/Collection.size:()I
     109: ireturn

  public final int findBestTree();
    Code:
       0: aload_0
       1: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
       4: invokevirtual #49                 // Method com/github/brpeterman/advent2022/ForestSurvey$TreeMap.getTrees:()Ljava/util/Map;
       7: invokeinterface #55,  1           // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
      12: checkcast     #57                 // class java/lang/Iterable
      15: astore_1
      16: nop
      17: iconst_0
      18: istore_2
      19: aload_1
      20: astore_3
      21: new           #59                 // class java/util/ArrayList
      24: dup
      25: invokespecial #60                 // Method java/util/ArrayList."<init>":()V
      28: checkcast     #62                 // class java/util/Collection
      31: astore        4
      33: iconst_0
      34: istore        5
      36: aload_3
      37: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      42: astore        6
      44: aload         6
      46: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      51: ifeq          144
      54: aload         6
      56: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      61: astore        7
      63: aload         7
      65: checkcast     #78                 // class com/github/brpeterman/advent2022/ForestSurvey$Coords
      68: astore        8
      70: iconst_0
      71: istore        9
      73: aload         8
      75: invokevirtual #108                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords.getRow:()I
      78: ifeq          127
      81: aload         8
      83: invokevirtual #108                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords.getRow:()I
      86: aload_0
      87: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
      90: invokevirtual #111                // Method com/github/brpeterman/advent2022/ForestSurvey$TreeMap.getHeight:()I
      93: iconst_1
      94: isub
      95: if_icmpeq     127
      98: aload         8
     100: invokevirtual #114                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords.getColumn:()I
     103: ifeq          127
     106: aload         8
     108: invokevirtual #114                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords.getColumn:()I
     111: aload_0
     112: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
     115: invokevirtual #117                // Method com/github/brpeterman/advent2022/ForestSurvey$TreeMap.getWidth:()I
     118: iconst_1
     119: isub
     120: if_icmpeq     127
     123: iconst_1
     124: goto          128
     127: iconst_0
     128: ifeq          44
     131: aload         4
     133: aload         7
     135: invokeinterface #86,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     140: pop
     141: goto          44
     144: aload         4
     146: checkcast     #88                 // class java/util/List
     149: nop
     150: checkcast     #57                 // class java/lang/Iterable
     153: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     158: astore_2
     159: aload_2
     160: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     165: ifne          176
     168: new           #119                // class java/util/NoSuchElementException
     171: dup
     172: invokespecial #120                // Method java/util/NoSuchElementException."<init>":()V
     175: athrow
     176: aload_2
     177: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     182: checkcast     #78                 // class com/github/brpeterman/advent2022/ForestSurvey$Coords
     185: astore_3
     186: iconst_0
     187: istore        4
     189: aload_0
     190: aload_3
     191: invokevirtual #124                // Method scenicScore:(Lcom/github/brpeterman/advent2022/ForestSurvey$Coords;)I
     194: istore_3
     195: aload_2
     196: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     201: ifeq          238
     204: aload_2
     205: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     210: checkcast     #78                 // class com/github/brpeterman/advent2022/ForestSurvey$Coords
     213: astore        4
     215: iconst_0
     216: istore        5
     218: aload_0
     219: aload         4
     221: invokevirtual #124                // Method scenicScore:(Lcom/github/brpeterman/advent2022/ForestSurvey$Coords;)I
     224: istore        4
     226: iload_3
     227: iload         4
     229: if_icmpge     195
     232: iload         4
     234: istore_3
     235: goto          195
     238: iload_3
     239: ireturn

  public final boolean isVisible(com.github.brpeterman.advent2022.ForestSurvey$Coords);
    Code:
       0: aload_1
       1: ldc           #128                // String coords
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
      10: invokevirtual #49                 // Method com/github/brpeterman/advent2022/ForestSurvey$TreeMap.getTrees:()Ljava/util/Map;
      13: aload_1
      14: invokeinterface #132,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      19: dup
      20: invokestatic  #136                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      23: checkcast     #138                // class java/lang/Number
      26: invokevirtual #141                // Method java/lang/Number.intValue:()I
      29: istore_2
      30: new           #143                // class kotlin/ranges/IntRange
      33: dup
      34: iconst_0
      35: aload_1
      36: invokevirtual #108                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords.getRow:()I
      39: iconst_1
      40: isub
      41: invokespecial #146                // Method kotlin/ranges/IntRange."<init>":(II)V
      44: checkcast     #57                 // class java/lang/Iterable
      47: astore_3
      48: iconst_0
      49: istore        4
      51: aload_3
      52: instanceof    #62                 // class java/util/Collection
      55: ifeq          74
      58: aload_3
      59: checkcast     #62                 // class java/util/Collection
      62: invokeinterface #149,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
      67: ifeq          74
      70: iconst_1
      71: goto          161
      74: aload_3
      75: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      80: astore        5
      82: aload         5
      84: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      89: ifeq          160
      92: aload         5
      94: checkcast     #151                // class kotlin/collections/IntIterator
      97: invokevirtual #154                // Method kotlin/collections/IntIterator.nextInt:()I
     100: istore        6
     102: iload         6
     104: istore        7
     106: iconst_0
     107: istore        8
     109: aload_0
     110: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
     113: invokevirtual #49                 // Method com/github/brpeterman/advent2022/ForestSurvey$TreeMap.getTrees:()Ljava/util/Map;
     116: new           #78                 // class com/github/brpeterman/advent2022/ForestSurvey$Coords
     119: dup
     120: iload         7
     122: aload_1
     123: invokevirtual #114                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords.getColumn:()I
     126: invokespecial #155                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords."<init>":(II)V
     129: invokeinterface #132,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     134: dup
     135: invokestatic  #136                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     138: checkcast     #138                // class java/lang/Number
     141: invokevirtual #141                // Method java/lang/Number.intValue:()I
     144: iload_2
     145: if_icmpge     152
     148: iconst_1
     149: goto          153
     152: iconst_0
     153: ifne          82
     156: iconst_0
     157: goto          161
     160: iconst_1
     161: ifne          582
     164: new           #143                // class kotlin/ranges/IntRange
     167: dup
     168: aload_1
     169: invokevirtual #108                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords.getRow:()I
     172: iconst_1
     173: iadd
     174: aload_0
     175: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
     178: invokevirtual #111                // Method com/github/brpeterman/advent2022/ForestSurvey$TreeMap.getHeight:()I
     181: iconst_1
     182: isub
     183: invokespecial #146                // Method kotlin/ranges/IntRange."<init>":(II)V
     186: checkcast     #57                 // class java/lang/Iterable
     189: astore_3
     190: iconst_0
     191: istore        4
     193: aload_3
     194: instanceof    #62                 // class java/util/Collection
     197: ifeq          216
     200: aload_3
     201: checkcast     #62                 // class java/util/Collection
     204: invokeinterface #149,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     209: ifeq          216
     212: iconst_1
     213: goto          303
     216: aload_3
     217: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     222: astore        5
     224: aload         5
     226: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     231: ifeq          302
     234: aload         5
     236: checkcast     #151                // class kotlin/collections/IntIterator
     239: invokevirtual #154                // Method kotlin/collections/IntIterator.nextInt:()I
     242: istore        6
     244: iload         6
     246: istore        7
     248: iconst_0
     249: istore        8
     251: aload_0
     252: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
     255: invokevirtual #49                 // Method com/github/brpeterman/advent2022/ForestSurvey$TreeMap.getTrees:()Ljava/util/Map;
     258: new           #78                 // class com/github/brpeterman/advent2022/ForestSurvey$Coords
     261: dup
     262: iload         7
     264: aload_1
     265: invokevirtual #114                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords.getColumn:()I
     268: invokespecial #155                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords."<init>":(II)V
     271: invokeinterface #132,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     276: dup
     277: invokestatic  #136                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     280: checkcast     #138                // class java/lang/Number
     283: invokevirtual #141                // Method java/lang/Number.intValue:()I
     286: iload_2
     287: if_icmpge     294
     290: iconst_1
     291: goto          295
     294: iconst_0
     295: ifne          224
     298: iconst_0
     299: goto          303
     302: iconst_1
     303: ifne          582
     306: new           #143                // class kotlin/ranges/IntRange
     309: dup
     310: iconst_0
     311: aload_1
     312: invokevirtual #114                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords.getColumn:()I
     315: iconst_1
     316: isub
     317: invokespecial #146                // Method kotlin/ranges/IntRange."<init>":(II)V
     320: checkcast     #57                 // class java/lang/Iterable
     323: astore_3
     324: iconst_0
     325: istore        4
     327: aload_3
     328: instanceof    #62                 // class java/util/Collection
     331: ifeq          350
     334: aload_3
     335: checkcast     #62                 // class java/util/Collection
     338: invokeinterface #149,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     343: ifeq          350
     346: iconst_1
     347: goto          437
     350: aload_3
     351: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     356: astore        5
     358: aload         5
     360: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     365: ifeq          436
     368: aload         5
     370: checkcast     #151                // class kotlin/collections/IntIterator
     373: invokevirtual #154                // Method kotlin/collections/IntIterator.nextInt:()I
     376: istore        6
     378: iload         6
     380: istore        7
     382: iconst_0
     383: istore        8
     385: aload_0
     386: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
     389: invokevirtual #49                 // Method com/github/brpeterman/advent2022/ForestSurvey$TreeMap.getTrees:()Ljava/util/Map;
     392: new           #78                 // class com/github/brpeterman/advent2022/ForestSurvey$Coords
     395: dup
     396: aload_1
     397: invokevirtual #108                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords.getRow:()I
     400: iload         7
     402: invokespecial #155                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords."<init>":(II)V
     405: invokeinterface #132,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     410: dup
     411: invokestatic  #136                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     414: checkcast     #138                // class java/lang/Number
     417: invokevirtual #141                // Method java/lang/Number.intValue:()I
     420: iload_2
     421: if_icmpge     428
     424: iconst_1
     425: goto          429
     428: iconst_0
     429: ifne          358
     432: iconst_0
     433: goto          437
     436: iconst_1
     437: ifne          582
     440: new           #143                // class kotlin/ranges/IntRange
     443: dup
     444: aload_1
     445: invokevirtual #114                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords.getColumn:()I
     448: iconst_1
     449: iadd
     450: aload_0
     451: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
     454: invokevirtual #117                // Method com/github/brpeterman/advent2022/ForestSurvey$TreeMap.getWidth:()I
     457: iconst_1
     458: isub
     459: invokespecial #146                // Method kotlin/ranges/IntRange."<init>":(II)V
     462: checkcast     #57                 // class java/lang/Iterable
     465: astore_3
     466: iconst_0
     467: istore        4
     469: aload_3
     470: instanceof    #62                 // class java/util/Collection
     473: ifeq          492
     476: aload_3
     477: checkcast     #62                 // class java/util/Collection
     480: invokeinterface #149,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     485: ifeq          492
     488: iconst_1
     489: goto          579
     492: aload_3
     493: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     498: astore        5
     500: aload         5
     502: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     507: ifeq          578
     510: aload         5
     512: checkcast     #151                // class kotlin/collections/IntIterator
     515: invokevirtual #154                // Method kotlin/collections/IntIterator.nextInt:()I
     518: istore        6
     520: iload         6
     522: istore        7
     524: iconst_0
     525: istore        8
     527: aload_0
     528: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
     531: invokevirtual #49                 // Method com/github/brpeterman/advent2022/ForestSurvey$TreeMap.getTrees:()Ljava/util/Map;
     534: new           #78                 // class com/github/brpeterman/advent2022/ForestSurvey$Coords
     537: dup
     538: aload_1
     539: invokevirtual #108                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords.getRow:()I
     542: iload         7
     544: invokespecial #155                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords."<init>":(II)V
     547: invokeinterface #132,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     552: dup
     553: invokestatic  #136                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     556: checkcast     #138                // class java/lang/Number
     559: invokevirtual #141                // Method java/lang/Number.intValue:()I
     562: iload_2
     563: if_icmpge     570
     566: iconst_1
     567: goto          571
     570: iconst_0
     571: ifne          500
     574: iconst_0
     575: goto          579
     578: iconst_1
     579: ifeq          586
     582: iconst_1
     583: goto          587
     586: iconst_0
     587: ireturn

  public final int scenicScore(com.github.brpeterman.advent2022.ForestSurvey$Coords);
    Code:
       0: aload_1
       1: ldc           #128                // String coords
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
      10: invokevirtual #49                 // Method com/github/brpeterman/advent2022/ForestSurvey$TreeMap.getTrees:()Ljava/util/Map;
      13: aload_1
      14: invokeinterface #132,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      19: dup
      20: invokestatic  #136                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      23: checkcast     #138                // class java/lang/Number
      26: invokevirtual #141                // Method java/lang/Number.intValue:()I
      29: istore_2
      30: invokestatic  #169                // Method com/github/brpeterman/advent2022/ForestSurvey$Offset.values:()[Lcom/github/brpeterman/advent2022/ForestSurvey$Offset;
      33: astore        4
      35: nop
      36: iconst_0
      37: istore        5
      39: aload         4
      41: astore        6
      43: new           #59                 // class java/util/ArrayList
      46: dup
      47: aload         4
      49: arraylength
      50: invokespecial #172                // Method java/util/ArrayList."<init>":(I)V
      53: checkcast     #62                 // class java/util/Collection
      56: astore        7
      58: iconst_0
      59: istore        8
      61: iconst_0
      62: istore        9
      64: aload         6
      66: arraylength
      67: istore        10
      69: iload         9
      71: iload         10
      73: if_icmpge     245
      76: aload         6
      78: iload         9
      80: aaload
      81: astore        11
      83: aload         7
      85: aload         11
      87: astore        12
      89: astore        16
      91: iconst_0
      92: istore        13
      94: new           #78                 // class com/github/brpeterman/advent2022/ForestSurvey$Coords
      97: dup
      98: aload_1
      99: invokevirtual #108                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords.getRow:()I
     102: aload         12
     104: invokevirtual #175                // Method com/github/brpeterman/advent2022/ForestSurvey$Offset.getRowOffset:()I
     107: iadd
     108: aload_1
     109: invokevirtual #114                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords.getColumn:()I
     112: aload         12
     114: invokevirtual #178                // Method com/github/brpeterman/advent2022/ForestSurvey$Offset.getColOffset:()I
     117: iadd
     118: invokespecial #155                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords."<init>":(II)V
     121: astore        14
     123: iconst_1
     124: istore        15
     126: aload_0
     127: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
     130: invokevirtual #49                 // Method com/github/brpeterman/advent2022/ForestSurvey$TreeMap.getTrees:()Ljava/util/Map;
     133: aload         14
     135: invokeinterface #132,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     140: ifnull        225
     143: aload_0
     144: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
     147: invokevirtual #49                 // Method com/github/brpeterman/advent2022/ForestSurvey$TreeMap.getTrees:()Ljava/util/Map;
     150: aload         14
     152: invokeinterface #132,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     157: dup
     158: invokestatic  #136                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     161: checkcast     #138                // class java/lang/Number
     164: invokevirtual #141                // Method java/lang/Number.intValue:()I
     167: iload_2
     168: if_icmpge     225
     171: new           #78                 // class com/github/brpeterman/advent2022/ForestSurvey$Coords
     174: dup
     175: aload         14
     177: invokevirtual #108                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords.getRow:()I
     180: aload         12
     182: invokevirtual #175                // Method com/github/brpeterman/advent2022/ForestSurvey$Offset.getRowOffset:()I
     185: iadd
     186: aload         14
     188: invokevirtual #114                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords.getColumn:()I
     191: aload         12
     193: invokevirtual #178                // Method com/github/brpeterman/advent2022/ForestSurvey$Offset.getColOffset:()I
     196: iadd
     197: invokespecial #155                // Method com/github/brpeterman/advent2022/ForestSurvey$Coords."<init>":(II)V
     200: astore        14
     202: aload_0
     203: getfield      #32                 // Field map:Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
     206: invokevirtual #49                 // Method com/github/brpeterman/advent2022/ForestSurvey$TreeMap.getTrees:()Ljava/util/Map;
     209: aload         14
     211: invokeinterface #132,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     216: ifnull        126
     219: iinc          15, 1
     222: goto          126
     225: iload         15
     227: invokestatic  #184                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     230: aload         16
     232: swap
     233: invokeinterface #86,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     238: pop
     239: iinc          9, 1
     242: goto          69
     245: aload         7
     247: checkcast     #88                 // class java/util/List
     250: nop
     251: checkcast     #57                 // class java/lang/Iterable
     254: astore        4
     256: nop
     257: iconst_0
     258: istore        5
     260: aload         4
     262: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     267: astore        6
     269: aload         6
     271: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     276: ifne          289
     279: new           #186                // class java/lang/UnsupportedOperationException
     282: dup
     283: ldc           #188                // String Empty collection can\'t be reduced.
     285: invokespecial #190                // Method java/lang/UnsupportedOperationException."<init>":(Ljava/lang/String;)V
     288: athrow
     289: aload         6
     291: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     296: astore        7
     298: aload         6
     300: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     305: ifeq          349
     308: aload         7
     310: aload         6
     312: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     317: checkcast     #138                // class java/lang/Number
     320: invokevirtual #141                // Method java/lang/Number.intValue:()I
     323: istore        8
     325: checkcast     #138                // class java/lang/Number
     328: invokevirtual #141                // Method java/lang/Number.intValue:()I
     331: istore        9
     333: iconst_0
     334: istore        10
     336: iload         9
     338: iload         8
     340: imul
     341: invokestatic  #184                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     344: astore        7
     346: goto          298
     349: aload         7
     351: checkcast     #138                // class java/lang/Number
     354: invokevirtual #141                // Method java/lang/Number.intValue:()I
     357: istore_3
     358: iload_3
     359: ireturn

  static {};
    Code:
       0: new           #24                 // class com/github/brpeterman/advent2022/ForestSurvey$Companion
       3: dup
       4: aconst_null
       5: invokespecial #216                // Method com/github/brpeterman/advent2022/ForestSurvey$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #22                 // Field Companion:Lcom/github/brpeterman/advent2022/ForestSurvey$Companion;
      11: return
}

Compiled from "ForestSurvey.kt"
public final class com.github.brpeterman.advent2022.ForestSurvey$Coords {
  private final int row;

  private final int column;

  public com.github.brpeterman.advent2022.ForestSurvey$Coords(int, int);
    Code:
       0: aload_0
       1: invokespecial #9                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: iload_1
       6: putfield      #13                 // Field row:I
       9: aload_0
      10: iload_2
      11: putfield      #16                 // Field column:I
      14: return

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

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

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

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

  public final com.github.brpeterman.advent2022.ForestSurvey$Coords copy(int, int);
    Code:
       0: new           #2                  // class com/github/brpeterman/advent2022/ForestSurvey$Coords
       3: dup
       4: iload_1
       5: iload_2
       6: invokespecial #28                 // Method "<init>":(II)V
       9: areturn

  public static com.github.brpeterman.advent2022.ForestSurvey$Coords copy$default(com.github.brpeterman.advent2022.ForestSurvey$Coords, int, int, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_1
       2: iand
       3: ifeq          11
       6: aload_0
       7: getfield      #13                 // Field row:I
      10: istore_1
      11: iload_3
      12: iconst_2
      13: iand
      14: ifeq          22
      17: aload_0
      18: getfield      #16                 // Field column:I
      21: istore_2
      22: aload_0
      23: iload_1
      24: iload_2
      25: invokevirtual #32                 // Method copy:(II)Lcom/github/brpeterman/advent2022/ForestSurvey$Coords;
      28: areturn

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

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

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

Compiled from "ForestSurvey.kt"
public final class com.github.brpeterman.advent2022.ForestSurvey$TreeMap {
  private final int width;

  private final int height;

  private final java.util.Map<com.github.brpeterman.advent2022.ForestSurvey$Coords, java.lang.Integer> trees;

  public com.github.brpeterman.advent2022.ForestSurvey$TreeMap(int, int, java.util.Map<com.github.brpeterman.advent2022.ForestSurvey$Coords, java.lang.Integer>);
    Code:
       0: aload_3
       1: ldc           #10                 // String trees
       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: iload_1
      12: putfield      #23                 // Field width:I
      15: aload_0
      16: iload_2
      17: putfield      #26                 // Field height:I
      20: aload_0
      21: aload_3
      22: putfield      #29                 // Field trees:Ljava/util/Map;
      25: return

  public final int getWidth();
    Code:
       0: aload_0
       1: getfield      #23                 // Field width:I
       4: ireturn

  public final int getHeight();
    Code:
       0: aload_0
       1: getfield      #26                 // Field height:I
       4: ireturn

  public final java.util.Map<com.github.brpeterman.advent2022.ForestSurvey$Coords, java.lang.Integer> getTrees();
    Code:
       0: aload_0
       1: getfield      #29                 // Field trees:Ljava/util/Map;
       4: areturn

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

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

  public final java.util.Map<com.github.brpeterman.advent2022.ForestSurvey$Coords, java.lang.Integer> component3();
    Code:
       0: aload_0
       1: getfield      #29                 // Field trees:Ljava/util/Map;
       4: areturn

  public final com.github.brpeterman.advent2022.ForestSurvey$TreeMap copy(int, int, java.util.Map<com.github.brpeterman.advent2022.ForestSurvey$Coords, java.lang.Integer>);
    Code:
       0: aload_3
       1: ldc           #10                 // String trees
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #2                  // class com/github/brpeterman/advent2022/ForestSurvey$TreeMap
       9: dup
      10: iload_1
      11: iload_2
      12: aload_3
      13: invokespecial #45                 // Method "<init>":(IILjava/util/Map;)V
      16: areturn

  public static com.github.brpeterman.advent2022.ForestSurvey$TreeMap copy$default(com.github.brpeterman.advent2022.ForestSurvey$TreeMap, int, int, java.util.Map, int, java.lang.Object);
    Code:
       0: iload         4
       2: iconst_1
       3: iand
       4: ifeq          12
       7: aload_0
       8: getfield      #23                 // Field width:I
      11: istore_1
      12: iload         4
      14: iconst_2
      15: iand
      16: ifeq          24
      19: aload_0
      20: getfield      #26                 // Field height:I
      23: istore_2
      24: iload         4
      26: iconst_4
      27: iand
      28: ifeq          36
      31: aload_0
      32: getfield      #29                 // Field trees:Ljava/util/Map;
      35: astore_3
      36: aload_0
      37: iload_1
      38: iload_2
      39: aload_3
      40: invokevirtual #49                 // Method copy:(IILjava/util/Map;)Lcom/github/brpeterman/advent2022/ForestSurvey$TreeMap;
      43: areturn

  public java.lang.String toString();
    Code:
       0: new           #53                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #54                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #56                 // String TreeMap(width=
       9: invokevirtual #60                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #23                 // Field width:I
      16: invokevirtual #63                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #65                 // String , height=
      21: invokevirtual #60                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #26                 // Field height:I
      28: invokevirtual #63                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: ldc           #67                 // String , trees=
      33: invokevirtual #60                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      36: aload_0
      37: getfield      #29                 // Field trees:Ljava/util/Map;
      40: invokevirtual #70                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      43: bipush        41
      45: invokevirtual #73                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      48: invokevirtual #75                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      51: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #23                 // Field width:I
       4: invokestatic  #81                 // Method java/lang/Integer.hashCode:(I)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #26                 // Field height:I
      16: invokestatic  #81                 // 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      #29                 // Field trees:Ljava/util/Map;
      29: invokevirtual #83                 // Method java/lang/Object.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 com/github/brpeterman/advent2022/ForestSurvey$TreeMap
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class com/github/brpeterman/advent2022/ForestSurvey$TreeMap
      20: astore_2
      21: aload_0
      22: getfield      #23                 // Field width:I
      25: aload_2
      26: getfield      #23                 // Field width:I
      29: if_icmpeq     34
      32: iconst_0
      33: ireturn
      34: aload_0
      35: getfield      #26                 // Field height:I
      38: aload_2
      39: getfield      #26                 // Field height:I
      42: if_icmpeq     47
      45: iconst_0
      46: ireturn
      47: aload_0
      48: getfield      #29                 // Field trees:Ljava/util/Map;
      51: aload_2
      52: getfield      #29                 // Field trees:Ljava/util/Map;
      55: invokestatic  #91                 // 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
}