package day19

import java.io.File
import kotlin.math.abs

fun main() {
    val unidentifiedScanners = mutableListOf<UnidentifiedScanner>()
    File("src/main/kotlin/day19/input.txt").useLines { linesSeq ->
        val linesIterator = linesSeq.iterator()
        while (linesIterator.hasNext()) {
            val scannerId = linesIterator.next().substringAfter("scanner ").substringBefore(" ---")
            val scannerBeacons = mutableListOf<Vector3D>()
            while (linesIterator.hasNext()) {
                val line = linesIterator.next()
                if (line.isEmpty()) break
                val (x, y, z) = line.split(",")
                scannerBeacons.add(Vector3D.from(end = Point3D(x.toInt(), y.toInt(), z.toInt())))
            }
            unidentifiedScanners.add(UnidentifiedScanner(scannerId, scannerBeacons))
        }
    }
    val identifiedScanners = mutableSetOf<IdentifiedScanner>()
    var baseScanner = unidentifiedScanners.removeAt(0).run { IdentifiedScanner(id, Point3D.CENTER, beaconVectors) }
    identifiedScanners.add(baseScanner)

    val testedScanners = mutableListOf(baseScanner)
    while (unidentifiedScanners.isNotEmpty()) {
        val baseScannerInterBeaconVectors = baseScanner.beaconVectors.eachVector()
        val unidentifiedScannersIterator = unidentifiedScanners.iterator()
        for (unidentifiedScanner in unidentifiedScannersIterator) {
            val unidentifiedScannerInterBeaconsVectors = unidentifiedScanner.beaconVectors.eachVector()
            val commonDistances = baseScannerInterBeaconVectors.keys
                    .map { it.squaredLength() }
                    .intersect(unidentifiedScannerInterBeaconsVectors.keys.map { it.squaredLength() }.toSet())
            //scanner have at least 12 common beacons (12 inter beacon combinations == 66 (12 * 11 / 2))
            if (commonDistances.size >= 66) {
                val commonDistance = commonDistances.first()
                val identifiedBeaconsForCommonDistance = baseScannerInterBeaconVectors
                    .filter { it.key.squaredLength() == commonDistance }
                    .entries.first()
                val unidentifiedBeaconsForCommonDistance = unidentifiedScannerInterBeaconsVectors
                    .filter { it.key.squaredLength() == commonDistance }
                val scannerTransformation = TRANSFORMATIONS.first { transformation ->
                    unidentifiedBeaconsForCommonDistance
                        .map { it.key.transform(transformation) }
                        .any { it == identifiedBeaconsForCommonDistance.key }
                }
                val unidentifiedBeaconVector = unidentifiedBeaconsForCommonDistance.entries.first {
                    it.key.transform(scannerTransformation) == identifiedBeaconsForCommonDistance.key
                }.value.first
                val identifiedBeaconVector = identifiedBeaconsForCommonDistance.value.first
                val transformedBeaconVector = unidentifiedBeaconVector.transform(scannerTransformation)
                val scannerPositionShift = identifiedBeaconVector - transformedBeaconVector
                val identifiedScanner = IdentifiedScanner(
                    unidentifiedScanner.id,
                    baseScanner.position + scannerPositionShift,
                    unidentifiedScanner.beaconVectors.map { it.transform(scannerTransformation) }
                )
                identifiedScanners.add(identifiedScanner)
                unidentifiedScannersIterator.remove()
            }
        }
        testedScanners.add(baseScanner)
        baseScanner = identifiedScanners.first { it !in testedScanners }
    }
    println(identifiedScanners.flatMap { scanner -> scanner.beaconVectors.map { scanner.position + it } }.toSet().size)

    println(identifiedScanners.flatMap { identifiedScanner1 ->
        identifiedScanners.map { identifiedScanner2 ->
            identifiedScanner1.position.manhattanDistance(identifiedScanner2.position)
        }
    }.maxOrNull())
}

fun List<Vector3D>.eachVector(): Map<Vector3D, Pair<Vector3D, Vector3D>> = buildMap {
    this@eachVector.forEach { v1 ->
        this@eachVector.forEach { v2 ->
            if (v1 != v2) {
                put(v2 - v1, v1 to v2)
            }
        }
    }
}

data class UnidentifiedScanner(val id: String, val beaconVectors: List<Vector3D>)
data class IdentifiedScanner(val id: String, val position: Point3D, val beaconVectors: List<Vector3D>)

data class Vector3D(val dx: Int, val dy: Int, val dz: Int) {
    operator fun plus(other: Vector3D) = Vector3D(dx + other.dx, dy + other.dy, dz + other.dz)
    operator fun minus(other: Vector3D) = Vector3D(dx - other.dx, dy - other.dy, dz - other.dz)

    fun squaredLength(): Int = dx * dx + dy * dy + dz * dz

    fun transform(matrix: Matrix3D): Vector3D = Vector3D(
        dx * matrix.m00 + dy * matrix.m01 + dz * matrix.m02,
        dx * matrix.m10 + dy * matrix.m11 + dz * matrix.m12,
        dx * matrix.m20 + dy * matrix.m21 + dz * matrix.m22
    )

    companion object {
        fun from(start: Point3D = Point3D.CENTER, end: Point3D): Vector3D = Vector3D(end.x - start.x, end.y - start.y, end.z - start.z)
    }
}

data class Matrix3D(
    val m00: Int, val m01: Int, val m02: Int,
    val m10: Int, val m11: Int, val m12: Int,
    val m20: Int, val m21: Int, val m22: Int
)

data class Point3D(val x: Int, val y: Int, val z: Int) {
    operator fun plus(vector: Vector3D) = Point3D(x + vector.dx, y + vector.dy, z + vector.dz)
    operator fun minus(vector: Vector3D) = Point3D(x - vector.dx, y - vector.dy, z - vector.dz)

    fun manhattanDistance(other: Point3D) = abs(x - other.x) + abs(y - other.y) + abs(z - other.z)

    companion object {
        val CENTER = Point3D(0, 0, 0)
    }
}

