package turfkt

/**
 * Earth Radius used with the Harvesine formula and approximates using a spherical (non-ellipsoid) Earth.
 */
const val EARTH_RADIUS = 6371008.8

/**
 * Unit of measurement factors using a spherical (non-ellipsoid) earth radius.
 */
private val factors = mapOf(
    "centimeters" to EARTH_RADIUS * 100,
    "centimetres" to EARTH_RADIUS * 100,
    "degrees" to EARTH_RADIUS / 111325,
    "feet" to EARTH_RADIUS * 3.28084,
    "inches" to EARTH_RADIUS * 39.370,
    "kilometers" to EARTH_RADIUS / 1000,
    "kilometres" to EARTH_RADIUS / 1000,
    "meters" to EARTH_RADIUS,
    "metres" to EARTH_RADIUS,
    "miles" to EARTH_RADIUS / 1609.344,
    "millimeters" to EARTH_RADIUS * 1000,
    "millimetres" to EARTH_RADIUS * 1000,
    "nauticalmiles" to EARTH_RADIUS / 1852,
    "radians" to 1.0,
    "yards" to EARTH_RADIUS / 1.0936
)

/**
 * Convert a distance measurement (assuming a spherical Earth) from radians to a more friendly unit.
 * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet
 *
 * @param radians Radians across the sphere
 * @param units The length units to convert to. Can be degrees, radians, miles, or kilometers inches, yards, metres,
 * meters, kilometres, kilometers. Default to kilometers.
 * @returns The length in the given units.
 */
fun radiansToLength(radians: Double, units: String = "kilometers"): Double {
    if(!factors.containsKey(units)) throw IllegalArgumentException("Unrecognized units: $units")
    val factor = factors[units] ?: throw IllegalStateException("Factor for units $units was null")
    return radians * factor
}

/**
 * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into radians
 * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet
 *
 * @param distance The distance in real units
 * @param units The units of the given distance. Can be degrees, radians, miles, or kilometers inches, yards, metres,
 * meters, kilometres, kilometers. Defaults to kilometers.
 * @returns The length in radians.
 */
fun lengthToRadians(distance: Double, units: String = "kilometers"): Double {
    if(!factors.containsKey(units)) throw IllegalArgumentException("Unrecognized units: $units")
    val factor = factors[units] ?: throw IllegalStateException("Factor for units $units was null")
    return distance / factor
}

/**
 * Converts a length to the requested unit.
 * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet
 *
 * @param length length to be converted
 * @param originalUnit [originalUnit="kilometers"] of the length
 * @param finalUnit [finalUnit="kilometers"] returned unit
 * @return the converted length
 */
fun convertLength(length: Double, originalUnit: String = "kilometers", finalUnit: String = "kilometers"): Double {
    require(length >= 0) { "length must be a positive number" }
    return radiansToLength(lengthToRadians(length, originalUnit), finalUnit)
}

Compiled from "Conversions.kt"
public final class turfkt.ConversionsKt {
  public static final double EARTH_RADIUS;

  private static final java.util.Map<java.lang.String, java.lang.Double> factors;

  public static final double radiansToLength(double, java.lang.String);
    Code:
       0: aload_2
       1: ldc           #9                  // String units
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: getstatic     #19                 // Field factors:Ljava/util/Map;
       9: aload_2
      10: invokeinterface #25,  2           // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
      15: ifne          45
      18: new           #27                 // class java/lang/IllegalArgumentException
      21: dup
      22: new           #29                 // class java/lang/StringBuilder
      25: dup
      26: invokespecial #33                 // Method java/lang/StringBuilder."<init>":()V
      29: ldc           #35                 // String Unrecognized units:
      31: invokevirtual #39                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      34: aload_2
      35: invokevirtual #39                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      38: invokevirtual #43                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      41: invokespecial #46                 // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
      44: athrow
      45: getstatic     #19                 // Field factors:Ljava/util/Map;
      48: aload_2
      49: invokeinterface #50,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      54: checkcast     #52                 // class java/lang/Double
      57: dup
      58: ifnull        67
      61: invokevirtual #56                 // Method java/lang/Double.doubleValue:()D
      64: goto          100
      67: pop
      68: new           #58                 // class java/lang/IllegalStateException
      71: dup
      72: new           #29                 // class java/lang/StringBuilder
      75: dup
      76: invokespecial #33                 // Method java/lang/StringBuilder."<init>":()V
      79: ldc           #60                 // String Factor for units
      81: invokevirtual #39                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      84: aload_2
      85: invokevirtual #39                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      88: ldc           #62                 // String  was null
      90: invokevirtual #39                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      93: invokevirtual #43                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      96: invokespecial #63                 // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
      99: athrow
     100: dstore_3
     101: dload_0
     102: dload_3
     103: dmul
     104: dreturn

