package coursera.algorithms1.week1.assignments.interview

class UnionFindWithSpecificCanonicalElement(n: Int) {
    private val ids = IntArray(n) { it }
    private val largestValueAt = IntArray(n) { it }
    private val size = IntArray(n) { 1 }

    private fun root(p: Int): Int {
        var trav = p

        while (ids[trav] != trav) {
            ids[trav] = ids[ids[trav]]
            trav = ids[trav]
        }

        return trav
    }

    fun find(i: Int): Int =
        largestValueAt[root(i)]

    fun connected(p: Int, q: Int): Boolean =
        root(p) == root(q)

    fun union(p: Int, q: Int) {
        val pRoot = root(p)
        val qRoot = root(q)

        if (pRoot == qRoot) return

        val newRoot: Int
        val oldRoot: Int

        if (size[pRoot] > size[qRoot]) {
            ids[qRoot] = pRoot
            size[pRoot] += size[qRoot]

            newRoot = pRoot
            oldRoot = qRoot
        } else {
            ids[pRoot] = qRoot
            size[qRoot] += size[pRoot]

            newRoot = qRoot
            oldRoot = pRoot
        }

        if (largestValueAt[newRoot] < largestValueAt[oldRoot])
            largestValueAt[newRoot] = largestValueAt[oldRoot]
    }
}

Compiled from "UnionFindWithSpecificCanonicalElement.kt"
public final class coursera.algorithms1.week1.assignments.interview.UnionFindWithSpecificCanonicalElement {
  private final int[] ids;

  private final int[] largestValueAt;

  private final int[] size;

  public coursera.algorithms1.week1.assignments.interview.UnionFindWithSpecificCanonicalElement(int);
    Code:
       0: aload_0
       1: invokespecial #9                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: iconst_0
       6: istore_2
       7: iload_1
       8: newarray       int
      10: astore_3
      11: astore        5
      13: iload_2
      14: iload_1
      15: if_icmpge     33
      18: iload_2
      19: istore        4
      21: aload_3
      22: iload         4
      24: iload         4
      26: iastore
      27: iinc          2, 1
      30: goto          13
      33: aload         5
      35: aload_3
      36: putfield      #13                 // Field ids:[I
      39: aload_0
      40: iconst_0
      41: istore_2
      42: iload_1
      43: newarray       int
      45: astore_3
      46: astore        5
      48: iload_2
      49: iload_1
      50: if_icmpge     68
      53: iload_2
      54: istore        4
      56: aload_3
      57: iload         4
      59: iload         4
      61: iastore
      62: iinc          2, 1
      65: goto          48
      68: aload         5
      70: aload_3
      71: putfield      #16                 // Field largestValueAt:[I
      74: aload_0
      75: iconst_0
      76: istore_2
      77: iload_1
      78: newarray       int
      80: astore_3
      81: astore        5
      83: iload_2
      84: iload_1
      85: if_icmpge     102
      88: iload_2
      89: istore        4
      91: aload_3
      92: iload         4
      94: iconst_1
      95: iastore
      96: iinc          2, 1
      99: goto          83
     102: aload         5
     104: aload_3
     105: putfield      #19                 // Field size:[I
     108: return

  private final int root(int);
    Code:
       0: iload_1
       1: istore_2
       2: aload_0
       3: getfield      #13                 // Field ids:[I
       6: iload_2
       7: iaload
       8: iload_2
       9: if_icmpeq     39
      12: aload_0
      13: getfield      #13                 // Field ids:[I
      16: iload_2
      17: aload_0
      18: getfield      #13                 // Field ids:[I
      21: aload_0
      22: getfield      #13                 // Field ids:[I
      25: iload_2
      26: iaload
      27: iaload
      28: iastore
      29: aload_0
      30: getfield      #13                 // Field ids:[I
      33: iload_2
      34: iaload
      35: istore_2
      36: goto          2
      39: iload_2
      40: ireturn

  public final int find(int);
    Code:
       0: aload_0
       1: getfield      #16                 // Field largestValueAt:[I
       4: aload_0
       5: iload_1
       6: invokespecial #31                 // Method root:(I)I
       9: iaload
      10: ireturn

  public final boolean connected(int, int);
    Code:
       0: aload_0
       1: iload_1
       2: invokespecial #31                 // Method root:(I)I
       5: aload_0
       6: iload_2
       7: invokespecial #31                 // Method root:(I)I
      10: if_icmpne     17
      13: iconst_1
      14: goto          18
      17: iconst_0
      18: ireturn

  public final void union(int, int);
    Code:
       0: aload_0
       1: iload_1
       2: invokespecial #31                 // Method root:(I)I
       5: istore_3
       6: aload_0
       7: iload_2
       8: invokespecial #31                 // Method root:(I)I
      11: istore        4
      13: iload_3
      14: iload         4
      16: if_icmpne     20
      19: return
      20: iconst_0
      21: istore        5
      23: iconst_0
      24: istore        6
      26: aload_0
      27: getfield      #19                 // Field size:[I
      30: iload_3
      31: iaload
      32: aload_0
      33: getfield      #19                 // Field size:[I
      36: iload         4
      38: iaload
      39: if_icmple     82
      42: aload_0
      43: getfield      #13                 // Field ids:[I
      46: iload         4
      48: iload_3
      49: iastore
      50: aload_0
      51: getfield      #19                 // Field size:[I
      54: astore        7
      56: aload         7
      58: iload_3
      59: aload         7
      61: iload_3
      62: iaload
      63: aload_0
      64: getfield      #19                 // Field size:[I
      67: iload         4
      69: iaload
      70: iadd
      71: iastore
      72: iload_3
      73: istore        5
      75: iload         4
      77: istore        6
      79: goto          120
      82: aload_0
      83: getfield      #13                 // Field ids:[I
      86: iload_3
      87: iload         4
      89: iastore
      90: aload_0
      91: getfield      #19                 // Field size:[I
      94: astore        7
      96: aload         7
      98: iload         4
     100: aload         7
     102: iload         4
     104: iaload
     105: aload_0
     106: getfield      #19                 // Field size:[I
     109: iload_3
     110: iaload
     111: iadd
     112: iastore
     113: iload         4
     115: istore        5
     117: iload_3
     118: istore        6
     120: aload_0
     121: getfield      #16                 // Field largestValueAt:[I
     124: iload         5
     126: iaload
     127: aload_0
     128: getfield      #16                 // Field largestValueAt:[I
     131: iload         6
     133: iaload
     134: if_icmpge     151
     137: aload_0
     138: getfield      #16                 // Field largestValueAt:[I
     141: iload         5
     143: aload_0
     144: getfield      #16                 // Field largestValueAt:[I
     147: iload         6
     149: iaload
     150: iastore
     151: return
}


package coursera.algorithms1.week3.classroom

inline fun <reified T> mergeWithSmallerAux(arr: Array<T>, lo: Int, mid: Int, hi: Int, comparator: Comparator<T>) {
    val aux = Array(((hi - lo) / 2)) { arr[lo + it] }

    var i = lo
    var j = mid + 1

    var k = lo

    while (i <= mid && j <= hi) {
        if (comparator.compare(aux[i], arr[j]) > 0)
            arr[k++] = arr[j++]
        else
            arr[k++] = aux[i++]
    }

    while (i <= mid)
        arr[k++] = aux[i++]

    while (j <= hi)
        arr[k++] = arr[j++]
}

fun <T> merge(arr: Array<T>, aux: Array<T>, lo: Int, mid: Int, hi: Int, comparator: Comparator<T>) {
    for (i in lo..hi) {
        aux[i] = arr[i]
    }

    var i = lo
    var j = mid + 1

    for (k in lo..hi) {
        when {
            i > mid -> arr[k] = aux[j++]
            j > hi -> arr[k] = aux[i++]
            // keeps the sort stable.
            comparator.compare(aux[j], aux[i]) < 0 -> arr[k] = aux[j++]
            else -> arr[k] = aux[i++]
        }
    }
}

fun <T> mergeSort(arr: Array<T>, aux: Array<T>, lo: Int, hi: Int, comparator: Comparator<T>) {
    if (hi <= lo) return

    val mid = lo + (hi - lo) / 2

    mergeSort(arr, aux, lo, mid, comparator)
    mergeSort(arr, aux, mid + 1, hi, comparator)

    merge(arr, aux, lo, mid, hi, comparator)
}

inline fun <reified T> mergeSort(arr: Array<T>, comparator: Comparator<T>) {
    val aux = Array(arr.size) { arr[it] }
    mergeSort(arr, aux, 0, arr.lastIndex, comparator)
}