val TRANSFORMATIONS: List<Matrix3D> = listOf(
    Matrix3D(
        1, 0, 0,
        0, 1, 0,
        0, 0, 1
    ),
    Matrix3D(
        1, 0, 0,
        0, 0, -1,
        0, 1, 0
    ),
    Matrix3D(
        1, 0, 0,
        0, -1, 0,
        0, 0, -1
    ),
    Matrix3D(
        1, 0, 0,
        0, 0, 1,
        0, -1, 0
    ),
    Matrix3D(
        -1, 0, 0,
        0, -1, 0,
        0, 0, 1
    ),
    Matrix3D(
        -1, 0, 0,
        0, 0, -1,
        0, -1, 0
    ),
    Matrix3D(
        -1, 0, 0,
        0, 1, 0,
        0, 0, -1
    ),
    Matrix3D(
        -1, 0, 0,
        0, 0, 1,
        0, 1, 0
    ),
    Matrix3D(
        0, -1, 0,
        1, 0, 0,
        0, 0, 1
    ),
    Matrix3D(
        0, 0, 1,
        1, 0, 0,
        0, 1, 0
    ),
    Matrix3D(
        0, 1, 0,
        1, 0, 0,
        0, 0, -1
    ),
    Matrix3D(
        0, 0, -1,
        1, 0, 0,
        0, -1, 0
    ),
    Matrix3D(
        0, 1, 0,
        -1, 0, 0,
        0, 0, 1
    ),
    Matrix3D(
        0, 0, 1,
        -1, 0, 0,
        0, -1, 0
    ),
    Matrix3D(
        0, -1, 0,
        -1, 0, 0,
        0, 0, -1
    ),
    Matrix3D(
        0, 0, -1,
        -1, 0, 0,
        0, 1, 0
    ),
    Matrix3D(
        0, 0, -1,
        0, 1, 0,
        1, 0, 0
    ),
    Matrix3D(
        0, 1, 0,
        0, 0, 1,
        1, 0, 0
    ),
    Matrix3D(
        0, 0, 1,
        0, -1, 0,
        1, 0, 0
    ),
    Matrix3D(
        0, -1, 0,
        0, 0, -1,
        1, 0, 0
    ),
    Matrix3D(
        0, 0, -1,
        0, -1, 0,
        -1, 0, 0
    ),
    Matrix3D(
        0, -1, 0,
        0, 0, 1,
        -1, 0, 0
    ),
    Matrix3D(
        0, 0, 1,
        0, 1, 0,
        -1, 0, 0
    ),
    Matrix3D(
        0, 1, 0,
        0, 0, -1,
        -1, 0, 0
    ),
)

Compiled from "solution.kt"
public final class day19.SolutionKt {
  private static final java.util.List<day19.Matrix3D> TRANSFORMATIONS;