  public static double radiansToLength$default(double, java.lang.String, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_2
       2: iand
       3: ifeq          9
       6: ldc           #71                 // String kilometers
       8: astore_2
       9: dload_0
      10: aload_2
      11: invokestatic  #73                 // Method radiansToLength:(DLjava/lang/String;)D
      14: dreturn

  public static final double lengthToRadians(double, java.lang.String);
    Code:
       0: aload_2
       1: ldc           #9                  // String units
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: getstatic     #19                 // Field factors:Ljava/util/Map;
       9: aload_2
      10: invokeinterface #25,  2           // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
      15: ifne          45
      18: new           #27                 // class java/lang/IllegalArgumentException
      21: dup
      22: new           #29                 // class java/lang/StringBuilder
      25: dup
      26: invokespecial #33                 // Method java/lang/StringBuilder."<init>":()V
      29: ldc           #35                 // String Unrecognized units:
      31: invokevirtual #39                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      34: aload_2
      35: invokevirtual #39                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      38: invokevirtual #43                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      41: invokespecial #46                 // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
      44: athrow
      45: getstatic     #19                 // Field factors:Ljava/util/Map;
      48: aload_2
      49: invokeinterface #50,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      54: checkcast     #52                 // class java/lang/Double
      57: dup
      58: ifnull        67
      61: invokevirtual #56                 // Method java/lang/Double.doubleValue:()D
      64: goto          100
      67: pop
      68: new           #58                 // class java/lang/IllegalStateException
      71: dup
      72: new           #29                 // class java/lang/StringBuilder
      75: dup
      76: invokespecial #33                 // Method java/lang/StringBuilder."<init>":()V
      79: ldc           #60                 // String Factor for units
      81: invokevirtual #39                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      84: aload_2
      85: invokevirtual #39                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      88: ldc           #62                 // String  was null
      90: invokevirtual #39                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      93: invokevirtual #43                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      96: invokespecial #63                 // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
      99: athrow
     100: dstore_3
     101: dload_0
     102: dload_3
     103: ddiv
     104: dreturn

  public static double lengthToRadians$default(double, java.lang.String, int, java.lang.Object);
    Code:
       0: iload_3
       1: iconst_2
       2: iand
       3: ifeq          9
       6: ldc           #71                 // String kilometers
       8: astore_2
       9: dload_0
      10: aload_2
      11: invokestatic  #78                 // Method lengthToRadians:(DLjava/lang/String;)D
      14: dreturn

  public static final double convertLength(double, java.lang.String, java.lang.String);
    Code:
       0: aload_2
       1: ldc           #82                 // String originalUnit
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_3
       7: ldc           #84                 // String finalUnit
       9: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: dload_0
      13: dconst_0
      14: dcmpl
      15: iflt          22
      18: iconst_1
      19: goto          23
      22: iconst_0
      23: ifne          46
      26: iconst_0
      27: istore        4
      29: ldc           #86                 // String length must be a positive number
      31: astore        4
      33: new           #27                 // class java/lang/IllegalArgumentException
      36: dup
      37: aload         4
      39: invokevirtual #87                 // Method java/lang/Object.toString:()Ljava/lang/String;
      42: invokespecial #46                 // Method java/lang/IllegalArgumentException."<init>":(Ljava/lang/String;)V
      45: athrow
      46: dload_0
      47: aload_2
      48: invokestatic  #78                 // Method lengthToRadians:(DLjava/lang/String;)D
      51: aload_3
      52: invokestatic  #73                 // Method radiansToLength:(DLjava/lang/String;)D
      55: dreturn

  public static double convertLength$default(double, java.lang.String, java.lang.String, int, java.lang.Object);
    Code:
       0: iload         4
       2: iconst_2
       3: iand
       4: ifeq          10
       7: ldc           #71                 // String kilometers
       9: astore_2
      10: iload         4
      12: iconst_4
      13: iand
      14: ifeq          20
      17: ldc           #71                 // String kilometers
      19: astore_3
      20: dload_0
      21: aload_2
      22: aload_3
      23: invokestatic  #94                 // Method convertLength:(DLjava/lang/String;Ljava/lang/String;)D
      26: dreturn

  static {};
    Code:
       0: bipush        15
       2: anewarray     #97                 // class kotlin/Pair
       5: astore_0
       6: aload_0
       7: iconst_0
       8: ldc           #99                 // String centimeters
      10: ldc2_w        #100                // double 6.3710088E8d
      13: invokestatic  #105                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      16: invokestatic  #111                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      19: aastore
      20: aload_0
      21: iconst_1
      22: ldc           #113                // String centimetres
      24: ldc2_w        #100                // double 6.3710088E8d
      27: invokestatic  #105                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      30: invokestatic  #111                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      33: aastore
      34: aload_0
      35: iconst_2
      36: ldc           #115                // String degrees
      38: ldc2_w        #116                // double 57.22891354143274d
      41: invokestatic  #105                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      44: invokestatic  #111                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      47: aastore
      48: aload_0
      49: iconst_3
      50: ldc           #119                // String feet
      52: ldc2_w        #120                // double 2.0902260511392E7d
      55: invokestatic  #105                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      58: invokestatic  #111                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      61: aastore
      62: aload_0
      63: iconst_4
      64: ldc           #123                // String inches
      66: ldc2_w        #124                // double 2.5082661645599997E8d
      69: invokestatic  #105                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      72: invokestatic  #111                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      75: aastore
      76: aload_0
      77: iconst_5
      78: ldc           #71                 // String kilometers
      80: ldc2_w        #126                // double 6371.0088d
      83: invokestatic  #105                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      86: invokestatic  #111                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      89: aastore
      90: aload_0
      91: bipush        6
      93: ldc           #129                // String kilometres
      95: ldc2_w        #126                // double 6371.0088d
      98: invokestatic  #105                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     101: invokestatic  #111                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     104: aastore
     105: aload_0
     106: bipush        7
     108: ldc           #131                // String meters
     110: ldc2_w        #132                // double 6371008.8d
     113: invokestatic  #105                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     116: invokestatic  #111                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     119: aastore
     120: aload_0
     121: bipush        8
     123: ldc           #135                // String metres
     125: ldc2_w        #132                // double 6371008.8d
     128: invokestatic  #105                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     131: invokestatic  #111                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     134: aastore
     135: aload_0
     136: bipush        9
     138: ldc           #137                // String miles
     140: ldc2_w        #138                // double 3958.761333810546d
     143: invokestatic  #105                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     146: invokestatic  #111                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     149: aastore
     150: aload_0
     151: bipush        10
     153: ldc           #141                // String millimeters
     155: ldc2_w        #142                // double 6.3710088E9d
     158: invokestatic  #105                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     161: invokestatic  #111                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     164: aastore
     165: aload_0
     166: bipush        11
     168: ldc           #145                // String millimetres
     170: ldc2_w        #142                // double 6.3710088E9d
     173: invokestatic  #105                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     176: invokestatic  #111                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     179: aastore
     180: aload_0
     181: bipush        12
     183: ldc           #147                // String nauticalmiles
     185: ldc2_w        #148                // double 3440.069546436285d
     188: invokestatic  #105                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     191: invokestatic  #111                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     194: aastore
     195: aload_0
     196: bipush        13
     198: ldc           #150                // String radians
     200: dconst_1
     201: invokestatic  #105                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     204: invokestatic  #111                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     207: aastore
     208: aload_0
     209: bipush        14
     211: ldc           #152                // String yards
     213: ldc2_w        #153                // double 5825721.287490856d
     216: invokestatic  #105                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     219: invokestatic  #111                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     222: aastore
     223: aload_0
     224: invokestatic  #160                // Method kotlin/collections/MapsKt.mapOf:([Lkotlin/Pair;)Ljava/util/Map;
     227: putstatic     #19                 // Field factors:Ljava/util/Map;
     230: return
}


package tictactoe

import kotlin.math.abs

typealias Board = List<List<Char>>

enum class GameState {
    IMPOSSIBLE,
    X_WINS,
    O_WINS,
    DRAW,
    NOT_FINISHED,
}

fun main() {
    val input = "_________"
    var board = input.chunked(3).map { it.toList() }

    printBoard(board)
    for (player in "XOXOXOXOX") {
        board = promptForMove(board, player)
        printBoard(board)
        if (
            evaluateState(board) in listOf(
                GameState.X_WINS, GameState.O_WINS
            )
        ) break
    }
    printState(board)
}

fun updateBoard(board: Board, newCharacter: Char, coordinates: Pair<Int, Int>): Board {
    val (rowNumber, columnNumber) = coordinates
    return board.mapIndexed { r, row ->
        row.mapIndexed { c, square ->
            if (r == rowNumber && c == columnNumber) newCharacter else square
        }
    }
}

fun parseCoordinates(board: Board, input: String): Pair<Int, Int> {
    val (rowNumber, columnNumber) = try {
        input.split(" ").map { it.toInt() - 1 }
    } catch (e: Exception) {
        throw Exception("You should enter numbers!")
    }

    if (rowNumber !in 0..2 || columnNumber !in 0..2) {
        throw Exception("Coordinates should be from 1 to 3")
    }

    if (board[rowNumber][columnNumber] != '_') {
        throw Exception("This cell is occupied!")
    }

    return Pair(rowNumber, columnNumber)
}

fun promptForMove(board: Board, player: Char): Board {
    while (true) {
        print("Enter the coordinates: ")
        val input = readLine()!!

        try {
            val coordinates = parseCoordinates(board, input)
            return updateBoard(board, player, coordinates)
        } catch (e: Exception) {
            println(e.message)
        }
    }
}

fun evaluateState(board: Board): GameState {
    val countX = board.sumOf { row -> row.count { it == 'X' } }
    val countO = board.sumOf { row -> row.count { it == 'O' } }
    if (abs(countX - countO) > 1) return GameState.IMPOSSIBLE

    val rows = board
    val columns = board[0]
        .indices.map { i ->
            board.map { row -> row[i] }
        }
    val diagonals = listOf(
        board.indices.map { board[it][it] },
        board.indices.map { board[it][board.lastIndex - it] },
    )
    val lines = (rows + columns + diagonals)
        .map { it.joinToString("") }

    val winners = lines
        .filter { it in listOf("XXX", "OOO") }
        .map { it.first() }
        .toSet()

    return when (winners.size) {
        0 -> if (countX + countO == 9) GameState.DRAW else GameState.NOT_FINISHED
        1 -> if ('X' in winners) GameState.X_WINS else GameState.O_WINS
        else -> GameState.IMPOSSIBLE
    }
}

fun printState(board: Board) {
    val state = evaluateState(board)
    println(
        when (state) {
            GameState.IMPOSSIBLE -> "Impossible"
            GameState.X_WINS -> "X wins"
            GameState.O_WINS -> "O wins"
            GameState.DRAW -> "Draw"
            GameState.NOT_FINISHED -> "Game not finished"
        }
    )
}

fun printBoard(board: Board) {
    println("---------")
    board.forEach { row ->
        val marks = row.map { if (it in "XO") it else ' ' }
        println("| ${marks.joinToString(" ")} |")
    }
    println("---------")
}

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

