// File: /workspace/github_cpp_makefile_star2_O2/SethKasmann[P]clever-girl/src/uci.cpp
// Function: uci()
void uci()
{
    State root(Start_fen);
    std::string command, token;

    std::setvbuf(stdin, NULL, _IONBF, 0);

    while (1)
    {
        std::getline(std::cin, command);
        std::istringstream is(command);
        is >> std::skipws >> token;

        if (token == "quit")
            break;
        else if (token == "isready")
            std::cout << "readyok" << std::endl;
        else if (token == "uci")
        {
            std::cout << "id name Clever Girl" << std::endl
                      << "id author Seth Kasmann" << std::endl
                      << "option name Hash type spin default 1 min 1 max 128" << std::endl;
            std::cout << "uciok" << std::endl;
        }
        else if (token == "setoption")
        {
            std::string name, value;

            is >> token;
            while (is >> token && token != "value")
                name += token;
            while (is >> token)
                value += token;

            set_option(name, value);
        }
        else if (token == "position")
            position(is, root);
        else if (token == "go")
            go(is, root);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x708, %rsp            # imm = 0x708
leaq 0x23dc17(%rip), %rsi    # 0x252e30
leaq 0x200(%rsp), %rdi
callq 0x12a50
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %edx, %edx
leaq 0x50(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %dl, (%rax)
movb %dl, (%rcx)
movq 0xdd39(%rip), %rax      # 0x22f88
movq (%rax), %rdi
pushq $0x2
popq %rdx
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x4030
leaq 0x60(%rsp), %r15
leaq 0x80(%rsp), %r12
leaq 0x40(%rsp), %r13
leaq 0x6276(%rip), %r14      # 0x1b4ed
leaq 0x20(%rsp), %rbp
movq %rsp, %rbx
movq 0xdd5a(%rip), %rdi      # 0x22fe0
movq %r15, %rsi
callq 0x4060
movq %r12, %rdi
movq %r15, %rsi
pushq $0x8
popq %rdx
callq 0x4390
movq 0x80(%rsp), %rax
movq -0x18(%rax), %rax
orl $0x1000, 0x98(%rsp,%rax) # imm = 0x1000
movq %r12, %rdi
movq %r13, %rsi
callq 0x42b0
movq %r13, %rdi
leaq 0x3fa8(%rip), %rsi      # 0x19270
callq 0x1270d
testb %al, %al
jne 0x1548b
movq %r13, %rdi
leaq 0x618c(%rip), %rsi      # 0x1b46b
callq 0x1270d
leaq 0x6188(%rip), %rsi      # 0x1b473
testb %al, %al
jne 0x15352
movq %r13, %rdi
leaq 0x6182(%rip), %rsi      # 0x1b47b
callq 0x1270d
testb %al, %al
je 0x15373
movq 0xdc8f(%rip), %rdi      # 0x22f98
leaq 0x616f(%rip), %rsi      # 0x1b47f
callq 0x4240
movq %rax, %rdi
callq 0x4120
movq %rax, %rdi
leaq 0x616c(%rip), %rsi      # 0x1b493
callq 0x4240
movq %rax, %rdi
callq 0x4120
movq %rax, %rdi
leaq 0x616c(%rip), %rsi      # 0x1b4aa
callq 0x4240
movq %rax, %rdi
callq 0x4120
leaq 0x618b(%rip), %rsi      # 0x1b4dd
movq 0xdc3f(%rip), %rdi      # 0x22f98
callq 0x4240
movq %rax, %rdi
callq 0x4120
movq %r12, %rdi
callq 0x4110
jmp 0x1527f
movq %r13, %rdi
leaq 0x6166(%rip), %rsi      # 0x1b4e3
callq 0x1270d
testb %al, %al
je 0x15437
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
andq $0x0, 0x28(%rsp)
xorl %eax, %eax
movb %al, 0x30(%rsp)
leaq 0x10(%rsp), %rcx
movq %rcx, (%rsp)
andq $0x0, 0x8(%rsp)
movb %al, 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x42b0
movq %r12, %rdi
movq %r13, %rsi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x153fe
movq %r13, %rdi
movq %r14, %rsi
callq 0x15630
testb %al, %al
je 0x153fe
movq %rbp, %rdi
movq %r13, %rsi
callq 0x43f0
jmp 0x153be
movq %rbx, %rdi
movq %r13, %rsi
callq 0x43f0
movq %r12, %rdi
movq %r13, %rsi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x153f3
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x15197
movq %rbx, %rdi
callq 0x4418
movq %rbp, %rdi
callq 0x4418
jmp 0x15366
movq %r13, %rdi
leaq 0x60b2(%rip), %rsi      # 0x1b4f3
callq 0x1270d
testb %al, %al
je 0x1545f
movq %r12, %rdi
leaq 0x200(%rsp), %rsi
callq 0x14f32
jmp 0x15366
movq %r13, %rdi
leaq 0x5fb4(%rip), %rsi      # 0x1b41d
callq 0x1270d
testb %al, %al
je 0x15366
movq %r12, %rdi
leaq 0x200(%rsp), %rsi
callq 0x14c5d
jmp 0x15366
leaq 0x80(%rsp), %rdi
callq 0x4110
leaq 0x40(%rsp), %rdi
callq 0x4418
leaq 0x60(%rsp), %rdi
callq 0x4418
addq $0x708, %rsp            # imm = 0x708
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x154ce
jmp 0x154c2
movq %rax, %rbx
jmp 0x154f0
jmp 0x154ce
movq %rax, %rbx
jmp 0x154e3
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4418
leaq 0x20(%rsp), %rdi
callq 0x4418
leaq 0x80(%rsp), %rdi
callq 0x4110
leaq 0x40(%rsp), %rdi
callq 0x4418
leaq 0x60(%rsp), %rdi
callq 0x4418
movq %rbx, %rdi
callq 0x43d0