  public static final void main();
    Code:
       0: new           #10                 // class java/util/ArrayList
       3: dup
       4: invokespecial #13                 // Method java/util/ArrayList."<init>":()V
       7: checkcast     #15                 // class java/util/List
      10: astore_0
      11: new           #17                 // class java/io/File
      14: dup
      15: ldc           #19                 // String src/main/kotlin/day19/input.txt
      17: invokespecial #22                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      20: astore_1
      21: getstatic     #28                 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      24: astore_2
      25: iconst_0
      26: istore_3
      27: aload_1
      28: astore        4
      30: sipush        8192
      33: istore        5
      35: aload         4
      37: astore        6
      39: new           #30                 // class java/io/InputStreamReader
      42: dup
      43: new           #32                 // class java/io/FileInputStream
      46: dup
      47: aload         6
      49: invokespecial #35                 // Method java/io/FileInputStream."<init>":(Ljava/io/File;)V
      52: checkcast     #37                 // class java/io/InputStream
      55: aload_2
      56: invokespecial #40                 // Method java/io/InputStreamReader."<init>":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
      59: checkcast     #42                 // class java/io/Reader
      62: astore        6
      64: aload         6
      66: instanceof    #44                 // class java/io/BufferedReader
      69: ifeq          80
      72: aload         6
      74: checkcast     #44                 // class java/io/BufferedReader
      77: goto          91
      80: new           #44                 // class java/io/BufferedReader
      83: dup
      84: aload         6
      86: iload         5
      88: invokespecial #47                 // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
      91: checkcast     #49                 // class java/io/Closeable
      94: astore        4
      96: aconst_null
      97: astore        5
      99: nop
     100: aload         4
     102: checkcast     #44                 // class java/io/BufferedReader
     105: astore        6
     107: iconst_0
     108: istore        7
     110: aload         6
     112: invokestatic  #55                 // Method kotlin/io/TextStreamsKt.lineSequence:(Ljava/io/BufferedReader;)Lkotlin/sequences/Sequence;
     115: astore        8
     117: iconst_0
     118: istore        9
     120: aload         8
     122: invokeinterface #61,  1           // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
     127: astore        10
     129: aload         10
     131: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     136: ifeq          353
     139: aload         10
     141: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     146: checkcast     #73                 // class java/lang/String
     149: ldc           #75                 // String scanner
     151: aconst_null
     152: iconst_2
     153: aconst_null
     154: invokestatic  #81                 // Method kotlin/text/StringsKt.substringAfter$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
     157: ldc           #83                 // String  ---
     159: aconst_null
     160: iconst_2
     161: aconst_null
     162: invokestatic  #86                 // Method kotlin/text/StringsKt.substringBefore$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
     165: astore        11
     167: new           #10                 // class java/util/ArrayList
     170: dup
     171: invokespecial #13                 // Method java/util/ArrayList."<init>":()V
     174: checkcast     #15                 // class java/util/List
     177: astore        12
     179: aload         10
     181: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     186: ifeq          332
     189: aload         10
     191: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     196: checkcast     #73                 // class java/lang/String
     199: astore        13
     201: aload         13
     203: checkcast     #88                 // class java/lang/CharSequence
     206: invokeinterface #92,  1           // InterfaceMethod java/lang/CharSequence.length:()I
     211: ifne          218
     214: iconst_1
     215: goto          219
     218: iconst_0
     219: ifne          332
     222: aload         13
     224: checkcast     #88                 // class java/lang/CharSequence
     227: iconst_1
     228: anewarray     #73                 // class java/lang/String
     231: astore        14
     233: aload         14
     235: iconst_0
     236: ldc           #94                 // String ,
     238: aastore
     239: aload         14
     241: iconst_0
     242: iconst_0
     243: bipush        6
     245: aconst_null
     246: invokestatic  #98                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     249: astore        15
     251: aload         15
     253: iconst_0
     254: invokeinterface #102,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     259: checkcast     #73                 // class java/lang/String
     262: astore        14
     264: aload         15
     266: iconst_1
     267: invokeinterface #102,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     272: checkcast     #73                 // class java/lang/String
     275: astore        16
     277: aload         15
     279: iconst_2
     280: invokeinterface #102,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     285: checkcast     #73                 // class java/lang/String
     288: astore        17
     290: aload         12
     292: getstatic     #108                // Field day19/Vector3D.Companion:Lday19/Vector3D$Companion;
     295: aconst_null
     296: new           #110                // class day19/Point3D
     299: dup
     300: aload         14
     302: invokestatic  #116                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     305: aload         16
     307: invokestatic  #116                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     310: aload         17
     312: invokestatic  #116                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     315: invokespecial #119                // Method day19/Point3D."<init>":(III)V
     318: iconst_1
     319: aconst_null
     320: invokestatic  #125                // Method day19/Vector3D$Companion.from$default:(Lday19/Vector3D$Companion;Lday19/Point3D;Lday19/Point3D;ILjava/lang/Object;)Lday19/Vector3D;
     323: invokeinterface #129,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     328: pop
     329: goto          179
     332: aload_0
     333: new           #131                // class day19/UnidentifiedScanner
     336: dup
     337: aload         11
     339: aload         12
     341: invokespecial #134                // Method day19/UnidentifiedScanner."<init>":(Ljava/lang/String;Ljava/util/List;)V
     344: invokeinterface #129,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     349: pop
     350: goto          129
     353: nop
     354: getstatic     #140                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
     357: astore        6
     359: aload         4
     361: aload         5
     363: invokestatic  #146                // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     366: goto          390
     369: astore        7
     371: aload         7
     373: astore        5
     375: aload         7
     377: athrow
     378: astore        7
     380: aload         4
     382: aload         5
     384: invokestatic  #146                // Method kotlin/io/CloseableKt.closeFinally:(Ljava/io/Closeable;Ljava/lang/Throwable;)V
     387: aload         7
     389: athrow
     390: nop
     391: new           #148                // class java/util/LinkedHashSet
     394: dup
     395: invokespecial #149                // Method java/util/LinkedHashSet."<init>":()V
     398: checkcast     #151                // class java/util/Set
     401: astore_1
     402: aload_0
     403: iconst_0
     404: invokeinterface #154,  2          // InterfaceMethod java/util/List.remove:(I)Ljava/lang/Object;
     409: checkcast     #131                // class day19/UnidentifiedScanner
     412: astore        4
     414: iconst_0
     415: istore        5
     417: new           #156                // class day19/IdentifiedScanner
     420: dup
     421: aload         4
     423: invokevirtual #160                // Method day19/UnidentifiedScanner.getId:()Ljava/lang/String;
     426: getstatic     #163                // Field day19/Point3D.Companion:Lday19/Point3D$Companion;
     429: invokevirtual #169                // Method day19/Point3D$Companion.getCENTER:()Lday19/Point3D;
     432: aload         4
     434: invokevirtual #173                // Method day19/UnidentifiedScanner.getBeaconVectors:()Ljava/util/List;
     437: invokespecial #176                // Method day19/IdentifiedScanner."<init>":(Ljava/lang/String;Lday19/Point3D;Ljava/util/List;)V
     440: nop
     441: astore_2
     442: aload_1
     443: aload_2
     444: invokeinterface #177,  2          // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
     449: pop
     450: iconst_1
     451: anewarray     #156                // class day19/IdentifiedScanner
     454: astore        4
     456: aload         4
     458: iconst_0
     459: aload_2
     460: aastore
     461: aload         4
     463: invokestatic  #183                // Method kotlin/collections/CollectionsKt.mutableListOf:([Ljava/lang/Object;)Ljava/util/List;
     466: astore_3
     467: aload_0
     468: checkcast     #185                // class java/util/Collection
     471: invokeinterface #188,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     476: ifne          483
     479: iconst_1
     480: goto          484
     483: iconst_0
     484: ifeq          1776
     487: aload_2
     488: invokevirtual #189                // Method day19/IdentifiedScanner.getBeaconVectors:()Ljava/util/List;
     491: invokestatic  #193                // Method eachVector:(Ljava/util/List;)Ljava/util/Map;
     494: astore        4
     496: aload_0
     497: invokeinterface #194,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     502: astore        5
     504: aload         5
     506: astore        6
     508: aload         6
     510: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     515: ifeq          1679
     518: aload         6
     520: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     525: checkcast     #131                // class day19/UnidentifiedScanner
     528: astore        7
     530: aload         7
     532: invokevirtual #173                // Method day19/UnidentifiedScanner.getBeaconVectors:()Ljava/util/List;
     535: invokestatic  #193                // Method eachVector:(Ljava/util/List;)Ljava/util/Map;
     538: astore        8
     540: aload         4
     542: invokeinterface #200,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
     547: checkcast     #202                // class java/lang/Iterable
     550: astore        10
     552: nop
     553: iconst_0
     554: istore        11
     556: aload         10
     558: astore        12
     560: new           #10                 // class java/util/ArrayList
     563: dup
     564: aload         10
     566: bipush        10
     568: invokestatic  #206                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     571: invokespecial #209                // Method java/util/ArrayList."<init>":(I)V
     574: checkcast     #185                // class java/util/Collection
     577: astore        13
     579: iconst_0
     580: istore        14
     582: aload         12
     584: invokeinterface #210,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     589: astore        15
     591: aload         15
     593: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     598: ifeq          644
     601: aload         15
     603: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     608: astore        16
     610: aload         13
     612: aload         16
     614: checkcast     #104                // class day19/Vector3D
     617: astore        17
     619: astore        30
     621: iconst_0
     622: istore        18
     624: aload         17
     626: invokevirtual #213                // Method day19/Vector3D.squaredLength:()I
     629: invokestatic  #217                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     632: aload         30
     634: swap
     635: invokeinterface #218,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     640: pop
     641: goto          591
     644: aload         13
     646: checkcast     #15                 // class java/util/List
     649: nop
     650: checkcast     #202                // class java/lang/Iterable
     653: aload         8
     655: invokeinterface #200,  1          // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
     660: checkcast     #202                // class java/lang/Iterable
     663: astore        10
     665: astore        30
     667: iconst_0
     668: istore        11
     670: aload         10
     672: astore        12
     674: new           #10                 // class java/util/ArrayList
     677: dup
     678: aload         10
     680: bipush        10
     682: invokestatic  #206                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     685: invokespecial #209                // Method java/util/ArrayList."<init>":(I)V
     688: checkcast     #185                // class java/util/Collection
     691: astore        13
     693: iconst_0
     694: istore        14
     696: aload         12
     698: invokeinterface #210,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     703: astore        15
     705: aload         15
     707: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     712: ifeq          758
     715: aload         15
     717: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     722: astore        16
     724: aload         13
     726: aload         16
     728: checkcast     #104                // class day19/Vector3D
     731: astore        17
     733: astore        31
     735: iconst_0
     736: istore        18
     738: aload         17
     740: invokevirtual #213                // Method day19/Vector3D.squaredLength:()I
     743: invokestatic  #217                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     746: aload         31
     748: swap
     749: invokeinterface #218,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     754: pop
     755: goto          705
     758: aload         13
     760: checkcast     #15                 // class java/util/List
     763: nop
     764: aload         30
     766: swap
     767: checkcast     #202                // class java/lang/Iterable
     770: invokestatic  #222                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
     773: checkcast     #202                // class java/lang/Iterable
     776: invokestatic  #226                // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;
     779: astore        9
     781: aload         9
     783: invokeinterface #229,  1          // InterfaceMethod java/util/Set.size:()I
     788: bipush        66
     790: if_icmplt     508
     793: aload         9
     795: checkcast     #202                // class java/lang/Iterable
     798: invokestatic  #233                // Method kotlin/collections/CollectionsKt.first:(Ljava/lang/Iterable;)Ljava/lang/Object;
     801: checkcast     #235                // class java/lang/Number
     804: invokevirtual #238                // Method java/lang/Number.intValue:()I
     807: istore        10
     809: aload         4
     811: astore        12
     813: nop
     814: iconst_0
     815: istore        13
     817: aload         12
     819: astore        14
     821: new           #240                // class java/util/LinkedHashMap
     824: dup
     825: invokespecial #241                // Method java/util/LinkedHashMap."<init>":()V
     828: checkcast     #196                // class java/util/Map
     831: astore        15
     833: iconst_0
     834: istore        16
     836: aload         14
     838: invokeinterface #244,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     843: invokeinterface #245,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     848: astore        17
     850: aload         17
     852: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     857: ifeq          930
     860: aload         17
     862: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     867: checkcast     #247                // class java/util/Map$Entry
     870: astore        18
     872: aload         18
     874: astore        19
     876: iconst_0
     877: istore        20
     879: aload         19
     881: invokeinterface #250,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     886: checkcast     #104                // class day19/Vector3D
     889: invokevirtual #213                // Method day19/Vector3D.squaredLength:()I
     892: iload         10
     894: if_icmpne     901
     897: iconst_1
     898: goto          902
     901: iconst_0
     902: ifeq          850
     905: aload         15
     907: aload         18
     909: invokeinterface #250,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
     914: aload         18
     916: invokeinterface #253,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
     921: invokeinterface #257,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     926: pop
     927: goto          850
     930: aload         15
     932: nop
     933: invokeinterface #244,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     938: checkcast     #202                // class java/lang/Iterable
     941: invokestatic  #233                // Method kotlin/collections/CollectionsKt.first:(Ljava/lang/Iterable;)Ljava/lang/Object;
     944: checkcast     #247                // class java/util/Map$Entry
     947: astore        11
     949: aload         8
     951: astore        13
     953: nop
     954: iconst_0
     955: istore        14
     957: aload         13
     959: astore        15
     961: new           #240                // class java/util/LinkedHashMap
     964: dup
     965: invokespecial #241                // Method java/util/LinkedHashMap."<init>":()V
     968: checkcast     #196                // class java/util/Map
     971: astore        16
     973: iconst_0
     974: istore        17
     976: aload         15
     978: invokeinterface #244,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
     983: invokeinterface #245,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     988: astore        18
     990: aload         18
     992: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     997: ifeq          1070
    1000: aload         18
    1002: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1007: checkcast     #247                // class java/util/Map$Entry
    1010: astore        19
    1012: aload         19
    1014: astore        20
    1016: iconst_0
    1017: istore        21
    1019: aload         20
    1021: invokeinterface #250,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
    1026: checkcast     #104                // class day19/Vector3D
    1029: invokevirtual #213                // Method day19/Vector3D.squaredLength:()I
    1032: iload         10
    1034: if_icmpne     1041
    1037: iconst_1
    1038: goto          1042
    1041: iconst_0
    1042: ifeq          990
    1045: aload         16
    1047: aload         19
    1049: invokeinterface #250,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
    1054: aload         19
    1056: invokeinterface #253,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
    1061: invokeinterface #257,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    1066: pop
    1067: goto          990
    1070: aload         16
    1072: nop
    1073: astore        12
    1075: getstatic     #261                // Field TRANSFORMATIONS:Ljava/util/List;
    1078: checkcast     #202                // class java/lang/Iterable
    1081: astore        14
    1083: iconst_0
    1084: istore        15
    1086: aload         14
    1088: invokeinterface #210,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1093: astore        16
    1095: aload         16
    1097: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1102: ifeq          1339
    1105: aload         16
    1107: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1112: astore        17
    1114: aload         17
    1116: checkcast     #263                // class day19/Matrix3D
    1119: astore        18
    1121: iconst_0
    1122: istore        19
    1124: aload         12
    1126: astore        20
    1128: nop
    1129: iconst_0
    1130: istore        21
    1132: aload         20
    1134: astore        22
    1136: new           #10                 // class java/util/ArrayList
    1139: dup
    1140: aload         20
    1142: invokeinterface #264,  1          // InterfaceMethod java/util/Map.size:()I
    1147: invokespecial #209                // Method java/util/ArrayList."<init>":(I)V
    1150: checkcast     #185                // class java/util/Collection
    1153: astore        23
    1155: iconst_0
    1156: istore        24
    1158: aload         22
    1160: invokeinterface #244,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
    1165: invokeinterface #245,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
    1170: astore        25
    1172: aload         25
    1174: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1179: ifeq          1232
    1182: aload         25
    1184: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1189: checkcast     #247                // class java/util/Map$Entry
    1192: astore        26
    1194: aload         23
    1196: aload         26
    1198: astore        27
    1200: astore        28
    1202: iconst_0
    1203: istore        29
    1205: aload         27
    1207: invokeinterface #250,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
    1212: checkcast     #104                // class day19/Vector3D
    1215: aload         18
    1217: invokevirtual #268                // Method day19/Vector3D.transform:(Lday19/Matrix3D;)Lday19/Vector3D;
    1220: aload         28
    1222: swap
    1223: invokeinterface #218,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1228: pop
    1229: goto          1172
    1232: aload         23
    1234: checkcast     #15                 // class java/util/List
    1237: nop
    1238: checkcast     #202                // class java/lang/Iterable
    1241: astore        20
    1243: nop
    1244: iconst_0
    1245: istore        21
    1247: aload         20
    1249: instanceof    #185                // class java/util/Collection
    1252: ifeq          1272
    1255: aload         20
    1257: checkcast     #185                // class java/util/Collection
    1260: invokeinterface #188,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
    1265: ifeq          1272
    1268: iconst_0
    1269: goto          1330
    1272: aload         20
    1274: invokeinterface #210,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1279: astore        22
    1281: aload         22
    1283: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1288: ifeq          1329
    1291: aload         22
    1293: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1298: astore        23
    1300: aload         23
    1302: checkcast     #104                // class day19/Vector3D
    1305: astore        24
    1307: iconst_0
    1308: istore        25
    1310: aload         24
    1312: aload         11
    1314: invokeinterface #250,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
    1319: invokestatic  #274                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
    1322: ifeq          1281
    1325: iconst_1
    1326: goto          1330
    1329: iconst_0
    1330: nop
    1331: ifeq          1095
    1334: aload         17
    1336: goto          1350
    1339: new           #276                // class java/util/NoSuchElementException
    1342: dup
    1343: ldc_w         #278                // String Collection contains no element matching the predicate.
    1346: invokespecial #279                // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
    1349: athrow
    1350: checkcast     #263                // class day19/Matrix3D
    1353: astore        13
    1355: aload         12
    1357: invokeinterface #244,  1          // InterfaceMethod java/util/Map.entrySet:()Ljava/util/Set;
    1362: checkcast     #202                // class java/lang/Iterable
    1365: astore        15
    1367: iconst_0
    1368: istore        16
    1370: aload         15
    1372: invokeinterface #210,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1377: astore        17
    1379: aload         17
    1381: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1386: ifeq          1441
    1389: aload         17
    1391: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1396: astore        18
    1398: aload         18
    1400: checkcast     #247                // class java/util/Map$Entry
    1403: astore        19
    1405: iconst_0
    1406: istore        20
    1408: aload         19
    1410: invokeinterface #250,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
    1415: checkcast     #104                // class day19/Vector3D
    1418: aload         13
    1420: invokevirtual #268                // Method day19/Vector3D.transform:(Lday19/Matrix3D;)Lday19/Vector3D;
    1423: aload         11
    1425: invokeinterface #250,  1          // InterfaceMethod java/util/Map$Entry.getKey:()Ljava/lang/Object;
    1430: invokestatic  #274                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
    1433: ifeq          1379
    1436: aload         18
    1438: goto          1452
    1441: new           #276                // class java/util/NoSuchElementException
    1444: dup
    1445: ldc_w         #278                // String Collection contains no element matching the predicate.
    1448: invokespecial #279                // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
    1451: athrow
    1452: checkcast     #247                // class java/util/Map$Entry
    1455: invokeinterface #253,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
    1460: checkcast     #281                // class kotlin/Pair
    1463: invokevirtual #284                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
    1466: checkcast     #104                // class day19/Vector3D
    1469: astore        14
    1471: aload         11
    1473: invokeinterface #253,  1          // InterfaceMethod java/util/Map$Entry.getValue:()Ljava/lang/Object;
    1478: checkcast     #281                // class kotlin/Pair
    1481: invokevirtual #284                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
    1484: checkcast     #104                // class day19/Vector3D
    1487: astore        15
    1489: aload         14
    1491: aload         13
    1493: invokevirtual #268                // Method day19/Vector3D.transform:(Lday19/Matrix3D;)Lday19/Vector3D;
    1496: astore        16
    1498: aload         15
    1500: aload         16
    1502: invokevirtual #288                // Method day19/Vector3D.minus:(Lday19/Vector3D;)Lday19/Vector3D;
    1505: astore        17
    1507: aload         7
    1509: invokevirtual #160                // Method day19/UnidentifiedScanner.getId:()Ljava/lang/String;
    1512: aload_2
    1513: invokevirtual #291                // Method day19/IdentifiedScanner.getPosition:()Lday19/Point3D;
    1516: aload         17
    1518: invokevirtual #295                // Method day19/Point3D.plus:(Lday19/Vector3D;)Lday19/Point3D;
    1521: aload         7
    1523: invokevirtual #173                // Method day19/UnidentifiedScanner.getBeaconVectors:()Ljava/util/List;
    1526: checkcast     #202                // class java/lang/Iterable
    1529: astore        19
    1531: astore        33
    1533: astore        32
    1535: iconst_0
    1536: istore        20
    1538: aload         19
    1540: astore        21
    1542: new           #10                 // class java/util/ArrayList
    1545: dup
    1546: aload         19
    1548: bipush        10
    1550: invokestatic  #206                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
    1553: invokespecial #209                // Method java/util/ArrayList."<init>":(I)V
    1556: checkcast     #185                // class java/util/Collection
    1559: astore        22
    1561: iconst_0
    1562: istore        23
    1564: aload         21
    1566: invokeinterface #210,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1571: astore        24
    1573: aload         24
    1575: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1580: ifeq          1625
    1583: aload         24
    1585: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1590: astore        25
    1592: aload         22
    1594: aload         25
    1596: checkcast     #104                // class day19/Vector3D
    1599: astore        26
    1601: astore        34
    1603: iconst_0
    1604: istore        27
    1606: aload         26
    1608: aload         13
    1610: invokevirtual #268                // Method day19/Vector3D.transform:(Lday19/Matrix3D;)Lday19/Vector3D;
    1613: aload         34
    1615: swap
    1616: invokeinterface #218,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1621: pop
    1622: goto          1573
    1625: aload         22
    1627: checkcast     #15                 // class java/util/List
    1630: nop
    1631: astore        34
    1633: aload         32
    1635: aload         33
    1637: aload         34
    1639: astore        35
    1641: astore        36
    1643: astore        37
    1645: new           #156                // class day19/IdentifiedScanner
    1648: dup
    1649: aload         37
    1651: aload         36
    1653: aload         35
    1655: invokespecial #176                // Method day19/IdentifiedScanner."<init>":(Ljava/lang/String;Lday19/Point3D;Ljava/util/List;)V
    1658: astore        18
    1660: aload_1
    1661: aload         18
    1663: invokeinterface #177,  2          // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
    1668: pop
    1669: aload         5
    1671: invokeinterface #297,  1          // InterfaceMethod java/util/Iterator.remove:()V
    1676: goto          508
    1679: aload_3
    1680: aload_2
    1681: invokeinterface #129,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
    1686: pop
    1687: aload_1
    1688: checkcast     #202                // class java/lang/Iterable
    1691: astore        6
    1693: iconst_0
    1694: istore        7
    1696: aload         6
    1698: invokeinterface #210,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1703: astore        8
    1705: aload         8
    1707: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1712: ifeq          1758
    1715: aload         8
    1717: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1722: astore        9
    1724: aload         9
    1726: checkcast     #156                // class day19/IdentifiedScanner
    1729: astore        10
    1731: iconst_0
    1732: istore        11
    1734: aload_3
    1735: aload         10
    1737: invokeinterface #300,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
    1742: ifne          1749
    1745: iconst_1
    1746: goto          1750
    1749: iconst_0
    1750: ifeq          1705
    1753: aload         9
    1755: goto          1769
    1758: new           #276                // class java/util/NoSuchElementException
    1761: dup
    1762: ldc_w         #278                // String Collection contains no element matching the predicate.
    1765: invokespecial #279                // Method java/util/NoSuchElementException."<init>":(Ljava/lang/String;)V
    1768: athrow
    1769: checkcast     #156                // class day19/IdentifiedScanner
    1772: astore_2
    1773: goto          467
    1776: aload_1
    1777: checkcast     #202                // class java/lang/Iterable
    1780: astore        4
    1782: iconst_0
    1783: istore        5
    1785: aload         4
    1787: astore        6
    1789: new           #10                 // class java/util/ArrayList
    1792: dup
    1793: invokespecial #13                 // Method java/util/ArrayList."<init>":()V
    1796: checkcast     #185                // class java/util/Collection
    1799: astore        7
    1801: iconst_0
    1802: istore        8
    1804: aload         6
    1806: invokeinterface #210,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1811: astore        9
    1813: aload         9
    1815: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1820: ifeq          1968
    1823: aload         9
    1825: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1830: astore        10
    1832: aload         10
    1834: checkcast     #156                // class day19/IdentifiedScanner
    1837: astore        11
    1839: iconst_0
    1840: istore        12
    1842: aload         11
    1844: invokevirtual #189                // Method day19/IdentifiedScanner.getBeaconVectors:()Ljava/util/List;
    1847: checkcast     #202                // class java/lang/Iterable
    1850: astore        13
    1852: iconst_0
    1853: istore        14
    1855: aload         13
    1857: astore        15
    1859: new           #10                 // class java/util/ArrayList
    1862: dup
    1863: aload         13
    1865: bipush        10
    1867: invokestatic  #206                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
    1870: invokespecial #209                // Method java/util/ArrayList."<init>":(I)V
    1873: checkcast     #185                // class java/util/Collection
    1876: astore        16
    1878: iconst_0
    1879: istore        17
    1881: aload         15
    1883: invokeinterface #210,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1888: astore        18
    1890: aload         18
    1892: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1897: ifeq          1945
    1900: aload         18
    1902: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1907: astore        19
    1909: aload         16
    1911: aload         19
    1913: checkcast     #104                // class day19/Vector3D
    1916: astore        20
    1918: astore        21
    1920: iconst_0
    1921: istore        22
    1923: aload         11
    1925: invokevirtual #291                // Method day19/IdentifiedScanner.getPosition:()Lday19/Point3D;
    1928: aload         20
    1930: invokevirtual #295                // Method day19/Point3D.plus:(Lday19/Vector3D;)Lday19/Point3D;
    1933: aload         21
    1935: swap
    1936: invokeinterface #218,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1941: pop
    1942: goto          1890
    1945: aload         16
    1947: checkcast     #15                 // class java/util/List
    1950: nop
    1951: checkcast     #202                // class java/lang/Iterable
    1954: nop
    1955: astore        11
    1957: aload         7
    1959: aload         11
    1961: invokestatic  #304                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
    1964: pop
    1965: goto          1813
    1968: aload         7
    1970: checkcast     #15                 // class java/util/List
    1973: nop
    1974: checkcast     #202                // class java/lang/Iterable
    1977: invokestatic  #222                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
    1980: invokeinterface #229,  1          // InterfaceMethod java/util/Set.size:()I
    1985: istore        4
    1987: getstatic     #310                // Field java/lang/System.out:Ljava/io/PrintStream;
    1990: iload         4
    1992: invokevirtual #315                // Method java/io/PrintStream.println:(I)V
    1995: aload_1
    1996: checkcast     #202                // class java/lang/Iterable
    1999: astore        4
    2001: iconst_0
    2002: istore        5
    2004: aload         4
    2006: astore        6
    2008: new           #10                 // class java/util/ArrayList
    2011: dup
    2012: invokespecial #13                 // Method java/util/ArrayList."<init>":()V
    2015: checkcast     #185                // class java/util/Collection
    2018: astore        7
    2020: iconst_0
    2021: istore        8
    2023: aload         6
    2025: invokeinterface #210,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    2030: astore        9
    2032: aload         9
    2034: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    2039: ifeq          2189
    2042: aload         9
    2044: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    2049: astore        10
    2051: aload         10
    2053: checkcast     #156                // class day19/IdentifiedScanner
    2056: astore        11
    2058: iconst_0
    2059: istore        12
    2061: aload_1
    2062: checkcast     #202                // class java/lang/Iterable
    2065: astore        13
    2067: iconst_0
    2068: istore        14
    2070: aload         13
    2072: astore        15
    2074: new           #10                 // class java/util/ArrayList
    2077: dup
    2078: aload         13
    2080: bipush        10
    2082: invokestatic  #206                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
    2085: invokespecial #209                // Method java/util/ArrayList."<init>":(I)V
    2088: checkcast     #185                // class java/util/Collection
    2091: astore        16
    2093: iconst_0
    2094: istore        17
    2096: aload         15
    2098: invokeinterface #210,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    2103: astore        18
    2105: aload         18
    2107: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    2112: ifeq          2166
    2115: aload         18
    2117: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    2122: astore        19
    2124: aload         16
    2126: aload         19
    2128: checkcast     #156                // class day19/IdentifiedScanner
    2131: astore        20
    2133: astore        21
    2135: iconst_0
    2136: istore        22
    2138: aload         11
    2140: invokevirtual #291                // Method day19/IdentifiedScanner.getPosition:()Lday19/Point3D;
    2143: aload         20
    2145: invokevirtual #291                // Method day19/IdentifiedScanner.getPosition:()Lday19/Point3D;
    2148: invokevirtual #319                // Method day19/Point3D.manhattanDistance:(Lday19/Point3D;)I
    2151: invokestatic  #217                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
    2154: aload         21
    2156: swap
    2157: invokeinterface #218,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    2162: pop
    2163: goto          2105
    2166: aload         16
    2168: checkcast     #15                 // class java/util/List
    2171: nop
    2172: checkcast     #202                // class java/lang/Iterable
    2175: nop
    2176: astore        11
    2178: aload         7
    2180: aload         11
    2182: invokestatic  #304                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
    2185: pop
    2186: goto          2032
    2189: aload         7
    2191: checkcast     #15                 // class java/util/List
    2194: nop
    2195: checkcast     #202                // class java/lang/Iterable
    2198: invokestatic  #323                // Method kotlin/collections/CollectionsKt.maxOrNull:(Ljava/lang/Iterable;)Ljava/lang/Comparable;
    2201: astore        4
    2203: getstatic     #310                // Field java/lang/System.out:Ljava/io/PrintStream;
    2206: aload         4
    2208: invokevirtual #326                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
    2211: return
    Exception table:
       from    to  target type
          99   359   369   Class java/lang/Throwable
          99   359   378   any
         369   378   378   any
         378   380   378   any

