// File: /workspace/github_cpp_makefile_star2_O2/SethKasmann[P]clever-girl/src/uci.cpp
// Function: go(std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char>>&, State&)
void go(std::istringstream & is, State & s)
{
    std::string token;
    SearchInfo search_info;
    Move m;

    while (is >> token)
    {
        if (token == "searchmoves")
        {
            while (is >> token)
            {
                m = get_uci_move(token, s);
                if (m != nullMove)
                    search_info.sm.push_back(m);
                else
                {
                    std::cout << "illegal move found: " << token << '\n';
                    return;
                }
            }
        }
        else if (token == "ponder")
            search_info.ponder = true;
        else if (token == "wtime")
            is >> search_info.time[white];
        else if (token == "btime")
            is >> search_info.time[black];
        else if (token == "winc")
            is >> search_info.inc[white];
        else if (token == "binc")
            is >> search_info.inc[black];
        else if (token == "movestogo")
            is >> search_info.moves_to_go;
        else if (token == "depth")
            is >> search_info.depth;
        else if (token == "nodes")
            is >> search_info.max_nodes;
        else if (token == "mate")
            is >> search_info.mate;
        else if (token == "movetime")
            is >> search_info.moveTime;
        else if (token == "infinite")
            search_info.infinite = true;
    }

    search_info.clock.set();
    if (!search_info.moveTime)
        search_info.moveTime = allocate_time(search_info.time[s.getOurColor()], 
                                              history.size() / 2, 
                                              search_info.moves_to_go);
    setup_search(s, search_info);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r14
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq 0x24(%rsp), %rdx
xorps %xmm0, %xmm0
movaps %xmm0, -0x14(%rdx)
movabsq $0x3200000000, %rcx     # imm = 0x3200000000
movq %rcx, -0x4(%rdx)
leaq 0x20(%rsp), %rcx
andq $0x0, 0xc(%rcx)
movq %rdi, %r15
xorl %ecx, %ecx
leaq 0x38(%rsp), %rdx
movb %cl, 0x12(%rdx)
leaq 0x50(%rsp), %rbx
andq $0x0, 0x10(%rbx)
movb %cl, (%rax)
movaps %xmm0, (%rbx)
movups %xmm0, -0x18(%rbx)
movb %cl, -0x8(%rbx)
leaq 0x68(%rsp), %r13
leaq 0x6706(%rip), %rbp      # 0x1b3d8
leaq 0xe(%rsp), %r12
movq %r15, %rdi
movq %r13, %rsi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x14ec9
movq %r13, %rdi
movq %rbp, %rsi
callq 0x1270d
testb %al, %al
je 0x14d42
movq %r15, %rdi
movq %r13, %rsi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x14cd7
movq %r13, %rdi
movq %r14, %rsi
callq 0x14b84
movw %ax, 0xe(%rsp)
testw %ax, %ax
je 0x14e7a
movq %rbx, %rdi
movq %r12, %rsi
callq 0x15530
jmp 0x14d03
movq %r13, %rdi
leaq 0x66ad(%rip), %rsi      # 0x1b3f9
callq 0x1270d
testb %al, %al
je 0x14d5f
movb $0x1, 0x49(%rsp)
jmp 0x14cd7
movq %r13, %rdi
leaq 0x6697(%rip), %rsi      # 0x1b400
callq 0x1270d
leaq 0x10(%rsp), %rsi
testb %al, %al
jne 0x14e27
movq %r13, %rdi
leaq 0x6681(%rip), %rsi      # 0x1b406
callq 0x1270d
leaq 0x14(%rsp), %rsi
testb %al, %al
jne 0x14e27
movq %r13, %rdi
leaq 0x666b(%rip), %rsi      # 0x1b40c
callq 0x1270d
leaq 0x18(%rsp), %rsi
testb %al, %al
jne 0x14e27
movq %r13, %rdi
leaq 0x6658(%rip), %rsi      # 0x1b411
callq 0x1270d
leaq 0x1c(%rsp), %rsi
testb %al, %al
jne 0x14e27
movq %r13, %rdi
leaq 0x6645(%rip), %rsi      # 0x1b416
callq 0x1270d
leaq 0x20(%rsp), %rsi
testb %al, %al
jne 0x14e27
movq %r13, %rdi
leaq 0x6637(%rip), %rsi      # 0x1b420
callq 0x1270d
leaq 0x24(%rsp), %rsi
testb %al, %al
jne 0x14e27
movq %r13, %rdi
leaq 0x6625(%rip), %rsi      # 0x1b426
callq 0x1270d
leaq 0x28(%rsp), %rsi
testb %al, %al
jne 0x14e27
movq %r13, %rdi
leaq 0x6613(%rip), %rsi      # 0x1b42c
callq 0x1270d
leaq 0x34(%rsp), %rsi
testb %al, %al
je 0x14e34
movq %r15, %rdi
callq 0x4160
jmp 0x14cd7
movq %r13, %rdi
leaq 0x65f3(%rip), %rsi      # 0x1b431
callq 0x1270d
testb %al, %al
je 0x14e59
movq %r15, %rdi
leaq 0x38(%rsp), %rsi
callq 0x4270
jmp 0x14cd7
movq %r13, %rdi
leaq 0x65d7(%rip), %rsi      # 0x1b43a
callq 0x1270d
testb %al, %al
je 0x14cd7
movb $0x1, 0x48(%rsp)
jmp 0x14cd7
movq 0xe117(%rip), %rdi      # 0x22f98
leaq 0x655c(%rip), %rsi      # 0x1b3e4
callq 0x4240
leaq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0x41e0
pushq $0xa
popq %rsi
movq %rax, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x148dc
leaq 0x68(%rsp), %rdi
callq 0x4418
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4050
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0x14f02
movl (%r14), %eax
movl 0x10(%rsp,%rax,4), %edi
leaq 0x1d37c7(%rip), %rax    # 0x1e86b0
movq 0x8(%rax), %rsi
subq (%rax), %rsi
shrq $0x5, %rsi
movl 0x20(%rsp), %edx
callq 0x15550
movq %rax, 0x38(%rsp)
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x125ce
jmp 0x14ea5
jmp 0x14f15
jmp 0x14f15
movq %rax, %r14
movq %rbx, %rdi
callq 0x148dc
leaq 0x68(%rsp), %rdi
callq 0x4418
movq %r14, %rdi
callq 0x43d0