LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/./moveiterator.h
// Function: MoveIterator::MoveIterator(Board const&, int)
MoveIterator(const Board & b, int Unique = -1) : base_board(b), move(M_SWAP, b.orient()) {
		unique = (Unique == -1 ? base_board.num_moves() <= Board::unique_depth : Unique);

		if(base_board.won() >= 0){
			move = Move(36, 8); //already done
		} else {
			if(unique)
				hashes.init(base_board.moves_avail());
			++(*this); //find the first valid move
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
vxorps %xmm0, %xmm0, %xmm0
movq %rsi, (%rdi)
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
vmovups %xmm0, 0x8(%rdi)
vmovups %xmm0, 0x11(%rdi)
movw $0xfc01, 0x21(%rdi)     # imm = 0xFC01
movb $0x8, 0x23(%rdi)
movw $0xdead, 0x24(%rdi)     # imm = 0xDEAD
movq $0x0, 0x28(%rdi)
cmpq $0x0, 0x20(%rsi)
jne 0xd2c9
movq %r14, %rdi
callq 0x96fe
movzbl 0x1b(%r14), %eax
shll $0xc, %eax
orl $0xeff, %eax            # imm = 0xEFF
movw %ax, 0x30(%rbx)
xorl %eax, %eax
movq %rax, 0x38(%rbx)
movl $0x0, 0x40(%rbx)
movq %rax, 0x48(%rbx)
cmpl $-0x1, %ebp
je 0xd2fa
movq (%rbx), %r14
testl %ebp, %ebp
setne %al
jmp 0xd305
movq (%rbx), %r14
cmpb $0xb, 0x18(%r14)
setb %al
movb %al, 0x34(%rbx)
movb 0x1a(%r14), %al
cmpb $-0x4, %al
jne 0xd31c
movq %r14, %rdi
callq 0xd9e4
movb %al, 0x1a(%r14)
testb %al, %al
js 0xd328
movw $0x8824, 0x30(%rbx)     # imm = 0x8824
jmp 0xd36f
cmpb $0x1, 0x34(%rbx)
jne 0xd367
movq (%rbx), %r15
leaq 0x38(%rbx), %r14
movb 0x1a(%r15), %al
cmpb $-0x4, %al
jne 0xd349
movq %r15, %rdi
callq 0xd9e4
movb %al, 0x1a(%r15)
movzbl 0x18(%r15), %ecx
movl $0x120, %edx            # imm = 0x120
xorl %esi, %esi
shll $0x3, %ecx
subl %ecx, %edx
testb %al, %al
cmovsl %edx, %esi
movq %r14, %rdi
callq 0xd920
movq %rbx, %rdi
callq 0xd39c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x48(%rbx), %rdi
movq %rax, %r14
testq %rdi, %rdi
je 0xd38b
callq 0x43d0
movq %r14, %rdi
movq $0x0, 0x48(%rbx)
callq 0x45b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/./moveiterator.h
// Function: MoveIterator::operator++()
MoveIterator & operator ++ (){ //prefix form
		while(true){
			move.r++;
			if(move.r >= 8){
				move.r = 0;
				do{
					move.l++;
					if(move.l >= 36) //done
						return *this;
				}while(!base_board.valid_move_fast(move));
			}
			after = base_board;
			bool move_success = after.move(move);
			assert(move_success);
			if(unique){
				uint64_t h = after.hash();
				if(!hashes.add(h))
					continue;
			}
			break;
		}
		return *this;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x1cc25(%rip), %r12     # 0x29fd0
leaq 0x8(%rdi), %r14
leaq 0x38(%rdi), %r15
movq %rdi, %rbx
movzwl 0x30(%rbx), %eax
leal 0x100(%rax), %ecx
andl $0xf0ff, %eax           # imm = 0xF0FF
movl %ecx, %edx
andl $0xf00, %edx            # imm = 0xF00
orl %eax, %edx
btl $0xb, %ecx
movw %dx, 0x30(%rbx)
movq (%rbx), %rcx
jae 0xd403
leal 0x1(%rax), %edx
andl $0xffffff00, %eax       # imm = 0xFFFFFF00
movzbl %dl, %esi
orl %esi, %eax
movw %ax, 0x30(%rbx)
cmpb $0x23, %sil
jg 0xd447
movzwl %dx, %edx
movsbq %dl, %rdx
movq (%r12,%rdx,8), %rdx
testq %rdx, (%rcx)
jne 0xd3dc
movq 0x20(%rcx), %rax
movq %r14, %rdi
movq %rax, 0x20(%r14)
vmovups (%rcx), %ymm0
vmovups %ymm0, (%r14)
movl 0x30(%rbx), %esi
vzeroupper
callq 0x9282
testb %al, %al
je 0xd456
cmpb $0x1, 0x34(%rbx)
jne 0xd447
movq %r14, %rdi
callq 0x96fe
movq %r15, %rdi
movq %rax, %rsi
callq 0xd99a
testb %al, %al
je 0xd3b6
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1be27(%rip), %rdi     # 0x29284
leaq 0x1be2d(%rip), %rsi     # 0x29291
leaq 0x1be37(%rip), %rcx     # 0x292a2
movl $0x2e, %edx
callq 0x41b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/./hashset.h
// Function: HashSet::init(unsigned int)
void init(unsigned int s){
		size = roundup(s)*4;
		mask = size-1;
		count = 0;
		table = new uint64_t[size];
		for(unsigned int i = 0; i < size; i++)
			table[i] = 0;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
decl %esi
movq %rdi, %rbx
movl %esi, %eax
shrl %eax
orl %esi, %eax
movl %eax, %ecx
shrl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x10, %eax
orl %ecx, %eax
leal 0x4(,%rax,4), %r15d
leal 0x3(,%rax,4), %eax
leaq (,%r15,8), %r14
movl %r15d, (%rdi)
movl %eax, 0x4(%rdi)
movl $0x0, 0x8(%rdi)
movq %r14, %rdi
callq 0x4030
movq %rax, 0x10(%rbx)
testl %r15d, %r15d
je 0xd993
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x4170
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/./hashset.h
// Function: HashSet::add(unsigned long)
static uint64_t mix_bits(uint64_t h){
		h ^= (h >> 17);
		h ^= (h << 31);
		h ^= (h >>  8);
		return h;
	}

// Assembly:
movq %rsi, %rax
shrq $0x11, %rax
movl 0x4(%rdi), %edx
xorq %rsi, %rax
movq 0x10(%rdi), %rsi
movq %rax, %rcx
shlq $0x1f, %rcx
xorq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
xorq %rcx, %rax
movl %eax, %ecx
andl %edx, %ecx
movq (%rsi,%rcx,8), %r8
testq %r8, %r8
je 0xd9d7
cmpq %rax, %r8
je 0xd9e1
incl %ecx
andl %edx, %ecx
jmp 0xd9c3
movq %rax, (%rsi,%rcx,8)
incl 0x8(%rdi)
movb $0x1, %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/./board.h
// Function: Board::won_calc() const
int8_t won_calc() const {
		int8_t wonside = 0;
		uint64_t ws = sides[1];
		uint64_t bs = sides[2];

		for(int i = 0; i < 32; i++){
			uint64_t wm = winmaps[i];
			if     ((ws & wm) == wm) wonside |= 1;
			else if((bs & wm) == wm) wonside |= 2;
		}

		switch(wonside){
			case 1:
			case 2:  return wonside;
			case 3:  return 0; //wonside == 3 when both sides win simultaneously
			default: return (nummoves >= 36 ? 0 : -3);
		}
	}

// Assembly:
movq 0x8(%rdi), %rcx
movq 0x10(%rdi), %rdx
leaq 0x1c70d(%rip), %r8      # 0x2a100
xorl %esi, %esi
xorl %eax, %eax
movq (%r8,%rsi,8), %r9
andnq %r9, %rcx, %r10
jne 0xda06
orb $0x1, %al
jmp 0xda1b
movzbl %al, %r10d
orb $0x2, %al
andnq %r9, %rdx, %r9
testq %r9, %r9
movzbl %al, %eax
cmovnel %r10d, %eax
incq %rsi
cmpq $0x20, %rsi
jne 0xd9f7
decb %al
cmpb $0x3, %al
jae 0xda38
shlb $0x3, %al
movl $0x201, %ecx            # imm = 0x201
shrxl %eax, %ecx, %eax
retq
xorl %ecx, %ecx
cmpb $0x24, 0x18(%rdi)
movl $0xfd, %eax
cmovael %ecx, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/./game.h
// Function: Game::move(Move const&)
bool move(const Move & m){
		if(getboard().move(m)){
			hist.push_back(m);
			return true;
		}
		return false;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x920c
movl (%rbx), %esi
movq %r15, %rdi
callq 0x9282
movl %eax, %ebp
testb %al, %al
je 0xda98
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0xda8d
movl (%rbx), %eax
movl %eax, (%rsi)
addq $0x4, 0x8(%r14)
jmp 0xda98
movq %r14, %rdi
movq %rbx, %rdx
callq 0xdaa6
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/gtpagent.cpp
// Function: PentagoGTP::get_time()
double PentagoGTP::get_time(){
	double ret = 0;

	switch(time.method){
		case TimeControl::PERCENT:
			ret += time.param*time_remain/100;
			break;
		case TimeControl::STATS:{
			double gamelen = agent->gamelen();
			if(gamelen > 0){
				ret += 2.0*time.param*time_remain / gamelen;
				break;
			}
		}//fall back to even
		case TimeControl::EVEN:
			ret += 2.0*time.param*time_remain / game.moves_remain();
			break;
	}

	if(ret > time_remain)
		ret = time_remain;

	ret += time.move;

	return ret;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl 0x58(%rdi), %eax
movq %rdi, %rbx
cmpl $0x2, %eax
je 0xf626
cmpl $0x1, %eax
je 0xf654
vxorpd %xmm0, %xmm0, %xmm0
testl %eax, %eax
jne 0xf68a
vmovsd 0x60(%rbx), %xmm0
vmulsd 0x80(%rbx), %xmm0, %xmm0
vdivsd 0x19cb4(%rip), %xmm0, %xmm0 # 0x292d8
jmp 0xf682
movq 0x90(%rbx), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
vxorpd %xmm1, %xmm1, %xmm1
vucomisd %xmm1, %xmm0
jbe 0xf654
vmovsd 0x60(%rbx), %xmm2
vaddsd %xmm2, %xmm2, %xmm2
vmulsd 0x80(%rbx), %xmm2, %xmm2
vdivsd %xmm0, %xmm2, %xmm0
jmp 0xf686
vmovsd 0x60(%rbx), %xmm0
leaq 0x38(%rbx), %rdi
vaddsd %xmm0, %xmm0, %xmm0
vmulsd 0x80(%rbx), %xmm0, %xmm0
vmovsd %xmm0, 0x8(%rsp)
callq 0x15472
vmovsd 0x8(%rsp), %xmm1
vcvtsi2sd %eax, %xmm2, %xmm0
vdivsd %xmm0, %xmm1, %xmm0
vxorpd %xmm1, %xmm1, %xmm1
vaddsd %xmm1, %xmm0, %xmm0
vmovsd 0x80(%rbx), %xmm1
vminsd %xmm0, %xmm1, %xmm0
vaddsd 0x70(%rbx), %xmm0, %xmm0
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/gtpagent.cpp
// Function: PentagoGTP::time_used(double)
void PentagoGTP::time_used(double used){
	if(time.flexible)
		time_remain += time.move - used;
	else
		time_remain += min(0.0, time.move - used);
	if(time_remain < 0)
			time_remain = 0;
}

// Assembly:
kmovb 0x78(%rdi), %k1
vmovsd 0x70(%rdi), %xmm1
vsubsd %xmm0, %xmm1, %xmm0
vxorpd %xmm1, %xmm1, %xmm1
vminsd %xmm1, %xmm0, %xmm2
vmovsd %xmm0, %xmm2, %xmm2 {%k1}
vaddsd 0x80(%rdi), %xmm2, %xmm0
vucomisd %xmm0, %xmm1
vmovsd %xmm0, 0x80(%rdi)
jbe 0xf6df
movq $0x0, 0x80(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/gtpagent.cpp
// Function: PentagoGTP::gtp_pv(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>)
GTPResponse PentagoGTP::gtp_pv(vecstr args){
	string pvstr = "";
	vector<Move> pv = agent->get_pv();
	for(unsigned int i = 0; i < pv.size(); i++)
		pvstr += pv[i].to_s() + " ";
	return GTPResponse(true, pvstr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, 0x60(%rsp)
leaq 0x50(%rsp), %rax
leaq 0x1847f(%rip), %rdx     # 0x28ae3
leaq 0x40(%rsp), %rdi
movq %rsi, %r14
movq %rdx, %rsi
movq %rax, -0x10(%rax)
callq 0xa810
movq 0x90(%r14), %rsi
movq (%rsi), %rax
leaq 0x8(%rsp), %rdi
callq *0x40(%rax)
movq 0x8(%rsp), %rax
cmpq %rax, 0x10(%rsp)
je 0x10771
leaq 0x30(%rsp), %r13
movl $0x1, %ebx
leaq 0x98(%rsp), %rbp
leaq 0x88(%rsp), %r14
leaq 0x1b19e(%rip), %r15     # 0x2b859
leaq 0x40(%rsp), %r12
xorl %ecx, %ecx
leaq (%rax,%rcx,4), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x999a
movq %r14, %rdi
movq %r15, %rsi
callq 0x4610
movq %r13, 0x20(%rsp)
movq %rax, %rcx
addq $0x10, %rcx
movq (%rax), %rdx
cmpq %rcx, %rdx
je 0x106fe
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x10708
vmovups (%rcx), %xmm0
vmovups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x28(%rsp), %rdx
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x40b0
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x10741
callq 0x42b0
movq 0x88(%rsp), %rdi
cmpq %rbp, %rdi
je 0x10753
callq 0x42b0
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rdx
movl %ebx, %ecx
incl %ebx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rcx, %rdx
ja 0x106c2
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
leaq 0x78(%rsp), %r14
movq %r14, -0x10(%r14)
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x8e30
movq 0x60(%rsp), %rbx
leaq 0x68(%rsp), %rdx
movl $0x1, %esi
movq %rbx, %rdi
callq 0x8dba
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x107b7
callq 0x42b0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x107c6
callq 0x42b0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x107da
callq 0x42b0
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x68(%rsp), %rdi
movq %rax, %rbx
cmpq %r14, %rdi
jne 0x1082e
jmp 0x10833
jmp 0x10805
movq %rax, %rbx
jmp 0x10842
movq %rax, %rbx
jmp 0x10833
movq %rax, %rbx
jmp 0x10821
movq 0x20(%rsp), %rdi
movq %rax, %rbx
cmpq %r13, %rdi
je 0x10821
callq 0x42b0
movq 0x88(%rsp), %rdi
cmpq %rbp, %rdi
je 0x10833
callq 0x42b0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x10842
callq 0x42b0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x10856
callq 0x42b0
movq %rbx, %rdi
callq 0x45b0
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/gtpagent.cpp
// Function: PentagoGTP::gtp_params(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>)
GTPResponse PentagoGTP::gtp_params(vecstr args){
	if(dynamic_cast<AgentAB   *>(agent)) return gtp_ab_params(args);
	if(dynamic_cast<AgentMCTS *>(agent)) return gtp_mcts_params(args);
	if(dynamic_cast<AgentPNS  *>(agent)) return gtp_pns_params(args);

	return GTPResponse(false, "Unknown Agent type");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq 0x90(%rsi), %r12
movq %rdi, %rbx
testq %r12, %r12
je 0x10950
movq %rdx, %r15
leaq 0x254c2(%rip), %rdx     # 0x35d48
movq %rsi, %r14
leaq 0x251c8(%rip), %rsi     # 0x35a58
movq %r12, %rdi
xorl %ecx, %ecx
callq 0x4340
testq %rax, %rax
je 0x108c7
leaq 0x50(%rsp), %r12
movq %r15, %rsi
movq %r12, %rdi
callq 0xa426
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x109d8
leaq 0x50(%rsp), %rdi
jmp 0x10949
leaq 0x2520a(%rip), %rdx     # 0x35ad8
leaq 0x25183(%rip), %rsi     # 0x35a58
movq %r12, %rdi
xorl %ecx, %ecx
callq 0x4340
testq %rax, %rax
je 0x10909
leaq 0x38(%rsp), %r12
movq %r15, %rsi
movq %r12, %rdi
callq 0xa426
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x11230
leaq 0x38(%rsp), %rdi
jmp 0x10949
leaq 0x25300(%rip), %rdx     # 0x35c10
leaq 0x25141(%rip), %rsi     # 0x35a58
movq %r12, %rdi
xorl %ecx, %ecx
callq 0x4340
testq %rax, %rax
je 0x10950
leaq 0x20(%rsp), %r12
movq %r15, %rsi
movq %r12, %rdi
callq 0xa426
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1434a
leaq 0x20(%rsp), %rdi
callq 0x8f7e
jmp 0x1098d
leaq 0x10(%rsp), %r15
leaq 0x18d1f(%rip), %rsi     # 0x2967b
leaq 0x18d2a(%rip), %rdx     # 0x2968d
movq %rsp, %r14
movq %r14, %rdi
movq %r15, -0x10(%r15)
callq 0xa810
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x8dba
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1098d
callq 0x42b0
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0x109b8
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
jmp 0x109b8
leaq 0x50(%rsp), %rdi
movq %rax, %rbx
callq 0x8f7e
jmp 0x109d0
movq (%rsp), %rdi
movq %rax, %rbx
cmpq %r15, %rdi
je 0x109d0
callq 0x42b0
movq %rbx, %rdi
callq 0x45b0
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/./pentagogtp.h
// Function: TimeControl::method_name[abi:cxx11]()
string method_name(){
		switch(method){
			case PERCENT: return "percent";
			case EVEN:    return "even";
			case STATS:   return "stats";
			default:      return "WTF? unknown time control method";
		}
	}

// Assembly:
pushq %rbx
movl (%rsi), %eax
leaq 0x10(%rdi), %rcx
movq %rdi, %rbx
movq %rcx, (%rdi)
cmpl $0x2, %eax
je 0x15227
cmpl $0x1, %eax
je 0x15217
testl %eax, %eax
jne 0x15237
leaq 0x143bd(%rip), %rsi     # 0x295cb
leaq 0x143bd(%rip), %rdx     # 0x295d2
jmp 0x15245
leaq 0x143ba(%rip), %rsi     # 0x295d8
leaq 0x143b7(%rip), %rdx     # 0x295dc
jmp 0x15245
leaq 0x143b4(%rip), %rsi     # 0x295e2
leaq 0x143b2(%rip), %rdx     # 0x295e7
jmp 0x15245
leaq 0x14c54(%rip), %rsi     # 0x29e92
leaq 0x14c6d(%rip), %rdx     # 0x29eb2
movq %rbx, %rdi
callq 0xa810
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/string.cpp
// Function: to_str[abi:cxx11](double, int)
string to_str(double a, int prec){
	double p = pow(10.0, prec);
	a = round(a*p)/p;

	stringstream out;
//	out.precision(prec);
	out << a;
	return out.str();
}

// Assembly:
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
vmovsd %xmm0, (%rsp)
vcvtsi2sd %esi, %xmm1, %xmm1
vmovsd 0x14813(%rip), %xmm0    # 0x29ec0
movq %rdi, %rbx
callq 0x4590
vmulsd (%rsp), %xmm0, %xmm1
vpbroadcastq 0x14805(%rip), %xmm2 # 0x29ec8
leaq 0x8(%rsp), %rdi
vpternlogq $0xf8, 0x147fd(%rip){1to2}, %xmm1, %xmm2 # 0x29ed0
vaddsd %xmm2, %xmm1, %xmm1
vroundsd $0xb, %xmm1, %xmm1, %xmm1
vdivsd %xmm0, %xmm1, %xmm0
vmovsd %xmm0, (%rsp)
callq 0x41e0
leaq 0x18(%rsp), %rdi
vmovsd (%rsp), %xmm0
callq 0x44f0
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x44e0
movq 0x208aa(%rip), %rsi     # 0x35fb8
leaq 0x8(%rsp), %rdi
callq 0x4200
leaq 0x88(%rsp), %rdi
callq 0x40c0
movq %rbx, %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
retq
movq 0x20880(%rip), %rsi     # 0x35fb8
leaq 0x8(%rsp), %rdi
movq %rax, %rbx
callq 0x4200
leaq 0x88(%rsp), %rdi
callq 0x40c0
movq %rbx, %rdi
callq 0x45b0
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/string.cpp
// Function: explode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
vecstr explode(const string & str, const string & sep){
	vecstr ret;
	string::size_type old = 0, pos = 0;
	while((pos = str.find_first_of(sep, old)) != string::npos){
		ret.push_back(str.substr(old, pos - old));
		old = pos + sep.length();
	}
	ret.push_back(str.substr(old));
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
vxorps %xmm0, %xmm0, %xmm0
movq $0x0, 0x10(%rdi)
movq %rsi, %r14
movq %rdx, %r15
movq %rdi, %rbx
xorl %ebp, %ebp
vmovups %xmm0, (%rdi)
movq %r14, %rdi
movq (%rdx), %rsi
movq 0x8(%rdx), %rcx
xorl %edx, %edx
callq 0x4470
cmpq $-0x1, %rax
je 0x158e2
leaq 0x8(%rsp), %r13
movq %rax, %r12
xorl %ebp, %ebp
movq %r12, %rcx
subq %rbp, %rcx
movq %r13, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x4300
movq %rbx, %rdi
movq %r13, %rsi
callq 0x15a26
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x158c1
callq 0x42b0
movq 0x8(%r15), %rcx
movq (%r15), %rsi
movq %r12, %rbp
movq %r14, %rdi
addq %rcx, %rbp
movq %rbp, %rdx
callq 0x4470
movq %rax, %r12
cmpq $-0x1, %rax
jne 0x1588e
leaq 0x8(%rsp), %rdi
movq $-0x1, %rcx
movq %r14, %rsi
movq %rbp, %rdx
callq 0x4300
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x15a26
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15919
callq 0x42b0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x1594d
jmp 0x1593b
movq %rax, %r14
jmp 0x15957
movq 0x8(%rsp), %rdi
movq %rax, %r14
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x15957
callq 0x42b0
movq %rbx, %rdi
callq 0x8f7e
movq %r14, %rdi
callq 0x45b0
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/board.cpp
// Function: Board::Board(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Board::Board(string str) {
	sides[1] = 0;
	sides[2] = 0;
	nummoves = 0;
	outcome = -4;
	cached_score = default_score;
	cached_hash = 0;

	assert(str.length() == 36);
	int moved[3] = {0,0,0};
	for(int i = 0; i < 36; i++){
		int8_t side = str[i] - '0';
		assert(side >= 0 && side <= 2);

		if(side > 0){
			nummoves++;
			sides[side] |= xybits[i];
			moved[side]++;
		}
	}
	assert(moved[1] == moved[2] || moved[1] == moved[2] + 1); //even number of moves per player
	sides[0] = sides[1] | sides[2];
	to_play = (nummoves % 2) + 1;
}

// Assembly:
subq $0x18, %rsp
vxorps %xmm0, %xmm0, %xmm0
movb $0x0, 0x18(%rdi)
vmovups %xmm0, 0x8(%rdi)
movb $-0x4, 0x1a(%rdi)
movw $0xdead, 0x1c(%rdi)     # imm = 0xDEAD
movq $0x0, 0x20(%rdi)
cmpq $0x24, 0x8(%rsi)
jne 0x15d49
movl $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
xorl %edx, %edx
xorl %eax, %eax
movq (%rsi), %rcx
leaq 0x1430f(%rip), %rsi     # 0x29fd0
movb (%rcx), %r8b
addb $-0x30, %r8b
cmpb $0x3, %r8b
jae 0x15d2a
testb %r8b, %r8b
je 0x15ce9
incb %al
movzbl %r8b, %r8d
movb %al, 0x18(%rdi)
movq (%rdx,%rsi), %r9
orq %r9, (%rdi,%r8,8)
incl 0x8(%rsp,%r8,4)
addq $0x8, %rdx
incq %rcx
cmpq $0x120, %rdx            # imm = 0x120
jne 0x15cc1
movl 0xc(%rsp), %ecx
movl 0x10(%rsp), %edx
cmpl %edx, %ecx
sete %sil
incl %edx
cmpl %edx, %ecx
sete %cl
orb %sil, %cl
je 0x15d68
movq 0x10(%rdi), %rcx
andb $0x1, %al
orq 0x8(%rdi), %rcx
incb %al
movq %rcx, (%rdi)
movb %al, 0x19(%rdi)
addq $0x18, %rsp
retq
leaq 0x15501(%rip), %rdi     # 0x2b232
leaq 0x154db(%rip), %rsi     # 0x2b213
leaq 0x154de(%rip), %rcx     # 0x2b21d
movl $0x28, %edx
callq 0x41b0
leaq 0x154b0(%rip), %rdi     # 0x2b200
leaq 0x154bc(%rip), %rsi     # 0x2b213
leaq 0x154bf(%rip), %rcx     # 0x2b21d
movl $0x24, %edx
callq 0x41b0
leaq 0x154da(%rip), %rdi     # 0x2b249
leaq 0x1549d(%rip), %rsi     # 0x2b213
leaq 0x154a0(%rip), %rcx     # 0x2b21d
movl $0x30, %edx
callq 0x41b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/board.cpp
// Function: Board::state[abi:cxx11]() const
string Board::state() const {
	string s;
	for(int y = 0; y < 6; y++)
		for(int x = 0; x < 6; x++)
			s += to_str((int)get(x, y));
	return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
leaq 0x1422f(%rip), %rbp     # 0x29fd0
movl $0x1, %r12d
leaq 0x18(%rsp), %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rax, (%rdi)
movq %rax, 0x8(%rsp)
movq $0x0, 0x8(%rdi)
xorl %eax, %eax
movb $0x0, 0x10(%rdi)
xorl %r13d, %r13d
movq %rax, 0x10(%rsp)
movq (%rbp,%r13,8), %rax
xorl %esi, %esi
testq %rax, 0x10(%r14)
setne %sil
addl %esi, %esi
testq %rax, 0x8(%r14)
cmovnel %r12d, %esi
movq %r15, %rdi
callq 0xd4eb
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x40b0
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x15e17
callq 0x42b0
incq %r13
cmpq $0x6, %r13
jne 0x15dd0
movq 0x10(%rsp), %rax
addq $0x30, %rbp
incq %rax
cmpq $0x6, %rax
jne 0x15dc8
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rsp), %rdi
movq %rax, %r14
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x15e60
callq 0x42b0
jmp 0x15e60
movq %rax, %r14
movq 0x8(%rsp), %rax
movq (%rbx), %rdi
cmpq %rax, %rdi
je 0x15e72
callq 0x42b0
movq %r14, %rdi
callq 0x45b0
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/board.cpp
// Function: Board::won_str[abi:cxx11]() const
string Board::won_str() const {
	switch(won()){
		case -3: return "none";
		case -2: return "black_or_draw";
		case -1: return "white_or_draw";
		case 0:
		case 3:  return "draw";
		case 1:  return "white";
		case 2:  return "black";
	}
	return "unknown";
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movb 0x1a(%rsi), %al
movq %rdi, %rbx
cmpb $-0x4, %al
jne 0x16f89
movq %rsi, %rdi
movq %rsi, %r14
callq 0xd9e4
movb %al, 0x1a(%r14)
movzbl %al, %eax
cmpl $0xfc, %eax
jg 0x16fc5
cmpl $0x3, %eax
ja 0x1702a
leaq 0x12f8d(%rip), %rcx     # 0x29f30
movl %eax, %eax
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10(%rbx), %rax
leaq 0x1203a(%rip), %rsi     # 0x28ff3
leaq 0x12037(%rip), %rdx     # 0x28ff7
jmp 0x17050
cmpl $0xff, %eax
je 0x16fee
cmpl $0xfe, %eax
je 0x1703e
cmpl $0xfd, %eax
jne 0x1702a
leaq 0x10(%rbx), %rax
leaq 0x11abf(%rip), %rsi     # 0x28aa4
leaq 0x11abc(%rip), %rdx     # 0x28aa8
jmp 0x17050
leaq 0x10(%rbx), %rax
leaq 0x11ff1(%rip), %rsi     # 0x28fea
leaq 0x11ff7(%rip), %rdx     # 0x28ff7
jmp 0x17050
leaq 0x10(%rbx), %rax
leaq 0x11546(%rip), %rsi     # 0x28553
leaq 0x11544(%rip), %rdx     # 0x28558
jmp 0x17050
leaq 0x10(%rbx), %rax
leaq 0x1155e(%rip), %rsi     # 0x2857f
leaq 0x1155c(%rip), %rdx     # 0x28584
jmp 0x17050
leaq 0x10(%rbx), %rax
leaq 0x11a67(%rip), %rsi     # 0x28a9c
leaq 0x11a67(%rip), %rdx     # 0x28aa3
jmp 0x17050
leaq 0x10(%rbx), %rax
leaq 0x11f93(%rip), %rsi     # 0x28fdc
leaq 0x11f99(%rip), %rdx     # 0x28fe9
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0xa810
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/board.cpp
// Function: gen_lookup3to2(unsigned int, unsigned int)
uint16_t * gen_lookup3to2(unsigned int inbits, unsigned int outbits){
	uint16_t * lookup = new uint16_t[1 << (inbits*2)];
	for(uint16_t i = 0; i < (1 << inbits);  i++){ //top bits
		for(uint16_t j = 0; j < (1 << inbits); j++){ //bottom bits
			uint16_t bi = i, bj = j, val = 0, exp = 1;
			while(bi || bj){
				if((bi & 1) && (bj & 1)){ //not base 3 if both are set
					val = 0;
					break;
				}
				val += exp * (2*(bi & 1) + (bj & 1));
				exp *= 3;
				bi >>= 1;
				bj >>= 1;
			}
			assert(val < (1 << outbits));
			lookup[(i << inbits) + j] = val;
//			printf("%5X, ", val);
//			if(j % 16 == 15)
//				printf("\n");
		}
	}
	return lookup;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leal (%rbx,%rbx), %eax
movl $0x2, %ecx
movl %esi, %ebp
shlxl %eax, %ecx, %edi
callq 0x4030
movq %rbx, (%rsp)
cmpl $0x1f, %ebx
je 0x17166
movq (%rsp), %rcx
movl $0x1, %edx
xorl %edi, %edi
xorl %esi, %esi
shlxl %ecx, %edx, %ecx
shlxl %ebp, %edx, %edx
movq (%rsp), %r8
xorl %r9d, %r9d
shlxl %r8d, %edi, %edi
xorl %r8d, %r8d
movl %esi, %r10d
orw %r8w, %r10w
je 0x17132
movw $0x1, %r11w
movl %r8d, %ebp
movl %esi, %r14d
xorl %r10d, %r10d
movl %r14d, %r15d
movl %ebp, %r12d
andw $0x1, %r15w
sete %r13b
andw $0x1, %r12w
sete %bl
orb %r13b, %bl
cmpb $0x1, %bl
jne 0x17132
movzwl %r15w, %ebx
movzwl %r12w, %r15d
leal (%r15,%rbx,2), %ebx
movzwl %bp, %r15d
shrl %r15d
imull %r11d, %ebx
leal (%r11,%r11,2), %r11d
addl %ebx, %r10d
movzwl %r14w, %ebx
shrl %ebx
cmpw $0x2, %r14w
setae %r14b
cmpw $0x2, %bp
setae %bpl
orb %r14b, %bpl
movl %r15d, %ebp
movl %ebx, %r14d
jne 0x170d1
jmp 0x17135
xorl %r10d, %r10d
movzwl %r10w, %r11d
cmpl %r11d, %edx
jle 0x17175
addl %edi, %r9d
incl %r8d
movslq %r9d, %r9
movw %r10w, (%rax,%r9,2)
movzwl %r8w, %r9d
cmpl %r9d, %ecx
jg 0x170ba
incl %esi
movzwl %si, %edi
cmpl %edi, %ecx
jg 0x170ab
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x14150(%rip), %rdi     # 0x2b2cc
leaq 0x14090(%rip), %rsi     # 0x2b213
leaq 0x14157(%rip), %rcx     # 0x2b2e1
movl $0xe1, %edx
callq 0x41b0
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/board.cpp
// Function: check(unsigned long, unsigned char, Board&)
void check(uint64_t h, uint8_t o, Board &b){
	if(h != b.hash())
		printf("expected hash: %lu, got: %lu\n", h, b.hash());
	if(o != b.orient())
		printf("expected orient: %i, got: %i\n", o, b.orient());
	if(h != b.hash() || o != b.orient())
		printf("%s", b.to_s().c_str());
	assert(h == b.hash());
	assert(o == b.orient());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movq %rdx, %rdi
movq %rdx, %rbx
movl %esi, %ebp
callq 0x96fe
cmpq %r14, %rax
je 0x171cf
movq %rbx, %rdi
callq 0x96fe
leaq 0x14154(%rip), %rdi     # 0x2b316
movq %rax, %rdx
movq %r14, %rsi
xorl %eax, %eax
callq 0x4040
cmpq $0x0, 0x20(%rbx)
jne 0x171de
movq %rbx, %rdi
callq 0x96fe
movb 0x1b(%rbx), %al
cmpb %bpl, %al
je 0x17210
cmpq $0x0, 0x20(%rbx)
movzbl %bpl, %r15d
jne 0x171fc
movq %rbx, %rdi
callq 0x96fe
movb 0x1b(%rbx), %al
movzbl %al, %edx
leaq 0x1412e(%rip), %rdi     # 0x2b334
movl %r15d, %esi
xorl %eax, %eax
callq 0x4040
movq %rbx, %rdi
callq 0x96fe
cmpq %r14, %rax
jne 0x17232
cmpq $0x0, 0x20(%rbx)
jne 0x1722c
movq %rbx, %rdi
callq 0x96fe
cmpb %bpl, 0x1b(%rbx)
je 0x1726a
leaq 0x8(%rsp), %r15
movl $0x1, %edx
movq %rbx, %rsi
movq %r15, %rdi
callq 0x15e7a
movq (%r15), %rsi
leaq 0x14101(%rip), %rdi     # 0x2b352
xorl %eax, %eax
callq 0x4040
movq (%r15), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1726a
callq 0x42b0
movq %rbx, %rdi
callq 0x96fe
cmpq %r14, %rax
jne 0x17297
cmpq $0x0, 0x20(%rbx)
jne 0x17286
movq %rbx, %rdi
callq 0x96fe
cmpb %bpl, 0x1b(%rbx)
jne 0x172b6
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x140b7(%rip), %rdi     # 0x2b355
leaq 0x13f6e(%rip), %rsi     # 0x2b213
leaq 0x140b7(%rip), %rcx     # 0x2b363
movl $0xf4, %edx
callq 0x41b0
leaq 0x140cd(%rip), %rdi     # 0x2b38a
leaq 0x13f4f(%rip), %rsi     # 0x2b213
leaq 0x14098(%rip), %rcx     # 0x2b363
movl $0xf5, %edx
callq 0x41b0
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/board.cpp
// Function: check(unsigned long, unsigned char, std::initializer_list<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>)
void check(uint64_t h, uint8_t o, std::initializer_list<string> moves){
	Board b;
	for(string m : moves){
		b.move(m);
	}
	check(h, o, b);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
vxorps %xmm0, %xmm0, %xmm0
movl %esi, (%rsp)
movq %rdi, 0x8(%rsp)
vmovups %xmm0, 0x19(%rsp)
vmovaps %xmm0, 0x10(%rsp)
movw $0xfc01, 0x29(%rsp)     # imm = 0xFC01
movb $0x8, 0x2b(%rsp)
movw $0xdead, 0x2c(%rsp)     # imm = 0xDEAD
movq $0x0, 0x30(%rsp)
testq %rcx, %rcx
je 0x17401
movq %rcx, %r14
shlq $0x5, %r14
leaq 0x48(%rsp), %rbp
leaq 0x38(%rsp), %r12
leaq 0x4(%rsp), %r13
leaq 0x10(%rsp), %rbx
movq %rdx, %r15
addq %rdx, %r14
movq %rbp, 0x38(%rsp)
movq %r12, %rdi
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
callq 0x8e30
movl $0x8, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0xd07c
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0x9282
movq 0x38(%rsp), %rdi
cmpq %rbp, %rdi
je 0x173f8
callq 0x42b0
addq $0x20, %r15
cmpq %r14, %r15
jne 0x173b6
movzbl (%rsp), %esi
movq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x17194
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x38(%rsp), %rdi
movq %rax, %rbx
cmpq %rbp, %rdi
je 0x17435
callq 0x42b0
movq %rbx, %rdi
callq 0x45b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/move.cpp
// Function: check(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
void check(const std::string a, int ao, const std::string b, int bo) {
	Move am = Move(b, bo).rotate(ao);
	Move bm = Move(a, ao).rotate(bo);
	printf("%s %2i <=> %s %2i ", a.c_str(), ao, b.c_str(), bo);
	printf("  :  %s %2i <=> %s %2i\n", bm.to_s().c_str(), bm.o, am.to_s().c_str(), am.o);
	assert(bm == Move(b, bo));
	assert(am == Move(a, ao));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
leaq 0x18(%rsp), %r12
movl %esi, %ebx
movq %rdi, %r14
movl %ecx, %ebp
movq %rdx, %r15
movq %rdx, %rsi
movl %ecx, %edx
movq %r12, %rdi
callq 0xd07c
movq %r12, %rdi
movl %ebx, %esi
callq 0x93c0
leaq 0x8(%rsp), %rcx
leaq 0x18(%rsp), %r12
movq %r14, %rsi
movl %ebx, %edx
movq %r12, %rdi
movw %ax, (%rcx)
callq 0xd07c
movq %r12, %rdi
movl %ebp, %esi
callq 0x93c0
leaq 0xc(%rsp), %r12
leaq 0x12892(%rip), %rdi     # 0x2b4da
movq %r14, 0x10(%rsp)
movl %ebx, %edx
movl %ebp, %r8d
movw %ax, (%r12)
xorl %eax, %eax
movq (%r14), %rsi
movq (%r15), %rcx
callq 0x4040
leaq 0x18(%rsp), %r13
movq %r12, %rsi
xorl %edx, %edx
movq %r13, %rdi
callq 0x999a
movq (%r13), %r13
movzwl (%r12), %r12d
leaq 0x38(%rsp), %rdi
leaq 0x8(%rsp), %rsi
xorl %edx, %edx
callq 0x999a
movzwl 0x8(%rsp), %r8d
leaq 0x48(%rsp), %r14
shrl $0xc, %r12d
leaq 0x12847(%rip), %rdi     # 0x2b4ed
movq %r13, %rsi
xorl %eax, %eax
movq -0x10(%r14), %rcx
movl %r12d, %edx
shrl $0xc, %r8d
callq 0x4040
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x18cc9
callq 0x42b0
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x18cdc
callq 0x42b0
leaq 0x18(%rsp), %r12
movq %r15, %rsi
movl %ebp, %edx
movq %r12, %rdi
callq 0xd07c
movzwl 0xc(%rsp), %eax
cmpw (%r12), %ax
jne 0x18d28
movq 0x10(%rsp), %rsi
leaq 0x18(%rsp), %r15
movl %ebx, %edx
movq %r15, %rdi
callq 0xd07c
movzwl 0x8(%rsp), %eax
cmpw (%r15), %ax
jne 0x18d47
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x127d6(%rip), %rdi     # 0x2b505
leaq 0x127e1(%rip), %rsi     # 0x2b517
leaq 0x127e3(%rip), %rcx     # 0x2b520
movl $0xc, %edx
callq 0x41b0
leaq 0x1280d(%rip), %rdi     # 0x2b55b
leaq 0x127c2(%rip), %rsi     # 0x2b517
leaq 0x127c4(%rip), %rcx     # 0x2b520
movl $0xd, %edx
callq 0x41b0
leaq 0x28(%rsp), %rcx
movq %rax, %rbx
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x18d7c
callq 0x42b0
movq %rbx, %rdi
callq 0x45b0
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/move.cpp
// Function: check(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void check(const std::string a, const std::string b) {
	Move ma(a);
	Move mb(b);
	Move ar = ma.rotate(mb.orientation());
	Move br = mb.rotate(ma.orientation());
	if(ma != br || mb != ar){
		printf("%s => %s    %s => %s\n", a.c_str(),  ar.to_s(true).c_str(), b.c_str(), br.to_s(true).c_str());
		printf("%s\n", Board().to_s(true).c_str());
	}
	assert(ma == br);
	assert(mb == ar);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
leaq 0xc(%rsp), %r15
movl $0x8, %edx
movq %rdi, %r14
movq %rsi, %rbx
movq %r14, %rsi
movq %r15, %rdi
callq 0xd07c
leaq 0x8(%rsp), %r12
movl $0x8, %edx
movq %rbx, %rsi
movq %r12, %rdi
callq 0xd07c
movzwl (%r12), %esi
movq %r15, %rdi
shrl $0xc, %esi
callq 0x93c0
movzwl (%r15), %esi
movl %eax, %ebp
movw %bp, 0x4(%rsp)
movq %r12, %rdi
shrl $0xc, %esi
callq 0x93c0
movw %ax, (%rsp)
cmpw %ax, (%r15)
jne 0x18dfb
cmpw %bp, 0x8(%rsp)
je 0x18ecc
movq (%r14), %r14
leaq 0x10(%rsp), %r15
leaq 0x4(%rsp), %rsi
movl $0x1, %edx
movq %r15, %rdi
callq 0x999a
movq (%r15), %r15
movq (%rbx), %rbx
leaq 0x40(%rsp), %rdi
movl $0x1, %edx
movq %rsp, %rsi
callq 0x999a
leaq 0x50(%rsp), %r12
leaq 0x12734(%rip), %rdi     # 0x2b56d
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
xorl %eax, %eax
movq -0x10(%r12), %r8
callq 0x4040
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x18e5d
callq 0x42b0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x18e70
callq 0x42b0
leaq 0x40(%rsp), %rbx
vxorps %xmm0, %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movl $0x1, %edx
vmovups %xmm0, 0x9(%rsi)
vmovaps %xmm0, (%rsi)
movw $0xfc01, 0x19(%rsi)     # imm = 0xFC01
movb $0x8, 0x1b(%rsi)
movw $0xdead, 0x1c(%rsi)     # imm = 0xDEAD
movq %rbx, %rdi
movq $0x0, 0x20(%rsi)
callq 0x15e7a
movq (%rbx), %rdi
callq 0x4490
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x18ec1
callq 0x42b0
movzwl 0xc(%rsp), %eax
cmpw (%rsp), %ax
jne 0x18f04
movzwl 0x8(%rsp), %eax
cmpw 0x4(%rsp), %ax
jne 0x18ee5
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x126d1(%rip), %rdi     # 0x2b5bd
leaq 0x12624(%rip), %rsi     # 0x2b517
leaq 0x12692(%rip), %rcx     # 0x2b58c
movl $0x1a, %edx
callq 0x41b0
leaq 0x12678(%rip), %rdi     # 0x2b583
leaq 0x12605(%rip), %rsi     # 0x2b517
leaq 0x12673(%rip), %rcx     # 0x2b58c
movl $0x19, %edx
callq 0x41b0
leaq 0x20(%rsp), %rcx
movq %rax, %rbx
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x18f39
callq 0x42b0
movq %rbx, %rdi
callq 0x45b0
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/agentmcts.cpp
// Function: AgentMCTS::garbage_collect(Board&, AgentMCTS::Node*)
void AgentMCTS::garbage_collect(Board & board, Node * node){
	Node * child = node->children.begin(),
		 * end = node->children.end();

	int toplay = board.toplay();
	for( ; child != end; child++){
		if(child->children.num() == 0)
			continue;

		if(	(node->outcome >= 0 && child->exp.num() > gcsolved && (node->outcome != toplay || child->outcome == toplay || child->outcome == 0)) || //parent is solved, only keep the proof tree, plus heavy draws
			(node->outcome <  0 && child->exp.num() > (child->outcome >= 0 ? gcsolved : gclimit)) ){ // only keep heavy nodes, with different cutoffs for solved and unsolved
			board.move(child->move);
			garbage_collect(board, child);
			board.undo(child->move);
		}else{
			nodes -= child->dealloc(ctmem);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x20(%rdx), %rcx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r13d, %r13d
movl $0x0, %r12d
leaq 0x10(%rcx), %rax
cmpq $0x2, %rcx
cmovaeq %rax, %r12
jb 0x1acf0
movzwl 0x6(%rcx), %ecx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %r13
cmpq %r13, %r12
je 0x1ade1
movzbl 0x19(%r14), %eax
leaq 0xf0(%r15), %rcx
addq $0x14, %r12
leaq 0x70(%r15), %rdx
movq %rcx, 0x20(%rsp)
leaq 0xd8(%r15), %rcx
movq %rdx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movl %eax, 0xc(%rsp)
movq 0xc(%r12), %rax
cmpq $0x2, %rax
jb 0x1adcc
cmpw $0x0, 0x6(%rax)
je 0x1adcc
movb 0x12(%rbx), %al
movq -0xc(%r12), %rcx
leaq -0x14(%r12), %rbp
testb %al, %al
js 0x1ad8f
movl 0x70(%r15), %edx
cmpq %rdx, %rcx
jbe 0x1ad77
cmpb 0xc(%rsp), %al
jne 0x1ada7
movsbl -0x2(%r12), %eax
testl %eax, %eax
sete %cl
cmpl 0xc(%rsp), %eax
sete %al
orb %cl, %al
jne 0x1ada7
movq 0x20(%rsp), %rsi
movq %rbp, %rdi
callq 0x1ec8c
movl %eax, %eax
subq %rax, 0xd0(%r15)
jmp 0x1adcc
cmpb $0x0, -0x2(%r12)
movq 0x18(%rsp), %rax
cmovsq 0x10(%rsp), %rax
movl (%rax), %eax
cmpq %rax, %rcx
jbe 0x1ad77
movl (%r12), %esi
movq %r14, %rdi
callq 0x9282
movq %r15, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x1acb2
movq %r14, %rdi
movq %r12, %rsi
callq 0x1fdd4
leaq 0x28(%r12), %rax
addq $0x14, %r12
cmpq %r13, %r12
movq %rax, %r12
jne 0x1ad27
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/agentmcts.cpp
// Function: AgentMCTS::stop_threads()
void AgentMCTS::stop_threads(){
	if(threadstate != Thread_Wait_Start){
		timedout();
		runbarrier.wait();
		CAS(threadstate, Thread_Wait_End, Thread_Wait_Start);
		assert(threadstate == Thread_Wait_Start);
	}
}

// Assembly:
pushq %rbx
movl 0xa80(%rdi), %eax
cmpl $0x1, %eax
je 0x1c880
movq (%rdi), %rax
movq %rdi, %rbx
callq *0x58(%rax)
leaq 0xaa0(%rbx), %rdi
callq 0x1ddd8
movl $0x1, %ecx
movl $0x6, %eax
lock
cmpxchgl %ecx, 0xa80(%rbx)
movl 0xa80(%rbx), %eax
cmpl $0x1, %eax
jne 0x1c882
popq %rbx
retq
leaq 0xeec4(%rip), %rdi      # 0x2b74d
leaq 0xeede(%rip), %rsi      # 0x2b76e
leaq 0xf052(%rip), %rcx      # 0x2b8e9
movl $0xdb, %edx
callq 0x41b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/agentmcts.cpp
// Function: AgentMCTS::AgentMCTS()
AgentMCTS::AgentMCTS() {
	nodes = 0;
	runs = 0;
	gclimit = 5;
	time_used = 0;

	profile     = false;
	ponder      = false;
//#ifdef SINGLE_THREAD ... make sure only 1 thread
	numthreads  = 1;
	maxmem      = 1000*1024*1024;

	explore     = 1;
	parentexplore = true;
	knowledge   = true;
	useexplore  = 1;
	fpurgency   = 1;
	rollouts    = 10;

	keeptree    = true;
	minimax     = 1;
	visitexpand = 1;
	prunesymmetry = true;
	gcsolved    = 100000;

	win_score = 1;

	instantwin  = 0;

	//no threads started until a board is set
	threadstate = Thread_Wait_Start;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
vxorps %xmm0, %xmm0, %xmm0
movw $0xfc01, %ax            # imm = 0xFC01
movb $0x8, %cl
movw $0xdead, %dx            # imm = 0xDEAD
movq %rdi, %rbx
leaq 0xf0(%rbx), %r14
xorl %esi, %esi
vmovups %xmm0, 0x19(%rdi)
vmovups %xmm0, 0x10(%rdi)
movw %ax, 0x29(%rdi)
movb %cl, 0x2b(%rdi)
movw %dx, 0x2c(%rdi)
movq %rsi, 0x30(%rdi)
leaq 0x19146(%rip), %rdi     # 0x35a78
movq %rdi, (%rbx)
vmovups %xmm0, 0x80(%rbx)
vmovups %xmm0, 0x89(%rbx)
movw %ax, 0x99(%rbx)
movb %cl, 0x9b(%rbx)
movw %dx, 0x9c(%rbx)
vmovups %xmm0, 0xa0(%rbx)
vmovups %xmm0, 0xaa(%rbx)
movl $0x8efc00fd, 0xba(%rbx) # imm = 0x8EFC00FD
movw $0x8efc, 0xc0(%rbx)     # imm = 0x8EFC
movq %rsi, 0xc8(%rbx)
movq %r14, %rdi
callq 0x1eb58
vxorps %xmm0, %xmm0, %xmm0
leaq 0xaa0(%rbx), %r12
movq $0x0, 0xa98(%rbx)
vmovups %xmm0, 0xa88(%rbx)
movq %r12, %rdi
callq 0xd828
movl $0x1, 0xaf8(%rbx)
movl $0x0, 0xafc(%rbx)
leaq 0xb00(%rbx), %rdi
callq 0xd828
vbroadcastss 0xec76(%rip), %xmm0 # 0x2b650
movl $0x1, %eax
movb $0x1, %dl
movabsq $0x100000001, %rsi      # imm = 0x100000001
xorl %ecx, %ecx
movl %eax, 0xb58(%rbx)
movl %ecx, 0xb5c(%rbx)
movq %rcx, 0xd0(%rbx)
movq %rcx, 0xe0(%rbx)
movl $0x5, 0xd8(%rbx)
movq %rcx, 0xb60(%rbx)
movw $0x100, 0x48(%rbx)      # imm = 0x100
movb $0x0, 0x38(%rbx)
movl %eax, 0x3c(%rbx)
movq $0x3e800000, 0x40(%rbx) # imm = 0x3E800000
movl $0x3f800000, 0x4c(%rbx) # imm = 0x3F800000
movb %dl, 0x50(%rbx)
vmovlps %xmm0, 0x54(%rbx)
movl $0xa, 0x5c(%rbx)
movb %dl, 0x60(%rbx)
movq %rsi, 0x64(%rbx)
movabsq $0x1000186a0, %rsi      # imm = 0x1000186A0
movb %dl, 0x6c(%rbx)
movq %rsi, 0x70(%rbx)
movl %ecx, 0x78(%rbx)
movl %eax, 0xa80(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r12, %rdi
movq %rax, %r15
callq 0xd756
jmp 0x1ca80
movq %rax, %r15
leaq 0xa88(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x1ca94
callq 0x42b0
movq %r14, %rdi
callq 0x1ebea
jmp 0x1caa1
movq %rax, %r15
addq $0xa8, %rbx
movq %rbx, %rdi
callq 0x1ec34
movq %r15, %rdi
callq 0x45b0
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/agentmcts.cpp
// Function: AgentMCTS::~AgentMCTS()
AgentMCTS::~AgentMCTS(){
	stop_threads();

	numthreads = 0;
	reset_threads(); //shut down the theads properly

	root.dealloc(ctmem);
	ctmem.compact();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x18fb4(%rip), %rax     # 0x35a78
movq %rdi, %rbx
movq %rax, (%rdi)
callq 0x1c842
movl $0x0, 0x3c(%rbx)
movq %rbx, %rdi
callq 0x1cb4e
leaq 0xa8(%rbx), %r14
leaq 0xf0(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x1ec8c
vxorps %xmm0, %xmm0, %xmm0
vxorps %xmm1, %xmm1, %xmm1
movq %r15, %rdi
callq 0x1de8e
leaq 0xb00(%rbx), %rdi
callq 0xd756
leaq 0xaa0(%rbx), %rdi
callq 0xd756
movq 0xa88(%rbx), %rdi
testq %rdi, %rdi
je 0x1cb30
callq 0x42b0
movq %r15, %rdi
callq 0x1ebea
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1ec34
movq %rax, %rdi
callq 0x8dae
nop
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/agentmcts.cpp
// Function: AgentMCTS::reset_threads()
void AgentMCTS::reset_threads(){ //start and end with threadstate = Thread_Wait_Start
	assert(threadstate == Thread_Wait_Start);

//wait for them to all get to the barrier
	assert(CAS(threadstate, Thread_Wait_Start, Thread_Wait_Start_Cancelled));
	runbarrier.wait();

//make sure they exited cleanly
	for(unsigned int i = 0; i < threads.size(); i++)
		threads[i]->join();

	threads.clear();

	threadstate = Thread_Wait_Start;

	runbarrier.reset(numthreads + 1);
	gcbarrier.reset(numthreads);

//start new threads
	for(int i = 0; i < numthreads; i++)
		threads.push_back(new MCTSThread(this));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl 0xa80(%rdi), %eax
cmpl $0x1, %eax
jne 0x1cc7a
movl $0x2, %ecx
movl $0x1, %eax
movq %rdi, %rbx
lock
cmpxchgl %ecx, 0xa80(%rdi)
jne 0x1cc99
leaq 0xaa0(%rbx), %r14
movq %r14, %rdi
callq 0x1ddd8
movq 0xa88(%rbx), %rax
movq 0xa90(%rbx), %rdx
cmpq %rax, %rdx
je 0x1cbdb
movl $0x1, %ebp
xorl %ecx, %ecx
movq (%rax,%rcx,8), %rdi
addq $0x10, %rdi
callq 0x200d0
movq 0xa90(%rbx), %rdx
movq 0xa88(%rbx), %rax
movl %ebp, %ecx
incl %ebp
movq %rdx, %rsi
subq %rax, %rsi
sarq $0x3, %rsi
cmpq %rcx, %rsi
ja 0x1cbad
cmpq %rax, %rdx
je 0x1cbe7
movq %rax, 0xa90(%rbx)
movl $0x1, 0xa80(%rbx)
movq %r14, %rdi
movl 0x3c(%rbx), %esi
incl %esi
callq 0x1ed1e
movl 0x3c(%rbx), %esi
leaq 0xb00(%rbx), %rdi
callq 0x1ed1e
cmpl $0x0, 0x3c(%rbx)
jle 0x1cc6d
leaq 0xa88(%rbx), %r14
leaq 0x8(%rsp), %r15
xorl %ebp, %ebp
movl $0xf8, %edi
callq 0x42e0
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1ed62
movq %r12, 0x8(%rsp)
movq 0xa90(%rbx), %rsi
cmpq 0xa98(%rbx), %rsi
je 0x1cc5b
movq %r12, (%rsi)
addq $0x8, 0xa90(%rbx)
jmp 0x1cc66
movq %r14, %rdi
movq %r15, %rdx
callq 0x2062c
incl %ebp
cmpl 0x3c(%rbx), %ebp
jl 0x1cc21
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xeacc(%rip), %rdi      # 0x2b74d
leaq 0xeae6(%rip), %rsi      # 0x2b76e
leaq 0xec99(%rip), %rcx      # 0x2b928
movl $0xe6, %edx
callq 0x41b0
leaq 0xeca8(%rip), %rdi      # 0x2b948
leaq 0xeac7(%rip), %rsi      # 0x2b76e
leaq 0xec7a(%rip), %rcx      # 0x2b928
movl $0xe9, %edx
callq 0x41b0
movq %r12, %rdi
movq %rax, %rbx
callq 0x42b0
movq %rbx, %rdi
callq 0x45b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/agentmcts.cpp
// Function: AgentMCTS::statestring[abi:cxx11]()
string AgentMCTS::statestring(){
	switch(threadstate){
	case Thread_Cancelled:  return "Thread_Wait_Cancelled";
	case Thread_Wait_Start: return "Thread_Wait_Start";
	case Thread_Wait_Start_Cancelled: return "Thread_Wait_Start_Cancelled";
	case Thread_Running:    return "Thread_Running";
	case Thread_GC:         return "Thread_GC";
	case Thread_GC_End:     return "Thread_GC_End";
	case Thread_Wait_End:   return "Thread_Wait_End";
	}
	return "Thread_State_Unknown!!!";
}

// Assembly:
pushq %rbx
movl 0xa80(%rsi), %eax
leaq 0x10(%rdi), %rcx
movq %rdi, %rbx
movq %rcx, (%rdi)
cmpq $0x6, %rax
ja 0x1cd6b
leaq 0xe96e(%rip), %rcx      # 0x2b690
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xeb36(%rip), %rsi      # 0x2b868
leaq 0xeb44(%rip), %rdx      # 0x2b87d
jmp 0x1cda9
leaq 0xeb67(%rip), %rsi      # 0x2b8a9
leaq 0xeb69(%rip), %rdx      # 0x2b8b2
jmp 0x1cda9
leaq 0xeb2c(%rip), %rsi      # 0x2b87e
leaq 0xeb40(%rip), %rdx      # 0x2b899
jmp 0x1cda9
leaq 0xeb38(%rip), %rsi      # 0x2b89a
leaq 0xeb3f(%rip), %rdx      # 0x2b8a8
jmp 0x1cda9
leaq 0xeb5f(%rip), %rsi      # 0x2b8d1
leaq 0xeb6f(%rip), %rdx      # 0x2b8e8
jmp 0x1cda9
leaq 0xe9da(%rip), %rsi      # 0x2b75c
leaq 0xe9e4(%rip), %rdx      # 0x2b76d
jmp 0x1cda9
leaq 0xeb21(%rip), %rsi      # 0x2b8b3
leaq 0xeb27(%rip), %rdx      # 0x2b8c0
jmp 0x1cda9
leaq 0xeb1f(%rip), %rsi      # 0x2b8c1
leaq 0xeb27(%rip), %rdx      # 0x2b8d0
movq %rbx, %rdi
callq 0xa810
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/agentmcts.cpp
// Function: AgentMCTS::set_ponder(bool)
void AgentMCTS::set_ponder(bool p){
	if(ponder != p){
		ponder = p;
		stop_threads();

		if(ponder)
			start_threads();
	}
}

// Assembly:
pushq %rbx
cmpb %sil, 0x38(%rdi)
je 0x1cdd8
movq %rdi, %rbx
movb %sil, 0x38(%rdi)
callq 0x1c842
cmpb $0x1, 0x38(%rbx)
jne 0x1cdd8
movq %rbx, %rdi
popq %rbx
jmp 0x1c8a2
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/agentmcts.cpp
// Function: AgentMCTS::set_board(Board const&, bool)
void AgentMCTS::set_board(const Board & board, bool clear){
	stop_threads();

	nodes -= root.dealloc(ctmem);
	root = Node();
	root.exp.addwins(visitexpand+1);

	rootboard = board;

	reset_threads(); //needed since the threads aren't started before a board it set

	if(ponder)
		start_threads();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x1c842
leaq 0xa8(%rbx), %r15
leaq 0xf0(%rbx), %rsi
movq %r15, %rdi
callq 0x1ec8c
movl %eax, %eax
subq %rax, 0xd0(%rbx)
movw $0x8efc, %ax            # imm = 0x8EFC
vxorps %xmm0, %xmm0, %xmm0
movq %rsp, %rsi
movl $0xfd0000, 0x10(%rsi)   # imm = 0xFD0000
vmovaps %xmm0, (%rsi)
movw %ax, 0x14(%rsi)
movw %ax, 0x18(%rsi)
movq $0x0, 0x20(%rsi)
movq %r15, %rdi
callq 0x1ef48
movq %rsp, %rdi
callq 0x1ec34
movl 0x68(%rbx), %eax
movq %rbx, %rdi
incl %eax
vmovq %rax, %xmm0
addq %rax, %rax
vmovq %rax, %xmm1
vpunpcklqdq %xmm0, %xmm1, %xmm0 # xmm0 = xmm1[0],xmm0[0]
vpaddq 0xa8(%rbx), %xmm0, %xmm0
vmovdqu %xmm0, 0xa8(%rbx)
vmovups (%r14), %ymm0
vmovups %ymm0, 0x80(%rbx)
movq 0x20(%r14), %rax
movq %rax, 0xa0(%rbx)
vzeroupper
callq 0x1cb4e
cmpb $0x1, 0x38(%rbx)
jne 0x1ce9a
movq %rbx, %rdi
callq 0x1c8a2
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rsp, %rdi
movq %rax, %rbx
callq 0x1ec34
movq %rbx, %rdi
callq 0x45b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]pentagod/agentmcts.cpp
// Function: AgentMCTS::gamelen() const
double AgentMCTS::gamelen() const {
	DepthStats len;
	for(unsigned int i = 0; i < threads.size(); i++)
		len += threads[i]->gamelen;
	return len.avg();
}

// Assembly:
movq 0xa88(%rdi), %rax
movq 0xa90(%rdi), %rcx
subq %rax, %rcx
je 0x1d67d
sarq $0x3, %rcx
xorl %edi, %edi
xorl %edx, %edx
xorl %esi, %esi
movq (%rax,%rdi,8), %r8
incq %rdi
addl 0xa0(%r8), %edx
addq 0xa8(%r8), %rsi
movl %edi, %r8d
cmpq %r8, %rcx
ja 0x1d64b
testl %edx, %edx
je 0x1d67d
vcvtusi2sd %rsi, %xmm0, %xmm0
vcvtusi2sd %edx, %xmm1, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
retq
vxorps %xmm0, %xmm0, %xmm0
retq