inline fun <reified T> mergeSortIterative(arr: Array<T>, comparator: Comparator<T>) {

    val aux = Array(arr.size) { arr[it] }
    var sz = 1

    while (sz < arr.size) {
        var lo = 0

        while (lo < arr.size - sz) {
            merge(arr, aux, lo, lo + sz - 1, (lo + sz + sz - 1).coerceAtMost(arr.lastIndex), comparator)
            lo += sz + sz
        }

        sz += sz
    }
}

fun main() {
    val arr = arrayOf(4, 5, 1, 2, 8, 9, 0, 10)
    mergeSortIterative(arr) { a, b -> a - b }
    println(arr.joinToString())
}

Compiled from "MergeSort.kt"
public final class coursera.algorithms1.week3.classroom.MergeSortKt {
  public static final <T> void mergeWithSmallerAux(T[], int, int, int, java.util.Comparator<T>);
    Code:
       0: aload_0
       1: ldc           #9                  // String arr
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload         4
       8: ldc           #17                 // String comparator
      10: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      13: iconst_0
      14: istore        5
      16: iconst_0
      17: istore        7
      19: iload_3
      20: iload_1
      21: isub
      22: iconst_2
      23: idiv
      24: istore        8
      26: iload         8
      28: iconst_0
      29: ldc           #19                 // String T
      31: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.reifiedOperationMarker:(ILjava/lang/String;)V
      34: anewarray     #4                  // class java/lang/Object
      37: astore        9
      39: iload         7
      41: iload         8
      43: if_icmpge     67
      46: iload         7
      48: istore        10
      50: aload         9
      52: iload         10
      54: aload_0
      55: iload_1
      56: iload         10
      58: iadd
      59: aaload
      60: aastore
      61: iinc          7, 1
      64: goto          39
      67: aload         9
      69: astore        6
      71: iload_1
      72: istore        7
      74: iload_2
      75: iconst_1
      76: iadd
      77: istore        8
      79: iload_1
      80: istore        9
      82: iload         7
      84: iload_2
      85: if_icmpgt     148
      88: iload         8
      90: iload_3
      91: if_icmpgt     148
      94: aload         4
      96: aload         6
      98: iload         7
     100: aaload
     101: aload_0
     102: iload         8
     104: aaload
     105: invokeinterface #29,  3           // InterfaceMethod java/util/Comparator.compare:(Ljava/lang/Object;Ljava/lang/Object;)I
     110: ifle          130
     113: aload_0
     114: iload         9
     116: iinc          9, 1
     119: aload_0
     120: iload         8
     122: iinc          8, 1
     125: aaload
     126: aastore
     127: goto          82
     130: aload_0
     131: iload         9
     133: iinc          9, 1
     136: aload         6
     138: iload         7
     140: iinc          7, 1
     143: aaload
     144: aastore
     145: goto          82
     148: iload         7
     150: iload_2
     151: if_icmpgt     172
     154: aload_0
     155: iload         9
     157: iinc          9, 1
     160: aload         6
     162: iload         7
     164: iinc          7, 1
     167: aaload
     168: aastore
     169: goto          148
     172: iload         8
     174: iload_3
     175: if_icmpgt     195
     178: aload_0
     179: iload         9
     181: iinc          9, 1
     184: aload_0
     185: iload         8
     187: iinc          8, 1
     190: aaload
     191: aastore
     192: goto          172
     195: return

  public static final <T> void merge(T[], T[], int, int, int, java.util.Comparator<T>);
    Code:
       0: aload_0
       1: ldc           #9                  // String arr
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #46                 // String aux
       9: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload         5
      14: ldc           #17                 // String comparator
      16: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      19: iload_2
      20: istore        6
      22: iload         6
      24: iload         4
      26: if_icmpgt     50
      29: aload_1
      30: iload         6
      32: aload_0
      33: iload         6
      35: aaload
      36: aastore
      37: iload         6
      39: iload         4
      41: if_icmpeq     50
      44: iinc          6, 1
      47: goto          29
      50: iload_2
      51: istore        6
      53: iload_3
      54: iconst_1
      55: iadd
      56: istore        7
      58: iload_2
      59: istore        8
      61: iload         8
      63: iload         4
      65: if_icmpgt     166
      68: nop
      69: iload         6
      71: iload_3
      72: if_icmple     89
      75: aload_0
      76: iload         8
      78: aload_1
      79: iload         7
      81: iinc          7, 1
      84: aaload
      85: aastore
      86: goto          153
      89: iload         7
      91: iload         4
      93: if_icmple     110
      96: aload_0
      97: iload         8
      99: aload_1
     100: iload         6
     102: iinc          6, 1
     105: aaload
     106: aastore
     107: goto          153
     110: aload         5
     112: aload_1
     113: iload         7
     115: aaload
     116: aload_1
     117: iload         6
     119: aaload
     120: invokeinterface #29,  3           // InterfaceMethod java/util/Comparator.compare:(Ljava/lang/Object;Ljava/lang/Object;)I
     125: ifge          142
     128: aload_0
     129: iload         8
     131: aload_1
     132: iload         7
     134: iinc          7, 1
     137: aaload
     138: aastore
     139: goto          153
     142: aload_0
     143: iload         8
     145: aload_1
     146: iload         6
     148: iinc          6, 1
     151: aaload
     152: aastore
     153: iload         8
     155: iload         4
     157: if_icmpeq     166
     160: iinc          8, 1
     163: goto          68
     166: return

  public static final <T> void mergeSort(T[], T[], int, int, java.util.Comparator<T>);
    Code:
       0: aload_0
       1: ldc           #9                  // String arr
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #46                 // String aux
       9: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload         4
      14: ldc           #17                 // String comparator
      16: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      19: iload_3
      20: iload_2
      21: if_icmpgt     25
      24: return
      25: iload_2
      26: iload_3
      27: iload_2
      28: isub
      29: iconst_2
      30: idiv
      31: iadd
      32: istore        5
      34: aload_0
      35: aload_1
      36: iload_2
      37: iload         5
      39: aload         4
      41: invokestatic  #51                 // Method mergeSort:([Ljava/lang/Object;[Ljava/lang/Object;IILjava/util/Comparator;)V
      44: aload_0
      45: aload_1
      46: iload         5
      48: iconst_1
      49: iadd
      50: iload_3
      51: aload         4
      53: invokestatic  #51                 // Method mergeSort:([Ljava/lang/Object;[Ljava/lang/Object;IILjava/util/Comparator;)V
      56: aload_0
      57: aload_1
      58: iload_2
      59: iload         5
      61: iload_3
      62: aload         4
      64: invokestatic  #53                 // Method merge:([Ljava/lang/Object;[Ljava/lang/Object;IIILjava/util/Comparator;)V
      67: return

  public static final <T> void mergeSort(T[], java.util.Comparator<T>);
    Code:
       0: aload_0
       1: ldc           #9                  // String arr
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #17                 // String comparator
       9: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: iconst_0
      13: istore_2
      14: iconst_0
      15: istore        4
      17: aload_0
      18: arraylength
      19: istore        5
      21: iload         5
      23: iconst_0
      24: ldc           #19                 // String T
      26: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.reifiedOperationMarker:(ILjava/lang/String;)V
      29: anewarray     #4                  // class java/lang/Object
      32: astore        6
      34: iload         4
      36: iload         5
      38: if_icmpge     60
      41: iload         4
      43: istore        7
      45: aload         6
      47: iload         7
      49: aload_0
      50: iload         7
      52: aaload
      53: aastore
      54: iinc          4, 1
      57: goto          34
      60: aload         6
      62: astore_3
      63: aload_0
      64: aload_3
      65: iconst_0
      66: aload_0
      67: invokestatic  #61                 // Method kotlin/collections/ArraysKt.getLastIndex:([Ljava/lang/Object;)I
      70: aload_1
      71: invokestatic  #51                 // Method mergeSort:([Ljava/lang/Object;[Ljava/lang/Object;IILjava/util/Comparator;)V
      74: return