  public static final java.util.Map<day19.Vector3D, kotlin.Pair<day19.Vector3D, day19.Vector3D>> eachVector(java.util.List<day19.Vector3D>);
    Code:
       0: aload_0
       1: ldc_w         #422                // String <this>
       4: invokestatic  #426                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: invokestatic  #432                // Method kotlin/collections/MapsKt.createMapBuilder:()Ljava/util/Map;
      10: astore_1
      11: aload_1
      12: astore_2
      13: iconst_0
      14: istore_3
      15: aload_0
      16: checkcast     #202                // class java/lang/Iterable
      19: astore        4
      21: iconst_0
      22: istore        5
      24: aload         4
      26: invokeinterface #210,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      31: astore        6
      33: aload         6
      35: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      40: ifeq          151
      43: aload         6
      45: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      50: astore        7
      52: aload         7
      54: checkcast     #104                // class day19/Vector3D
      57: astore        8
      59: iconst_0
      60: istore        9
      62: aload_0
      63: checkcast     #202                // class java/lang/Iterable
      66: astore        10
      68: iconst_0
      69: istore        11
      71: aload         10
      73: invokeinterface #210,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      78: astore        12
      80: aload         12
      82: invokeinterface #67,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      87: ifeq          145
      90: aload         12
      92: invokeinterface #71,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      97: astore        13
      99: aload         13
     101: checkcast     #104                // class day19/Vector3D
     104: astore        14
     106: iconst_0
     107: istore        15
     109: aload         8
     111: aload         14
     113: invokestatic  #274                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     116: ifne          140
     119: aload_2
     120: aload         14
     122: aload         8
     124: invokevirtual #288                // Method day19/Vector3D.minus:(Lday19/Vector3D;)Lday19/Vector3D;
     127: aload         8
     129: aload         14
     131: invokestatic  #438                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     134: invokeinterface #257,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     139: pop
     140: nop
     141: nop
     142: goto          80
     145: nop
     146: nop
     147: nop
     148: goto          33
     151: nop
     152: nop
     153: aload_1
     154: invokestatic  #442                // Method kotlin/collections/MapsKt.build:(Ljava/util/Map;)Ljava/util/Map;
     157: areturn

