// File: /workspace/github_cpp_makefile_star2_O1/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 0x14b182(%rip), %rsi    # 0x164e20
leaq 0x200(%rsp), %rdi
callq 0x16640
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
xorl %ecx, %ecx
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
movq 0xb2b6(%rip), %rax      # 0x24f88
movq (%rax), %rdi
xorl %esi, %esi
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x4030
movq 0xb2f6(%rip), %r14      # 0x24fe0
leaq 0x60(%rsp), %r12
leaq 0x80(%rsp), %r13
leaq 0x40(%rsp), %rbp
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4230
movsbl %al, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x43d0
movq %r13, %rdi
movq %r12, %rbx
movq %r12, %rsi
movl $0x8, %edx
callq 0x4370
movq 0x80(%rsp), %rax
movq -0x18(%rax), %rax
orl $0x1000, 0x98(%rsp,%rax) # imm = 0x1000
movq %r13, %rdi
movq %rbp, %rsi
callq 0x42b0
movq %rbp, %rdi
leaq 0x45e3(%rip), %rsi      # 0x1e340
callq 0x4090
testl %eax, %eax
je 0x1a041
movl %eax, %r12d
movq %rbp, %rdi
leaq 0x67d4(%rip), %rsi      # 0x2054b
callq 0x4090
testl %eax, %eax
je 0x19ded
movq %rbp, %rdi
leaq 0x67d1(%rip), %rsi      # 0x2055b
callq 0x4090
testl %eax, %eax
je 0x19dff
movq %rbp, %rdi
leaq 0x6826(%rip), %rsi      # 0x205c3
callq 0x4090
testl %eax, %eax
je 0x19f40
movq %rbp, %rdi
leaq 0x681f(%rip), %rsi      # 0x205d3
callq 0x4090
testl %eax, %eax
je 0x1a02c
movq %rbp, %rdi
leaq 0x6732(%rip), %rsi      # 0x204fd
callq 0x4090
testl %eax, %eax
jne 0x19f13
movq %r13, %rdi
leaq 0x200(%rsp), %rsi
callq 0x1949b
jmp 0x19f13
movl $0x7, %r15d
leaq 0x6759(%rip), %rsi      # 0x20553
jmp 0x19ed2
movl $0x13, %edx
movq 0xb195(%rip), %rdi      # 0x24fa0
leaq 0x674d(%rip), %rsi      # 0x2055f
callq 0x4290
movq 0xb182(%rip), %rcx      # 0x24fa0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x4230
movsbl %al, %esi
movq 0xb164(%rip), %rdi      # 0x24fa0
callq 0x4040
movq %rax, %rdi
callq 0x4170
movq %rax, %r15
movl $0x16, %edx
movq %rax, %rdi
leaq 0x6718(%rip), %rsi      # 0x20573
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4230
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4170
movq %rax, %r15
movl $0x32, %edx
movq %rax, %rdi
leaq 0x66f1(%rip), %rsi      # 0x2058a
callq 0x4290
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4230
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movl $0x5, %r15d
movq %rax, %rdi
callq 0x4170
leaq 0x66eb(%rip), %rsi      # 0x205bd
movq 0xb0c7(%rip), %rdi      # 0x24fa0
movq %r15, %rdx
callq 0x4290
movq 0xb0b8(%rip), %rcx      # 0x24fa0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x4230
movsbl %al, %esi
movq 0xb09a(%rip), %rdi      # 0x24fa0
callq 0x4040
movq %rax, %rdi
callq 0x4170
movq %r13, %rdi
movq 0xb07b(%rip), %rsi      # 0x24f98
callq 0x42f0
leaq 0xf8(%rsp), %rdi
callq 0x40c0
testl %r12d, %r12d
movq %rbx, %r12
jne 0x19cfc
jmp 0x1a062
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x28(%rsp)
movb %cl, 0x30(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rcx, 0x8(%rsp)
movb %cl, 0x10(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x42b0
movq %r13, %rdi
movq %rbp, %rsi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x19fc6
movq %rbp, %rdi
leaq 0x6638(%rip), %rsi      # 0x205cd
callq 0x4090
testl %eax, %eax
je 0x19fc6
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x40b0
jmp 0x19f72
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq %rsp, %rdi
callq 0x40b0
movq %r13, %rdi
movq %rbp, %rsi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x19fb4
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x19b96
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1a007
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4250
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x19f13
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4250
jmp 0x19f13
movq %r13, %rdi
leaq 0x200(%rsp), %rsi
callq 0x1985b
jmp 0x19f13
movq 0xaf50(%rip), %rsi      # 0x24f98
leaq 0x80(%rsp), %rdi
callq 0x42f0
leaq 0xf8(%rsp), %rdi
callq 0x40c0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1a07e
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4250
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x1a09a
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4250
addq $0x708, %rsp            # imm = 0x708
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1a0bc
jmp 0x1a0b0
movq %rax, %rbx
jmp 0x1a117
jmp 0x1a0bc
movq %rax, %rbx
jmp 0x1a0f6
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1a0da
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4250
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x1a0f6
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4250
movq 0xae9b(%rip), %rsi      # 0x24f98
leaq 0x80(%rsp), %rdi
callq 0x42f0
leaq 0xf8(%rsp), %rdi
callq 0x40c0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1a133
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4250
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x1a14f
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4250
movq %rbx, %rdi
callq 0x43b0
nop