  public static final <T> void mergeSortIterative(T[], java.util.Comparator<T>);
    Code:
       0: aload_0
       1: ldc           #9                  // String arr
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #17                 // String comparator
       9: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: iconst_0
      13: istore_2
      14: iconst_0
      15: istore        4
      17: aload_0
      18: arraylength
      19: istore        5
      21: iload         5
      23: iconst_0
      24: ldc           #19                 // String T
      26: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.reifiedOperationMarker:(ILjava/lang/String;)V
      29: anewarray     #4                  // class java/lang/Object
      32: astore        6
      34: iload         4
      36: iload         5
      38: if_icmpge     60
      41: iload         4
      43: istore        7
      45: aload         6
      47: iload         7
      49: aload_0
      50: iload         7
      52: aaload
      53: aastore
      54: iinc          4, 1
      57: goto          34
      60: aload         6
      62: astore_3
      63: iconst_1
      64: istore        4
      66: iload         4
      68: aload_0
      69: arraylength
      70: if_icmpge     141
      73: iconst_0
      74: istore        5
      76: iload         5
      78: aload_0
      79: arraylength
      80: iload         4
      82: isub
      83: if_icmpge     131
      86: aload_0
      87: aload_3
      88: iload         5
      90: iload         5
      92: iload         4
      94: iadd
      95: iconst_1
      96: isub
      97: iload         5
      99: iload         4
     101: iadd
     102: iload         4
     104: iadd
     105: iconst_1
     106: isub
     107: aload_0
     108: invokestatic  #61                 // Method kotlin/collections/ArraysKt.getLastIndex:([Ljava/lang/Object;)I
     111: invokestatic  #69                 // Method kotlin/ranges/RangesKt.coerceAtMost:(II)I
     114: aload_1
     115: invokestatic  #53                 // Method merge:([Ljava/lang/Object;[Ljava/lang/Object;IIILjava/util/Comparator;)V
     118: iload         5
     120: iload         4
     122: iload         4
     124: iadd
     125: iadd
     126: istore        5
     128: goto          76
     131: iload         4
     133: iload         4
     135: iadd
     136: istore        4
     138: goto          66
     141: return

  public static final void main();
    Code:
       0: bipush        8
       2: anewarray     #75                 // class java/lang/Integer
       5: astore_1
       6: aload_1
       7: iconst_0
       8: iconst_4
       9: invokestatic  #79                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      12: aastore
      13: aload_1
      14: iconst_1
      15: iconst_5
      16: invokestatic  #79                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      19: aastore
      20: aload_1
      21: iconst_2
      22: iconst_1
      23: invokestatic  #79                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      26: aastore
      27: aload_1
      28: iconst_3
      29: iconst_2
      30: invokestatic  #79                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      33: aastore
      34: aload_1
      35: iconst_4
      36: bipush        8
      38: invokestatic  #79                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      41: aastore
      42: aload_1
      43: iconst_5
      44: bipush        9
      46: invokestatic  #79                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      49: aastore
      50: aload_1
      51: bipush        6
      53: iconst_0
      54: invokestatic  #79                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      57: aastore
      58: aload_1
      59: bipush        7
      61: bipush        10
      63: invokestatic  #79                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      66: aastore
      67: aload_1
      68: astore_0
      69: invokedynamic #96,  0             // InvokeDynamic #0:compare:()Ljava/util/Comparator;
      74: astore_1
      75: iconst_0
      76: istore_2
      77: iconst_0
      78: istore_3
      79: aload_0
      80: arraylength
      81: istore        4
      83: iload         4
      85: anewarray     #75                 // class java/lang/Integer
      88: astore        5
      90: iload_3
      91: iload         4
      93: if_icmpge     114
      96: iload_3
      97: istore        6
      99: aload         5
     101: iload         6
     103: aload_0
     104: iload         6
     106: aaload
     107: aastore
     108: iinc          3, 1
     111: goto          90
     114: aload         5
     116: astore        7
     118: iconst_1
     119: istore_3
     120: iload_3
     121: aload_0
     122: arraylength
     123: if_icmpge     186
     126: iconst_0
     127: istore        4
     129: iload         4
     131: aload_0
     132: arraylength
     133: iload_3
     134: isub
     135: if_icmpge     179
     138: aload_0
     139: aload         7
     141: iload         4
     143: iload         4
     145: iload_3
     146: iadd
     147: iconst_1
     148: isub
     149: iload         4
     151: iload_3
     152: iadd
     153: iload_3
     154: iadd
     155: iconst_1
     156: isub
     157: aload_0
     158: invokestatic  #61                 // Method kotlin/collections/ArraysKt.getLastIndex:([Ljava/lang/Object;)I
     161: invokestatic  #69                 // Method kotlin/ranges/RangesKt.coerceAtMost:(II)I
     164: aload_1
     165: invokestatic  #53                 // Method merge:([Ljava/lang/Object;[Ljava/lang/Object;IIILjava/util/Comparator;)V
     168: iload         4
     170: iload_3
     171: iload_3
     172: iadd
     173: iadd
     174: istore        4
     176: goto          129
     179: iload_3
     180: iload_3
     181: iadd
     182: istore_3
     183: goto          120
     186: nop
     187: aload_0
     188: aconst_null
     189: aconst_null
     190: aconst_null
     191: iconst_0
     192: aconst_null
     193: aconst_null
     194: bipush        63
     196: aconst_null
     197: invokestatic  #100                // Method kotlin/collections/ArraysKt.joinToString$default:([Ljava/lang/Object;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
     200: getstatic     #106                // Field java/lang/System.out:Ljava/io/PrintStream;
     203: swap
     204: invokevirtual #112                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     207: return

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

  private static final int main$lambda$0(java.lang.Integer, java.lang.Integer);
    Code:
       0: aload_0
       1: invokevirtual #127                // Method java/lang/Integer.intValue:()I
       4: aload_1
       5: invokestatic  #130                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
       8: aload_1
       9: invokevirtual #127                // Method java/lang/Integer.intValue:()I
      12: isub
      13: ireturn
}


package com.example.posetrackervrc.data

import kotlin.math.sqrt

data class Vector3D(val x: Float, val y: Float, val z: Float) {
    companion object {
        val zero = Vector3D(0.0f, 0.0f, 0.0f)
        val right = Vector3D(1.0f, 0.0f, 0.0f)
        val up = Vector3D(0.0f, 1.0f, 0.0f)
        val forward = Vector3D(0.0f, 0.0f, 1.0f)

        fun getRotationAxis(from: Vector3D, to: Vector3D): Vector3D {
            val crossProduct = from.cross(to)
            return crossProduct.normalized
        }
    }
    val sqrMagnitude: Float get() = x * x + y * y + z * z
    val magnitude: Float get() = sqrt(sqrMagnitude)
    val normalized: Vector3D
        get() {
            val magnitude = magnitude
            return if (magnitude != 0.0f) {
                Vector3D(x / magnitude, y / magnitude, z / magnitude)
            } else {
                zero
            }
        }

    operator fun plus(vector: Vector3D): Vector3D {
        return Vector3D(x + vector.x, y + vector.y, z + vector.z)
    }

    operator fun minus(vector: Vector3D): Vector3D {
        return Vector3D(x - vector.x, y - vector.y, z - vector.z)
    }

    operator fun times(multiplier: Float): Vector3D {
        return Vector3D(x * multiplier, y * multiplier, z * multiplier)
    }
    operator fun times(multiplier: Int): Vector3D {
        return Vector3D(x * multiplier, y * multiplier, z * multiplier)
    }

    operator fun div(divisor: Float): Vector3D {
        return Vector3D(x / divisor, y / divisor, z / divisor)
    }
    operator fun div(divisor: Int): Vector3D {
        return Vector3D(x / divisor, y / divisor, z / divisor)
    }

    operator fun unaryMinus(): Vector3D {
        return Vector3D(-x, -y, -z)
    }

    fun dot(vector: Vector3D): Float {
        return x * vector.x + y * vector.y + z * vector.z
    }

    fun cross(vector: Vector3D): Vector3D {
        return Vector3D(
            x = y * vector.z - z * vector.y,
            y = z * vector.x - x * vector.z,
            z = x * vector.y - y * vector.x
        )
    }

    fun project(vector: Vector3D): Vector3D {
        val normalized = normalized
        return vector - normalized.dot(vector) * normalized
    }
}

operator fun Float.times(vector: Vector3D): Vector3D {
    return vector * this
}

Compiled from "Vector3D.kt"
public final class com.example.posetrackervrc.data.Vector3D {
  public static final com.example.posetrackervrc.data.Vector3D$Companion Companion;

  private final float x;

  private final float y;

  private final float z;

  private static final com.example.posetrackervrc.data.Vector3D zero;

  private static final com.example.posetrackervrc.data.Vector3D right;

  private static final com.example.posetrackervrc.data.Vector3D up;

  private static final com.example.posetrackervrc.data.Vector3D forward;

  public com.example.posetrackervrc.data.Vector3D(float, float, float);
    Code:
       0: aload_0
       1: invokespecial #9                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: fload_1
       6: putfield      #13                 // Field x:F
       9: aload_0
      10: fload_2
      11: putfield      #16                 // Field y:F
      14: aload_0
      15: fload_3
      16: putfield      #19                 // Field z:F
      19: return

  public final float getX();
    Code:
       0: aload_0
       1: getfield      #13                 // Field x:F
       4: freturn

  public final float getY();
    Code:
       0: aload_0
       1: getfield      #16                 // Field y:F
       4: freturn