  public static final java.util.List<day19.Matrix3D> getTRANSFORMATIONS();
    Code:
       0: getstatic     #261                // Field TRANSFORMATIONS:Ljava/util/List;
       3: areturn

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

  static {};
    Code:
       0: bipush        24
       2: anewarray     #263                // class day19/Matrix3D
       5: astore_0
       6: aload_0
       7: iconst_0
       8: new           #263                // class day19/Matrix3D
      11: dup
      12: iconst_1
      13: iconst_0
      14: iconst_0
      15: iconst_0
      16: iconst_1
      17: iconst_0
      18: iconst_0
      19: iconst_0
      20: iconst_1
      21: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
      24: aastore
      25: aload_0
      26: iconst_1
      27: new           #263                // class day19/Matrix3D
      30: dup
      31: iconst_1
      32: iconst_0
      33: iconst_0
      34: iconst_0
      35: iconst_0
      36: iconst_m1
      37: iconst_0
      38: iconst_1
      39: iconst_0
      40: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
      43: aastore
      44: aload_0
      45: iconst_2
      46: new           #263                // class day19/Matrix3D
      49: dup
      50: iconst_1
      51: iconst_0
      52: iconst_0
      53: iconst_0
      54: iconst_m1
      55: iconst_0
      56: iconst_0
      57: iconst_0
      58: iconst_m1
      59: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
      62: aastore
      63: aload_0
      64: iconst_3
      65: new           #263                // class day19/Matrix3D
      68: dup
      69: iconst_1
      70: iconst_0
      71: iconst_0
      72: iconst_0
      73: iconst_0
      74: iconst_1
      75: iconst_0
      76: iconst_m1
      77: iconst_0
      78: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
      81: aastore
      82: aload_0
      83: iconst_4
      84: new           #263                // class day19/Matrix3D
      87: dup
      88: iconst_m1
      89: iconst_0
      90: iconst_0
      91: iconst_0
      92: iconst_m1
      93: iconst_0
      94: iconst_0
      95: iconst_0
      96: iconst_1
      97: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     100: aastore
     101: aload_0
     102: iconst_5
     103: new           #263                // class day19/Matrix3D
     106: dup
     107: iconst_m1
     108: iconst_0
     109: iconst_0
     110: iconst_0
     111: iconst_0
     112: iconst_m1
     113: iconst_0
     114: iconst_m1
     115: iconst_0
     116: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     119: aastore
     120: aload_0
     121: bipush        6
     123: new           #263                // class day19/Matrix3D
     126: dup
     127: iconst_m1
     128: iconst_0
     129: iconst_0
     130: iconst_0
     131: iconst_1
     132: iconst_0
     133: iconst_0
     134: iconst_0
     135: iconst_m1
     136: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     139: aastore
     140: aload_0
     141: bipush        7
     143: new           #263                // class day19/Matrix3D
     146: dup
     147: iconst_m1
     148: iconst_0
     149: iconst_0
     150: iconst_0
     151: iconst_0
     152: iconst_1
     153: iconst_0
     154: iconst_1
     155: iconst_0
     156: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     159: aastore
     160: aload_0
     161: bipush        8
     163: new           #263                // class day19/Matrix3D
     166: dup
     167: iconst_0
     168: iconst_m1
     169: iconst_0
     170: iconst_1
     171: iconst_0
     172: iconst_0
     173: iconst_0
     174: iconst_0
     175: iconst_1
     176: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     179: aastore
     180: aload_0
     181: bipush        9
     183: new           #263                // class day19/Matrix3D
     186: dup
     187: iconst_0
     188: iconst_0
     189: iconst_1
     190: iconst_1
     191: iconst_0
     192: iconst_0
     193: iconst_0
     194: iconst_1
     195: iconst_0
     196: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     199: aastore
     200: aload_0
     201: bipush        10
     203: new           #263                // class day19/Matrix3D
     206: dup
     207: iconst_0
     208: iconst_1
     209: iconst_0
     210: iconst_1
     211: iconst_0
     212: iconst_0
     213: iconst_0
     214: iconst_0
     215: iconst_m1
     216: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     219: aastore
     220: aload_0
     221: bipush        11
     223: new           #263                // class day19/Matrix3D
     226: dup
     227: iconst_0
     228: iconst_0
     229: iconst_m1
     230: iconst_1
     231: iconst_0
     232: iconst_0
     233: iconst_0
     234: iconst_m1
     235: iconst_0
     236: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     239: aastore
     240: aload_0
     241: bipush        12
     243: new           #263                // class day19/Matrix3D
     246: dup
     247: iconst_0
     248: iconst_1
     249: iconst_0
     250: iconst_m1
     251: iconst_0
     252: iconst_0
     253: iconst_0
     254: iconst_0
     255: iconst_1
     256: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     259: aastore
     260: aload_0
     261: bipush        13
     263: new           #263                // class day19/Matrix3D
     266: dup
     267: iconst_0
     268: iconst_0
     269: iconst_1
     270: iconst_m1
     271: iconst_0
     272: iconst_0
     273: iconst_0
     274: iconst_m1
     275: iconst_0
     276: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     279: aastore
     280: aload_0
     281: bipush        14
     283: new           #263                // class day19/Matrix3D
     286: dup
     287: iconst_0
     288: iconst_m1
     289: iconst_0
     290: iconst_m1
     291: iconst_0
     292: iconst_0
     293: iconst_0
     294: iconst_0
     295: iconst_m1
     296: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     299: aastore
     300: aload_0
     301: bipush        15
     303: new           #263                // class day19/Matrix3D
     306: dup
     307: iconst_0
     308: iconst_0
     309: iconst_m1
     310: iconst_m1
     311: iconst_0
     312: iconst_0
     313: iconst_0
     314: iconst_1
     315: iconst_0
     316: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     319: aastore
     320: aload_0
     321: bipush        16
     323: new           #263                // class day19/Matrix3D
     326: dup
     327: iconst_0
     328: iconst_0
     329: iconst_m1
     330: iconst_0
     331: iconst_1
     332: iconst_0
     333: iconst_1
     334: iconst_0
     335: iconst_0
     336: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     339: aastore
     340: aload_0
     341: bipush        17
     343: new           #263                // class day19/Matrix3D
     346: dup
     347: iconst_0
     348: iconst_1
     349: iconst_0
     350: iconst_0
     351: iconst_0
     352: iconst_1
     353: iconst_1
     354: iconst_0
     355: iconst_0
     356: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     359: aastore
     360: aload_0
     361: bipush        18
     363: new           #263                // class day19/Matrix3D
     366: dup
     367: iconst_0
     368: iconst_0
     369: iconst_1
     370: iconst_0
     371: iconst_m1
     372: iconst_0
     373: iconst_1
     374: iconst_0
     375: iconst_0
     376: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     379: aastore
     380: aload_0
     381: bipush        19
     383: new           #263                // class day19/Matrix3D
     386: dup
     387: iconst_0
     388: iconst_m1
     389: iconst_0
     390: iconst_0
     391: iconst_0
     392: iconst_m1
     393: iconst_1
     394: iconst_0
     395: iconst_0
     396: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     399: aastore
     400: aload_0
     401: bipush        20
     403: new           #263                // class day19/Matrix3D
     406: dup
     407: iconst_0
     408: iconst_0
     409: iconst_m1
     410: iconst_0
     411: iconst_m1
     412: iconst_0
     413: iconst_m1
     414: iconst_0
     415: iconst_0
     416: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     419: aastore
     420: aload_0
     421: bipush        21
     423: new           #263                // class day19/Matrix3D
     426: dup
     427: iconst_0
     428: iconst_m1
     429: iconst_0
     430: iconst_0
     431: iconst_0
     432: iconst_1
     433: iconst_m1
     434: iconst_0
     435: iconst_0
     436: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     439: aastore
     440: aload_0
     441: bipush        22
     443: new           #263                // class day19/Matrix3D
     446: dup
     447: iconst_0
     448: iconst_0
     449: iconst_1
     450: iconst_0
     451: iconst_1
     452: iconst_0
     453: iconst_m1
     454: iconst_0
     455: iconst_0
     456: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     459: aastore
     460: aload_0
     461: bipush        23
     463: new           #263                // class day19/Matrix3D
     466: dup
     467: iconst_0
     468: iconst_1
     469: iconst_0
     470: iconst_0
     471: iconst_0
     472: iconst_m1
     473: iconst_m1
     474: iconst_0
     475: iconst_0
     476: invokespecial #462                // Method day19/Matrix3D."<init>":(IIIIIIIII)V
     479: aastore
     480: aload_0
     481: invokestatic  #465                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     484: putstatic     #261                // Field TRANSFORMATIONS:Ljava/util/List;
     487: return
}