  static {};
    Code:
       0: invokestatic  #14                 // Method tictactoe/GameState.values:()[Ltictactoe/GameState;
       3: arraylength
       4: newarray       int
       6: astore_0
       7: nop
       8: aload_0
       9: getstatic     #18                 // Field tictactoe/GameState.IMPOSSIBLE:Ltictactoe/GameState;
      12: invokevirtual #22                 // Method tictactoe/GameState.ordinal:()I
      15: iconst_1
      16: iastore
      17: goto          21
      20: astore_1
      21: nop
      22: aload_0
      23: getstatic     #25                 // Field tictactoe/GameState.X_WINS:Ltictactoe/GameState;
      26: invokevirtual #22                 // Method tictactoe/GameState.ordinal:()I
      29: iconst_2
      30: iastore
      31: goto          35
      34: astore_1
      35: nop
      36: aload_0
      37: getstatic     #28                 // Field tictactoe/GameState.O_WINS:Ltictactoe/GameState;
      40: invokevirtual #22                 // Method tictactoe/GameState.ordinal:()I
      43: iconst_3
      44: iastore
      45: goto          49
      48: astore_1
      49: nop
      50: aload_0
      51: getstatic     #31                 // Field tictactoe/GameState.DRAW:Ltictactoe/GameState;
      54: invokevirtual #22                 // Method tictactoe/GameState.ordinal:()I
      57: iconst_4
      58: iastore
      59: goto          63
      62: astore_1
      63: nop
      64: aload_0
      65: getstatic     #34                 // Field tictactoe/GameState.NOT_FINISHED:Ltictactoe/GameState;
      68: invokevirtual #22                 // Method tictactoe/GameState.ordinal:()I
      71: iconst_5
      72: iastore
      73: goto          77
      76: astore_1
      77: aload_0
      78: putstatic     #38                 // Field $EnumSwitchMapping$0:[I
      81: return
    Exception table:
       from    to  target type
           7    17    20   Class java/lang/NoSuchFieldError
          21    31    34   Class java/lang/NoSuchFieldError
          35    45    48   Class java/lang/NoSuchFieldError
          49    59    62   Class java/lang/NoSuchFieldError
          63    73    76   Class java/lang/NoSuchFieldError
}