  public final float getZ();
    Code:
       0: aload_0
       1: getfield      #19                 // Field z:F
       4: freturn

  public final float getSqrMagnitude();
    Code:
       0: aload_0
       1: getfield      #13                 // Field x:F
       4: aload_0
       5: getfield      #13                 // Field x:F
       8: fmul
       9: aload_0
      10: getfield      #16                 // Field y:F
      13: aload_0
      14: getfield      #16                 // Field y:F
      17: fmul
      18: fadd
      19: aload_0
      20: getfield      #19                 // Field z:F
      23: aload_0
      24: getfield      #19                 // Field z:F
      27: fmul
      28: fadd
      29: freturn

  public final float getMagnitude();
    Code:
       0: aload_0
       1: invokevirtual #29                 // Method getSqrMagnitude:()F
       4: f2d
       5: invokestatic  #35                 // Method java/lang/Math.sqrt:(D)D
       8: d2f
       9: freturn

  public final com.example.posetrackervrc.data.Vector3D getNormalized();
    Code:
       0: aload_0
       1: invokevirtual #40                 // Method getMagnitude:()F
       4: fstore_1
       5: fload_1
       6: fconst_0
       7: fcmpg
       8: ifne          15
      11: iconst_1
      12: goto          16
      15: iconst_0
      16: ifne          47
      19: new           #2                  // class com/example/posetrackervrc/data/Vector3D
      22: dup
      23: aload_0
      24: getfield      #13                 // Field x:F
      27: fload_1
      28: fdiv
      29: aload_0
      30: getfield      #16                 // Field y:F
      33: fload_1
      34: fdiv
      35: aload_0
      36: getfield      #19                 // Field z:F
      39: fload_1
      40: fdiv
      41: invokespecial #42                 // Method "<init>":(FFF)V
      44: goto          50
      47: getstatic     #45                 // Field zero:Lcom/example/posetrackervrc/data/Vector3D;
      50: areturn

  public final com.example.posetrackervrc.data.Vector3D plus(com.example.posetrackervrc.data.Vector3D);
    Code:
       0: aload_1
       1: ldc           #50                 // String vector
       3: invokestatic  #56                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #2                  // class com/example/posetrackervrc/data/Vector3D
       9: dup
      10: aload_0
      11: getfield      #13                 // Field x:F
      14: aload_1
      15: getfield      #13                 // Field x:F
      18: fadd
      19: aload_0
      20: getfield      #16                 // Field y:F
      23: aload_1
      24: getfield      #16                 // Field y:F
      27: fadd
      28: aload_0
      29: getfield      #19                 // Field z:F
      32: aload_1
      33: getfield      #19                 // Field z:F
      36: fadd
      37: invokespecial #42                 // Method "<init>":(FFF)V
      40: areturn

  public final com.example.posetrackervrc.data.Vector3D minus(com.example.posetrackervrc.data.Vector3D);
    Code:
       0: aload_1
       1: ldc           #50                 // String vector
       3: invokestatic  #56                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #2                  // class com/example/posetrackervrc/data/Vector3D
       9: dup
      10: aload_0
      11: getfield      #13                 // Field x:F
      14: aload_1
      15: getfield      #13                 // Field x:F
      18: fsub
      19: aload_0
      20: getfield      #16                 // Field y:F
      23: aload_1
      24: getfield      #16                 // Field y:F
      27: fsub
      28: aload_0
      29: getfield      #19                 // Field z:F
      32: aload_1
      33: getfield      #19                 // Field z:F
      36: fsub
      37: invokespecial #42                 // Method "<init>":(FFF)V
      40: areturn

  public final com.example.posetrackervrc.data.Vector3D times(float);
    Code:
       0: new           #2                  // class com/example/posetrackervrc/data/Vector3D
       3: dup
       4: aload_0
       5: getfield      #13                 // Field x:F
       8: fload_1
       9: fmul
      10: aload_0
      11: getfield      #16                 // Field y:F
      14: fload_1
      15: fmul
      16: aload_0
      17: getfield      #19                 // Field z:F
      20: fload_1
      21: fmul
      22: invokespecial #42                 // Method "<init>":(FFF)V
      25: areturn

  public final com.example.posetrackervrc.data.Vector3D times(int);
    Code:
       0: new           #2                  // class com/example/posetrackervrc/data/Vector3D
       3: dup
       4: aload_0
       5: getfield      #13                 // Field x:F
       8: iload_1
       9: i2f
      10: fmul
      11: aload_0
      12: getfield      #16                 // Field y:F
      15: iload_1
      16: i2f
      17: fmul
      18: aload_0
      19: getfield      #19                 // Field z:F
      22: iload_1
      23: i2f
      24: fmul
      25: invokespecial #42                 // Method "<init>":(FFF)V
      28: areturn

  public final com.example.posetrackervrc.data.Vector3D div(float);
    Code:
       0: new           #2                  // class com/example/posetrackervrc/data/Vector3D
       3: dup
       4: aload_0
       5: getfield      #13                 // Field x:F
       8: fload_1
       9: fdiv
      10: aload_0
      11: getfield      #16                 // Field y:F
      14: fload_1
      15: fdiv
      16: aload_0
      17: getfield      #19                 // Field z:F
      20: fload_1
      21: fdiv
      22: invokespecial #42                 // Method "<init>":(FFF)V
      25: areturn

  public final com.example.posetrackervrc.data.Vector3D div(int);
    Code:
       0: new           #2                  // class com/example/posetrackervrc/data/Vector3D
       3: dup
       4: aload_0
       5: getfield      #13                 // Field x:F
       8: iload_1
       9: i2f
      10: fdiv
      11: aload_0
      12: getfield      #16                 // Field y:F
      15: iload_1
      16: i2f
      17: fdiv
      18: aload_0
      19: getfield      #19                 // Field z:F
      22: iload_1
      23: i2f
      24: fdiv
      25: invokespecial #42                 // Method "<init>":(FFF)V
      28: areturn

  public final com.example.posetrackervrc.data.Vector3D unaryMinus();
    Code:
       0: new           #2                  // class com/example/posetrackervrc/data/Vector3D
       3: dup
       4: aload_0
       5: getfield      #13                 // Field x:F
       8: fneg
       9: aload_0
      10: getfield      #16                 // Field y:F
      13: fneg
      14: aload_0
      15: getfield      #19                 // Field z:F
      18: fneg
      19: invokespecial #42                 // Method "<init>":(FFF)V
      22: areturn

  public final float dot(com.example.posetrackervrc.data.Vector3D);
    Code:
       0: aload_1
       1: ldc           #50                 // String vector
       3: invokestatic  #56                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: getfield      #13                 // Field x:F
      10: aload_1
      11: getfield      #13                 // Field x:F
      14: fmul
      15: aload_0
      16: getfield      #16                 // Field y:F
      19: aload_1
      20: getfield      #16                 // Field y:F
      23: fmul
      24: fadd
      25: aload_0
      26: getfield      #19                 // Field z:F
      29: aload_1
      30: getfield      #19                 // Field z:F
      33: fmul
      34: fadd
      35: freturn

  public final com.example.posetrackervrc.data.Vector3D cross(com.example.posetrackervrc.data.Vector3D);
    Code:
       0: aload_1
       1: ldc           #50                 // String vector
       3: invokestatic  #56                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #2                  // class com/example/posetrackervrc/data/Vector3D
       9: dup
      10: aload_0
      11: getfield      #16                 // Field y:F
      14: aload_1
      15: getfield      #19                 // Field z:F
      18: fmul
      19: aload_0
      20: getfield      #19                 // Field z:F
      23: aload_1
      24: getfield      #16                 // Field y:F
      27: fmul
      28: fsub
      29: aload_0
      30: getfield      #19                 // Field z:F
      33: aload_1
      34: getfield      #13                 // Field x:F
      37: fmul
      38: aload_0
      39: getfield      #13                 // Field x:F
      42: aload_1
      43: getfield      #19                 // Field z:F
      46: fmul
      47: fsub
      48: aload_0
      49: getfield      #13                 // Field x:F
      52: aload_1
      53: getfield      #16                 // Field y:F
      56: fmul
      57: aload_0
      58: getfield      #16                 // Field y:F
      61: aload_1
      62: getfield      #13                 // Field x:F
      65: fmul
      66: fsub
      67: invokespecial #42                 // Method "<init>":(FFF)V
      70: areturn

