// File: /workspace/github_cpp_makefile_star2_O3/vygr[P]C-Chess/chess.cpp
// Function: score(score_board const&, int, int, int, int)
auto score(const score_board &sbrd, int colour, int alpha, int beta, int ply)
{
	static auto trans_table = std::unordered_map<std::string, int>{};
	static auto trans_lru = std::list<std::string>{};
	if (ply < 2) return score_impl(sbrd, colour, alpha, beta, ply);
	std::string key; key.reserve(90);
	key += sbrd.brd; key += ":";
	key += std::to_string(colour); key += ":";
	key += std::to_string(ply); key += ":";
	key += std::to_string(alpha); key += ":";
	key += std::to_string(beta);
	auto search = trans_table.find(key);
	if (search != end(trans_table)) return search->second;
	auto score = score_impl(sbrd, colour, alpha, beta, ply);
	if (score == timeout_value || score == -timeout_value) return score;
	trans_table[key] = score;
	trans_lru.push_back(key);
	if (trans_lru.size() > max_score_entries)
	{
		trans_table.erase(trans_lru.front());
		trans_lru.pop_front();
	}
	return score;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %r8d, %ebx
movl %ecx, 0x2c(%rsp)
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, 0x50(%rsp)
movb 0xaaac(%rip), %al       # 0xe458
testb %al, %al
je 0x3e55
movb 0xaabe(%rip), %al       # 0xe478
testb %al, %al
je 0x3e5f
cmpl $0x1, %ebx
jg 0x39ec
movq 0x50(%rsp), %rdi
movl %r15d, %esi
movl %r14d, %edx
movl 0x2c(%rsp), %ecx
movl %ebx, %r8d
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3ec3
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x30(%rsp), %rdi
movl $0x5a, %esi
callq 0x2260
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
leaq 0x30(%rsp), %rdi
callq 0x20b0
leaq 0x61fb(%rip), %rsi      # 0x9c28
leaq 0x30(%rsp), %rdi
callq 0x22f0
movl %r15d, %r13d
negl %r13d
cmovsl %r15d, %r13d
movl $0x1, %r12d
cmpl $0xa, %r13d
jb 0x3a97
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r13d, %ecx
cmpl $0x63, %ecx
jbe 0x3a8e
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x3a94
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x3a97
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x3a5b
addl $-0x3, %r12d
jmp 0x3a97
addl $-0x2, %r12d
jmp 0x3a97
decl %r12d
movl %r15d, %ebp
shrl $0x1f, %ebp
leal (%r12,%rbp), %esi
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8(%rsp), %rdi
movl $0x2d, %edx
callq 0x21e0
movl %ebp, %edi
addq 0x8(%rsp), %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x6906
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x30(%rsp), %rdi
callq 0x20b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3afb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0x6126(%rip), %rsi      # 0x9c28
leaq 0x30(%rsp), %rdi
callq 0x22f0
movl $0x1, %r12d
cmpl $0xa, %ebx
jb 0x3b60
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebx, %ecx
cmpl $0x63, %ecx
jbe 0x3b57
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x3b5d
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x3b60
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x3b24
addl $-0x3, %r12d
jmp 0x3b60
addl $-0x2, %r12d
jmp 0x3b60
decl %r12d
movl %r12d, %esi
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
movl $0x2d, %edx
callq 0x21e0
movq 0x8(%rsp), %rdi
movl %r12d, %esi
movl %ebx, %edx
callq 0x6906
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x30(%rsp), %rdi
callq 0x20b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3bb9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0x6068(%rip), %rsi      # 0x9c28
leaq 0x30(%rsp), %rdi
callq 0x22f0
movl %r14d, %r13d
negl %r13d
cmovsl %r14d, %r13d
movl $0x1, %r12d
cmpl $0xa, %r13d
jb 0x3c2a
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r13d, %ecx
cmpl $0x63, %ecx
jbe 0x3c21
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x3c27
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x3c2a
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x3bee
addl $-0x3, %r12d
jmp 0x3c2a
addl $-0x2, %r12d
jmp 0x3c2a
decl %r12d
movl %r14d, %ebp
shrl $0x1f, %ebp
leal (%r12,%rbp), %esi
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
movl $0x2d, %edx
callq 0x21e0
movl %ebp, %edi
addq 0x8(%rsp), %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x6906
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x30(%rsp), %rdi
callq 0x20b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3c8d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0x5f94(%rip), %rsi      # 0x9c28
leaq 0x30(%rsp), %rdi
callq 0x22f0
movl 0x2c(%rsp), %eax
movl %eax, %r13d
negl %r13d
cmovsl %eax, %r13d
movl $0x1, %r12d
cmpl $0xa, %r13d
jb 0x3d02
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r13d, %ecx
cmpl $0x63, %ecx
jbe 0x3cf9
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x3cff
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x3d02
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x3cc6
addl $-0x3, %r12d
jmp 0x3d02
addl $-0x2, %r12d
jmp 0x3d02
decl %r12d
movl 0x2c(%rsp), %eax
movl %eax, %ebp
shrl $0x1f, %ebp
leal (%r12,%rbp), %esi
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
movl $0x2d, %edx
callq 0x21e0
movl %ebp, %edi
addq 0x8(%rsp), %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x6906
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x30(%rsp), %rdi
callq 0x20b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3d68
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0xa6b1(%rip), %rdi      # 0xe420
leaq 0x30(%rsp), %rsi
callq 0x7fb2
testq %rax, %rax
je 0x3dae
movl 0x28(%rax), %ebx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x3d9d
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21a0
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x50(%rsp), %rdi
movl %r15d, %esi
movl %r14d, %edx
movl 0x2c(%rsp), %ecx
movl %ebx, %r8d
callq 0x3ec3
movl %eax, %ebx
cmpl $0xfff9e580, %eax       # imm = 0xFFF9E580
je 0x3d81
cmpl $0x61a80, %ebx          # imm = 0x61A80
je 0x3d81
leaq 0xa643(%rip), %rdi      # 0xe420
leaq 0x30(%rsp), %rsi
callq 0x80ca
movl %ebx, (%rax)
leaq 0xa670(%rip), %rdi      # 0xe460
leaq 0x30(%rsp), %rsi
callq 0x841c
leaq 0xa65f(%rip), %rsi      # 0xe460
movq %rax, %rdi
callq 0x2050
movq 0xa660(%rip), %rax      # 0xe470
incq %rax
movq %rax, 0xa656(%rip)      # 0xe470
cmpq $0x186a1, %rax          # imm = 0x186A1
jb 0x3d81
movq 0xa633(%rip), %rsi      # 0xe460
addq $0x10, %rsi
leaq 0xa5e8(%rip), %rdi      # 0xe420
callq 0x846e
movq 0xa61c(%rip), %rsi      # 0xe460
leaq 0xa615(%rip), %rdi      # 0xe460
callq 0x8556
jmp 0x3d81
callq 0x2310
jmp 0x39b4
callq 0x2386
jmp 0x39c2
jmp 0x3e9c
jmp 0x3e9c
jmp 0x3e79
jmp 0x3e9c
jmp 0x3e79
jmp 0x3e9c
jmp 0x3e79
jmp 0x3e9c
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3e9f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x3e9f
jmp 0x3e9c
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x3ebb
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x22c0