// File: /workspace/github_cpp_makefile_star2_O3/cpirc[P]Monochrome/src/uci.cpp
// Function: UCI::go(std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char>>&)
void go(std::stringstream& ss) {
    sc.max_depth = MAX_PLY;
    sc.moves_per_session = 0;
    sc.increment = 0;
    sc.search_start_time = 0;
    sc.search_end_time = 0;
    sc.movetime = 0;

    int wtime = -1;
    int btime = -1;
    int winc = -1;
    int binc = -1;

    std::string word;
    while (ss >> word) {
        if (word == "wtime") {
            ss >> wtime;
        } else if (word == "btime") {
            ss >> btime;
        } else if (word == "winc") {
            ss >> winc;
        } else if (word == "binc") {
            ss >> binc;
        } else if (word == "depth") {
            ss >> sc.max_depth;
        } else if (word == "movetime") {
            ss >> sc.movetime;
        } else if (word == "movestogo") {
            ss >> sc.moves_per_session;
        }
    }

    if (sc.pos.flipped) {
        sc.our_clock = btime;
        sc.increment = binc;
    } else {
        sc.our_clock = wtime;
        sc.increment = winc;
    }

    std::thread search(start_search, std::ref(sc));
    search.detach();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movl $0x40, 0x249cd9(%rip)   # 0x253ab0
xorl %eax, %eax
movq %rax, 0x249cf8(%rip)    # 0x253ad8
xorps %xmm0, %xmm0
movups %xmm0, 0x249cca(%rip)   # 0x253ab4
movups %xmm0, 0x249ccf(%rip)   # 0x253ac0
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
leaq -0x44(%rbp), %r13
movl %ecx, (%r13)
leaq -0x34(%rbp), %rdx
movl %ecx, (%rdx)
leaq -0x30(%rbp), %rdx
movl %ecx, (%rdx)
leaq -0x2c(%rbp), %rdx
movl %ecx, (%rdx)
leaq -0x58(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
leaq -0x68(%rbp), %r14
leaq 0x3654(%rip), %r15      # 0xd47e
leaq 0x3653(%rip), %r12      # 0xd484
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3200
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x9f22
movq %r14, %rdi
movq %r15, %rsi
callq 0x3070
movq %r13, %rsi
testl %eax, %eax
je 0x9f01
movq %r14, %rdi
movq %r12, %rsi
callq 0x3070
leaq -0x34(%rbp), %rsi
testl %eax, %eax
je 0x9f01
movq %r14, %rdi
leaq 0x3605(%rip), %rsi      # 0xd48a
callq 0x3070
leaq -0x30(%rbp), %rsi
testl %eax, %eax
je 0x9f01
movq %r14, %rdi
leaq 0x35f3(%rip), %rsi      # 0xd48f
callq 0x3070
leaq -0x2c(%rbp), %rsi
testl %eax, %eax
je 0x9f01
movq %r14, %rdi
leaq 0x35e1(%rip), %rsi      # 0xd494
callq 0x3070
leaq 0x249bf1(%rip), %rsi    # 0x253ab0
testl %eax, %eax
je 0x9ef4
movq %r14, %rdi
leaq 0x35cd(%rip), %rsi      # 0xd49a
callq 0x3070
testl %eax, %eax
je 0x9f0e
movq %r14, %rdi
leaq 0x35c3(%rip), %rsi      # 0xd4a3
callq 0x3070
leaq 0x249bc8(%rip), %rsi    # 0x253ab4
testl %eax, %eax
jne 0x9e31
movq %rbx, %rdi
callq 0x32c0
jmp 0x9e31
movq %rbx, %rdi
callq 0x30e0
jmp 0x9e31
movq %rbx, %rdi
leaq 0x249bc0(%rip), %rsi    # 0x253ad8
callq 0x31d0
jmp 0x9e31
leaq 0x249b1f(%rip), %rax    # 0x253a48
cmpb $0x0, 0x249b59(%rip)    # 0x253a89
leaq -0x34(%rbp), %rcx
leaq -0x44(%rbp), %rdx
cmovneq %rcx, %rdx
movslq (%rdx), %rcx
movq %rcx, 0x249b8a(%rip)    # 0x253ad0
leaq -0x2c(%rbp), %rcx
leaq -0x30(%rbp), %rdx
cmovneq %rcx, %rdx
movslq (%rdx), %rcx
movq %rcx, 0x249b5c(%rip)    # 0x253ab8
leaq -0x70(%rbp), %rdx
movq %rax, (%rdx)
leaq -0x224d(%rip), %rsi     # 0x7d1d
leaq -0x40(%rbp), %rdi
callq 0xa6bc
leaq -0x40(%rbp), %rdi
callq 0x32b0
cmpq $0x0, -0x40(%rbp)
jne 0x9fab
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x9f95
callq 0x31a0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, -0x40(%rbp)
je 0x9fb2
callq 0x3060
jmp 0x9fb2
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x9fc7
callq 0x31a0
movq %rbx, %rdi
callq 0x32d0