  public final com.example.posetrackervrc.data.Vector3D project(com.example.posetrackervrc.data.Vector3D);
    Code:
       0: aload_1
       1: ldc           #50                 // String vector
       3: invokestatic  #56                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokevirtual #71                 // Method getNormalized:()Lcom/example/posetrackervrc/data/Vector3D;
      10: astore_2
      11: aload_1
      12: aload_2
      13: aload_1
      14: invokevirtual #73                 // Method dot:(Lcom/example/posetrackervrc/data/Vector3D;)F
      17: aload_2
      18: invokestatic  #78                 // Method com/example/posetrackervrc/data/Vector3DKt.times:(FLcom/example/posetrackervrc/data/Vector3D;)Lcom/example/posetrackervrc/data/Vector3D;
      21: invokevirtual #80                 // Method minus:(Lcom/example/posetrackervrc/data/Vector3D;)Lcom/example/posetrackervrc/data/Vector3D;
      24: areturn

  public final float component1();
    Code:
       0: aload_0
       1: getfield      #13                 // Field x:F
       4: freturn

  public final float component2();
    Code:
       0: aload_0
       1: getfield      #16                 // Field y:F
       4: freturn

  public final float component3();
    Code:
       0: aload_0
       1: getfield      #19                 // Field z:F
       4: freturn

  public final com.example.posetrackervrc.data.Vector3D copy(float, float, float);
    Code:
       0: new           #2                  // class com/example/posetrackervrc/data/Vector3D
       3: dup
       4: fload_1
       5: fload_2
       6: fload_3
       7: invokespecial #42                 // Method "<init>":(FFF)V
      10: areturn

  public static com.example.posetrackervrc.data.Vector3D copy$default(com.example.posetrackervrc.data.Vector3D, float, float, float, int, java.lang.Object);
    Code:
       0: iload         4
       2: iconst_1
       3: iand
       4: ifeq          12
       7: aload_0
       8: getfield      #13                 // Field x:F
      11: fstore_1
      12: iload         4
      14: iconst_2
      15: iand
      16: ifeq          24
      19: aload_0
      20: getfield      #16                 // Field y:F
      23: fstore_2
      24: iload         4
      26: iconst_4
      27: iand
      28: ifeq          36
      31: aload_0
      32: getfield      #19                 // Field z:F
      35: fstore_3
      36: aload_0
      37: fload_1
      38: fload_2
      39: fload_3
      40: invokevirtual #90                 // Method copy:(FFF)Lcom/example/posetrackervrc/data/Vector3D;
      43: areturn

  public java.lang.String toString();
    Code:
       0: new           #94                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #95                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #97                 // String Vector3D(x=
       9: invokevirtual #101                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field x:F
      16: invokevirtual #104                // Method java/lang/StringBuilder.append:(F)Ljava/lang/StringBuilder;
      19: ldc           #106                // String , y=
      21: invokevirtual #101                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #16                 // Field y:F
      28: invokevirtual #104                // Method java/lang/StringBuilder.append:(F)Ljava/lang/StringBuilder;
      31: ldc           #108                // String , z=
      33: invokevirtual #101                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      36: aload_0
      37: getfield      #19                 // Field z:F
      40: invokevirtual #104                // Method java/lang/StringBuilder.append:(F)Ljava/lang/StringBuilder;
      43: bipush        41
      45: invokevirtual #111                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      48: invokevirtual #113                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      51: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #13                 // Field x:F
       4: invokestatic  #120                // Method java/lang/Float.hashCode:(F)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #16                 // Field y:F
      16: invokestatic  #120                // Method java/lang/Float.hashCode:(F)I
      19: iadd
      20: istore_1
      21: iload_1
      22: bipush        31
      24: imul
      25: aload_0
      26: getfield      #19                 // Field z:F
      29: invokestatic  #120                // Method java/lang/Float.hashCode:(F)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/example/posetrackervrc/data/Vector3D
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class com/example/posetrackervrc/data/Vector3D
      20: astore_2
      21: aload_0
      22: getfield      #13                 // Field x:F
      25: aload_2
      26: getfield      #13                 // Field x:F
      29: invokestatic  #128                // Method java/lang/Float.compare:(FF)I
      32: ifeq          37
      35: iconst_0
      36: ireturn
      37: aload_0
      38: getfield      #16                 // Field y:F
      41: aload_2
      42: getfield      #16                 // Field y:F
      45: invokestatic  #128                // Method java/lang/Float.compare:(FF)I
      48: ifeq          53
      51: iconst_0
      52: ireturn
      53: aload_0
      54: getfield      #19                 // Field z:F
      57: aload_2
      58: getfield      #19                 // Field z:F
      61: invokestatic  #128                // Method java/lang/Float.compare:(FF)I
      64: ifeq          69
      67: iconst_0
      68: ireturn
      69: iconst_1
      70: ireturn

  public static final com.example.posetrackervrc.data.Vector3D access$getZero$cp();
    Code:
       0: getstatic     #45                 // Field zero:Lcom/example/posetrackervrc/data/Vector3D;
       3: areturn

  public static final com.example.posetrackervrc.data.Vector3D access$getRight$cp();
    Code:
       0: getstatic     #135                // Field right:Lcom/example/posetrackervrc/data/Vector3D;
       3: areturn

  public static final com.example.posetrackervrc.data.Vector3D access$getUp$cp();
    Code:
       0: getstatic     #139                // Field up:Lcom/example/posetrackervrc/data/Vector3D;
       3: areturn

  public static final com.example.posetrackervrc.data.Vector3D access$getForward$cp();
    Code:
       0: getstatic     #143                // Field forward:Lcom/example/posetrackervrc/data/Vector3D;
       3: areturn

  static {};
    Code:
       0: new           #146                // class com/example/posetrackervrc/data/Vector3D$Companion
       3: dup
       4: aconst_null
       5: invokespecial #149                // Method com/example/posetrackervrc/data/Vector3D$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #153                // Field Companion:Lcom/example/posetrackervrc/data/Vector3D$Companion;
      11: new           #2                  // class com/example/posetrackervrc/data/Vector3D
      14: dup
      15: fconst_0
      16: fconst_0
      17: fconst_0
      18: invokespecial #42                 // Method "<init>":(FFF)V
      21: putstatic     #45                 // Field zero:Lcom/example/posetrackervrc/data/Vector3D;
      24: new           #2                  // class com/example/posetrackervrc/data/Vector3D
      27: dup
      28: fconst_1
      29: fconst_0
      30: fconst_0
      31: invokespecial #42                 // Method "<init>":(FFF)V
      34: putstatic     #135                // Field right:Lcom/example/posetrackervrc/data/Vector3D;
      37: new           #2                  // class com/example/posetrackervrc/data/Vector3D
      40: dup
      41: fconst_0
      42: fconst_1
      43: fconst_0
      44: invokespecial #42                 // Method "<init>":(FFF)V
      47: putstatic     #139                // Field up:Lcom/example/posetrackervrc/data/Vector3D;
      50: new           #2                  // class com/example/posetrackervrc/data/Vector3D
      53: dup
      54: fconst_0
      55: fconst_0
      56: fconst_1
      57: invokespecial #42                 // Method "<init>":(FFF)V
      60: putstatic     #143                // Field forward:Lcom/example/posetrackervrc/data/Vector3D;
      63: return
}

Compiled from "Vector3D.kt"
public final class com.example.posetrackervrc.data.Vector3DKt {
  public static final com.example.posetrackervrc.data.Vector3D times(float, com.example.posetrackervrc.data.Vector3D);
    Code:
       0: aload_1
       1: ldc           #9                  // String vector
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: fload_0
       8: invokevirtual #20                 // Method com/example/posetrackervrc/data/Vector3D.times:(F)Lcom/example/posetrackervrc/data/Vector3D;
      11: areturn
}

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

  public final com.example.posetrackervrc.data.Vector3D getZero();
    Code:
       0: invokestatic  #18                 // Method com/example/posetrackervrc/data/Vector3D.access$getZero$cp:()Lcom/example/posetrackervrc/data/Vector3D;
       3: areturn

  public final com.example.posetrackervrc.data.Vector3D getRight();
    Code:
       0: invokestatic  #22                 // Method com/example/posetrackervrc/data/Vector3D.access$getRight$cp:()Lcom/example/posetrackervrc/data/Vector3D;
       3: areturn

  public final com.example.posetrackervrc.data.Vector3D getUp();
    Code:
       0: invokestatic  #26                 // Method com/example/posetrackervrc/data/Vector3D.access$getUp$cp:()Lcom/example/posetrackervrc/data/Vector3D;
       3: areturn

  public final com.example.posetrackervrc.data.Vector3D getForward();
    Code:
       0: invokestatic  #30                 // Method com/example/posetrackervrc/data/Vector3D.access$getForward$cp:()Lcom/example/posetrackervrc/data/Vector3D;
       3: areturn

  public final com.example.posetrackervrc.data.Vector3D getRotationAxis(com.example.posetrackervrc.data.Vector3D, com.example.posetrackervrc.data.Vector3D);
    Code:
       0: aload_1
       1: ldc           #34                 // String from
       3: invokestatic  #40                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #42                 // String to
       9: invokestatic  #40                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_1
      13: aload_2
      14: invokevirtual #46                 // Method com/example/posetrackervrc/data/Vector3D.cross:(Lcom/example/posetrackervrc/data/Vector3D;)Lcom/example/posetrackervrc/data/Vector3D;
      17: astore_3
      18: aload_3
      19: invokevirtual #49                 // Method com/example/posetrackervrc/data/Vector3D.getNormalized:()Lcom/example/posetrackervrc/data/Vector3D;
      22: areturn

  public com.example.posetrackervrc.data.Vector3D$Companion(kotlin.jvm.internal.DefaultConstructorMarker);
    Code:
       0: aload_0
       1: invokespecial #53                 // Method "<init>":()V
       4: return
}