Compiled from "Main.kt"
public final class tictactoe.MainKt {
  public static final void main();
    Code:
       0: ldc           #8                  // String _________
       2: astore_0
       3: aload_0
       4: checkcast     #10                 // class java/lang/CharSequence
       7: iconst_3
       8: invokestatic  #16                 // Method kotlin/text/StringsKt.chunked:(Ljava/lang/CharSequence;I)Ljava/util/List;
      11: checkcast     #18                 // class java/lang/Iterable
      14: astore_2
      15: iconst_0
      16: istore_3
      17: aload_2
      18: astore        4
      20: new           #20                 // class java/util/ArrayList
      23: dup
      24: aload_2
      25: bipush        10
      27: invokestatic  #26                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      30: invokespecial #30                 // Method java/util/ArrayList."<init>":(I)V
      33: checkcast     #32                 // class java/util/Collection
      36: astore        5
      38: iconst_0
      39: istore        6
      41: aload         4
      43: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      48: astore        7
      50: aload         7
      52: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      57: ifeq          103
      60: aload         7
      62: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      67: astore        8
      69: aload         5
      71: aload         8
      73: checkcast     #48                 // class java/lang/String
      76: astore        9
      78: astore        11
      80: iconst_0
      81: istore        10
      83: aload         9
      85: checkcast     #10                 // class java/lang/CharSequence
      88: invokestatic  #52                 // Method kotlin/text/StringsKt.toList:(Ljava/lang/CharSequence;)Ljava/util/List;
      91: aload         11
      93: swap
      94: invokeinterface #56,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      99: pop
     100: goto          50
     103: aload         5
     105: checkcast     #58                 // class java/util/List
     108: nop
     109: astore_1
     110: aload_1
     111: invokestatic  #62                 // Method printBoard:(Ljava/util/List;)V
     114: iconst_0
     115: istore_2
     116: ldc           #64                 // String XOXOXOXOX
     118: invokevirtual #68                 // Method java/lang/String.length:()I
     121: istore_3
     122: iload_2
     123: iload_3
     124: if_icmpge     192
     127: ldc           #64                 // String XOXOXOXOX
     129: iload_2
     130: invokevirtual #72                 // Method java/lang/String.charAt:(I)C
     133: istore        4
     135: aload_1
     136: iload         4
     138: invokestatic  #76                 // Method promptForMove:(Ljava/util/List;C)Ljava/util/List;
     141: astore_1
     142: aload_1
     143: invokestatic  #62                 // Method printBoard:(Ljava/util/List;)V
     146: iconst_2
     147: anewarray     #78                 // class tictactoe/GameState
     150: astore        5
     152: aload         5
     154: iconst_0
     155: getstatic     #82                 // Field tictactoe/GameState.X_WINS:Ltictactoe/GameState;
     158: aastore
     159: aload         5
     161: iconst_1
     162: getstatic     #85                 // Field tictactoe/GameState.O_WINS:Ltictactoe/GameState;
     165: aastore
     166: aload         5
     168: invokestatic  #89                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     171: aload_1
     172: invokestatic  #93                 // Method evaluateState:(Ljava/util/List;)Ltictactoe/GameState;
     175: invokeinterface #96,  2           // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
     180: ifeq          186
     183: goto          192
     186: iinc          2, 1
     189: goto          122
     192: aload_1
     193: invokestatic  #99                 // Method printState:(Ljava/util/List;)V
     196: return

  public static final java.util.List<java.util.List<java.lang.Character>> updateBoard(java.util.List<? extends java.util.List<java.lang.Character>>, char, kotlin.Pair<java.lang.Integer, java.lang.Integer>);
    Code:
       0: aload_0
       1: ldc           #124                // String board
       3: invokestatic  #130                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #132                // String coordinates
       9: invokestatic  #130                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_2
      13: invokevirtual #137                // Method kotlin/Pair.component1:()Ljava/lang/Object;
      16: checkcast     #139                // class java/lang/Number
      19: invokevirtual #142                // Method java/lang/Number.intValue:()I
      22: istore_3
      23: aload_2
      24: invokevirtual #145                // Method kotlin/Pair.component2:()Ljava/lang/Object;
      27: checkcast     #139                // class java/lang/Number
      30: invokevirtual #142                // Method java/lang/Number.intValue:()I
      33: istore        4
      35: aload_0
      36: checkcast     #18                 // class java/lang/Iterable
      39: astore        5
      41: iconst_0
      42: istore        6
      44: aload         5
      46: astore        7
      48: new           #20                 // class java/util/ArrayList
      51: dup
      52: aload         5
      54: bipush        10
      56: invokestatic  #26                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      59: invokespecial #30                 // Method java/util/ArrayList."<init>":(I)V
      62: checkcast     #32                 // class java/util/Collection
      65: astore        8
      67: iconst_0
      68: istore        9
      70: iconst_0
      71: istore        10
      73: aload         7
      75: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      80: astore        11
      82: aload         11
      84: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      89: ifeq          290
      92: aload         11
      94: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      99: astore        12
     101: aload         8
     103: iload         10
     105: iinc          10, 1
     108: istore        13
     110: iload         13
     112: ifge          118
     115: invokestatic  #148                // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
     118: iload         13
     120: aload         12
     122: checkcast     #58                 // class java/util/List
     125: astore        14
     127: istore        15
     129: astore        30
     131: iconst_0
     132: istore        16
     134: aload         14
     136: checkcast     #18                 // class java/lang/Iterable
     139: astore        17
     141: iconst_0
     142: istore        18
     144: aload         17
     146: astore        19
     148: new           #20                 // class java/util/ArrayList
     151: dup
     152: aload         17
     154: bipush        10
     156: invokestatic  #26                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     159: invokespecial #30                 // Method java/util/ArrayList."<init>":(I)V
     162: checkcast     #32                 // class java/util/Collection
     165: astore        20
     167: iconst_0
     168: istore        21
     170: iconst_0
     171: istore        22
     173: aload         19
     175: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     180: astore        23
     182: aload         23
     184: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     189: ifeq          271
     192: aload         23
     194: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     199: astore        24
     201: aload         20
     203: iload         22
     205: iinc          22, 1
     208: istore        25
     210: iload         25
     212: ifge          218
     215: invokestatic  #148                // Method kotlin/collections/CollectionsKt.throwIndexOverflow:()V
     218: iload         25
     220: aload         24
     222: checkcast     #150                // class java/lang/Character
     225: invokevirtual #154                // Method java/lang/Character.charValue:()C
     228: istore        26
     230: istore        27
     232: astore        28
     234: iconst_0
     235: istore        29
     237: iload         15
     239: iload_3
     240: if_icmpne     254
     243: iload         27
     245: iload         4
     247: if_icmpne     254
     250: iload_1
     251: goto          256
     254: iload         26
     256: invokestatic  #158                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     259: aload         28
     261: swap
     262: invokeinterface #56,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     267: pop
     268: goto          182
     271: aload         20
     273: checkcast     #58                 // class java/util/List
     276: nop
     277: nop
     278: aload         30
     280: swap
     281: invokeinterface #56,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     286: pop
     287: goto          82
     290: aload         8
     292: checkcast     #58                 // class java/util/List
     295: nop
     296: areturn

