// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x44(%rsp), %rdx
xorps %xmm0, %xmm0
movaps %xmm0, -0x14(%rdx)
movabsq $0x3200000000, %rcx     # imm = 0x3200000000
movq %rcx, -0x4(%rdx)
movq %rax, 0x8(%rdx)
leaq 0x58(%rsp), %rcx
movb %al, 0x12(%rcx)
leaq 0x70(%rsp), %r12
movaps %xmm0, (%r12)
movq %rax, 0x10(%r12)
movups %xmm0, -0x18(%r12)
movb %al, -0x8(%r12)
leaq 0x10(%rsp), %r13
leaq 0x6fa9(%rip), %rbp      # 0x204b8
leaq 0xc(%rsp), %r15
movq %r14, %rdi
movq %r13, %rsi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x19782
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4090
testl %eax, %eax
je 0x196b0
movq %r13, %rdi
leaq 0x6f8b(%rip), %rsi      # 0x204d9
callq 0x4090
testl %eax, %eax
je 0x196db
movq %r13, %rdi
leaq 0x6f7b(%rip), %rsi      # 0x204e0
callq 0x4090
leaq 0x30(%rsp), %rsi
testl %eax, %eax
je 0x196ce
movq %r13, %rdi
leaq 0x6f65(%rip), %rsi      # 0x204e6
callq 0x4090
leaq 0x34(%rsp), %rsi
testl %eax, %eax
je 0x196ce
movq %r13, %rdi
leaq 0x6f4f(%rip), %rsi      # 0x204ec
callq 0x4090
leaq 0x38(%rsp), %rsi
testl %eax, %eax
je 0x196ce
movq %r13, %rdi
leaq 0x6f38(%rip), %rsi      # 0x204f1
callq 0x4090
leaq 0x3c(%rsp), %rsi
testl %eax, %eax
je 0x196ce
movq %r13, %rdi
leaq 0x6f21(%rip), %rsi      # 0x204f6
callq 0x4090
leaq 0x40(%rsp), %rsi
testl %eax, %eax
je 0x196ce
movq %r13, %rdi
leaq 0x6f0f(%rip), %rsi      # 0x20500
callq 0x4090
leaq 0x44(%rsp), %rsi
testl %eax, %eax
je 0x196ce
movq %r13, %rdi
leaq 0x6ef9(%rip), %rsi      # 0x20506
callq 0x4090
leaq 0x48(%rsp), %rsi
testl %eax, %eax
je 0x196ce
movq %r13, %rdi
leaq 0x6ee3(%rip), %rsi      # 0x2050c
callq 0x4090
leaq 0x54(%rsp), %rsi
testl %eax, %eax
je 0x196ce
movq %r13, %rdi
leaq 0x6ecc(%rip), %rsi      # 0x20511
callq 0x4090
testl %eax, %eax
je 0x196e5
movq %r13, %rdi
leaq 0x6ebe(%rip), %rsi      # 0x2051a
callq 0x4090
testl %eax, %eax
jne 0x19514
movb $0x1, 0x68(%rsp)
jmp 0x19514
movq %r13, %rdi
movq %rbx, %rsi
callq 0x19374
movw %ax, 0xc(%rsp)
testw %ax, %ax
je 0x196f7
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0x196a5
movw %ax, (%rsi)
addq $0x2, %rsi
movq %rsi, 0x78(%rsp)
jmp 0x196b0
movq %r12, %rdi
movq %r15, %rdx
callq 0x1a314
movq %r14, %rdi
movq %r13, %rsi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x19673
jmp 0x19514
movq %r14, %rdi
callq 0x4140
jmp 0x19514
movb $0x1, 0x69(%rsp)
jmp 0x19514
movq %r14, %rdi
leaq 0x58(%rsp), %rsi
callq 0x4260
jmp 0x19514
movq 0xb8a2(%rip), %rdi      # 0x24fa0
leaq 0x6dbf(%rip), %rsi      # 0x204c4
movl $0x14, %edx
callq 0x4290
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0xb880(%rip), %rdi      # 0x24fa0
callq 0x4290
leaq 0xf(%rsp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x4290
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x19754
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4250
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x19770
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4250
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4060
movq %rax, 0x60(%rsp)
cmpq $0x0, 0x58(%rsp)
jne 0x19804
movl (%rbx), %eax
leaq 0x140f03(%rip), %rcx    # 0x15a6a0
movq 0x8(%rcx), %rdx
subq (%rcx), %rdx
shrq $0x5, %rdx
movl 0x40(%rsp), %ecx
cmpl $0xa, %edx
movl $0xa, %esi
cmovll %edx, %esi
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
divsd 0x6ce2(%rip), %xmm0     # 0x204a8
addsd 0x6ce2(%rip), %xmm0     # 0x204b0
cvtsd2ss %xmm0, %xmm0
testl %ecx, %ecx
movl $0x1e, %esi
cmovnel %ecx, %esi
movl 0x30(%rsp,%rax,4), %eax
cltd
idivl %esi
cvtsi2ss %eax, %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %rax
cmpq $0x1f5, %rax            # imm = 0x1F5
movl $0x1f4, %ecx            # imm = 0x1F4
cmovgeq %rax, %rcx
movq %rcx, 0x58(%rsp)
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x1631a
jmp 0x1973a
jmp 0x1981a
jmp 0x1981a
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x19837
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4250
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x19853
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4250
movq %rbx, %rdi
callq 0x43b0