package com.luckystar.advent2020

fun main() {
    val file = object {}.javaClass.getResource("/2020/input_4.txt").readText()
    val passports = file.split("\r\n\r\n")

    val data = passports.map { p ->
        val split = p
                .split("\r\n")
                .reduce { acc, s -> "$acc $s" }
                .split(" ")
        val parts = split
                .map { part ->
                    val pair = part.split(":")
                    Pair(pair[0], pair[1])
                }
                .associateBy({ pair -> pair.first }, { pair -> pair.second })
        Passport(parts["byr"]?.toInt(), parts["iyr"]?.toInt(), parts["eyr"]?.toInt(), parts["hgt"], parts["hcl"], parts["ecl"], parts["pid"], parts["cid"])
    }

    // part 1
    println(data.filter { passport ->
        passport.byr != null
                && passport.iyr != null
                && passport.eyr != null
                && passport.hgt != null
                && passport.hcl != null
                && passport.ecl != null
                && passport.pid != null
    }.count())

    // part 2
    val hgtRegex = """(\d+)(cm|in)""".toRegex()
    val hclRegex = """#[0-9a-f]{6}""".toRegex()
    val eclRegex = """^(amb|blu|brn|gry|grn|hzl|oth)$""".toRegex()
    val pidRegex = """^(\d){9}$""".toRegex()
    fun validate(passport: Passport): Boolean {
        if (passport.byr != null
                && passport.iyr != null
                && passport.eyr != null
                && passport.hgt != null
                && passport.hcl != null
                && passport.ecl != null
                && passport.pid != null) {
            if (passport.byr !in 1920..2002) {
                return false
            }
            if (passport.iyr !in 2010..2020) {
                return false
            }
            if (passport.eyr !in 2020..2030) {
                return false
            }

            val hgtMatch = hgtRegex.find(passport.hgt) ?: return false
            val ( value, type ) = hgtMatch.destructured
            val hgtValue = value.toInt()
            if (type == "cm" && (hgtValue !in 150..193)
                    || type == "in" && (hgtValue !in 59..76)) {
                return false
            }

            if (hclRegex.find(passport.hcl) == null) {
                return false
            }
            if (eclRegex.find(passport.ecl) == null) {
                return false
            }
            if (pidRegex.find(passport.pid) == null) {
                return false
            }

            return true
        } else {
            return false
        }
    }
    println(data.filter(::validate).count())
}

data class Passport(
        val byr: Int?,
        val iyr: Int?,
        val eyr: Int?,
        val hgt: String?,
        val hcl: String?,
        val ecl: String?,
        val pid: String?,
        val cid: String?
)

