// File: /workspace/github_cpp_makefile_star2_O1/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 0xfd18
movb $0x1, %al
xchgb %al, 0x81a8(%r13)
movq %r15, %rdi
movq %rsi, 0x8(%rsp)
movl %r9d, 0x24(%rsp)
callq 0x44b0
movl 0xc0(%rsp), %ecx
movl 0x24(%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 0x11918
leaq 0x58(%rsp), %r15
movq %r15, %rdi
movq 0x28(%rsp), %rsi
callq 0x1197e
movq $0x0, 0x10(%rsp)
movl $0x50, %edi
callq 0x42a0
leaq 0x10ef4(%rip), %rcx     # 0x20c88
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 0xfdd8
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 0xfe14
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 0x18(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0x4260
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xfe38
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%rsp), %rdx
movq (%rdx), %rax
testq %rax, %rax
jne 0xfe8f
movq 0x10(%rsp), %rcx
movq %rcx, (%rdx)
movq %rax, 0x10(%rsp)
movq 0x68(%rsp), %rax
testq %rax, %rax
je 0xfe69
movq %r15, %rdi
movq %r15, %rsi
movl $0x3, %edx
callq *%rax
movq 0x48(%rsp), %rax
testq %rax, %rax
je 0xfe80
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 0xfee7
jmp 0xfee7
movq %rax, %r14
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xfeab
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x18(%rsp)
jmp 0xfeb9
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0xfef0
jmp 0xfedf
movq %rax, %r14
movq 0x48(%rsp), %rax
testq %rax, %rax
je 0xfedf
movq %rbx, %rdi
movq %rbx, %rsi
movl $0x3, %edx
callq *%rax
movq %r14, %rdi
callq 0x44f0
movq %rax, %rdi
callq 0x1190d
nop