// File: /workspace/github_cpp_makefile_star2_O2/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, 0x253b4c(%rip)   # 0x25b6d8
andq $0x0, 0x253b6c(%rip)    # 0x25b700
xorps %xmm0, %xmm0
movups %xmm0, 0x253b3e(%rip)   # 0x25b6dc
movups %xmm0, 0x253b43(%rip)   # 0x25b6e8
leaq -0x44(%rbp), %r13
orl $-0x1, (%r13)
leaq -0x34(%rbp), %rax
orl $-0x1, (%rax)
leaq -0x30(%rbp), %rax
orl $-0x1, (%rax)
leaq -0x2c(%rbp), %rax
orl $-0x1, (%rax)
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x70(%rbp), %r14
leaq 0x3840(%rip), %r15      # 0xb41e
leaq 0x383f(%rip), %r12      # 0xb424
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7ccd
movq %r14, %rdi
movq %r15, %rsi
callq 0x3977
movq %r13, %rsi
testb %al, %al
jne 0x7c55
movq %r14, %rdi
movq %r12, %rsi
callq 0x3977
leaq -0x34(%rbp), %rsi
testb %al, %al
jne 0x7c55
movq %r14, %rdi
leaq 0x37f9(%rip), %rsi      # 0xb42a
callq 0x3977
leaq -0x30(%rbp), %rsi
testb %al, %al
jne 0x7c55
movq %r14, %rdi
leaq 0x37e7(%rip), %rsi      # 0xb42f
callq 0x3977
leaq -0x2c(%rbp), %rsi
testb %al, %al
je 0x7c5f
movq %rbx, %rdi
callq 0x20f0
jmp 0x7be5
movq %r14, %rdi
leaq 0x37cb(%rip), %rsi      # 0xb434
callq 0x3977
leaq 0x253a63(%rip), %rsi    # 0x25b6d8
testb %al, %al
je 0x7c86
movq %rbx, %rdi
callq 0x2280
jmp 0x7be5
movq %r14, %rdi
leaq 0x37aa(%rip), %rsi      # 0xb43a
callq 0x3977
testb %al, %al
je 0x7cad
movq %rbx, %rdi
leaq 0x253a5d(%rip), %rsi    # 0x25b700
callq 0x21b0
jmp 0x7be5
movq %r14, %rdi
leaq 0x378c(%rip), %rsi      # 0xb443
callq 0x3977
leaq 0x253a19(%rip), %rsi    # 0x25b6dc
testb %al, %al
je 0x7be5
jmp 0x7c79
leaq 0x25399c(%rip), %rax    # 0x25b670
cmpb $0x0, 0x2539d6(%rip)    # 0x25b6b1
leaq -0x34(%rbp), %rcx
leaq -0x44(%rbp), %rdx
cmovneq %rcx, %rdx
movslq (%rdx), %rcx
movq %rcx, 0x253a07(%rip)    # 0x25b6f8
leaq -0x2c(%rbp), %rcx
leaq -0x30(%rbp), %rdx
cmovneq %rcx, %rdx
movslq (%rdx), %rcx
movq %rcx, 0x2539d9(%rip)    # 0x25b6e0
leaq -0x50(%rbp), %rdx
movq %rax, (%rdx)
leaq -0x1a8e(%rip), %rsi     # 0x6287
leaq -0x40(%rbp), %rdi
callq 0x8288
leaq -0x40(%rbp), %rdi
callq 0x2270
leaq -0x40(%rbp), %rdi
callq 0x8302
leaq -0x70(%rbp), %rdi
callq 0x20a0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x8302
jmp 0x7d5b
jmp 0x7d58
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2290