LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/sgf.h
// Function: Morat::SGFPrinter<Morat::Move>::child_end()
void child_end() {
		assert(!_root);
		assert(_depth >= 1);
		_depth--;
		if(_indent)
			print("\n" + std::string(_depth, ' '));
		print(")");
		_indent = true;
	}

// Assembly:
pushq %rbx
subq $0x60, %rsp
cmpb $0x1, 0x8(%rdi)
je 0xe6de
movl 0xc(%rdi), %eax
movq %rdi, %rbx
testl %eax, %eax
jle 0xe6f7
decl %eax
movl %eax, 0xc(%rbx)
cmpb $0x1, 0x10(%rbx)
jne 0xe6a9
leaq 0x10(%rsp), %rcx
movl %eax, %esi
movq %rcx, -0x10(%rcx)
movq %rsp, %rdi
pushq $0x20
popq %rdx
callq 0x53b0
leaq 0x1425f(%rip), %rsi     # 0x228dc
leaq 0x40(%rsp), %rdi
movq %rsp, %rdx
callq 0xcf8b
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x10d70
leaq 0x40(%rsp), %rdi
callq 0x5150
movq %rsp, %rdi
callq 0x5150
leaq 0x16284(%rip), %rsi     # 0x24934
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x5110
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x10d70
leaq 0x20(%rsp), %rdi
callq 0x5150
movb $0x1, 0x10(%rbx)
addq $0x60, %rsp
popq %rbx
retq
leaq 0x15a57(%rip), %rdi     # 0x2413c
leaq 0x15a57(%rip), %rsi     # 0x24143
leaq 0x15baf(%rip), %rcx     # 0x242a2
pushq $0x46
jmp 0xe70e
leaq 0x15a9e(%rip), %rdi     # 0x2419c
leaq 0x15a3e(%rip), %rsi     # 0x24143
leaq 0x15b96(%rip), %rcx     # 0x242a2
pushq $0x47
popq %rdx
callq 0x51f0
leaq 0x40(%rsp), %rdi
movq %rax, %rbx
callq 0x5150
jmp 0xe726
movq %rax, %rbx
movq %rsp, %rdi
jmp 0xe735
jmp 0xe73c
leaq 0x20(%rsp), %rdi
movq %rax, %rbx
callq 0x5150
jmp 0xe73f
movq %rax, %rbx
movq %rbx, %rdi
callq 0x5650
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/move_iterator.h
// Function: Morat::MoveIterator<Morat::Hex::Board>::operator++()
MoveIterator & operator ++ () {  //prefix form
		do {
			move_.x++;
			move_.xy++;

			if (move_.x >= line_end_) {
				move_.y++;
				if (move_.y >= board_.lines()) {  // done
					move_ = M_NONE;
					return *this;
				}
				move_.x = board_.line_start(move_.y);
				move_.xy = board_.xy(move_.x, move_.y);
				line_end_ = board_.line_end(move_.y);
			}
		} while (!board_.valid_move_fast(move_));

		return *this;
	}