  public static final kotlin.Pair<java.lang.Integer, java.lang.Integer> parseCoordinates(java.util.List<? extends java.util.List<java.lang.Character>>, java.lang.String);
    Code:
       0: aload_0
       1: ldc           #124                // String board
       3: invokestatic  #130                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #179                // String input
       9: invokestatic  #130                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: nop
      13: aload_1
      14: checkcast     #10                 // class java/lang/CharSequence
      17: iconst_1
      18: anewarray     #48                 // class java/lang/String
      21: astore_3
      22: aload_3
      23: iconst_0
      24: ldc           #181                // String
      26: aastore
      27: aload_3
      28: iconst_0
      29: iconst_0
      30: bipush        6
      32: aconst_null
      33: invokestatic  #185                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      36: checkcast     #18                 // class java/lang/Iterable
      39: astore_3
      40: iconst_0
      41: istore        4
      43: aload_3
      44: astore        5
      46: new           #20                 // class java/util/ArrayList
      49: dup
      50: aload_3
      51: bipush        10
      53: invokestatic  #26                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      56: invokespecial #30                 // Method java/util/ArrayList."<init>":(I)V
      59: checkcast     #32                 // class java/util/Collection
      62: astore        6
      64: iconst_0
      65: istore        7
      67: aload         5
      69: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      74: astore        8
      76: aload         8
      78: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      83: ifeq          131
      86: aload         8
      88: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      93: astore        9
      95: aload         6
      97: aload         9
      99: checkcast     #48                 // class java/lang/String
     102: astore        10
     104: astore        12
     106: iconst_0
     107: istore        11
     109: aload         10
     111: invokestatic  #191                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     114: iconst_1
     115: isub
     116: invokestatic  #194                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     119: aload         12
     121: swap
     122: invokeinterface #56,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     127: pop
     128: goto          76
     131: aload         6
     133: checkcast     #58                 // class java/util/List
     136: nop
     137: astore_3
     138: goto          153
     141: astore        4
     143: new           #178                // class java/lang/Exception
     146: dup
     147: ldc           #196                // String You should enter numbers!
     149: invokespecial #199                // Method java/lang/Exception."<init>":(Ljava/lang/String;)V
     152: athrow
     153: aload_3
     154: astore_2
     155: aload_2
     156: iconst_0
     157: invokeinterface #203,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     162: checkcast     #139                // class java/lang/Number
     165: invokevirtual #142                // Method java/lang/Number.intValue:()I
     168: istore_3
     169: aload_2
     170: iconst_1
     171: invokeinterface #203,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     176: checkcast     #139                // class java/lang/Number
     179: invokevirtual #142                // Method java/lang/Number.intValue:()I
     182: istore        4
     184: iconst_0
     185: iload_3
     186: if_icmpgt     202
     189: iload_3
     190: iconst_3
     191: if_icmpge     198
     194: iconst_1
     195: goto          203
     198: iconst_0
     199: goto          203
     202: iconst_0
     203: ifeq          230
     206: iconst_0
     207: iload         4
     209: if_icmpgt     226
     212: iload         4
     214: iconst_3
     215: if_icmpge     222
     218: iconst_1
     219: goto          227
     222: iconst_0
     223: goto          227
     226: iconst_0
     227: ifne          240
     230: new           #178                // class java/lang/Exception
     233: dup
     234: ldc           #205                // String Coordinates should be from 1 to 3
     236: invokespecial #199                // Method java/lang/Exception."<init>":(Ljava/lang/String;)V
     239: athrow
     240: aload_0
     241: iload_3
     242: invokeinterface #203,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     247: checkcast     #58                 // class java/util/List
     250: iload         4
     252: invokeinterface #203,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     257: checkcast     #150                // class java/lang/Character
     260: invokevirtual #154                // Method java/lang/Character.charValue:()C
     263: bipush        95
     265: if_icmpeq     278
     268: new           #178                // class java/lang/Exception
     271: dup
     272: ldc           #207                // String This cell is occupied!
     274: invokespecial #199                // Method java/lang/Exception."<init>":(Ljava/lang/String;)V
     277: athrow
     278: new           #134                // class kotlin/Pair
     281: dup
     282: iload_3
     283: invokestatic  #194                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     286: iload         4
     288: invokestatic  #194                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     291: invokespecial #210                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     294: areturn
    Exception table:
       from    to  target type
          12   138   141   Class java/lang/Exception

  public static final java.util.List<java.util.List<java.lang.Character>> promptForMove(java.util.List<? extends java.util.List<java.lang.Character>>, char);
    Code:
       0: aload_0
       1: ldc           #124                // String board
       3: invokestatic  #130                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: nop
       7: ldc           #216                // String Enter the coordinates:
       9: getstatic     #222                // Field java/lang/System.out:Ljava/io/PrintStream;
      12: swap
      13: invokevirtual #228                // Method java/io/PrintStream.print:(Ljava/lang/Object;)V
      16: invokestatic  #234                // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
      19: dup
      20: invokestatic  #237                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      23: astore_2
      24: nop
      25: aload_0
      26: aload_2
      27: invokestatic  #239                // Method parseCoordinates:(Ljava/util/List;Ljava/lang/String;)Lkotlin/Pair;
      30: astore_3
      31: aload_0
      32: iload_1
      33: aload_3
      34: invokestatic  #241                // Method updateBoard:(Ljava/util/List;CLkotlin/Pair;)Ljava/util/List;
      37: areturn
      38: astore_3
      39: aload_3
      40: invokevirtual #244                // Method java/lang/Exception.getMessage:()Ljava/lang/String;
      43: getstatic     #222                // Field java/lang/System.out:Ljava/io/PrintStream;
      46: swap
      47: invokevirtual #247                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      50: goto          6
    Exception table:
       from    to  target type
          24    38    38   Class java/lang/Exception

