// File: /workspace/github_cpp_makefile_star2_O3/codeandkey[P]neocortex/src/search.cpp
// Function: neocortex::search::Search::go(std::function<void (neocortex::search::SearchInfo)>, std::function<void (neocortex::Move)>, int, int, int, int, int, int, bool)
void search::Search::go(std::function<void(SearchInfo)> info, std::function<void(Move)> bestmove, int wtime, int btime, int winc, int binc, int depth, int movetime, bool infinite) {
	stop();

	this->wtime = wtime;
	this->btime = btime;
	this->winc = winc;
	this->binc = binc;
	this->depth = depth;
	this->movetime = movetime;
	this->infinite = infinite;

	/* Start main search thread. */
	control_should_stop = false;
	control_thread = std::thread([=] { control_worker(root, info, bestmove); });
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %r8d, %ebp
movl %ecx, %r14d
movq %rdx, 0x28(%rsp)
movq %rdi, %r13
movb 0xc8(%rsp), %al
movl 0xc0(%rsp), %ecx
movl 0xb8(%rsp), %r12d
movl 0xb0(%rsp), %ebx
leaq 0x81a0(%rdi), %r15
cmpq $0x0, 0x81a0(%rdi)
je 0x10096
movb $0x1, %al
xchgb %al, 0x81a8(%r13)
movq %r15, %rdi
movq %rsi, 0x8(%rsp)
movl %r9d, 0x1c(%rsp)
callq 0x44b0
movl 0xc0(%rsp), %ecx
movl 0x1c(%rsp), %r9d
movq 0x8(%rsp), %rsi
xorl %eax, %eax
xchgb %al, 0x81a8(%r13)
movb 0xc8(%rsp), %al
movq %r15, 0x8(%rsp)
xchgl %r14d, 0x81e8(%r13)
xchgl %ebp, 0x81ec(%r13)
xchgl %r9d, 0x81f0(%r13)
xchgl %ebx, 0x81f4(%r13)
xchgl %r12d, 0x81fc(%r13)
xchgl %ecx, 0x81f8(%r13)
xchgb %al, 0x8200(%r13)
xorl %eax, %eax
xchgb %al, 0x81a8(%r13)
leaq 0x38(%rsp), %rbx
movq %r13, -0x8(%rbx)
movq %rbx, %rdi
callq 0x11bb8
leaq 0x58(%rsp), %r15
movq %r15, %rdi
movq 0x28(%rsp), %rsi
callq 0x11c16
movq $0x0, 0x10(%rsp)
movl $0x50, %edi
callq 0x42a0
leaq 0x11b76(%rip), %rcx     # 0x21c88
movq %rcx, (%rax)
movq 0x30(%rsp), %rcx
movq %rcx, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq $0x0, 0x20(%rax)
movq 0x50(%rsp), %rcx
movq %rcx, 0x28(%rax)
movq 0x48(%rsp), %rcx
testq %rcx, %rcx
je 0x10156
leaq 0x10(%rax), %rdx
leaq 0x48(%rsp), %rsi
movups (%rbx), %xmm1
movups %xmm1, (%rdx)
movq %rcx, 0x20(%rax)
movups %xmm0, (%rsi)
movups %xmm0, 0x30(%rax)
movq $0x0, 0x40(%rax)
movq 0x70(%rsp), %rcx
movq %rcx, 0x48(%rax)
movq 0x68(%rsp), %rcx
testq %rcx, %rcx
je 0x10192
movq %rax, %rdx
addq $0x30, %rdx
leaq 0x68(%rsp), %rsi
movups (%r15), %xmm0
movups %xmm0, (%rdx)
movq %rcx, 0x40(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rsi)
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0x4260
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x101b6
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%rsp), %rcx
cmpq $0x0, (%rcx)
jne 0x1020f
movq 0x10(%rsp), %rax
movq %rax, (%rcx)
movq $0x0, 0x10(%rsp)
movq 0x68(%rsp), %rax
testq %rax, %rax
je 0x101e9
movq %r15, %rdi
movq %r15, %rsi
movl $0x3, %edx
callq *%rax
movq 0x48(%rsp), %rax
testq %rax, %rax
je 0x10200
movq %rbx, %rdi
movq %rbx, %rsi
movl $0x3, %edx
callq *%rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4070
jmp 0x1025e
jmp 0x1025e
movq %rax, %r14
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x10230
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x10230
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x10266
jmp 0x10256
movq %rax, %r14
movq 0x48(%rsp), %rax
testq %rax, %rax
je 0x10256
movq %rbx, %rdi
movq %rbx, %rsi
movl $0x3, %edx
callq *%rax
movq %r14, %rdi
callq 0x44f0
movq %rax, %rdi
callq 0x11bad