Compiled from "Advent4.kt"
public final class com.luckystar.advent2020.Advent4Kt {
  public static final void main();
    Code:
       0: new           #8                  // class com/luckystar/advent2020/Advent4Kt$main$file$1
       3: dup
       4: invokespecial #11                 // Method com/luckystar/advent2020/Advent4Kt$main$file$1."<init>":()V
       7: invokevirtual #15                 // Method java/lang/Object.getClass:()Ljava/lang/Class;
      10: ldc           #17                 // String /2020/input_4.txt
      12: invokevirtual #23                 // Method java/lang/Class.getResource:(Ljava/lang/String;)Ljava/net/URL;
      15: dup
      16: ldc           #25                 // String getResource(...)
      18: invokestatic  #31                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      21: astore_1
      22: getstatic     #37                 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      25: astore_2
      26: aload_1
      27: invokestatic  #43                 // Method kotlin/io/TextStreamsKt.readBytes:(Ljava/net/URL;)[B
      30: astore_3
      31: new           #45                 // class java/lang/String
      34: dup
      35: aload_3
      36: aload_2
      37: invokespecial #48                 // Method java/lang/String."<init>":([BLjava/nio/charset/Charset;)V
      40: astore_0
      41: aload_0
      42: checkcast     #50                 // class java/lang/CharSequence
      45: iconst_1
      46: anewarray     #45                 // class java/lang/String
      49: astore_2
      50: aload_2
      51: iconst_0
      52: ldc           #52                 // String \r\n\r\n
      54: aastore
      55: aload_2
      56: iconst_0
      57: iconst_0
      58: bipush        6
      60: aconst_null
      61: invokestatic  #58                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      64: astore_1
      65: aload_1
      66: checkcast     #60                 // class java/lang/Iterable
      69: astore_3
      70: iconst_0
      71: istore        4
      73: aload_3
      74: astore        5
      76: new           #62                 // class java/util/ArrayList
      79: dup
      80: aload_3
      81: bipush        10
      83: invokestatic  #68                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      86: invokespecial #71                 // Method java/util/ArrayList."<init>":(I)V
      89: checkcast     #73                 // class java/util/Collection
      92: astore        6
      94: iconst_0
      95: istore        7
      97: aload         5
      99: invokeinterface #77,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     104: astore        8
     106: aload         8
     108: invokeinterface #83,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     113: ifeq          757
     116: aload         8
     118: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     123: astore        9
     125: aload         6
     127: aload         9
     129: checkcast     #45                 // class java/lang/String
     132: astore        10
     134: astore        28
     136: iconst_0
     137: istore        11
     139: aload         10
     141: checkcast     #50                 // class java/lang/CharSequence
     144: iconst_1
     145: anewarray     #45                 // class java/lang/String
     148: astore        12
     150: aload         12
     152: iconst_0
     153: ldc           #89                 // String \r\n
     155: aastore
     156: aload         12
     158: iconst_0
     159: iconst_0
     160: bipush        6
     162: aconst_null
     163: invokestatic  #58                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     166: checkcast     #60                 // class java/lang/Iterable
     169: astore        12
     171: nop
     172: iconst_0
     173: istore        13
     175: aload         12
     177: invokeinterface #77,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     182: astore        14
     184: aload         14
     186: invokeinterface #83,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     191: ifne          204
     194: new           #91                 // class java/lang/UnsupportedOperationException
     197: dup
     198: ldc           #93                 // String Empty collection can\'t be reduced.
     200: invokespecial #96                 // Method java/lang/UnsupportedOperationException."<init>":(Ljava/lang/String;)V
     203: athrow
     204: aload         14
     206: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     211: astore        15
     213: aload         14
     215: invokeinterface #83,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     220: ifeq          275
     223: aload         15
     225: aload         14
     227: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     232: checkcast     #45                 // class java/lang/String
     235: astore        16
     237: checkcast     #45                 // class java/lang/String
     240: astore        17
     242: iconst_0
     243: istore        18
     245: new           #98                 // class java/lang/StringBuilder
     248: dup
     249: invokespecial #99                 // Method java/lang/StringBuilder."<init>":()V
     252: aload         17
     254: invokevirtual #103                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     257: bipush        32
     259: invokevirtual #106                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     262: aload         16
     264: invokevirtual #103                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     267: invokevirtual #110                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     270: astore        15
     272: goto          213
     275: aload         15
     277: checkcast     #50                 // class java/lang/CharSequence
     280: iconst_1
     281: anewarray     #45                 // class java/lang/String
     284: astore        12
     286: aload         12
     288: iconst_0
     289: ldc           #112                // String
     291: aastore
     292: aload         12
     294: iconst_0
     295: iconst_0
     296: bipush        6
     298: aconst_null
     299: invokestatic  #58                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     302: astore        19
     304: aload         19
     306: checkcast     #60                 // class java/lang/Iterable
     309: astore        13
     311: nop
     312: iconst_0
     313: istore        14
     315: aload         13
     317: astore        15
     319: new           #62                 // class java/util/ArrayList
     322: dup
     323: aload         13
     325: bipush        10
     327: invokestatic  #68                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     330: invokespecial #71                 // Method java/util/ArrayList."<init>":(I)V
     333: checkcast     #73                 // class java/util/Collection
     336: astore        16
     338: iconst_0
     339: istore        17
     341: aload         15
     343: invokeinterface #77,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     348: astore        18
     350: aload         18
     352: invokeinterface #83,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     357: ifeq          447
     360: aload         18
     362: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     367: astore        20
     369: aload         16
     371: aload         20
     373: checkcast     #45                 // class java/lang/String
     376: astore        21
     378: astore        22
     380: iconst_0
     381: istore        23
     383: aload         21
     385: checkcast     #50                 // class java/lang/CharSequence
     388: iconst_1
     389: anewarray     #45                 // class java/lang/String
     392: astore        24
     394: aload         24
     396: iconst_0
     397: ldc           #114                // String :
     399: aastore
     400: aload         24
     402: iconst_0
     403: iconst_0
     404: bipush        6
     406: aconst_null
     407: invokestatic  #58                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     410: astore        25
     412: new           #116                // class kotlin/Pair
     415: dup
     416: aload         25
     418: iconst_0
     419: invokeinterface #122,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     424: aload         25
     426: iconst_1
     427: invokeinterface #122,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     432: invokespecial #125                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     435: aload         22
     437: swap
     438: invokeinterface #129,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     443: pop
     444: goto          350
     447: aload         16
     449: checkcast     #118                // class java/util/List
     452: nop
     453: checkcast     #60                 // class java/lang/Iterable
     456: astore        13
     458: nop
     459: iconst_0
     460: istore        14
     462: aload         13
     464: bipush        10
     466: invokestatic  #68                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     469: invokestatic  #135                // Method kotlin/collections/MapsKt.mapCapacity:(I)I
     472: bipush        16
     474: invokestatic  #141                // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I
     477: istore        15
     479: aload         13
     481: astore        16
     483: new           #143                // class java/util/LinkedHashMap
     486: dup
     487: iload         15
     489: invokespecial #144                // Method java/util/LinkedHashMap."<init>":(I)V
     492: checkcast     #146                // class java/util/Map
     495: astore        17
     497: iconst_0
     498: istore        18
     500: aload         16
     502: invokeinterface #77,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     507: astore        20
     509: aload         20
     511: invokeinterface #83,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     516: ifeq          592
     519: aload         20
     521: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     526: astore        21
     528: aload         17
     530: aload         21
     532: checkcast     #116                // class kotlin/Pair
     535: astore        23
     537: astore        22
     539: iconst_0
     540: istore        24
     542: aload         23
     544: invokevirtual #149                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     547: checkcast     #45                 // class java/lang/String
     550: aload         22
     552: swap
     553: aload         21
     555: checkcast     #116                // class kotlin/Pair
     558: astore        23
     560: astore        26
     562: astore        22
     564: iconst_0
     565: istore        24
     567: aload         23
     569: invokevirtual #152                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     572: checkcast     #45                 // class java/lang/String
     575: astore        27
     577: aload         22
     579: aload         26
     581: aload         27
     583: invokeinterface #156,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     588: pop
     589: goto          509
     592: aload         17
     594: nop
     595: astore        12
     597: new           #158                // class com/luckystar/advent2020/Passport
     600: dup
     601: aload         12
     603: ldc           #160                // String byr
     605: invokeinterface #163,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     610: checkcast     #45                 // class java/lang/String
     613: dup
     614: ifnull        626
     617: invokestatic  #169                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     620: invokestatic  #173                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     623: goto          628
     626: pop
     627: aconst_null
     628: aload         12
     630: ldc           #175                // String iyr
     632: invokeinterface #163,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     637: checkcast     #45                 // class java/lang/String
     640: dup
     641: ifnull        653
     644: invokestatic  #169                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     647: invokestatic  #173                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     650: goto          655
     653: pop
     654: aconst_null
     655: aload         12
     657: ldc           #177                // String eyr
     659: invokeinterface #163,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     664: checkcast     #45                 // class java/lang/String
     667: dup
     668: ifnull        680
     671: invokestatic  #169                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     674: invokestatic  #173                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     677: goto          682
     680: pop
     681: aconst_null
     682: aload         12
     684: ldc           #179                // String hgt
     686: invokeinterface #163,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     691: checkcast     #45                 // class java/lang/String
     694: aload         12
     696: ldc           #181                // String hcl
     698: invokeinterface #163,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     703: checkcast     #45                 // class java/lang/String
     706: aload         12
     708: ldc           #183                // String ecl
     710: invokeinterface #163,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     715: checkcast     #45                 // class java/lang/String
     718: aload         12
     720: ldc           #185                // String pid
     722: invokeinterface #163,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     727: checkcast     #45                 // class java/lang/String
     730: aload         12
     732: ldc           #187                // String cid
     734: invokeinterface #163,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     739: checkcast     #45                 // class java/lang/String
     742: invokespecial #190                // Method com/luckystar/advent2020/Passport."<init>":(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
     745: aload         28
     747: swap
     748: invokeinterface #129,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     753: pop
     754: goto          106
     757: aload         6
     759: checkcast     #118                // class java/util/List
     762: nop
     763: astore_2
     764: aload_2
     765: checkcast     #60                 // class java/lang/Iterable
     768: astore_3
     769: iconst_0
     770: istore        4
     772: aload_3
     773: astore        5
     775: new           #62                 // class java/util/ArrayList
     778: dup
     779: invokespecial #191                // Method java/util/ArrayList."<init>":()V
     782: checkcast     #73                 // class java/util/Collection
     785: astore        6
     787: iconst_0
     788: istore        7
     790: aload         5
     792: invokeinterface #77,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     797: astore        8
     799: aload         8
     801: invokeinterface #83,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     806: ifeq          905
     809: aload         8
     811: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     816: astore        9
     818: aload         9
     820: checkcast     #158                // class com/luckystar/advent2020/Passport
     823: astore        10
     825: iconst_0
     826: istore        11
     828: aload         10
     830: invokevirtual #195                // Method com/luckystar/advent2020/Passport.getByr:()Ljava/lang/Integer;
     833: ifnull        888
     836: aload         10
     838: invokevirtual #198                // Method com/luckystar/advent2020/Passport.getIyr:()Ljava/lang/Integer;
     841: ifnull        888
     844: aload         10
     846: invokevirtual #201                // Method com/luckystar/advent2020/Passport.getEyr:()Ljava/lang/Integer;
     849: ifnull        888
     852: aload         10
     854: invokevirtual #204                // Method com/luckystar/advent2020/Passport.getHgt:()Ljava/lang/String;
     857: ifnull        888
     860: aload         10
     862: invokevirtual #207                // Method com/luckystar/advent2020/Passport.getHcl:()Ljava/lang/String;
     865: ifnull        888
     868: aload         10
     870: invokevirtual #210                // Method com/luckystar/advent2020/Passport.getEcl:()Ljava/lang/String;
     873: ifnull        888
     876: aload         10
     878: invokevirtual #213                // Method com/luckystar/advent2020/Passport.getPid:()Ljava/lang/String;
     881: ifnull        888
     884: iconst_1
     885: goto          889
     888: iconst_0
     889: ifeq          799
     892: aload         6
     894: aload         9
     896: invokeinterface #129,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     901: pop
     902: goto          799
     905: aload         6
     907: checkcast     #118                // class java/util/List
     910: nop
     911: checkcast     #73                 // class java/util/Collection
     914: invokeinterface #217,  1          // InterfaceMethod java/util/Collection.size:()I
     919: istore_3
     920: getstatic     #223                // Field java/lang/System.out:Ljava/io/PrintStream;
     923: iload_3
     924: invokevirtual #228                // Method java/io/PrintStream.println:(I)V
     927: new           #230                // class kotlin/text/Regex
     930: dup
     931: ldc           #232                // String (\\d+)(cm|in)
     933: invokespecial #233                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
     936: astore_3
     937: new           #230                // class kotlin/text/Regex
     940: dup
     941: ldc           #235                // String #[0-9a-f]{6}
     943: invokespecial #233                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
     946: astore        4
     948: new           #230                // class kotlin/text/Regex
     951: dup
     952: ldc           #237                // String ^(amb|blu|brn|gry|grn|hzl|oth)$
     954: invokespecial #233                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
     957: astore        5
     959: new           #230                // class kotlin/text/Regex
     962: dup
     963: ldc           #239                // String ^(\\d){9}$
     965: invokespecial #233                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
     968: astore        6
     970: aload_2
     971: checkcast     #60                 // class java/lang/Iterable
     974: astore        7
     976: iconst_0
     977: istore        8
     979: aload         7
     981: astore        9
     983: new           #62                 // class java/util/ArrayList
     986: dup
     987: invokespecial #191                // Method java/util/ArrayList."<init>":()V
     990: checkcast     #73                 // class java/util/Collection
     993: astore        10
     995: iconst_0
     996: istore        11
     998: aload         9
    1000: invokeinterface #77,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1005: astore        12
    1007: aload         12
    1009: invokeinterface #83,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1014: ifeq          1064
    1017: aload         12
    1019: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1024: astore        13
    1026: aload         13
    1028: checkcast     #158                // class com/luckystar/advent2020/Passport
    1031: astore        14
    1033: iconst_0
    1034: istore        15
    1036: aload_3
    1037: aload         4
    1039: aload         5
    1041: aload         6
    1043: aload         14
    1045: invokestatic  #243                // Method main$validate:(Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/text/Regex;Lcom/luckystar/advent2020/Passport;)Z
    1048: ifeq          1007
    1051: aload         10
    1053: aload         13
    1055: invokeinterface #129,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1060: pop
    1061: goto          1007
    1064: aload         10
    1066: checkcast     #118                // class java/util/List
    1069: nop
    1070: checkcast     #73                 // class java/util/Collection
    1073: invokeinterface #217,  1          // InterfaceMethod java/util/Collection.size:()I
    1078: istore        7
    1080: getstatic     #223                // Field java/lang/System.out:Ljava/io/PrintStream;
    1083: iload         7
    1085: invokevirtual #228                // Method java/io/PrintStream.println:(I)V
    1088: return

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