  public static final tictactoe.GameState evaluateState(java.util.List<? extends java.util.List<java.lang.Character>>);
    Code:
       0: aload_0
       1: ldc           #124                // String board
       3: invokestatic  #130                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: checkcast     #18                 // class java/lang/Iterable
      10: astore_2
      11: iconst_0
      12: istore_3
      13: aload_2
      14: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      19: astore        4
      21: aload         4
      23: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      28: ifeq          175
      31: aload         4
      33: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      38: astore        5
      40: iload_3
      41: aload         5
      43: checkcast     #58                 // class java/util/List
      46: astore        6
      48: istore        24
      50: iconst_0
      51: istore        7
      53: aload         6
      55: checkcast     #18                 // class java/lang/Iterable
      58: astore        8
      60: iconst_0
      61: istore        9
      63: aload         8
      65: instanceof    #32                 // class java/util/Collection
      68: ifeq          88
      71: aload         8
      73: checkcast     #32                 // class java/util/Collection
      76: invokeinterface #251,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
      81: ifeq          88
      84: iconst_0
      85: goto          163
      88: iconst_0
      89: istore        10
      91: aload         8
      93: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      98: astore        11
     100: aload         11
     102: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     107: ifeq          161
     110: aload         11
     112: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     117: astore        12
     119: aload         12
     121: checkcast     #150                // class java/lang/Character
     124: invokevirtual #154                // Method java/lang/Character.charValue:()C
     127: istore        13
     129: iconst_0
     130: istore        14
     132: iload         13
     134: bipush        88
     136: if_icmpne     143
     139: iconst_1
     140: goto          144
     143: iconst_0
     144: ifeq          100
     147: iinc          10, 1
     150: iload         10
     152: ifge          100
     155: invokestatic  #254                // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V
     158: goto          100
     161: iload         10
     163: nop
     164: istore        25
     166: iload         24
     168: iload         25
     170: iadd
     171: istore_3
     172: goto          21
     175: iload_3
     176: istore_1
     177: aload_0
     178: checkcast     #18                 // class java/lang/Iterable
     181: astore_3
     182: iconst_0
     183: istore        4
     185: aload_3
     186: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     191: astore        5
     193: aload         5
     195: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     200: ifeq          349
     203: aload         5
     205: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     210: astore        6
     212: iload         4
     214: aload         6
     216: checkcast     #58                 // class java/util/List
     219: astore        7
     221: istore        24
     223: iconst_0
     224: istore        8
     226: aload         7
     228: checkcast     #18                 // class java/lang/Iterable
     231: astore        9
     233: iconst_0
     234: istore        10
     236: aload         9
     238: instanceof    #32                 // class java/util/Collection
     241: ifeq          261
     244: aload         9
     246: checkcast     #32                 // class java/util/Collection
     249: invokeinterface #251,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     254: ifeq          261
     257: iconst_0
     258: goto          336
     261: iconst_0
     262: istore        11
     264: aload         9
     266: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     271: astore        12
     273: aload         12
     275: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     280: ifeq          334
     283: aload         12
     285: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     290: astore        13
     292: aload         13
     294: checkcast     #150                // class java/lang/Character
     297: invokevirtual #154                // Method java/lang/Character.charValue:()C
     300: istore        14
     302: iconst_0
     303: istore        15
     305: iload         14
     307: bipush        79
     309: if_icmpne     316
     312: iconst_1
     313: goto          317
     316: iconst_0
     317: ifeq          273
     320: iinc          11, 1
     323: iload         11
     325: ifge          273
     328: invokestatic  #254                // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V
     331: goto          273
     334: iload         11
     336: nop
     337: istore        25
     339: iload         24
     341: iload         25
     343: iadd
     344: istore        4
     346: goto          193
     349: iload         4
     351: istore_2
     352: iload_1
     353: iload_2
     354: isub
     355: invokestatic  #260                // Method java/lang/Math.abs:(I)I
     358: iconst_1
     359: if_icmple     366
     362: getstatic     #263                // Field tictactoe/GameState.IMPOSSIBLE:Ltictactoe/GameState;
     365: areturn
     366: aload_0
     367: astore_3
     368: aload_0
     369: iconst_0
     370: invokeinterface #203,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     375: checkcast     #32                 // class java/util/Collection
     378: invokestatic  #267                // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;
     381: checkcast     #18                 // class java/lang/Iterable
     384: astore        5
     386: iconst_0
     387: istore        6
     389: aload         5
     391: astore        7
     393: new           #20                 // class java/util/ArrayList
     396: dup
     397: aload         5
     399: bipush        10
     401: invokestatic  #26                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     404: invokespecial #30                 // Method java/util/ArrayList."<init>":(I)V
     407: checkcast     #32                 // class java/util/Collection
     410: astore        8
     412: iconst_0
     413: istore        9
     415: aload         7
     417: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     422: astore        10
     424: aload         10
     426: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     431: ifeq          581
     434: aload         10
     436: checkcast     #269                // class kotlin/collections/IntIterator
     439: invokevirtual #272                // Method kotlin/collections/IntIterator.nextInt:()I
     442: istore        11
     444: aload         8
     446: iload         11
     448: istore        12
     450: astore        24
     452: iconst_0
     453: istore        13
     455: aload_0
     456: checkcast     #18                 // class java/lang/Iterable
     459: astore        14
     461: iconst_0
     462: istore        15
     464: aload         14
     466: astore        16
     468: new           #20                 // class java/util/ArrayList
     471: dup
     472: aload         14
     474: bipush        10
     476: invokestatic  #26                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     479: invokespecial #30                 // Method java/util/ArrayList."<init>":(I)V
     482: checkcast     #32                 // class java/util/Collection
     485: astore        17
     487: iconst_0
     488: istore        18
     490: aload         16
     492: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     497: astore        19
     499: aload         19
     501: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     506: ifeq          562
     509: aload         19
     511: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     516: astore        20
     518: aload         17
     520: aload         20
     522: checkcast     #58                 // class java/util/List
     525: astore        21
     527: astore        22
     529: iconst_0
     530: istore        23
     532: aload         21
     534: iload         12
     536: invokeinterface #203,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     541: checkcast     #150                // class java/lang/Character
     544: invokevirtual #154                // Method java/lang/Character.charValue:()C
     547: invokestatic  #158                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     550: aload         22
     552: swap
     553: invokeinterface #56,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     558: pop
     559: goto          499
     562: aload         17
     564: checkcast     #58                 // class java/util/List
     567: nop
     568: nop
     569: aload         24
     571: swap
     572: invokeinterface #56,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     577: pop
     578: goto          424
     581: aload         8
     583: checkcast     #58                 // class java/util/List
     586: nop
     587: astore        4
     589: iconst_2
     590: anewarray     #58                 // class java/util/List
     593: astore        6
     595: aload         6
     597: iconst_0
     598: aload_0
     599: checkcast     #32                 // class java/util/Collection
     602: invokestatic  #267                // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;
     605: checkcast     #18                 // class java/lang/Iterable
     608: astore        7
     610: istore        25
     612: astore        24
     614: iconst_0
     615: istore        8
     617: aload         7
     619: astore        9
     621: new           #20                 // class java/util/ArrayList
     624: dup
     625: aload         7
     627: bipush        10
     629: invokestatic  #26                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     632: invokespecial #30                 // Method java/util/ArrayList."<init>":(I)V
     635: checkcast     #32                 // class java/util/Collection
     638: astore        10
     640: iconst_0
     641: istore        11
     643: aload         9
     645: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     650: astore        12
     652: aload         12
     654: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     659: ifeq          722
     662: aload         12
     664: checkcast     #269                // class kotlin/collections/IntIterator
     667: invokevirtual #272                // Method kotlin/collections/IntIterator.nextInt:()I
     670: istore        13
     672: aload         10
     674: iload         13
     676: istore        14
     678: astore        26
     680: iconst_0
     681: istore        15
     683: aload_0
     684: iload         14
     686: invokeinterface #203,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     691: checkcast     #58                 // class java/util/List
     694: iload         14
     696: invokeinterface #203,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     701: checkcast     #150                // class java/lang/Character
     704: invokevirtual #154                // Method java/lang/Character.charValue:()C
     707: invokestatic  #158                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     710: aload         26
     712: swap
     713: invokeinterface #56,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     718: pop
     719: goto          652
     722: aload         10
     724: checkcast     #58                 // class java/util/List
     727: nop
     728: astore        26
     730: aload         24
     732: iload         25
     734: aload         26
     736: aastore
     737: aload         6
     739: iconst_1
     740: aload_0
     741: checkcast     #32                 // class java/util/Collection
     744: invokestatic  #267                // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;
     747: checkcast     #18                 // class java/lang/Iterable
     750: astore        7
     752: istore        25
     754: astore        24
     756: iconst_0
     757: istore        8
     759: aload         7
     761: astore        9
     763: new           #20                 // class java/util/ArrayList
     766: dup
     767: aload         7
     769: bipush        10
     771: invokestatic  #26                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     774: invokespecial #30                 // Method java/util/ArrayList."<init>":(I)V
     777: checkcast     #32                 // class java/util/Collection
     780: astore        10
     782: iconst_0
     783: istore        11
     785: aload         9
     787: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     792: astore        12
     794: aload         12
     796: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     801: ifeq          869
     804: aload         12
     806: checkcast     #269                // class kotlin/collections/IntIterator
     809: invokevirtual #272                // Method kotlin/collections/IntIterator.nextInt:()I
     812: istore        13
     814: aload         10
     816: iload         13
     818: istore        14
     820: astore        26
     822: iconst_0
     823: istore        15
     825: aload_0
     826: iload         14
     828: invokeinterface #203,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     833: checkcast     #58                 // class java/util/List
     836: aload_0
     837: invokestatic  #276                // Method kotlin/collections/CollectionsKt.getLastIndex:(Ljava/util/List;)I
     840: iload         14
     842: isub
     843: invokeinterface #203,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     848: checkcast     #150                // class java/lang/Character
     851: invokevirtual #154                // Method java/lang/Character.charValue:()C
     854: invokestatic  #158                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     857: aload         26
     859: swap
     860: invokeinterface #56,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     865: pop
     866: goto          794
     869: aload         10
     871: checkcast     #58                 // class java/util/List
     874: nop
     875: astore        26
     877: aload         24
     879: iload         25
     881: aload         26
     883: aastore
     884: aload         6
     886: invokestatic  #89                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     889: astore        5
     891: aload_3
     892: checkcast     #32                 // class java/util/Collection
     895: aload         4
     897: checkcast     #18                 // class java/lang/Iterable
     900: invokestatic  #280                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     903: checkcast     #32                 // class java/util/Collection
     906: aload         5
     908: checkcast     #18                 // class java/lang/Iterable
     911: invokestatic  #280                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     914: checkcast     #18                 // class java/lang/Iterable
     917: astore        7
     919: nop
     920: iconst_0
     921: istore        8
     923: aload         7
     925: astore        9
     927: new           #20                 // class java/util/ArrayList
     930: dup
     931: aload         7
     933: bipush        10
     935: invokestatic  #26                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     938: invokespecial #30                 // Method java/util/ArrayList."<init>":(I)V
     941: checkcast     #32                 // class java/util/Collection
     944: astore        10
     946: iconst_0
     947: istore        11
     949: aload         9
     951: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     956: astore        12
     958: aload         12
     960: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     965: ifeq          1025
     968: aload         12
     970: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     975: astore        13
     977: aload         10
     979: aload         13
     981: checkcast     #58                 // class java/util/List
     984: astore        14
     986: astore        24
     988: iconst_0
     989: istore        15
     991: aload         14
     993: checkcast     #18                 // class java/lang/Iterable
     996: ldc_w         #282                // String
     999: checkcast     #10                 // class java/lang/CharSequence
    1002: aconst_null
    1003: aconst_null
    1004: iconst_0
    1005: aconst_null
    1006: aconst_null
    1007: bipush        62
    1009: aconst_null
    1010: invokestatic  #286                // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
    1013: aload         24
    1015: swap
    1016: invokeinterface #56,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1021: pop
    1022: goto          958
    1025: aload         10
    1027: checkcast     #58                 // class java/util/List
    1030: nop
    1031: astore        6
    1033: aload         6
    1035: checkcast     #18                 // class java/lang/Iterable
    1038: astore        8
    1040: nop
    1041: iconst_0
    1042: istore        9
    1044: aload         8
    1046: astore        10
    1048: new           #20                 // class java/util/ArrayList
    1051: dup
    1052: invokespecial #288                // Method java/util/ArrayList."<init>":()V
    1055: checkcast     #32                 // class java/util/Collection
    1058: astore        11
    1060: iconst_0
    1061: istore        12
    1063: aload         10
    1065: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1070: astore        13
    1072: aload         13
    1074: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1079: ifeq          1149
    1082: aload         13
    1084: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1089: astore        14
    1091: aload         14
    1093: checkcast     #48                 // class java/lang/String
    1096: astore        15
    1098: iconst_0
    1099: istore        16
    1101: iconst_2
    1102: anewarray     #48                 // class java/lang/String
    1105: astore        17
    1107: aload         17
    1109: iconst_0
    1110: ldc_w         #290                // String XXX
    1113: aastore
    1114: aload         17
    1116: iconst_1
    1117: ldc_w         #292                // String OOO
    1120: aastore
    1121: aload         17
    1123: invokestatic  #89                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
    1126: aload         15
    1128: invokeinterface #96,  2           // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
    1133: ifeq          1072
    1136: aload         11
    1138: aload         14
    1140: invokeinterface #56,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1145: pop
    1146: goto          1072
    1149: aload         11
    1151: checkcast     #58                 // class java/util/List
    1154: nop
    1155: checkcast     #18                 // class java/lang/Iterable
    1158: astore        8
    1160: nop
    1161: iconst_0
    1162: istore        9
    1164: aload         8
    1166: astore        10
    1168: new           #20                 // class java/util/ArrayList
    1171: dup
    1172: aload         8
    1174: bipush        10
    1176: invokestatic  #26                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
    1179: invokespecial #30                 // Method java/util/ArrayList."<init>":(I)V
    1182: checkcast     #32                 // class java/util/Collection
    1185: astore        11
    1187: iconst_0
    1188: istore        12
    1190: aload         10
    1192: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1197: astore        13
    1199: aload         13
    1201: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1206: ifeq          1255
    1209: aload         13
    1211: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1216: astore        14
    1218: aload         11
    1220: aload         14
    1222: checkcast     #48                 // class java/lang/String
    1225: astore        15
    1227: astore        24
    1229: iconst_0
    1230: istore        16
    1232: aload         15
    1234: checkcast     #10                 // class java/lang/CharSequence
    1237: invokestatic  #296                // Method kotlin/text/StringsKt.first:(Ljava/lang/CharSequence;)C
    1240: invokestatic  #158                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
    1243: aload         24
    1245: swap
    1246: invokeinterface #56,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1251: pop
    1252: goto          1199
    1255: aload         11
    1257: checkcast     #58                 // class java/util/List
    1260: nop
    1261: checkcast     #18                 // class java/lang/Iterable
    1264: invokestatic  #300                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
    1267: astore        7
    1269: aload         7
    1271: invokeinterface #305,  1          // InterfaceMethod java/util/Set.size:()I
    1276: tableswitch   { // 0 to 1
                     0: 1300
                     1: 1320
               default: 1347
          }
    1300: iload_1
    1301: iload_2
    1302: iadd
    1303: bipush        9
    1305: if_icmpne     1314
    1308: getstatic     #308                // Field tictactoe/GameState.DRAW:Ltictactoe/GameState;
    1311: goto          1350
    1314: getstatic     #311                // Field tictactoe/GameState.NOT_FINISHED:Ltictactoe/GameState;
    1317: goto          1350
    1320: aload         7
    1322: bipush        88
    1324: invokestatic  #158                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
    1327: invokeinterface #312,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
    1332: ifeq          1341
    1335: getstatic     #82                 // Field tictactoe/GameState.X_WINS:Ltictactoe/GameState;
    1338: goto          1350
    1341: getstatic     #85                 // Field tictactoe/GameState.O_WINS:Ltictactoe/GameState;
    1344: goto          1350
    1347: getstatic     #263                // Field tictactoe/GameState.IMPOSSIBLE:Ltictactoe/GameState;
    1350: areturn