// Assembly:
leaq 0x186f4(%rip), %rsi     # 0x26ea9
movq %rdi, %rax
movb 0x9(%rdi), %r9b
movzwl 0xa(%rdi), %r8d
movb 0xc(%rdi), %dil
movb 0x8(%rax), %cl
movq (%rax), %rdx
movb (%rsi), %sil
incb %r9b
incl %r8d
movb %r9b, 0x9(%rax)
movw %r8w, 0xa(%rax)
cmpb %dil, %r9b
jl 0xe80f
incb %cl
movb %cl, 0x8(%rax)
movb (%rdx), %dil
cmpb %cl, %dil
jle 0xe822
movsbl %dil, %r8d
movsbl %cl, %r9d
movb $0x0, 0x9(%rax)
movswl %r8w, %r8d
imull %r9d, %r8d
xorl %r9d, %r9d
movw %r8w, 0xa(%rax)
movb %dil, 0xc(%rax)
movq 0x10(%rdx), %r11
movswq %r8w, %r10
shlq $0x4, %r10
cmpb %sil, (%r11,%r10)
jne 0xe7ce
retq
movl $0xffff78fd, 0x8(%rax)  # imm = 0xFFFF78FD
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/sgf.h
// Function: Morat::SGFParser<Morat::Move>::next_child()
bool next_child() {
		eat_whitespace(_is);
		if(eat_char(_is, '('))
			return next_node();
		return false;
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x1fc93
movq (%rbx), %rdi
pushq $0x28
popq %rsi
callq 0x1fcf3
testb %al, %al
je 0xe86a
movq %rbx, %rdi
popq %rbx
jmp 0x10e86
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/sgf.h
// Function: Morat::SGFParser<Morat::Move>::move()
Move move() {
		if(_properties.count("W"))
			return Move(_properties["W"]);
		if(_properties.count("B"))
			return Move(_properties["B"]);
		return Move();
	}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x159ce(%rip), %rsi     # 0x2424d
leaq 0x8(%rsp), %rdi
leaq 0x5(%rsp), %rdx
callq 0x5110
addq $0x8, %rbx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x10f8a
leaq 0x8(%rsp), %rdi
movq %rax, %r14
callq 0x5150
testq %r14, %r14
je 0xe8e3
leaq 0x15995(%rip), %rsi     # 0x2424d
leaq 0x8(%rsp), %rdi
leaq 0x5(%rsp), %rdx
callq 0x5110
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xf636
leaq 0x6(%rsp), %rdi
movq %rax, %rsi
callq 0xd26c
jmp 0xe948
leaq 0x15965(%rip), %rsi     # 0x2424f
leaq 0x8(%rsp), %rdi
leaq 0x5(%rsp), %rdx
callq 0x5110
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x10f8a
leaq 0x8(%rsp), %rdi
movq %rax, %r14
callq 0x5150
testq %r14, %r14
je 0xe95f
leaq 0x15930(%rip), %rsi     # 0x2424f
leaq 0x8(%rsp), %rdi
leaq 0x5(%rsp), %rdx
callq 0x5110
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xf636
leaq 0x6(%rsp), %rdi
movq %rax, %rsi
callq 0xd26c
leaq 0x8(%rsp), %rdi
callq 0x5150
movzwl 0x6(%rsp), %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movw $0x78fc, 0x6(%rsp)      # imm = 0x78FC
jmp 0xe952
jmp 0xe974
jmp 0xe979
jmp 0xe974
jmp 0xe979
jmp 0xe974
jmp 0xe979
movq %rax, %rbx
jmp 0xe986
leaq 0x8(%rsp), %rdi
movq %rax, %rbx
callq 0x5150
movq %rbx, %rdi
callq 0x5650
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/compacttree.h
// Function: Morat::CompactTree<Morat::Hex::AgentMCTS::Node>::Children::dealloc(Morat::CompactTree<Morat::Hex::AgentMCTS::Node>&)
unsigned int dealloc(CompactTree & ct){
			Data * t = data;
			int n = 0;
			if(t && CAS(data, t, (Data*)NULL)){
				n = t->used;
				ct.dealloc(t);
			}
			return n;
		}

// Assembly:
pushq %rbx
movq (%rdi), %rcx
xorl %ebx, %ebx
testq %rcx, %rcx
je 0xec82
movq %rcx, %rax
lock
cmpxchgq %rbx, (%rdi)
jne 0xec82
movzwl 0x6(%rcx), %ebx
movq %rsi, %rdi
movq %rcx, %rsi
callq 0xec86
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/compacttree.h
// Function: Morat::CompactTree<Morat::Hex::AgentMCTS::Node>::Children::swap(Morat::CompactTree<Morat::Hex::AgentMCTS::Node>::Children&)
void swap(Children & other){
			//swap data pointer
			Data * temp;
			temp = data;
			data = other.data;
			other.data = temp;
			temp = NULL;

			//update parent pointer
			if(data > (Data*)LOCK)
				data->parent = &data;
			if(other.data > (Data*)LOCK)
				other.data->parent = &(other.data);
		}

// Assembly:
movq (%rdi), %rax
movq (%rsi), %rcx
movq %rcx, (%rdi)
movq %rax, (%rsi)
movq (%rdi), %rcx
cmpq $0x2, %rcx
jb 0xef2c
movq %rdi, 0x8(%rcx)
movq (%rsi), %rax
cmpq $0x2, %rax
jb 0xef36
movq %rsi, 0x8(%rax)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/board.h
// Function: Morat::Hex::Board::move(Morat::MoveValid const&, bool, bool)
bool move(const MoveValid & pos, bool checkwin = true, bool permanent = true) {
		assert(!outcome_.solved());

		if(!valid_move(pos))
			return false;

		last_move_ = pos;
		num_moves_++;

		Cell& cell = cells_[pos.xy];
		cell.piece = to_play_;
		cell.perm = permanent;

		update_hash(pos, to_play_); //depends on num_moves_
		update_pattern(pos, to_play_);

		// join the groups for win detection
		auto it = neighbors_small(pos);
		for (const MoveValid *i = it.begin(), *e = it.end(); i < e; i++) {
			if(i->on_board() && to_play_ == get(i->xy)){
				join_groups(pos.xy, i->xy);
				i++; //skip the next one. If it is the same group,
					 //it is already connected and forms a corner, which we can ignore
			}
		}

		// did I win?
		Cell * g = & cells_[find_group(pos.xy)];
		uint8_t winmask = (to_play_ == Side::P1 ? 3 : 0xC);
		if((g->edge & winmask) == winmask){
			outcome_ = +to_play_;
		}

		to_play_ = ~to_play_;

		return true;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x17f6a(%rip), %rdx     # 0x26eb1
movb 0x9(%rdi), %al
movl %ecx, %r15d
cmpb (%rdx), %al
jge 0xf04b
movq %rsi, %r14
movq %rdi, %rbx
callq 0xf06a
movl %eax, %ebp
testb %al, %al
je 0xf040
movzwl (%r14), %eax
movq %rbx, %rdi
movq %r14, %rsi
movw %ax, 0x6(%rbx)
incw 0x4(%rbx)
movswq 0x2(%r14), %rax
movq 0x10(%rbx), %rcx
movb 0x8(%rbx), %dl
shlq $0x4, %rax
movb %dl, (%rcx,%rax)
movb %r15b, 0x7(%rcx,%rax)
movl 0x8(%rbx), %edx
callq 0xf09e
movl 0x8(%rbx), %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf0f6
movswq 0x2(%r14), %rax
movq 0x38(%rbx), %rcx
xorl %r12d, %r12d
imulq $0x48, %rax, %rax
leaq 0x2(%rcx,%rax), %r15
cmpq $0x18, %r12
jge 0xeffc
movswq (%r15,%r12), %rdx
cmpq $-0x1, %rdx
je 0xeff6
movq 0x10(%rbx), %rax
movq %rdx, %rcx
shlq $0x4, %rcx
movb 0x8(%rbx), %sil
cmpb (%rax,%rcx), %sil
jne 0xeff6
movswl 0x2(%r14), %esi
movq %rbx, %rdi
callq 0xf13a
addq $0x4, %r12
addq $0x4, %r12
jmp 0xefbf
movswl 0x2(%r14), %esi
movq %rbx, %rdi
callq 0xf1b0
leaq 0x17e9a(%rip), %rsi     # 0x26eaa
movslq %eax, %rcx
movb 0x8(%rbx), %al
xorl %edi, %edi
movq 0x10(%rbx), %rdx
cmpb (%rsi), %al
sete %dil
shlq $0x4, %rcx
movzbl 0x6(%rdx,%rcx), %ecx
leal -0xd(%rdi,%rdi,8), %edx
orl %ecx, %edx
cmpl $-0x1, %edx
jne 0xf039
movb %al, 0x9(%rbx)
movb $0x3, %cl
subb %al, %cl
movb %cl, 0x8(%rbx)
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1482f(%rip), %rdi     # 0x23881
leaq 0x1380c(%rip), %rsi     # 0x22865
leaq 0x14834(%rip), %rcx     # 0x23894
movl $0xeb, %edx
callq 0x51f0
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/board.h
// Function: Morat::Hex::Board::update_hash(Morat::MoveValid const&, Morat::Side)
void update_hash(const MoveValid & pos, Side side) {
		int turn = side.to_i();
		hash.update(0, 3 * pos.xy + turn);
		if(num_moves_ <= unique_depth) {
			hash.update(1, 3 * xy(sizem1_ - pos.x, sizem1_ - pos.y) + turn);
		}
	}

// Assembly:
movswq 0x2(%rsi), %rax
movsbq %dl, %rcx
leaq (%rax,%rax,2), %rax
addq %rax, %rcx
leaq 0x17ecb(%rip), %rax     # 0x26f80
movq (%rax,%rcx,8), %rcx
xorq %rcx, 0x28(%rdi)
cmpw $0x5, 0x4(%rdi)
jg 0xf0f4
movsbl %dl, %ecx
movsbl 0x1(%rdi), %edx
movsbl 0x1(%rsi), %r8d
movsbl (%rsi), %esi
movl %edx, %r9d
subl %esi, %edx
movsbl (%rdi), %esi
subl %r8d, %r9d
imull %edx, %esi
addl %r9d, %esi
leal (%rsi,%rsi,2), %edx
addl %ecx, %edx
movslq %edx, %rcx
movq (%rax,%rcx,8), %rax
xorq %rax, 0x30(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/board.h
// Function: Morat::Hex::Board::join_groups(int, int)
bool join_groups(int i, int j){
		i = find_group(i);
		j = find_group(j);

		if(i == j)
			return true;

		if(cells_[i].size < cells_[j].size) //force i's subtree to be bigger
			std::swap(i, j);

		cells_[j].parent = i;
		cells_[i].size   += cells_[j].size;
		cells_[i].edge   |= cells_[j].edge;

		return false;
	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rdi, %r14
callq 0xf1b0
movl %eax, %ebx
movq %r14, %rdi
movl %ebp, %esi
callq 0xf1b0
cmpl %eax, %ebx
je 0xf1a5
movq 0x10(%r14), %rdx
movslq %ebx, %rcx
movslq %eax, %rsi
shlq $0x4, %rcx
shlq $0x4, %rsi
movzwl 0x2(%rdx,%rcx), %ecx
cmpw 0x2(%rdx,%rsi), %cx
movl %eax, %esi
movl %ebx, %ecx
cmovbl %ebx, %esi
cmovbl %eax, %ecx
movslq %esi, %rsi
shlq $0x4, %rsi
movw %cx, 0x4(%rdx,%rsi)
movslq %ecx, %rcx
movzwl 0x2(%rdx,%rsi), %edi
shlq $0x4, %rcx
addw %di, 0x2(%rdx,%rcx)
movb 0x6(%rdx,%rsi), %sil
orb %sil, 0x6(%rdx,%rcx)
cmpl %eax, %ebx
sete %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/compacttree.h
// Function: Morat::CompactTree<Morat::Hex::AgentMCTS::Node>::Freelist::pop(unsigned int)
Data * pop(unsigned int num){
			lock.lock();
			Data * t = pop_nolock(num);
			lock.unlock();
			return t;
		}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
leaq 0x1390(%rdi), %rbx
movq %rdi, %r14
movl %esi, %ebp
movq %rbx, %rdi
callq 0xeda4
movl %ebp, %ecx
movq (%r14,%rcx,8), %rax
testq %rax, %rax
je 0xf391
movq 0x8(%rax), %rdx
movq %rdx, (%r14,%rcx,8)
movl $0x0, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/compacttree.h
// Function: Morat::CompactTree<Morat::Hex::AgentPNS::Node>::Data::Data(unsigned int, Morat::CompactTree<Morat::Hex::AgentPNS::Node>::Data**)
Data(unsigned int n, Data ** p) : capacity(n), used(n), parent(p) {
			header = (((unsigned long)this >> 2) & 0xFFFF) | (0xBEEF << 16);
			if(empty()) header += 0xABCD;

			for(Node * i = begin(), * e = end(); i != e; ++i)
				new(i) Node(); //call the constructors
		}

// Assembly:
movl $0xf03, %ecx            # imm = 0xF03
movw %si, 0x4(%rdi)
movw %si, 0x6(%rdi)
movq %rdx, 0x8(%rdi)
movw $0x78fc, 0x22(%rdi)     # imm = 0x78FC
andq $0x0, 0x28(%rdi)
leaq 0x10(%rdi), %rax
bextrl %ecx, %edi, %ecx
leal -0x41110000(%rcx,%rcx), %ecx
movl %ecx, (%rdi)
movzwl %si, %ecx
shll $0x5, %ecx
testq %rcx, %rcx
je 0x17696
movw $0x78fc, 0x12(%rax)     # imm = 0x78FC
andq $0x0, 0x18(%rax)
addq $0x20, %rax
addq $-0x20, %rcx
jmp 0x1767c
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/compacttree.h
// Function: Morat::CompactTree<Morat::Hex::AgentMCTS::Node>::Chunk::alloc(unsigned int)
void alloc(unsigned int c){
			assert_empty();
			capacity = c;
			used = 0;
			mem = (char*) new uint64_t[capacity / sizeof(uint64_t)]; //use uint64_t instead of char to guarantee alignment
		}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0xf450
movl %ebx, 0xc(%r14)
andl $0x0, 0x10(%r14)
andl $-0x8, %ebx
movq %rbx, %rdi
callq 0x5030
movq %rax, 0x18(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/compacttree.h
// Function: Morat::CompactTree<Morat::Hex::AgentMCTS::Node>::Data::move(Morat::CompactTree<Morat::Hex::AgentMCTS::Node>::Data*)
void move(Data * s){
			assert(!empty()); //don't move an empty Data segment
			assert(*parent == s); //my parent points to my old location

			//update my parent with my new location
			*parent = this;

			//make sure the parent points back to the same place
			assert(parent_consistent());

			//update my children
			for(Node * i = begin(), * e = end(); i != e; ++i){
				if(i->children.data){
					i->children.data->parent = &(i->children.data);
					assert(i->children.data->parent_consistent());
				}
			}
		}

// Assembly:
pushq %rax
movl (%rdi), %eax
cmpl $0x4, %eax
jbe 0xf537
movq 0x8(%rdi), %rcx
cmpq %rsi, (%rcx)
jne 0xf550
movq %rdi, (%rcx)
movq 0x8(%rdi), %rcx
movq (%rcx), %rcx
cmpl (%rcx), %eax
jne 0xf569
movzwl 0x6(%rdi), %eax
addq $0x38, %rdi
imulq $0x30, %rax, %rax
testq %rax, %rax
je 0xf518
movq (%rdi), %rcx
testq %rcx, %rcx
je 0xf50e
movq %rdi, 0x8(%rcx)
movq (%rdi), %rcx
movl (%rcx), %edx
movq 0x8(%rcx), %rcx
movq (%rcx), %rcx
cmpl (%rcx), %edx
jne 0xf51a
addq $0x30, %rdi
addq $-0x30, %rax
jmp 0xf4ed
popq %rax
retq
leaq 0x14771(%rip), %rdi     # 0x23c92
leaq 0x14179(%rip), %rsi     # 0x236a1
leaq 0x146e8(%rip), %rcx     # 0x23c17
pushq $0x6a
popq %rdx
callq 0x51f0
leaq 0x146d0(%rip), %rdi     # 0x23c0e
leaq 0x1415c(%rip), %rsi     # 0x236a1
leaq 0x146cb(%rip), %rcx     # 0x23c17
pushq $0x5d
jmp 0xf531
leaq 0x1472e(%rip), %rdi     # 0x23c85
leaq 0x14143(%rip), %rsi     # 0x236a1
leaq 0x146b2(%rip), %rcx     # 0x23c17
pushq $0x5e
jmp 0xf531
leaq 0x14734(%rip), %rdi     # 0x23ca4
leaq 0x1412a(%rip), %rsi     # 0x236a1
leaq 0x14699(%rip), %rcx     # 0x23c17
pushq $0x64
jmp 0xf531
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/compacttree.h
// Function: Morat::CompactTree<Morat::Hex::AgentMCTS::Node>::Chunk::dealloc(bool)
void dealloc(bool deallocnext = false){
			assert(capacity > 0 && mem != NULL);
			if(deallocnext && next != NULL){
				next->dealloc(deallocnext);
				delete next;
				next = NULL;
			}
			assert(next == NULL);
			capacity = 0;
			used = 0;
			delete[] (uint64_t *)mem;
			mem = NULL;
		}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0xc(%rdi)
je 0xf5f8
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0xf5f8
movq (%rbx), %rax
testb %sil, %sil
je 0xf5dc
testq %rax, %rax
je 0xf5e1
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0xf582
movq (%rbx), %r14
testq %r14, %r14
je 0xf5c0
movq %r14, %rdi
callq 0xf450
movq %r14, %rdi
callq 0x52f0
andq $0x0, (%rbx)
movq 0x18(%rbx), %rdi
andq $0x0, 0xc(%rbx)
testq %rdi, %rdi
jne 0xf5e6
jmp 0xf5eb
testq %rax, %rax
jne 0xf617
andq $0x0, 0xc(%rbx)
callq 0x5450
andq $0x0, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x146b9(%rip), %rdi     # 0x23cb8
leaq 0x1409b(%rip), %rsi     # 0x236a1
leaq 0x146c7(%rip), %rcx     # 0x23cd4
movl $0xd4, %edx
callq 0x51f0
leaq 0x14428(%rip), %rdi     # 0x23a46
leaq 0x1407c(%rip), %rsi     # 0x236a1
leaq 0x146a8(%rip), %rcx     # 0x23cd4
movl $0xda, %edx
callq 0x51f0
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/thread.h
// Function: Morat::Barrier::wait()
bool wait(){
		cond.lock();

		//wait for threads to exit
		while(counter > waitexit)
			cond.wait();

		bool flip = (++counter == numthreads);

		if(flip){
			counter--;
			if(numthreads > 1)
				counter += waitexit;
			cond.broadcast();
		}else{
			while(counter < waitexit)
				cond.wait();

			counter--;
			if(counter == waitexit){
				counter = 0;
				cond.broadcast();
			}
		}
		cond.unlock();

		return flip;
	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x54e0
movl 0x5c(%rbx), %eax
cmpl $0x40000001, %eax       # imm = 0x40000001
jb 0xface
movq %rbx, %rdi
callq 0xfb3a
jmp 0xfaba
movl 0x5c(%rbx), %ebp
incl %ebp
movl %ebp, 0x5c(%rbx)
movl 0x58(%rbx), %r14d
cmpl %r14d, %ebp
jne 0xfaf4
decl 0x5c(%rbx)
movl 0x58(%rbx), %eax
cmpl $0x2, %eax
jb 0xfb1b
movl $0x40000000, %eax       # imm = 0x40000000
addl 0x5c(%rbx), %eax
jmp 0xfb18
movl 0x5c(%rbx), %eax
cmpl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
ja 0xfb08
movq %rbx, %rdi
callq 0xfb3a
jmp 0xfaf4
decl 0x5c(%rbx)
xorl %eax, %eax
movl 0x5c(%rbx), %ecx
cmpl $0x40000000, %ecx       # imm = 0x40000000
jne 0xfb24
movl %eax, 0x5c(%rbx)
leaq 0x28(%rbx), %rdi
callq 0x50d0
cmpl %r14d, %ebp
movq %rbx, %rdi
sete %bpl
callq 0x5250
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/thread.h
// Function: Morat::Barrier::~Barrier()
~Barrier(){
		cond.lock();

		//wait for threads to exit
		while(counter > waitexit)
			cond.wait();

		cond.unlock();
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x54e0
movl 0x5c(%rbx), %eax
cmpl $0x40000001, %eax       # imm = 0x40000001
jb 0xfe21
movq %rbx, %rdi
callq 0xfb3a
jmp 0xfe0d
movq %rbx, %rdi
callq 0x5250
movq %rbx, %rdi
popq %rbx
jmp 0xfe7a
movq %rax, %rdi
callq 0x8cf5
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/thread.h
// Function: Morat::Barrier::reset(int)
void reset(int n){
		cond.lock();
		assert(counter == 0);
		numthreads = n;
		cond.unlock();
	}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x54e0
cmpl $0x0, 0x5c(%rbx)
jne 0xfece
movl %ebp, 0x58(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5250
leaq 0x1412b(%rip), %rdi     # 0x24000
leaq 0x140f6(%rip), %rsi     # 0x23fd2
leaq 0x1412a(%rip), %rcx     # 0x2400d
movl $0xca, %edx
callq 0x51f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/policy_bridge.h
// Function: Morat::ProtectBridge<Morat::Hex::Board>::ProtectBridge()
ProtectBridge() : offset(0) {
		// precompute the valid moves around a pattern for all possible 6-patterns.
		for(unsigned int i = 0; i < 1<<12; i++){
			lookup[0][i] = lookup[1][i] = 0;
			unsigned int p = i;
			for(unsigned int d = 0; d < 6; d++){
				// player 1
				if((p & 0x1D) == 0x11) // 01 11 01 -> 01 00 01
					lookup[0][i] |= (1 << ((d+1)%6)); // +1 because we want to play in the empty spot

				// player 2
				if((p & 0x2E) == 0x22) // 10 11 10 -> 10 00 10
					lookup[1][i] |= (1 << ((d+1)%6));

				p = ((p & 0xFFC)>>2) | ((p & 0x3) << 10);
			}
		}
	}

// Assembly:
pushq %rbx
andl $0x0, (%rdi)
movl $0x2, %ecx
movl $0x1, %edx
movl $0xa02, %esi            # imm = 0xA02
xorl %eax, %eax
cmpq $0x1000, %rax           # imm = 0x1000
je 0x10332
xorl %r8d, %r8d
movb %r8b, 0x1004(%rdi,%rax)
movb %r8b, 0x4(%rdi,%rax)
xorl %r9d, %r9d
movl %eax, %r10d
xorl %r11d, %r11d
cmpl $0x6, %r11d
je 0x1032a
movl %r10d, %ebx
andl $0x1d, %ebx
cmpl $0x11, %ebx
jne 0x102f3
cmpl $0x5, %r11d
shlxl %r11d, %ecx, %ebx
cmovel %edx, %ebx
orb %bl, %r9b
movb %r9b, 0x4(%rdi,%rax)
movl %r10d, %ebx
andl $0x2e, %ebx
cmpl $0x22, %ebx
jne 0x10315
cmpl $0x5, %r11d
shlxl %r11d, %ecx, %ebx
cmovel %edx, %ebx
orb %bl, %r8b
movb %r8b, 0x1004(%rdi,%rax)
bextrl %esi, %r10d, %ebx
andl $0x3, %r10d
incl %r11d
shll $0xa, %r10d
orl %ebx, %r10d
jmp 0x102ce
incq %rax
jmp 0x102ad
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/thread.h
// Function: Morat::Thread::operator()(std::function<void ()>)
int operator()(std::function<void()> fn){
		assert(destruct == false);

		func = fn;
		destruct = true;
		return pthread_create(&thread, NULL, (void* (*)(void*)) &Thread::runner, this);
	}

// Assembly:
pushq %rbx
cmpb $0x0, 0x8(%rdi)
jne 0x103b8
movq %rdi, %rbx
addq $0x10, %rdi
callq 0x105b8
movb $0x1, 0x8(%rbx)
leaq 0x266(%rip), %rdx       # 0x10610
movq %rbx, %rdi
xorl %esi, %esi
movq %rbx, %rcx
popq %rbx
jmp 0x5680
leaq 0x13cc4(%rip), %rdi     # 0x24083
leaq 0x13c0c(%rip), %rsi     # 0x23fd2
leaq 0x13cc8(%rip), %rcx     # 0x24095
pushq $0x5c
popq %rdx
callq 0x51f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/agentpool.h
// Function: Morat::AgentThreadBase<Morat::Hex::AgentPNS>::run()
void run(){
		while(true){
			switch(pool->thread_state){
			case Thread_Cancelled:  //threads should exit
				return;

			case Thread_Wait_Start: //threads are waiting to start
			case Thread_Wait_Start_Cancelled:
				pool->run_barrier.wait();
				CAS(pool->thread_state, Thread_Wait_Start, Thread_Running);
				CAS(pool->thread_state, Thread_Wait_Start_Cancelled, Thread_Cancelled);
				break;

			case Thread_Wait_End:   //threads are waiting to end
				pool->run_barrier.wait();
				CAS(pool->thread_state, Thread_Wait_End, Thread_Wait_Start);
				break;

			case Thread_Running:    //threads are running
				if(agent->done()){ //solved or finished runs
					CAS(pool->thread_state, Thread_Running, Thread_Wait_End);
					break;
				}
				if(agent->need_gc()){ //out of memory, start garbage collection
					CAS(pool->thread_state, Thread_Running, Thread_GC);
					break;
				}
				iterate();
				break;

			case Thread_GC:         //one thread is running garbage collection, the rest are waiting
			case Thread_GC_End:     //once done garbage collecting, go to wait_end instead of back to running
				if(pool->gc_barrier.wait()){
					agent->start_gc();
					CAS(pool->thread_state, Thread_GC,     Thread_Running);
					CAS(pool->thread_state, Thread_GC_End, Thread_Wait_End);
				}
				pool->gc_barrier.wait();
				break;
			}
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xd9c0(%rip), %r13      # 0x24710
movq %rdi, %rbx
pushq $0x1
popq %rbp
pushq $0x3
popq %r14
pushq $0x2
popq %r15
pushq $0x6
popq %r12
movq 0x38(%rbx), %rdi
movl (%rdi), %eax
cmpq $0x6, %rax
ja 0x16d62
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
addq $0x20, %rdi
callq 0xfaae
movq 0x38(%rbx), %rcx
movl %ebp, %eax
xorl %edx, %edx
lock
cmpxchgl %r14d, (%rcx)
movl %r15d, %eax
movq 0x38(%rbx), %rcx
lock
cmpxchgl %edx, (%rcx)
jmp 0x16d62
subq $-0x80, %rdi
callq 0xfaae
testb %al, %al
je 0x16dc9
movq 0x40(%rbx), %rdi
callq 0x16e98
movq 0x38(%rbx), %rcx
pushq $0x4
popq %rax
lock
cmpxchgl %r14d, (%rcx)
movq 0x38(%rbx), %rcx
pushq $0x5
popq %rax
lock
cmpxchgl %r12d, (%rcx)
movq 0x38(%rbx), %rdi
subq $-0x80, %rdi
callq 0xfaae
jmp 0x16d62
movq 0x40(%rbx), %rax
cmpl $0x0, 0x1540(%rax)
je 0x16e26
cmpl $0x0, 0x1544(%rax)
je 0x16e26
movq %rax, %rdi
callq 0x159a8
testb %al, %al
je 0x16e33
movq 0x38(%rbx), %rcx
movl %r14d, %eax
pushq $0x4
popq %rdx
lock
cmpxchgl %edx, (%rcx)
jmp 0x16d62
addq $0x20, %rdi
callq 0xfaae
movq 0x38(%rbx), %rcx
movl %r12d, %eax
lock
cmpxchgl %ebp, (%rcx)
jmp 0x16d62
movl %r14d, %eax
lock
cmpxchgl %r12d, (%rdi)
jmp 0x16d62
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
jmp 0x16d62
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/../lib/bits.h
// Function: Morat::mix_bits(unsigned int)
inline uint32_t mix_bits(uint32_t h){
	h ^= h >> 16;
	h *= 0x85ebca6b;
	h ^= h >> 13;
	h *= 0xc2b2ae35;
	h ^= h >> 16;
	return h;
}

// Assembly:
movl %edi, %eax
shrl $0x10, %eax
xorl %edi, %eax
imull $0x85ebca6b, %eax, %eax # imm = 0x85EBCA6B
movl %eax, %ecx
shrl $0xd, %ecx
xorl %eax, %ecx
imull $0xc2b2ae35, %ecx, %ecx # imm = 0xC2B2AE35
movl %ecx, %eax
shrl $0x10, %eax
xorl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/lbdist.h
// Function: Morat::LBDistsBase<Morat::Hex::LBDists, Morat::Hex::Board>::IntPQueue::reset()
void reset(){
			current = 0;
			num = 0;
			for(int i = 0; i < maxvals; i++)
				counts[i] = 0;
		}

// Assembly:
andq $0x0, 0x7540(%rdi)
xorl %eax, %eax
cmpq $0x4, %rax
je 0x10b61
andl $0x0, 0x7530(%rdi,%rax,4)
incq %rax
jmp 0x10b4e
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/sgf.h
// Function: Morat::SGFParser<Morat::Move>::next_node()
bool next_node() {
		eat_whitespace(_is);
		if(eat_char(_is, ';')){
			read_node();
			return true;
		}
		return false;
	}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x1fc93
movq (%rbx), %rdi
pushq $0x3b
popq %rsi
callq 0x1fcf3
movl %eax, %ebp
testb %al, %al
je 0x10ead
movq %rbx, %rdi
callq 0x10eb6
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/sgf.h
// Function: Morat::SGFParser<Morat::Move>::read_node()
void read_node() {
		_properties.clear();
		char key[11], value[1025];
		for(int c = _is.peek(); _is.good() && 'A' <= c && c <= 'Z'; c = _is.peek()) {
			_is.getline(key, 10, '[');
			_is.getline(value, 1024, ']');
			_properties[key] = value;
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
leaq 0x8(%rdi), %r14
movq %rdi, %rbx
movq %r14, %rdi
callq 0xeb3e
movq (%rbx), %rdi
callq 0x5100
leaq 0x5(%rsp), %r15
leaq 0x30(%rsp), %r13
leaq 0x10(%rsp), %rbp
leaq 0x4(%rsp), %r12
addl $-0x41, %eax
cmpl $0x19, %eax
ja 0x10f62
movq (%rbx), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%rdi,%rax)
jne 0x10f62
movq %r15, %rsi
pushq $0xa
popq %rdx
pushq $0x5b
popq %rcx
callq 0x56d0
movq (%rbx), %rdi
movl $0x400, %edx            # imm = 0x400
movq %r13, %rsi
pushq $0x5d
popq %rcx
callq 0x56d0
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5110
movq %r14, %rdi
movq %rbp, %rsi
callq 0xf636
movq %rax, %rdi
movq %r13, %rsi
callq 0x56c0
movq %rbp, %rdi
callq 0x5150
movq (%rbx), %rdi
callq 0x5100
jmp 0x10ef2
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rsp), %rdi
movq %rax, %rbx
callq 0x5150
movq %rbx, %rdi
callq 0x5650
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/agentmctsthread.cpp
// Function: Morat::Hex::AgentMCTS::AgentThread::iterate()
void AgentMCTS::AgentThread::iterate(){
	INCR(agent->runs);
	if(agent->profile){
		timestamps[0] = Time();
		stage = 0;
	}

	movelist.reset(&(agent->rootboard));
	agent->root.exp.addvloss();
	Board copy = agent->rootboard;
	use_rave    = (unitrand() < agent->userave);
	use_explore = (unitrand() < agent->useexplore);
	walk_tree(copy, & agent->root, 0);
	agent->root.exp.addv(movelist.getexp(~agent->rootboard.to_play()));

	if(agent->profile){
		times[0] += timestamps[1] - timestamps[0];
		times[1] += timestamps[2] - timestamps[1];
		times[2] += timestamps[3] - timestamps[2];
		times[3] += Time() - timestamps[3];
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq 0x40(%rdi), %rax
movq %rdi, %rbx
lock
incq 0x4120(%rax)
movq 0x40(%rdi), %rsi
cmpb $0x1, 0x68(%rsi)
jne 0x11010
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x5ca0
movq (%r14), %rax
movq %rax, 0x121c8(%rbx)
andl $0x0, 0x12120(%rbx)
movq 0x40(%rbx), %rsi
leaq 0xcb78(%rbx), %r14
addq $0x10, %rsi
movq %r14, %rdi
callq 0x1253e
movq 0x40(%rbx), %rax
leaq 0x8(%rsp), %rdi
lock
incq 0x40f8(%rax)
movq 0x40(%rbx), %rsi
addq $0x10, %rsi
callq 0x9908
leaq 0x48(%rbx), %r15
movq %r15, %rdi
callq 0x12586
movq 0x40(%rbx), %rax
vmovss 0x88(%rax), %xmm1
vucomiss %xmm0, %xmm1
seta 0x2f14(%rbx)
movq %r15, %rdi
callq 0x12586
movq 0x40(%rbx), %rdx
vmovss 0x8c(%rdx), %xmm1
vucomiss %xmm0, %xmm1
seta 0x2f15(%rbx)
addq $0x40e0, %rdx           # imm = 0x40E0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x11174
movq 0x40(%rbx), %rax
movb $0x3, %cl
subb 0x18(%rax), %cl
movsbq %cl, %rcx
shlq $0x4, %rcx
leaq -0x10(%rcx,%r14), %rcx
movq (%rcx), %rdx
testq %rdx, %rdx
je 0x110bf
lock
addq %rdx, 0x40f0(%rax)
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
je 0x110d0
lock
addq %rcx, 0x40f8(%rax)
movq 0x40(%rbx), %rax
cmpb $0x1, 0x68(%rax)
jne 0x1114a
vmovupd 0x121c8(%rbx), %xmm0
vmovupd 0x121d0(%rbx), %xmm1
movq %rsp, %r14
movq %r14, %rdi
vunpcklpd %xmm1, %xmm0, %xmm0 # xmm0 = xmm0[0],xmm1[0]
vsubpd %xmm0, %xmm1, %xmm0
vaddpd 0x121a8(%rbx), %xmm0, %xmm0
vmovupd %xmm0, 0x121a8(%rbx)
vmovsd 0x121e0(%rbx), %xmm0
vsubsd 0x121d8(%rbx), %xmm0, %xmm0
vaddsd 0x121b8(%rbx), %xmm0, %xmm0
vmovsd %xmm0, 0x121b8(%rbx)
callq 0x5ca0
vmovsd (%r14), %xmm0
vsubsd 0x121e0(%rbx), %xmm0, %xmm0
vaddsd 0x121c0(%rbx), %xmm0, %xmm0
vmovsd %xmm0, 0x121c0(%rbx)
leaq 0x8(%rsp), %rdi
callq 0x83bc
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x8(%rsp), %rdi
movq %rax, %rbx
callq 0x83bc
movq %rbx, %rdi
callq 0x5650
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/agentmctsthread.cpp
// Function: Morat::Hex::AgentMCTS::AgentThread::add_knowledge(Morat::Hex::Board const&, Morat::Hex::AgentMCTS::Node*, Morat::Hex::AgentMCTS::Node*)
void AgentMCTS::AgentThread::add_knowledge(const Board & board, Node * node, Node * child){
	if(agent->localreply){ //boost for moves near the previous move
		int dist = board.dist(node->move, child->move);
		if(dist < 4)
			child->know += agent->localreply * (4 - dist);
	}

	if(agent->locality) //boost for moves near previous stones
		child->know += agent->locality * board.local(child->move, board.to_play());

	Board::Cell cell;
	if(agent->connect || agent->size)
		cell = board.test_cell(child->move);

//	if(agent->connect) //boost for moves that connect to edges
//		child->know += agent->connect * cell.numedges();

	if(agent->size) //boost for size of the group
		child->know += agent->size * cell.size;

	if(agent->bridge && test_bridge_probe(board, node->move, child->move)) //boost for maintaining a virtual connection
		child->know += agent->bridge;

	if(agent->dists)
		child->know += abs(agent->dists) * std::max(0, board.lines() - dists.get(child->move, board.to_play()));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq 0x40(%rdi), %rcx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
cmpl $0x0, 0xb4(%rcx)
je 0x1226b
leaq 0x24(%r12), %rsi
leaq 0x24(%rbx), %rdx
movq %r15, %rdi
callq 0x12888
movq 0x40(%r14), %rcx
cmpl $0x3, %eax
jg 0x1226b
pushq $0x4
popq %rdx
subl %eax, %edx
imull 0xb4(%rcx), %edx
addw %dx, 0x20(%rbx)
movl 0xb8(%rcx), %ebp
testl %ebp, %ebp
je 0x12290
movl 0x8(%r15), %edx
leaq 0x24(%rbx), %rsi
movq %r15, %rdi
callq 0x128d4
imull %ebp, %eax
addw %ax, 0x20(%rbx)
movq 0x40(%r14), %rcx
cmpl $0x0, 0xbc(%rcx)
jne 0x122a2
cmpl $0x0, 0xc0(%rcx)
je 0x122c6
leaq 0x24(%rbx), %rsi
movq %r15, %rdi
callq 0x128e8
movq 0x40(%r14), %rcx
movl 0xc0(%rcx), %edx
testl %edx, %edx
je 0x122c6
shrl $0x10, %eax
imull %edx, %eax
addw %ax, 0x20(%rbx)
cmpl $0x0, 0xc4(%rcx)
je 0x122f5
addq $0x24, %r12
leaq 0x24(%rbx), %rcx
movq %r15, %rsi
movq %r12, %rdx
callq 0x1233e
movq 0x40(%r14), %rcx
testb %al, %al
je 0x122f5
movzwl 0xc4(%rcx), %eax
addw %ax, 0x20(%rbx)
movl 0xc8(%rcx), %eax
testl %eax, %eax
je 0x12335
movl 0x8(%r15), %edx
movl 0x24(%rbx), %esi
movsbl (%r15), %r12d
movl %eax, %ebp
negl %ebp
cmovsl %eax, %ebp
addq $0x2f18, %r14           # imm = 0x2F18
movq %r14, %rdi
callq 0x129d6
subl %eax, %r12d
movl %r12d, %eax
sarl $0x1f, %eax
andnl %r12d, %eax, %eax
imull %ebp, %eax
addw %ax, 0x20(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/agentmctsthread.cpp
// Function: Morat::Hex::AgentMCTS::AgentThread::rollout_choose_move(Morat::Hex::Board&, Morat::Move const&)
Move AgentMCTS::AgentThread::rollout_choose_move(Board & board, const Move & prev){
	//look for instant wins
	if(agent->instantwin){
		Move move = instant_wins.choose_move(board, prev);
		if(move != M_UNKNOWN)
			return move;
	}

	//force a bridge reply
	if(agent->rolloutpattern){
		Move move = protect_bridge.choose_move(board, prev);
		if(move != M_UNKNOWN)
			return move;
	}

	//reuse the last good reply
	if(agent->lastgoodreply){
		Move move = last_good_reply.choose_move(board, prev);
		if(move != M_UNKNOWN)
			return move;
	}

	return random_policy.choose_move(board, prev);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x40(%rdi), %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpl $0x0, 0xd8(%rax)
je 0x124df
leaq 0x2f08(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12ad6
cmpb $-0x4, %al
jne 0x12538
movq 0x40(%r15), %rax
cmpb $0x1, 0xd0(%rax)
jne 0x12502
leaq 0xf04(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12d34
cmpb $-0x4, %al
jne 0x12538
movq 0x40(%r15), %rax
cmpl $0x0, 0xd4(%rax)
je 0x1251e
leaq 0x4c(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x12dcc
cmpb $-0x4, %al
jne 0x12538
addq $0xa14, %r15            # imm = 0xA14
movq %r14, %rsi
movq %rbx, %rdx
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x12e4a
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/movelist.h
// Function: Morat::MoveList<Morat::Hex::Board>::reset(Morat::Hex::Board*)
void reset(Board * b){
		tree = 0;
		rollout = 0;
		board = b;
		exp[0].clear();
		exp[1].clear();
		for(int i = 0; i < b->vec_size(); i++){
			rave[0][i].clear();
			rave[1][i].clear();
		}
	}

// Assembly:
andq $0x0, 0x5594(%rdi)
vxorps %xmm0, %xmm0, %xmm0
movq %rsi, 0x55a0(%rdi)
xorl %eax, %eax
vmovups %ymm0, (%rdi)
addq $0x2730, %rdi           # imm = 0x2730
vxorps %xmm0, %xmm0, %xmm0
movsbl (%rsi), %ecx
imull %ecx, %ecx
cmpq %rcx, %rax
jae 0x12582
vmovups %xmm0, -0x2710(%rdi)
vmovups %xmm0, (%rdi)
incq %rax
addq $0x10, %rdi
jmp 0x12562
vzeroupper
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/depthstats.h
// Function: Morat::DepthStats::add(unsigned int)
void add(unsigned int depth){
		num++;
		if(mindepth > depth) mindepth = depth;
		if(maxdepth < depth) maxdepth = depth;
		sumdepth += depth;
		sumdepthsq += depth*depth;
	}

// Assembly:
incl 0x8(%rdi)
cmpl %esi, (%rdi)
jbe 0x126bb
movl %esi, (%rdi)
cmpl %esi, 0x4(%rdi)
jae 0x126c3
movl %esi, 0x4(%rdi)
movl %esi, %eax
imull %esi, %esi
addq %rax, 0x10(%rdi)
addq %rsi, 0x18(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/lbdist.h
// Function: Morat::LBDistsBase<Morat::Hex::LBDists, Morat::Hex::Board>::run(Morat::Hex::Board const*, bool, Morat::Side)
void run(const Board * b, bool crossvcs = true, Side side = Side::BOTH) {
	// run the flood fills needed to generate the distances
		board = b;

		for(int i = 0; i < Board::LBDist_directions; i++)
			for(int j = 0; j < 2; j++)
				for(int k = 0; k < board->vec_size(); k++)
					dists[i][j][k] = maxdist; //far far away!

		if((side & Side::P1) == Side::P1) self()->init_player(crossvcs, Side::P1);
		if((side & Side::P2) == Side::P2) self()->init_player(crossvcs, Side::P2);
	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, 0x9c58(%rdi)
movl %ecx, %ebp
movq %rdi, %rbx
xorl %ecx, %ecx
movsbl (%rsi), %eax
movq %rdi, %rsi
imull %eax, %eax
cmpq $0x2, %rcx
je 0x1272c
movq %rsi, %rdi
xorl %r8d, %r8d
cmpq $0x2, %r8
je 0x12720
xorl %r9d, %r9d
cmpq %r9, %rax
je 0x12714
movl $0x3e8, (%rdi,%r9,4)    # imm = 0x3E8
incq %r9
jmp 0x12702
incq %r8
addq $0x9c4, %rdi            # imm = 0x9C4
jmp 0x126f9
incq %rcx
addq $0x1388, %rsi           # imm = 0x1388
jmp 0x126ed
leaq 0x14777(%rip), %rax     # 0x26eaa
notb %bpl
movzbl %dl, %r14d
movb (%rax), %al
testb %bpl, %al
jne 0x1274f
movzbl %al, %edx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1300e
leaq 0x14755(%rip), %rax     # 0x26eab
movb (%rax), %al
testb %bpl, %al
jne 0x1276f
movzbl %al, %edx
movq %rbx, %rdi
movl %r14d, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x1300e
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/board.h
// Function: Morat::Hex::Board::test_outcome(Morat::MoveValid const&, Morat::Side) const
Outcome test_outcome(const MoveValid & pos, Side turn) const {
		if(test_local(pos, turn)){
			Cell testcell = cells_[find_group(pos.xy)];
			int numgroups = 0;
			auto it = neighbors_small(pos);
			for (const MoveValid *i = it.begin(), *e = it.end(); i < e; i++) {
				if(i->on_board() && turn == get(i->xy)){
					const Cell * g = & cells_[find_group(i->xy)];
					testcell.edge   |= g->edge;
					testcell.size   += g->size;
					i++; //skip the next one
					numgroups++;
				}
			}

			int winmask = (turn == Side::P1 ? 3 : 0xC);
			if((testcell.edge & winmask) == winmask)
				return +turn;
		}

		return Outcome::UNKNOWN;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
callq 0x12f78
testb %al, %al
je 0x12827
movswl 0x2(%r15), %esi
movq %r14, %rdi
callq 0xf1b0
movslq %eax, %rcx
movq 0x10(%r14), %rax
movswq 0x2(%r15), %rsi
movq 0x38(%r14), %rdx
xorl %r12d, %r12d
shlq $0x4, %rcx
movb 0x6(%rax,%rcx), %bpl
imulq $0x48, %rsi, %rcx
leaq 0x2(%rdx,%rcx), %r15
cmpq $0x18, %r12
jge 0x1280a
movswq (%r15,%r12), %rsi
cmpq $-0x1, %rsi
je 0x12804
movq %rsi, %rcx
shlq $0x4, %rcx
cmpb %bl, (%rax,%rcx)
jne 0x12804
movq %r14, %rdi
callq 0xf1b0
movslq %eax, %rcx
movq 0x10(%r14), %rax
addq $0x4, %r12
shlq $0x4, %rcx
orb 0x6(%rax,%rcx), %bpl
addq $0x4, %r12
jmp 0x127cb
leaq 0x14699(%rip), %rax     # 0x26eaa
xorl %ecx, %ecx
cmpb %bl, (%rax)
movzbl %bpl, %eax
sete %cl
leal -0xd(%rcx,%rcx,8), %ecx
orl %eax, %ecx
cmpl $-0x1, %ecx
je 0x12830
leaq 0x14680(%rip), %rax     # 0x26eae
movb (%rax), %bl
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/board.h
// Function: Morat::Hex::Board::test_cell(Morat::Move const&) const
Cell test_cell(const Move & pos) const {
		Side turn = to_play();
		int posxy = xy(pos);

		Cell testcell = cells_[find_group(posxy)];
		auto it = neighbors_small(posxy);
		for (const MoveValid *i = it.begin(), *e = it.end(); i < e; i++) {
			if(i->on_board() && turn == get(i->xy)){
				const Cell * g = & cells_[find_group(i->xy)];
				testcell.edge   |= g->edge;
				testcell.size   += g->size; //not quite accurate if it's joining the same group twice
				i++; //skip the next one
			}
		}
		return testcell;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movsbq (%rsi), %rax
movsbq (%rdi), %rcx
movsbq 0x1(%rsi), %r15
movb 0x8(%rdi), %bpl
movq %rdi, %r14
imulq %rax, %rcx
addq %rcx, %r15
movl %r15d, %esi
callq 0xf1b0
movslq %eax, %rcx
movq 0x10(%r14), %rax
movq 0x38(%r14), %rdx
xorl %ebx, %ebx
shlq $0x4, %rcx
movq (%rax,%rcx), %r12
movq 0x8(%rax,%rcx), %rcx
movq %rcx, 0x10(%rsp)
imulq $0x48, %r15, %rcx
movl %r12d, %r13d
movq %r12, 0x8(%rsp)
shrl $0x10, %r13d
shrq $0x30, %r12
leaq 0x2(%rdx,%rcx), %r15
cmpq $0x18, %rbx
jge 0x12997
movswq (%r15,%rbx), %rsi
cmpq $-0x1, %rsi
je 0x12991
movq %rsi, %rcx
shlq $0x4, %rcx
cmpb (%rax,%rcx), %bpl
jne 0x12991
movq %r14, %rdi
callq 0xf1b0
movslq %eax, %rcx
movq 0x10(%r14), %rax
addq $0x4, %rbx
shlq $0x4, %rcx
orb 0x6(%rax,%rcx), %r12b
addw 0x2(%rax,%rcx), %r13w
addq $0x4, %rbx
jmp 0x12951
movq 0x8(%rsp), %rdx
movzbl %r12b, %eax
movabsq $-0xff000100000000, %rcx # imm = 0xFF00FFFF00000000
shll $0x10, %r13d
shlq $0x30, %rax
andq %rdx, %rcx
orq %rax, %rcx
movzwl %dx, %eax
movq 0x10(%rsp), %rdx
orq %rcx, %r13
orq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/policy_lastgoodreply.h
// Function: Morat::LastGoodReply<Morat::Hex::Board>::rollout_end(Morat::Hex::Board const&, Morat::MoveList<Morat::Hex::Board> const&, Morat::Outcome)
void rollout_end(const Board & board, const MoveList<Board> & movelist, Outcome outcome) {
		if(!enabled || outcome != Outcome::DRAW)
			return;
		int m = -1;
		for(const MovePlayer * i = movelist.begin(), * e = movelist.end(); i != e; i++){
			if(m >= 0){
				if(+i->player == outcome && *i != M_SWAP)
					goodreply[i->player.to_i() - 1][m] = *i;
				else if(enabled == 2)
					goodreply[i->player.to_i() - 1][m] = M_UNKNOWN;
			}
			m = board.xy(*i);
		}
	}

// Assembly:
cmpl $0x0, 0x9c4(%rdi)
je 0x12ad4
leaq 0x1448d(%rip), %rax     # 0x26eb1
cmpb %cl, (%rax)
jne 0x12ad4
movslq 0x5594(%rdx), %rax
movslq 0x5598(%rdx), %r8
movsbq %cl, %r9
decq %r9
leaq (%rax,%rax,2), %r10
leaq (%r8,%r8,2), %rax
addq %r10, %rax
pushq $-0x1
popq %r10
imulq $0x4e2, %r9, %r9        # imm = 0x4E2
xorl %r8d, %r8d
addq %rdi, %r9
cmpq %r8, %rax
je 0x12ad4
testl %r10d, %r10d
js 0x12ab1
movsbq 0x4e42(%rdx,%r8), %r11
movl %r10d, %r10d
cmpb %cl, %r11b
jne 0x12a93
cmpb $-0x1, 0x4e40(%rdx,%r8)
je 0x12a93
movzwl 0x4e40(%rdx,%r8), %r11d
movw %r11w, (%r9,%r10,2)
jmp 0x12ab1
cmpl $0x2, 0x9c4(%rdi)
jne 0x12ab1
imulq $0x4e2, %r11, %r11      # imm = 0x4E2
addq %rdi, %r11
movw $0x78fc, -0x4e2(%r11,%r10,2) # imm = 0x78FC
movsbl 0x4e40(%rdx,%r8), %r10d
movsbl (%rsi), %r11d
imull %r10d, %r11d
movsbl 0x4e41(%rdx,%r8), %r10d
addq $0x3, %r8
addl %r11d, %r10d
jmp 0x12a5d
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/policy_bridge.h
// Function: Morat::ProtectBridge<Morat::Hex::Board>::choose_move(Morat::Hex::Board const&, Morat::Move const&)
Move choose_move(const Board & board, const Move & prev) {
		uint32_t p = board.pattern_small(prev);
		uint16_t r = lookup[board.to_play().to_i()-1][p];

		if(!r) // nothing to save
			return M_UNKNOWN;

		unsigned int i;
		if((r & (r - 1)) == 0){ // only one bit set
			i = trailing_zeros(r);
		} else { // multiple choices of bridges to save
			offset = (offset + 1) % 6; // rotate the starting offset to avoid directional bias
			r |= (r << 6);
			r >>= offset;
			i = (offset + trailing_zeros(r)) % 6;
		}
		return board.neighbors(prev)[i];
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
movq %rdx, %r14
movq %rsi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x13bba
movsbq 0x8(%rbx), %rcx
movl %eax, %eax
shlq $0xc, %rcx
addq %r15, %rcx
movzbl -0xffc(%rax,%rcx), %ecx
testl %ecx, %ecx
je 0x12d99
blsrl %ecx, %eax
je 0x12d9f
movl (%r15), %eax
incl %eax
pushq $0x6
popq %rsi
cltd
idivl %esi
movl %ecx, %eax
shll $0x6, %eax
orl %ecx, %eax
movb $0x6, %cl
movl %edx, (%r15)
shrxl %edx, %eax, %eax
tzcntl %eax, %eax
addl %edx, %eax
cbtw
idivb %cl
movsbl %ah, %eax
jmp 0x12da3
movw $0x78fc, %ax            # imm = 0x78FC
jmp 0x12dc5
tzcntl %ecx, %eax
movsbq (%r14), %rcx
movsbq (%rbx), %rdx
movsbq 0x1(%r14), %rsi
movl %eax, %eax
imulq %rcx, %rdx
addq %rdx, %rsi
imulq $0x48, %rsi, %rcx
addq 0x38(%rbx), %rcx
movzwl (%rcx,%rax,4), %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/policy_lastgoodreply.h
// Function: Morat::LastGoodReply<Morat::Hex::Board>::choose_move(Morat::Hex::Board const&, Morat::Move const&) const
Move choose_move(const Board & board, const Move & prev) const {
		if (enabled && prev != M_SWAP) {
			Move move = goodreply[board.to_play().to_i() - 1][board.xy(prev)];
			if(move != M_UNKNOWN && board.valid_move_fast(move))
				return move;
		}
		return M_UNKNOWN;
	}

// Assembly:
cmpl $0x0, 0x9c4(%rdi)
je 0x12e36
movsbq (%rdx), %rax
cmpq $-0x1, %rax
je 0x12e36
movsbq 0x8(%rsi), %rcx
movsbq (%rsi), %r8
movsbq 0x1(%rdx), %rdx
imulq $0x4e2, %rcx, %rcx      # imm = 0x4E2
imulq %r8, %rax
addq %rax, %rdx
addq %rdi, %rcx
movzwl -0x4e2(%rcx,%rdx,2), %eax
cmpb $-0x4, %al
je 0x12e36
movsbq %al, %rdx
movzwl %ax, %ecx
leaq 0x14091(%rip), %rdi     # 0x26ea9
imulq %r8, %rdx
shrl $0x8, %ecx
shlq $0x4, %rdx
addq 0x10(%rsi), %rdx
movsbq %cl, %rsi
shlq $0x4, %rsi
movb (%rsi,%rdx), %dl
cmpb (%rdi), %dl
je 0x12e3e
movw $0x78, %cx
movw $0xfc, %ax
movzwl %cx, %ecx
movzbl %al, %eax
shll $0x8, %ecx
orl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/policy_random.h
// Function: Morat::RandomPolicy<Morat::Hex::Board>::choose_move(Morat::Hex::Board const&, Morat::Move const&)
Move choose_move(const Board & board, const Move & prev) {
		while(true){
			int r = rand() % cur;
			cur--;
			Move m = moves[r];
			moves[r] = moves[cur];
			moves[cur] = m;
			if(board.valid_move_fast(m))
				return m;
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x14053(%rip), %r15     # 0x26ea9
movq %rsi, %rbx
movq %rdi, %r14
movq %r14, %rdi
callq 0x12f58
movslq 0x4ec(%r14), %rcx
xorl %edx, %edx
divl %ecx
leal -0x1(%rcx), %eax
movl %eax, 0x4ec(%r14)
movslq %edx, %rdx
movzwl 0x2(%r14,%rcx,2), %ecx
movzwl 0x4(%r14,%rdx,2), %eax
movw %cx, 0x4(%r14,%rdx,2)
movl %eax, %esi
shrl $0x8, %esi
movslq 0x4ec(%r14), %rcx
movw %ax, 0x4(%r14,%rcx,2)
movsbq %al, %rcx
movsbq (%rbx), %rdx
imulq %rcx, %rdx
movsbq %sil, %rcx
shlq $0x4, %rcx
shlq $0x4, %rdx
addq 0x10(%rbx), %rdx
movb (%rcx,%rdx), %cl
cmpb (%r15), %cl
jne 0x12e5c
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/agentmcts.h
// Function: Morat::Hex::AgentMCTS::AgentThread::reset()
void reset(){
			treelen.reset();
			gamelen.reset();

			use_rave = false;
			use_explore = false;

			for(int a = 0; a < 2; a++)
				for(int b = 0; b < Board::num_win_types; b++)
					win_types[a][b].reset();

			for(int a = 0; a < 4; a++)
				times[a] = 0;
		}

// Assembly:
movl $0x3b9aca00, %eax       # imm = 0x3B9ACA00
vxorps %xmm0, %xmm0, %xmm0
andl $0x0, 0x12130(%rdi)
xorl %ecx, %ecx
movq %rax, 0x12128(%rdi)
vmovups %xmm0, 0x12138(%rdi)
andl $0x0, 0x12150(%rdi)
movq %rax, 0x12148(%rdi)
vmovups %xmm0, 0x12158(%rdi)
andw $0x0, 0x2f14(%rdi)
leaq 0x12178(%rdi), %rax
cmpq $0x40, %rcx
je 0x12f41
andl $0x0, -0x8(%rax,%rcx)
movq $0x3b9aca00, -0x10(%rax,%rcx) # imm = 0x3B9ACA00
vmovups %xmm0, (%rax,%rcx)
addq $0x20, %rcx
jmp 0x12f22
xorl %eax, %eax
cmpq $0x4, %rax
je 0x12f57
andq $0x0, 0x121a8(%rdi,%rax,8)
incq %rax
jmp 0x12f43
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/../lib/xorshift.h
// Function: Morat::XORShift_uint32::rand()
uint32_t rand(){
		r ^= (r << 13);
		r ^= (r >> 17);
		r ^= (r <<  5);
		return r * 1597334677;
	}

// Assembly:
movl (%rdi), %eax
movl %eax, %ecx
shll $0xd, %ecx
xorl %eax, %ecx
movl %ecx, %eax
shrl $0x11, %eax
xorl %ecx, %eax
movl %eax, %ecx
shll $0x5, %ecx
xorl %eax, %ecx
imull $0x5f356495, %ecx, %eax # imm = 0x5F356495
movl %ecx, (%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/hex/../lib/board_grid_hex.h
// Function: Morat::BoardGridHex<Morat::Hex::Board>::local(int, Morat::Side) const
int local(int i,               Side turn) const {
		Pattern p = pattern(i);
		Pattern x = ((p & 0xAAAAAAAAAull) >> 1) ^ (p & 0x555555555ull); // p1 is now when p1 or p2 but not both (ie off the board)
		p = x & (turn == Side::P1 ? p : p >> 1); // now just the selected player
		return (p & 0x000000FFF ? 3 : 0) |
		       (p & 0x000FFF000 ? 2 : 0) |
		       (p & 0xFFF000000 ? 1 : 0);
	}

// Assembly:
pushq %rbx
movl %edx, %ebx
callq 0x12fe4
leaq 0x13f0b(%rip), %rdx     # 0x26eaa
movq %rax, %rcx
shrq %rcx
xorq %rax, %rcx
cmpb %bl, (%rdx)
setne %dl
shrxq %rdx, %rax, %rdx
xorl %eax, %eax
andq %rcx, %rdx
testl $0x555000, %edx         # imm = 0x555000
setne %al
addl %eax, %eax
testw $0x555, %dx             # imm = 0x555
pushq $0x3
popq %rcx
movabsq $0x555000000, %rsi      # imm = 0x555000000
cmovel %eax, %ecx
xorl %eax, %eax
testq %rsi, %rdx
setne %al
orl %ecx, %eax
popq %rbx
retq
nop