  private static final boolean main$validate(kotlin.text.Regex, kotlin.text.Regex, kotlin.text.Regex, kotlin.text.Regex, com.luckystar.advent2020.Passport);
    Code:
       0: aload         4
       2: invokevirtual #195                // Method com/luckystar/advent2020/Passport.getByr:()Ljava/lang/Integer;
       5: ifnull        365
       8: aload         4
      10: invokevirtual #198                // Method com/luckystar/advent2020/Passport.getIyr:()Ljava/lang/Integer;
      13: ifnull        365
      16: aload         4
      18: invokevirtual #201                // Method com/luckystar/advent2020/Passport.getEyr:()Ljava/lang/Integer;
      21: ifnull        365
      24: aload         4
      26: invokevirtual #204                // Method com/luckystar/advent2020/Passport.getHgt:()Ljava/lang/String;
      29: ifnull        365
      32: aload         4
      34: invokevirtual #207                // Method com/luckystar/advent2020/Passport.getHcl:()Ljava/lang/String;
      37: ifnull        365
      40: aload         4
      42: invokevirtual #210                // Method com/luckystar/advent2020/Passport.getEcl:()Ljava/lang/String;
      45: ifnull        365
      48: aload         4
      50: invokevirtual #213                // Method com/luckystar/advent2020/Passport.getPid:()Ljava/lang/String;
      53: ifnull        365
      56: new           #305                // class kotlin/ranges/IntRange
      59: dup
      60: sipush        1920
      63: sipush        2002
      66: invokespecial #308                // Method kotlin/ranges/IntRange."<init>":(II)V
      69: aload         4
      71: invokevirtual #195                // Method com/luckystar/advent2020/Passport.getByr:()Ljava/lang/Integer;
      74: invokevirtual #311                // Method java/lang/Integer.intValue:()I
      77: invokevirtual #315                // Method kotlin/ranges/IntRange.contains:(I)Z
      80: ifne          85
      83: iconst_0
      84: ireturn
      85: new           #305                // class kotlin/ranges/IntRange
      88: dup
      89: sipush        2010
      92: sipush        2020
      95: invokespecial #308                // Method kotlin/ranges/IntRange."<init>":(II)V
      98: aload         4
     100: invokevirtual #198                // Method com/luckystar/advent2020/Passport.getIyr:()Ljava/lang/Integer;
     103: invokevirtual #311                // Method java/lang/Integer.intValue:()I
     106: invokevirtual #315                // Method kotlin/ranges/IntRange.contains:(I)Z
     109: ifne          114
     112: iconst_0
     113: ireturn
     114: new           #305                // class kotlin/ranges/IntRange
     117: dup
     118: sipush        2020
     121: sipush        2030
     124: invokespecial #308                // Method kotlin/ranges/IntRange."<init>":(II)V
     127: aload         4
     129: invokevirtual #201                // Method com/luckystar/advent2020/Passport.getEyr:()Ljava/lang/Integer;
     132: invokevirtual #311                // Method java/lang/Integer.intValue:()I
     135: invokevirtual #315                // Method kotlin/ranges/IntRange.contains:(I)Z
     138: ifne          143
     141: iconst_0
     142: ireturn
     143: aload_0
     144: aload         4
     146: invokevirtual #204                // Method com/luckystar/advent2020/Passport.getHgt:()Ljava/lang/String;
     149: checkcast     #50                 // class java/lang/CharSequence
     152: iconst_0
     153: iconst_2
     154: aconst_null
     155: invokestatic  #319                // Method kotlin/text/Regex.find$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/text/MatchResult;
     158: dup
     159: ifnonnull     165
     162: pop
     163: iconst_0
     164: ireturn
     165: astore        5
     167: aload         5
     169: invokeinterface #325,  1          // InterfaceMethod kotlin/text/MatchResult.getDestructured:()Lkotlin/text/MatchResult$Destructured;
     174: astore        6
     176: aload         6
     178: invokevirtual #331                // Method kotlin/text/MatchResult$Destructured.getMatch:()Lkotlin/text/MatchResult;
     181: invokeinterface #335,  1          // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;
     186: iconst_1
     187: invokeinterface #122,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     192: checkcast     #45                 // class java/lang/String
     195: astore        7
     197: aload         6
     199: invokevirtual #331                // Method kotlin/text/MatchResult$Destructured.getMatch:()Lkotlin/text/MatchResult;
     202: invokeinterface #335,  1          // InterfaceMethod kotlin/text/MatchResult.getGroupValues:()Ljava/util/List;
     207: iconst_2
     208: invokeinterface #122,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     213: checkcast     #45                 // class java/lang/String
     216: astore        8
     218: aload         7
     220: invokestatic  #169                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     223: istore        9
     225: aload         8
     227: ldc_w         #337                // String cm
     230: invokestatic  #341                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     233: ifeq          264
     236: sipush        150
     239: iload         9
     241: if_icmpgt     260
     244: iload         9
     246: sipush        194
     249: if_icmpge     256
     252: iconst_1
     253: goto          261
     256: iconst_0
     257: goto          261
     260: iconst_0
     261: ifeq          301
     264: aload         8
     266: ldc_w         #343                // String in
     269: invokestatic  #341                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     272: ifeq          303
     275: bipush        59
     277: iload         9
     279: if_icmpgt     297
     282: iload         9
     284: bipush        77
     286: if_icmpge     293
     289: iconst_1
     290: goto          298
     293: iconst_0
     294: goto          298
     297: iconst_0
     298: ifne          303
     301: iconst_0
     302: ireturn
     303: aload_1
     304: aload         4
     306: invokevirtual #207                // Method com/luckystar/advent2020/Passport.getHcl:()Ljava/lang/String;
     309: checkcast     #50                 // class java/lang/CharSequence
     312: iconst_0
     313: iconst_2
     314: aconst_null
     315: invokestatic  #319                // Method kotlin/text/Regex.find$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/text/MatchResult;
     318: ifnonnull     323
     321: iconst_0
     322: ireturn
     323: aload_2
     324: aload         4
     326: invokevirtual #210                // Method com/luckystar/advent2020/Passport.getEcl:()Ljava/lang/String;
     329: checkcast     #50                 // class java/lang/CharSequence
     332: iconst_0
     333: iconst_2
     334: aconst_null
     335: invokestatic  #319                // Method kotlin/text/Regex.find$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/text/MatchResult;
     338: ifnonnull     343
     341: iconst_0
     342: ireturn
     343: aload_3
     344: aload         4
     346: invokevirtual #213                // Method com/luckystar/advent2020/Passport.getPid:()Ljava/lang/String;
     349: checkcast     #50                 // class java/lang/CharSequence
     352: iconst_0
     353: iconst_2
     354: aconst_null
     355: invokestatic  #319                // Method kotlin/text/Regex.find$default:(Lkotlin/text/Regex;Ljava/lang/CharSequence;IILjava/lang/Object;)Lkotlin/text/MatchResult;
     358: ifnonnull     363
     361: iconst_0
     362: ireturn
     363: iconst_1
     364: ireturn
     365: iconst_0
     366: ireturn
}

Compiled from "Advent4.kt"
public final class com.luckystar.advent2020.Advent4Kt$main$file$1 {
  com.luckystar.advent2020.Advent4Kt$main$file$1();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return
}