  public static final void printState(java.util.List<? extends java.util.List<java.lang.Character>>);
    Code:
       0: aload_0
       1: ldc           #124                // String board
       3: invokestatic  #130                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokestatic  #93                 // Method evaluateState:(Ljava/util/List;)Ltictactoe/GameState;
      10: astore_1
      11: aload_1
      12: getstatic     #350                // Field tictactoe/MainKt$WhenMappings.$EnumSwitchMapping$0:[I
      15: swap
      16: invokevirtual #353                // Method tictactoe/GameState.ordinal:()I
      19: iaload
      20: tableswitch   { // 1 to 5
                     1: 56
                     2: 62
                     3: 68
                     4: 74
                     5: 80
               default: 86
          }
      56: ldc_w         #355                // String Impossible
      59: goto          94
      62: ldc_w         #357                // String X wins
      65: goto          94
      68: ldc_w         #359                // String O wins
      71: goto          94
      74: ldc_w         #361                // String Draw
      77: goto          94
      80: ldc_w         #363                // String Game not finished
      83: goto          94
      86: new           #365                // class kotlin/NoWhenBranchMatchedException
      89: dup
      90: invokespecial #366                // Method kotlin/NoWhenBranchMatchedException."<init>":()V
      93: athrow
      94: astore_2
      95: getstatic     #222                // Field java/lang/System.out:Ljava/io/PrintStream;
      98: aload_2
      99: invokevirtual #247                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     102: return

