// File: /workspace/github_cpp_makefile_star2_O1/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, 0x253673(%rip)   # 0x25d6f8
xorl %eax, %eax
movq %rax, 0x253692(%rip)    # 0x25d720
xorps %xmm0, %xmm0
movups %xmm0, 0x253664(%rip)   # 0x25d6fc
movups %xmm0, 0x253669(%rip)   # 0x25d708
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 0x3466(%rip), %r15      # 0xd53e
leaq 0x3465(%rip), %r12      # 0xd544
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3200
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xa1d0
movq %r14, %rdi
movq %r15, %rsi
callq 0x3070
movq %r13, %rsi
testl %eax, %eax
je 0xa1af
movq %r14, %rdi
movq %r12, %rsi
callq 0x3070
leaq -0x34(%rbp), %rsi
testl %eax, %eax
je 0xa1af
movq %r14, %rdi
leaq 0x3417(%rip), %rsi      # 0xd54a
callq 0x3070
leaq -0x30(%rbp), %rsi
testl %eax, %eax
je 0xa1af
movq %r14, %rdi
leaq 0x3405(%rip), %rsi      # 0xd54f
callq 0x3070
leaq -0x2c(%rbp), %rsi
testl %eax, %eax
je 0xa1af
movq %r14, %rdi
leaq 0x33f3(%rip), %rsi      # 0xd554
callq 0x3070
leaq 0x25358b(%rip), %rsi    # 0x25d6f8
testl %eax, %eax
je 0xa1a2
movq %r14, %rdi
leaq 0x33df(%rip), %rsi      # 0xd55a
callq 0x3070
testl %eax, %eax
je 0xa1bc
movq %r14, %rdi
leaq 0x33d5(%rip), %rsi      # 0xd563
callq 0x3070
leaq 0x253562(%rip), %rsi    # 0x25d6fc
testl %eax, %eax
jne 0xa0df
movq %rbx, %rdi
callq 0x32c0
jmp 0xa0df
movq %rbx, %rdi
callq 0x30e0
jmp 0xa0df
movq %rbx, %rdi
leaq 0x25355a(%rip), %rsi    # 0x25d720
callq 0x31d0
jmp 0xa0df
leaq 0x2534b9(%rip), %rax    # 0x25d690
cmpb $0x0, 0x2534f3(%rip)    # 0x25d6d1
leaq -0x34(%rbp), %rcx
leaq -0x44(%rbp), %rdx
cmovneq %rcx, %rdx
movslq (%rdx), %rcx
movq %rcx, 0x253524(%rip)    # 0x25d718
leaq -0x2c(%rbp), %rcx
leaq -0x30(%rbp), %rdx
cmovneq %rcx, %rdx
movslq (%rdx), %rcx
movq %rcx, 0x2534f6(%rip)    # 0x25d700
leaq -0x70(%rbp), %rdx
movq %rax, (%rdx)
leaq -0x2279(%rip), %rsi     # 0x7f9f
leaq -0x40(%rbp), %rdi
callq 0xa932
leaq -0x40(%rbp), %rdi
callq 0x32b0
cmpq $0x0, -0x40(%rbp)
jne 0xa259
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xa243
callq 0x31a0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, -0x40(%rbp)
je 0xa260
callq 0x3060
jmp 0xa260
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xa275
callq 0x31a0
movq %rbx, %rdi
callq 0x32d0