  public static final void printBoard(java.util.List<? extends java.util.List<java.lang.Character>>);
    Code:
       0: aload_0
       1: ldc           #124                // String board
       3: invokestatic  #130                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: ldc_w         #369                // String ---------
       9: getstatic     #222                // Field java/lang/System.out:Ljava/io/PrintStream;
      12: swap
      13: invokevirtual #247                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      16: aload_0
      17: checkcast     #18                 // class java/lang/Iterable
      20: astore_1
      21: iconst_0
      22: istore_2
      23: aload_1
      24: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      29: astore_3
      30: aload_3
      31: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      36: ifeq          243
      39: aload_3
      40: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      45: astore        4
      47: aload         4
      49: checkcast     #58                 // class java/util/List
      52: astore        5
      54: iconst_0
      55: istore        6
      57: aload         5
      59: checkcast     #18                 // class java/lang/Iterable
      62: astore        7
      64: iconst_0
      65: istore        8
      67: aload         7
      69: astore        9
      71: new           #20                 // class java/util/ArrayList
      74: dup
      75: aload         7
      77: bipush        10
      79: invokestatic  #26                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      82: invokespecial #30                 // Method java/util/ArrayList."<init>":(I)V
      85: checkcast     #32                 // class java/util/Collection
      88: astore        10
      90: iconst_0
      91: istore        11
      93: aload         9
      95: invokeinterface #36,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     100: astore        12
     102: aload         12
     104: invokeinterface #42,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     109: ifeq          177
     112: aload         12
     114: invokeinterface #46,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     119: astore        13
     121: aload         10
     123: aload         13
     125: checkcast     #150                // class java/lang/Character
     128: invokevirtual #154                // Method java/lang/Character.charValue:()C
     131: istore        14
     133: astore        15
     135: iconst_0
     136: istore        16
     138: ldc_w         #371                // String XO
     141: checkcast     #10                 // class java/lang/CharSequence
     144: iload         14
     146: iconst_0
     147: iconst_2
     148: aconst_null
     149: invokestatic  #375                // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;CZILjava/lang/Object;)Z
     152: ifeq          160
     155: iload         14
     157: goto          162
     160: bipush        32
     162: invokestatic  #158                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     165: aload         15
     167: swap
     168: invokeinterface #56,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     173: pop
     174: goto          102
     177: aload         10
     179: checkcast     #58                 // class java/util/List
     182: nop
     183: astore        17
     185: new           #377                // class java/lang/StringBuilder
     188: dup
     189: invokespecial #378                // Method java/lang/StringBuilder."<init>":()V
     192: ldc_w         #380                // String |
     195: invokevirtual #384                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     198: aload         17
     200: checkcast     #18                 // class java/lang/Iterable
     203: ldc           #181                // String
     205: checkcast     #10                 // class java/lang/CharSequence
     208: aconst_null
     209: aconst_null
     210: iconst_0
     211: aconst_null
     212: aconst_null
     213: bipush        62
     215: aconst_null
     216: invokestatic  #286                // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
     219: invokevirtual #384                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     222: ldc_w         #386                // String  |
     225: invokevirtual #384                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     228: invokevirtual #389                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     231: getstatic     #222                // Field java/lang/System.out:Ljava/io/PrintStream;
     234: swap
     235: invokevirtual #247                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     238: nop
     239: nop
     240: goto          30
     243: nop
     244: ldc_w         #369                // String ---------
     247: getstatic     #222                // Field java/lang/System.out:Ljava/io/PrintStream;
     250: swap
     251: invokevirtual #247                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     254: return

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