LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]morat/gomoku/agentmcts.cpp
// Function: Morat::Gomoku::AgentMCTS::AgentMCTS(Morat::Gomoku::Board const&)
AgentMCTS::AgentMCTS(const Board & b) : Agent(b), pool(this) {
	nodes = 0;
	runs = 0;
	gclimit = 5;

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

	msrave      = -2;
	msexplore   = 0;

	explore     = 0;
	parentexplore = false;
	ravefactor  = 500;
	decrrave    = 200;
	knowledge   = true;
	userave     = 1;
	useexplore  = 1;
	fpurgency   = 1;
	rollouts    = 1;
	dynwiden    = 0;
	logdynwiden = (dynwiden ? std::log(dynwiden) : 0);

	shortrave   = false;
	keeptree    = true;
	minimax     = 2;
	visitexpand = 1;
	gcsolved    = 100000;

	localreply  = 0;
	locality    = 0;

	weightedrandom = false;
	lastgoodreply  = false;

	for(int i = 0; i < 4096; i++)
		gammas[i] = 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x11dae
leaq 0x35ab1(%rip), %rax     # 0x448c8
vxorps %xmm0, %xmm0, %xmm0
leaq 0x4110(%rbx), %r14
movq %rax, (%rbx)
leaq 0x2309a(%rip), %rax     # 0x31ec6
vmovups %ymm0, 0x40c0(%rbx)
movw $0x0, 0x40e0(%rbx)
movb (%rax), %al
movb %al, 0x40e2(%rbx)
movl $0xfc78fd00, 0x40e3(%rbx) # imm = 0xFC78FD00
movb $0x78, 0x40e7(%rbx)
movq $0x0, 0x40e8(%rbx)
movq %r14, %rdi
vzeroupper
callq 0x11e18
leaq 0x54d0(%rbx), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x11eaa
xorl %eax, %eax
movq %rax, 0x40f0(%rbx)
movq %rax, 0x4100(%rbx)
movl $0x5, 0x40f8(%rbx)
movb %al, 0x60(%rbx)
movb %al, 0x50(%rbx)
movl $0x1, 0x54(%rbx)
movl $0x1, %esi
movq %r12, %rdi
callq 0x11f36
vmovss 0x1f31e(%rip), %xmm0    # 0x2e1d8
movq $0x3e800000, 0x58(%rbx) # imm = 0x3E800000
movabsq $0x13f800000, %rax      # imm = 0x13F800000
vmovlps %xmm0, 0x64(%rbx)
vmovsd 0x1f387(%rip), %xmm0    # 0x2e260
movb $0x0, 0x6c(%rbx)
vmovsd %xmm0, 0x70(%rbx)
vbroadcastss 0x1f2f1(%rip), %xmm0 # 0x2e1dc
movl $0x43480000, 0x78(%rbx) # imm = 0x43480000
movb $0x1, 0x7c(%rbx)
vmovlps %xmm0, 0x80(%rbx)
movq %rax, 0x88(%rbx)
movabsq $0x100000002, %rax      # imm = 0x100000002
vxorps %xmm0, %xmm0, %xmm0
movq $0x0, 0x90(%rbx)
movw $0x100, 0x98(%rbx)      # imm = 0x100
movq %rax, 0x9c(%rbx)
movl $0x186a0, 0xa4(%rbx)    # imm = 0x186A0
vmovups %xmm0, 0xac(%rbx)
vbroadcastss 0x1f292(%rip), %zmm0 # 0x2e1dc
xorl %eax, %eax
vmovups %zmm0, 0xbc(%rbx,%rax,4)
addq $0x10, %rax
cmpq $0x1000, %rax           # imm = 0x1000
jne 0xef4c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
vzeroupper
retq
movq %r12, %rdi
movq %rax, %r15
callq 0x120ce
jmp 0xef82
movq %rax, %r15
movq %r14, %rdi
callq 0x12110
jmp 0xef8f
movq %rax, %r15
leaq 0x40c0(%rbx), %rdi
callq 0x1215a
movq %rbx, %rdi
callq 0x13324
movq %r15, %rdi
callq 0x5670
nop
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]morat/gomoku/board.h
// Function: Morat::Gomoku::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;

		if(checkwin) {
			outcome_ = test_outcome(pos, to_play_);
		}

		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_);

		to_play_ = ~to_play_;

		return true;
	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
leaq 0x1e920(%rip), %r8      # 0x31ec9
movb 0x9(%rdi), %al
movl %ecx, %ebp
cmpb (%r8), %al
jge 0x1368a
movswq 0x2(%rsi), %rcx
movq %rsi, %r14
cmpq $-0x1, %rcx
je 0x13683
movq 0x10(%rdi), %rax
leaq 0x1e8ed(%rip), %rsi     # 0x31ec1
shlq $0x4, %rcx
movq %rdi, %rbx
movb (%rax,%rcx), %cl
cmpb (%rsi), %cl
jne 0x13683
testb %dl, %dl
je 0x135ff
movl 0x8(%rbx), %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x136aa
movb %al, 0x9(%rbx)
movq 0x10(%rbx), %rax
movzwl (%r14), %ecx
leaq 0x1e9e6(%rip), %rsi     # 0x31ff0
movw %cx, 0x6(%rbx)
incw 0x4(%rbx)
movswq 0x2(%r14), %rcx
movb 0x8(%rbx), %dl
shlq $0x4, %rcx
movb %dl, (%rax,%rcx)
movb %bpl, 0x1(%rax,%rcx)
movswq 0x2(%r14), %rcx
movsbq 0x8(%rbx), %rax
leaq (%rcx,%rcx,2), %rcx
leaq (%rcx,%rax), %rdx
shlq $0x5, %rcx
movq (%rsi,%rdx,8), %rdx
xorl %esi, %esi
xorq %rdx, 0x28(%rbx)
addq 0x30(%rbx), %rcx
movq 0x10(%rbx), %rdx
movzwl 0x2(%rcx,%rsi), %edi
cmpq $0xffff, %rdi           # imm = 0xFFFF
je 0x13669
movswq %di, %rdi
shlq $0x4, %rdi
orq %rax, 0x8(%rdx,%rdi)
shlq $0x2, %rax
addq $0x4, %rsi
cmpq $0x60, %rsi
jne 0x1364e
movb $0x3, %al
subb 0x8(%rbx), %al
movb %al, 0x8(%rbx)
movb $0x1, %al
jmp 0x13685
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1b3a4(%rip), %rdi     # 0x2ea35
leaq 0x1a1c0(%rip), %rsi     # 0x2d858
leaq 0x1b3a9(%rip), %rcx     # 0x2ea48
movl $0xbb, %edx
callq 0x51d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]morat/gomoku/board.h
// Function: Morat::Gomoku::Board::test_outcome(Morat::MoveValid const&, Morat::Side) const
Outcome test_outcome(const MoveValid & pos, Side turn) const {
		if (test_local(pos, turn)) {
			for (int d = 0; d < 4; d++) {
				int num = 1;
				MoveValid nb = pos;
				for (int i = 0; i < 4; i++) {
					nb = neighbors(nb)[d];
					if (nb.on_board() && get(nb) == turn)
						num++;
					else
						break;
				}
				nb = pos;
				for (int i = 0; i < 4; i++) {
					nb = neighbors(nb)[d + 4];
					if (nb.on_board() && get(nb) == turn)
						num++;
					else
						break;
				}
				if (num >= 5)
					return +turn;
			}
		}

		if(num_moves_+1 == num_cells_)
			return Outcome::DRAW;

		return Outcome::UNKNOWN;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movswl 0x2(%rsi), %esi
movl %edx, %ebx
movq %rdi, %r14
callq 0x137b0
cmpl $0x3, %eax
jne 0x13781
movzwl 0x2(%r15), %eax
movq 0x10(%r14), %rcx
movq 0x30(%r14), %rdx
xorl %esi, %esi
leaq (%rdx,%rsi,4), %r8
movl $0x1, %edi
movl %eax, %r9d
movswq %r9w, %r9
leaq (%r9,%r9,2), %r9
shlq $0x5, %r9
movl (%r8,%r9), %r9d
shrl $0x10, %r9d
cmpl $0xffff, %r9d           # imm = 0xFFFF
je 0x1371d
movswq %r9w, %r10
shlq $0x4, %r10
cmpb %bl, (%rcx,%r10)
jne 0x1371d
incl %edi
cmpl $0x5, %edi
jne 0x136e6
movl $0x5, %edi
leaq 0x10(%rdx,%rsi,4), %r9
leal 0x4(%rdi), %r10d
movl %eax, %ebp
xorl %r11d, %r11d
movl %edi, %r8d
movswq %bp, %r15
leaq (%r15,%r15,2), %r15
shlq $0x5, %r15
movl (%r9,%r15), %ebp
shrl $0x10, %ebp
cmpl $0xffff, %ebp           # imm = 0xFFFF
je 0x13768
movswq %bp, %r15
shlq $0x4, %r15
cmpb %bl, (%rcx,%r15)
jne 0x1376e
incl %r8d
incl %r11d
cmpl $0x4, %r11d
jne 0x1372e
movl %r10d, %r8d
jmp 0x1376e
addl %r11d, %edi
movl %edi, %r8d
cmpl $0x5, %r8d
jae 0x137a3
incq %rsi
cmpq $0x4, %rsi
jne 0x136da
movswl 0x4(%r14), %eax
movswl 0x2(%r14), %ecx
incl %eax
cmpl %ecx, %eax
jne 0x1379a
leaq 0x1e731(%rip), %rax     # 0x31ec9
jmp 0x137a1
leaq 0x1e725(%rip), %rax     # 0x31ec6
movb (%rax), %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]morat/gomoku/agentmctsthread.cpp
// Function: Morat::Gomoku::AgentMCTS::AgentThread::add_knowledge(Morat::Gomoku::Board const&, Morat::Gomoku::AgentMCTS::Node*, Morat::Gomoku::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());
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq 0x40(%rdi), %rax
movq %rcx, %rbx
movl 0xac(%rax), %ecx
testl %ecx, %ecx
je 0x16fdd
movsbl 0x25(%rdx), %edi
movsbl 0x25(%rbx), %r8d
movsbl 0x24(%rdx), %r9d
movsbl 0x24(%rbx), %edx
subl %r8d, %edi
movl %edi, %r8d
negl %r8d
cmovsl %edi, %r8d
subl %edx, %r9d
movl $0xff, %edi
andl %edi, %r8d
movl %r9d, %edx
negl %edx
cmovsl %r9d, %edx
andl %edi, %edx
cmpl %edx, %r8d
cmoval %r8d, %edx
cmpl $0x3, %edx
ja 0x16fdd
movl $0x4, %edi
subl %edx, %edi
imull %ecx, %edi
addw %di, 0x20(%rbx)
movl 0xb0(%rax), %ebp
testl %ebp, %ebp
je 0x1700b
movsbl 0x24(%rbx), %eax
movsbl (%rsi), %ecx
movl 0x8(%rsi), %edx
movq %rsi, %rdi
imull %eax, %ecx
movsbl 0x25(%rbx), %eax
addl %ecx, %eax
movl %eax, %esi
callq 0x137b0
imull %ebp, %eax
addw %ax, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]morat/gomoku/agentmctsthread.cpp
// Function: Morat::Gomoku::AgentMCTS::AgentThread::rollout_choose_move(Morat::Gomoku::Board&, Morat::Move const&)
Move AgentMCTS::AgentThread::rollout_choose_move(Board & board, const Move & prev){
	//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, 0xb8(%rax)
je 0x17040
leaq 0x4c(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x17436
cmpb $-0x4, %al
jne 0x1705a
addq $0xa14, %r15            # imm = 0xA14
movq %r14, %rsi
movq %rbx, %rdx
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x174b4
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]morat/gomoku/agentpns.cpp
// Function: Morat::Gomoku::AgentPNS::return_move(Morat::Gomoku::AgentPNS::Node const*, Morat::Side, int) const
bool AgentPNS::AgentThread::updatePDnum(Node * node){
	Node * i = node->children.begin();
	Node * end = node->children.end();

	uint32_t min = i->delta;
	uint64_t sum = 0;

	bool win = false;
	for( ; i != end; i++){
		win |= (i->phi == LOSS);
		sum += i->phi;
		if( min > i->delta)
			min = i->delta;
	}

	if(win)
		sum = LOSS;
	else if(sum >= INF32)
		sum = INF32;

	if(min == node->phi && sum == node->delta){
		return false;
	}else{
		if(sum == 0 && min == DRAW){
			node->phi = 0;
			node->delta = DRAW;
		}else{
			node->phi = min;
			node->delta = sum;
		}
		return true;
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq 0x18(%rsi), %r8
xorl %esi, %esi
movl $0x0, %eax
leaq 0x10(%r8), %rdi
cmpq $0x2, %r8
cmovaeq %rdi, %rax
jb 0x1a10a
movzwl 0x6(%r8), %esi
shll $0x5, %esi
addq %rsi, %rdi
movq %rdi, %rsi
cmpq %rsi, %rax
je 0x1a20c
leaq 0x17daf(%rip), %rdi     # 0x31ec9
leaq 0x17da5(%rip), %r9      # 0x31ec6
vmovsd 0x140df(%rip), %xmm0    # 0x2e208
vmovsd 0x140ef(%rip), %xmm1    # 0x2e220
vmovsd 0x140df(%rip), %xmm2    # 0x2e218
vmovsd 0x140cf(%rip), %xmm3    # 0x2e210
movb $0x3, %r8b
xorl %ebx, %ebx
subb %dl, %r8b
movb (%rdi), %dil
movb (%r9), %r9b
cmpl $0x3fffffff, (%rax)     # imm = 0x3FFFFFFF
movl %edx, %r10d
je 0x1a179
movl 0x4(%rax), %r11d
movl %edi, %r10d
cmpl $0x3ffffffe, %r11d      # imm = 0x3FFFFFFE
je 0x1a187
movl %r8d, %r10d
cmpl $0x3fffffff, %r11d      # imm = 0x3FFFFFFF
je 0x1a179
movl %r9d, %r10d
cmpb %dil, %r10b
jge 0x1a187
vcvtusi2sdq 0x8(%rax), %xmm5, %xmm4
jmp 0x1a1af
cmpb %dl, %r10b
jne 0x1a199
vcvtusi2sdq 0x8(%rax), %xmm5, %xmm4
vsubsd %xmm4, %xmm1, %xmm4
jmp 0x1a1af
vcvtusi2sdq 0x8(%rax), %xmm5, %xmm4
cmpb %dil, %r10b
jne 0x1a1ab
vaddsd %xmm2, %xmm4, %xmm4
jmp 0x1a1af
vaddsd %xmm3, %xmm4, %xmm4
vucomisd %xmm0, %xmm4
vmaxsd %xmm0, %xmm4, %xmm0
cmovaq %rax, %rbx
addq $0x20, %rax
cmpq %rsi, %rax
jne 0x1a14f
testq %rbx, %rbx
je 0x1a20c
testl %ecx, %ecx
jne 0x1a1d9
movzwl 0x12(%rbx), %eax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
leaq 0x8(%rsp), %r14
movq %rbx, %rsi
movq %r14, %rdi
callq 0x17dc0
leaq 0x136e5(%rip), %rsi     # 0x2d8d5
movq %r14, %rdi
callq 0x56e0
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %rax, %rsi
callq 0x59e1
jmp 0x1a1cd
leaq 0x1445e(%rip), %rdi     # 0x2e671
leaq 0x15892(%rip), %rsi     # 0x2faac
leaq 0x15955(%rip), %rcx     # 0x2fb76
movl $0x11d, %edx            # imm = 0x11D
callq 0x51d0
leaq 0x18(%rsp), %rcx
movq %rax, %rbx
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x1a241
callq 0x52e0
movq %rbx, %rdi
callq 0x5670
nop
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]morat/gomoku/board.cpp
// Function: Morat::Gomoku::Board::gen_neighbor_list() const
std::shared_ptr<MoveValid> Board::gen_neighbor_list() const {
	std::shared_ptr<MoveValid> list(new MoveValid[vec_size()*24]);
	MoveValid * a = list.get();
	for(int y = 0; y < size_; y++){
		for(int x = 0; x < size_; x++){
			Move pos(x,y);

			for(int i = 0; i < 24; i++){
				Move loc = pos + neighbor_offsets[i];
				*a = MoveValid(loc, (on_board(loc) ? xy(loc) : -1) );
				++a;
			}
		}
	}

	return list;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movsbl (%rsi), %ebp
movq %rdi, %rbx
movq %rsi, %r14
movl %ebp, %eax
imull %eax, %eax
shll $0x3, %eax
leal (%rax,%rax,2), %r15d
leaq (,%r15,4), %rdi
callq 0x5030
testl %ebp, %ebp
je 0x1e30b
leaq (%rax,%r15,4), %rcx
movq %rax, %rdx
movl $0xffff78fc, (%rdx)     # imm = 0xFFFF78FC
addq $0x4, %rdx
cmpq %rcx, %rdx
jne 0x1e2fc
leaq 0x8(%rbx), %rdi
movq %rax, %rsi
movq %rax, (%rbx)
callq 0x1e492
movb (%r14), %r8b
testb %r8b, %r8b
jle 0x1e3c0
movq (%rbx), %r9
leaq 0x123b0(%rip), %rcx     # 0x306e0
xorl %eax, %eax
testb %r8b, %r8b
jle 0x1e3b1
xorl %esi, %esi
movq %r9, %rdx
xorl %edi, %edi
movb 0x1(%rdi,%rcx), %bpl
movb (%rdi,%rcx), %r11b
movl $0xffff0000, %r9d       # imm = 0xFFFF0000
addb %sil, %bpl
addb %al, %r11b
movzbl %bpl, %r8d
movl %r8d, %r10d
orb %r11b, %r10b
movzbl %r11b, %r10d
js 0x1e37f
movb (%r14), %r15b
cmpb %r15b, %bpl
jge 0x1e37f
cmpb %r15b, %r11b
jae 0x1e37f
movzbl %r15b, %r9d
imull %r10d, %r9d
addl %r8d, %r9d
shll $0x10, %r9d
shll $0x8, %r8d
orl %r10d, %r8d
orl %r9d, %r8d
movl %r8d, (%rdx,%rdi)
addq $0x4, %rdi
cmpq $0x60, %rdi
jne 0x1e33e
movb (%r14), %r8b
incl %esi
leaq (%rdx,%rdi), %r9
movsbl %r8b, %r10d
cmpl %r10d, %esi
jl 0x1e339
addq %rdi, %rdx
movq %rdx, %r9
jmp 0x1e3b5
movsbl %r8b, %r10d
incl %eax
cmpl %r10d, %eax
jl 0x1e332
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]morat/gomoku/agentpns.h
// Function: Morat::Gomoku::AgentPNS::AgentPNS(Morat::Gomoku::Board const&)
AgentPNS(const Board & b) : Agent(b), pool(this) {
		ab = 2;
		df = true;
		epsilon = 0.25;
		ties = Side::NONE;
		numthreads = 1;
		pool.set_num_threads(numthreads);
		gclimit = 5;

		nodes = 0;
		reset();

		set_memlimit(1000*1024*1024);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x11dae
leaq 0x2334c(%rip), %rax     # 0x44b78
leaq 0x68(%rbx), %r14
addq $0x10, %rax
movq %rax, (%rbx)
movq %r14, %rdi
callq 0x22296
leaq 0x1428(%rbx), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x22328
leaq 0x10669(%rip), %rax     # 0x31ec1
leaq 0x1538(%rbx), %r12
movb (%rax), %al
movw $0x78fc, 0x154a(%rbx)   # imm = 0x78FC
movq $0x0, 0x1550(%rbx)
movl $0x2, 0x1520(%rbx)
movb $0x1, 0x1524(%rbx)
movl $0x3e800000, 0x1528(%rbx) # imm = 0x3E800000
movb %al, 0x152c(%rbx)
movl $0x1, 0x1530(%rbx)
movl $0x1, %esi
movq %r15, %rdi
callq 0x1bda2
movl $0x5, 0x60(%rbx)
xorl %eax, %eax
movq %rax, 0x50(%rbx)
movq %rax, 0x1510(%rbx)
movb $0x0, 0x8(%rbx)
movq (%rbx), %rax
movl $0x3e800000, %esi       # imm = 0x3E800000
movq %rbx, %rdi
callq *0x30(%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r13
jmp 0x218fa
movq %rax, %r13
jmp 0x21902
movq %r12, %rdi
movq %rax, %r13
callq 0x1ac2a
movq %r15, %rdi
callq 0x1c3a8
movq %r14, %rdi
callq 0x1c3ea
movq %rbx, %rdi
callq 0x13324
movq %r13, %rdi
callq 0x5670
// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]morat/gomoku/../lib/board_grid_oct.h
// Function: Morat::BoardGridOct<Morat::Gomoku::Board>::pattern_mirror(unsigned long)
static Pattern pattern_mirror(Pattern p) {
		/*
		 *  8  16 9 17 10    10 17  9 16  8
		 * 23  0  1  2 18    18  2  1  0 23
		 * 15  7  X  3 11 => 11  3  X  7 15
		 * 22  6  5  4 19    19  4  5  6 22
		 * 14 21 13 20 12    12 20 13 21 14
		 */

		// pull out an entry
		#define e(a) (p & (3ull << (2 * a)))

		// swap two entries, a > b
		#define s(a, b) ((e(a) >> (2 * (a - b))) | e(b) << (2 * (a - b)))

		return e(9) | e(1) | e(5) | e(13) |
		       s(17, 16) | s( 2,  0) | s( 7,  3) | s( 6,  4) | s(21, 20) |
		       s(10,  8) | s(23, 18) | s(15, 11) | s(22, 19) | s(14, 12);

		#undef e
		#undef s
	}

// Assembly:
vpmovsxbq 0xe4a3(%rip), %ymm2 # 0x308e0
vpbroadcastq %rdi, %zmm0
vpsrlvq 0xe464(%rip), %xmm0, %xmm1 # 0x308b0
vpmovsxbq 0xe47a(%rip), %zmm5 # 0x308d0
movq %rdi, %rdx
shlq $0x4, %rdx
leaq (,%rdi,4), %rcx
movabsq $0xc00000000, %rax      # imm = 0xC00000000
movq %rdi, %rsi
shrq $0xa, %rsi
vmovq %rdx, %xmm4
movb $-0x80, %dl
andq %rcx, %rax
movl %edi, %ecx
kmovd %edx, %k1
shlq $0xa, %rdi
movb $0x8, %dl
andl $0xc0c0, %ecx           # imm = 0xC0C0
rolw $0x8, %cx
movzwl %cx, %ecx
vpsllvq %ymm2, %ymm0, %ymm3
vpsrlvq %ymm2, %ymm0, %ymm2
vpblendd $0xcc, %ymm2, %ymm3, %ymm2 # ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
vpunpcklqdq %xmm0, %xmm4, %xmm3 # xmm3 = xmm4[0],xmm0[0]
valignq $0x5, %zmm1, %zmm1, %zmm4 # zmm4 = zmm1[5,6,7,0,1,2,3,4]
vinserti32x4 $0x1, %xmm1, %zmm3, %zmm3
vpermi2q %zmm3, %zmm2, %zmm5
vmovq %rsi, %xmm2
vinserti32x4 $0x0, %xmm2, %zmm4, %zmm2
vpbroadcastq %rdi, %zmm5 {%k1}
kmovd %edx, %k1
vpsllq $0x2, %zmm0, %zmm2 {%k1}
vpmovsxbq 0xe3f0(%rip), %zmm0 # 0x308d8
vpermi2q %zmm2, %zmm3, %zmm0
vpandq 0xe4c8(%rip), %zmm5, %zmm2 # 0x309c0
vmovq %rax, %xmm3
vpternlogq $0xf8, 0xe4f8(%rip), %zmm0, %zmm2 # 0x30a00
vextracti64x4 $0x1, %zmm2, %ymm0
vporq %zmm0, %zmm2, %zmm0
vextracti128 $0x1, %ymm0, %xmm2
vpor %xmm2, %xmm0, %xmm0
vpshufd $0xee, %xmm0, %xmm2     # xmm2 = xmm0[2,3,2,3]
vpor %xmm2, %xmm0, %xmm0
vpunpcklqdq %xmm3, %xmm0, %xmm0 # xmm0 = xmm0[0],xmm3[0]
vpternlogq $0xf8, 0xe389(%rip), %xmm1, %xmm0 # 0x308c0
vpshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
vpor %xmm1, %xmm0, %xmm0
vmovq %xmm0, %rax
orq %rcx, %rax
vzeroupper
retq
// File: /workspace/github_cpp_makefile_star2_O3/bakeunbin[P]inverse_mix_column_precalculated/invmc.cpp
// Function: decrypt_full_aesni(unsigned char const*, unsigned char (&) [131072], unsigned char const*)
auto decrypt_full_aesni (const uint8_t obj [AES_128_KEY_OBJ_SIZE], uint8_t (& output) [VECTOR_SIZE], const uint8_t input [VECTOR_SIZE])
{
	memcpy (output, input, VECTOR_SIZE);
	
	auto start = std::chrono::high_resolution_clock::now ();
	
	for (size_t i = 0 ; i < BLOCK_COUNT ; i ++)
		full_aesni (output + BLOCK_SIZE * i, obj);
	
	auto end = std::chrono::high_resolution_clock::now ();
	
	return std::chrono::duration_cast <std::chrono::nanoseconds> (end - start).count ();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x20000, %edx          # imm = 0x20000
movq %rsi, %rdi
movq %rax, %rsi
callq 0x10b0
xorl %r12d, %r12d
callq 0x1040
movq %rax, %r15
leaq (%rbx,%r12), %rdi
movq %r14, %rsi
callq 0x24a9
addq $0x10, %r12
cmpq $0x20000, %r12          # imm = 0x20000
jne 0x19eb
callq 0x1040
subq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/zencoders[P]algoritmica/./algorithms/sorting/quicksort.hpp
// Function: void algoritmica::algorithms::sorting::quicksort<int>(int*, int, int)
void quicksort(T1 s[], int l, int h)
{
    int p;
    if(h > l)
    {
        p = details::partition(s, l, h);
        quicksort(s, l, p - 1);
        quicksort(s, p + 1, h);
    }
}

// Assembly:
cmpl %esi, %edx
jle 0x4309
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x430a
movl %eax, %r15d
leal -0x1(%r15), %edx
movq %r14, %rdi
movl %ebp, %esi
callq 0x42c5
incl %r15d
movl %r15d, %ebp
cmpl %ebx, %r15d
jl 0x42d7
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/zencoders[P]algoritmica/./algorithms/sorting/quicksort.hpp
// Function: int algoritmica::algorithms::sorting::details::partition<int>(int*, int, int)
int partition(T1 s[], int l, int h)
    {
        int pivot = h;
        int firsthigh = l;
        for(int i = l; i < pivot; ++i)
        {
            if(s[i] < s[pivot])
            {
                details::swap(&s[i], &s[firsthigh]);
                firsthigh++;
            }
        }
        details::swap(&s[firsthigh], &s[pivot]);
        return firsthigh;
    }

// Assembly:
movslq %edx, %rcx
cmpl %edx, %esi
jge 0x4334
movslq %esi, %rax
movl (%rdi,%rax,4), %edx
cmpl (%rdi,%rcx,4), %edx
jge 0x432c
movslq %esi, %rsi
movl (%rdi,%rsi,4), %r8d
movl %r8d, (%rdi,%rax,4)
movl %edx, (%rdi,%rsi,4)
incl %esi
incq %rax
cmpq %rax, %rcx
jne 0x4314
movslq %esi, %rax
movl (%rdi,%rax,4), %edx
movl (%rdi,%rcx,4), %esi
movl %esi, (%rdi,%rax,4)
movl %edx, (%rdi,%rcx,4)
retq
// File: /workspace/github_cpp_makefile_star2_O3/zencoders[P]algoritmica/./algorithms/sorting/selectionsort.hpp
// Function: void algoritmica::algorithms::sorting::selectionsort<int>(int*, int)
void selectionsort(T1 s[], int size)
{
    for(int i = 0; i < size; i++)
    {
        int min = i;

        for(int j = i + 1; j < size; ++j)
        {
            if(s[j] < s[min])
                min = j;
        }
        details::swap(&s[i], &s[min]);
    }
}

// Assembly:
testl %esi, %esi
jle 0x55cb
pushq %rbx
movl %esi, %eax
movl $0x1, %ecx
xorl %edx, %edx
leaq 0x1(%rdx), %rsi
movl %edx, %r9d
movq %rcx, %r8
cmpq %rax, %rsi
jae 0x55ac
movl (%rdi,%r8,4), %r11d
movslq %r9d, %rbx
movl %r8d, %r10d
cmpl (%rdi,%rbx,4), %r11d
jl 0x55a1
movl %r9d, %r10d
incq %r8
movl %r10d, %r9d
cmpq %r8, %rax
jne 0x558e
movslq %r9d, %r8
movl (%rdi,%rdx,4), %r9d
movl (%rdi,%r8,4), %r10d
movl %r10d, (%rdi,%rdx,4)
movl %r9d, (%rdi,%r8,4)
incq %rcx
movq %rsi, %rdx
cmpq %rax, %rsi
jne 0x557f
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/zencoders[P]algoritmica/tests/littletest.hpp
// Function: littletest::test_runner& littletest::test_runner::run<littletest::test_base>(littletest::test_base*)
test_runner& run(test_impl* t)
        {
            std::cout << "Running test (" << 
                test_counter << "): " << 
                t->__lt_name__ << std::endl;

            t->run_test(this);

            test_counter++;
            return *this;
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x3aa3(%rip), %r15      # 0x9fd8
leaq 0xd77(%rip), %rsi       # 0x72b3
movl $0xe, %edx
movq %r15, %rdi
callq 0x2180
movl 0x24(%rbx), %esi
movq %r15, %rdi
callq 0x2220
movq %rax, %r15
leaq 0xd64(%rip), %rsi       # 0x72c2
movl $0x3, %edx
movq %rax, %rdi
callq 0x2180
movq 0x8(%r14), %r12
testq %r12, %r12
je 0x658c
movq %r12, %rdi
callq 0x2080
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x2180
jmp 0x65a6
movq (%r15), %rax
movq -0x18(%rax), %rax
movq %r15, %rdi
addq %rax, %rdi
movl 0x20(%r15,%rax), %esi
orl $0x1, %esi
callq 0x2200
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *(%rax)
incl 0x24(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/IncredibleHannes[P]QMUL-ChessGame/src/Model/Chessman/Bishop.cpp
// Function: Bishop::getPossibleMoves[abi:cxx11](Board const&) const
std::list<Move> Bishop::getPossibleMoves(const Board &board) const {
  std::list<Move> moves;
  if (!isCaptured()) {
    bool leftTop = true;
    bool rightTop = true;
    bool leftBottom = true;
    bool rightBottom = true;
    int i = 1;

    while (leftTop || rightTop || leftBottom || rightBottom) {
      checkMove(board, moves, leftTop, i, -i);
      checkMove(board, moves, rightTop, i, i);
      checkMove(board, moves, leftBottom, -i, -i);
      checkMove(board, moves, rightBottom, -i, i);
      i++;
    }
  }
  return moves;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rdi, 0x8(%rdi)
movq %rdi, (%rdi)
movq $0x0, 0x10(%rdi)
movq %rsi, %rdi
callq 0x37c2
testb %al, %al
je 0x2a36
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
leaq -0x2c(%rbp), %rcx
movb %al, (%rcx)
leaq -0x2b(%rbp), %rcx
movb %al, (%rcx)
leaq -0x2a(%rbp), %rcx
movb %al, (%rcx)
leaq -0x29(%rbp), %rcx
movb %al, (%rcx)
movl $0x1, %r12d
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testb $0x1, %al
jne 0x2a72
cmpb $0x0, -0x2b(%rbp)
jne 0x2a72
cmpb $0x0, -0x2a(%rbp)
jne 0x2a72
cmpb $0x1, -0x29(%rbp)
jne 0x2a24
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x2c(%rbp), %rcx
movl %r12d, %r8d
movl %r13d, %r9d
callq 0x2ee4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x2b(%rbp), %rcx
movl %r12d, %r8d
movl %r12d, %r9d
callq 0x2ee4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x2a(%rbp), %rcx
movl %r13d, %r8d
movl %r13d, %r9d
callq 0x2ee4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x29(%rbp), %rcx
movl %r13d, %r8d
movl %r12d, %r9d
callq 0x2ee4
incl %r12d
movb -0x2c(%rbp), %al
decl %r13d
jmp 0x2a5c
jmp 0x2ae2
movq %rax, %r14
movq %rbx, %rdi
callq 0x2b06
movq %r14, %rdi
callq 0x21d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/IncredibleHannes[P]QMUL-ChessGame/src/Model/Chessman/StraightLineMover.cpp
// Function: StraightLineMover::checkMove(Board const&, std::__cxx11::list<Move, std::allocator<Move>>&, bool&, int, int) const
void StraightLineMover::checkMove(const Board &board, std::list<Move> &moves,
                                  bool &direction, int dx, int dy) const {
  int x = this->getCurrentPosition().getX();
  int y = this->getCurrentPosition().getY();

  if (!direction) { return; }
  Position p = Position(x + dx, y + dy);
  if (!p.isValid()) {
    direction = false;
    return;
  }
  if (board.getChessman(p) != nullptr) {
    direction = false;
    if (board.getChessman(p)->getColour() != this->colour) {
      moves.push_back(Move(Position(x, y), p));
    }
  } else {
    moves.push_back(Move(Position(x, y), p));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %r9d, -0x3c(%rbp)
movl %r8d, %r15d
movq %rcx, %r14
movq %rdx, -0x48(%rbp)
movq %rsi, -0x60(%rbp)
movq %rdi, %r13
callq 0x384e
leaq -0x80(%rbp), %rbx
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x2962
movl %eax, %r12d
movq %r13, -0x58(%rbp)
movq %r13, %rdi
callq 0x384e
movq %rax, (%rbx)
leaq -0x80(%rbp), %rdi
callq 0x296a
movq %r14, -0x50(%rbp)
cmpb $0x1, (%r14)
jne 0x303f
movl %eax, %r13d
movl %r12d, -0x2c(%rbp)
addl %r12d, %r15d
movl -0x3c(%rbp), %edx
addl %eax, %edx
leaq -0x38(%rbp), %rbx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x292a
movq %rbx, %rdi
callq 0x2974
testb %al, %al
je 0x2fe7
movq -0x38(%rbp), %rsi
movq -0x60(%rbp), %rbx
movq %rbx, %rdi
callq 0x4c22
testq %rax, %rax
je 0x2ff0
movq -0x50(%rbp), %rax
movb $0x0, (%rax)
movq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0x4c22
movq %rax, %rdi
callq 0x37ae
movq -0x58(%rbp), %rcx
cmpb %al, 0x8(%rcx)
movl -0x2c(%rbp), %esi
je 0x303f
leaq -0x90(%rbp), %rbx
movq %rbx, %rdi
movl %r13d, %edx
callq 0x292a
movq -0x38(%rbp), %rdx
movq (%rbx), %rsi
leaq -0x80(%rbp), %rbx
movq %rbx, %rdi
callq 0x4040
movq -0x48(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2e84
jmp 0x3027
movq -0x50(%rbp), %rax
movb $0x0, (%rax)
jmp 0x303f
leaq -0x88(%rbp), %rbx
movq %rbx, %rdi
movl -0x2c(%rbp), %esi
movl %r13d, %edx
callq 0x292a
movq -0x38(%rbp), %rdx
movq (%rbx), %rsi
leaq -0x80(%rbp), %rbx
movq %rbx, %rdi
callq 0x4040
movq -0x48(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2e84
movq %rax, %rdi
movq %r14, %rsi
callq 0x2050
incq 0x10(%r14)
leaq -0x80(%rbp), %rdi
callq 0x40c0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3050
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x40c0
movq %rbx, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O3/IncredibleHannes[P]QMUL-ChessGame/src/Model/Chessman/Rook.cpp
// Function: Rook::getPossibleMoves[abi:cxx11](Board const&) const
std::list<Move> Rook::getPossibleMoves(const Board &board) const {
  std::list<Move> moves;
  if (!isCaptured()) {
    bool top = true;
    bool right = true;
    bool bottom = true;
    bool left = true;
    int i = 1;

    while (top || right || bottom || left) {
      checkMove(board, moves, top, i, 0);
      checkMove(board, moves, right, 0, i);
      checkMove(board, moves, bottom, -i, 0);
      checkMove(board, moves, left, 0, -i);
      i++;
    }
  }
  return moves;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rdi, 0x8(%rdi)
movq %rdi, (%rdi)
movq $0x0, 0x10(%rdi)
movq %rsi, %rdi
callq 0x37c2
testb %al, %al
je 0x36c6
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
leaq -0x2c(%rbp), %rcx
movb %al, (%rcx)
leaq -0x2b(%rbp), %rcx
movb %al, (%rcx)
leaq -0x2a(%rbp), %rcx
movb %al, (%rcx)
leaq -0x29(%rbp), %rcx
movb %al, (%rcx)
movl $0x1, %r12d
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testb $0x1, %al
jne 0x3702
cmpb $0x0, -0x2b(%rbp)
jne 0x3702
cmpb $0x0, -0x2a(%rbp)
jne 0x3702
cmpb $0x1, -0x29(%rbp)
jne 0x36b4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x2c(%rbp), %rcx
movl %r12d, %r8d
xorl %r9d, %r9d
callq 0x2ee4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x2b(%rbp), %rcx
xorl %r8d, %r8d
movl %r12d, %r9d
callq 0x2ee4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x2a(%rbp), %rcx
movl %r13d, %r8d
xorl %r9d, %r9d
callq 0x2ee4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x29(%rbp), %rcx
xorl %r8d, %r8d
movl %r13d, %r9d
callq 0x2ee4
incl %r12d
movb -0x2c(%rbp), %al
decl %r13d
jmp 0x36ec
jmp 0x3772
movq %rax, %r14
movq %rbx, %rdi
callq 0x2b06
movq %r14, %rdi
callq 0x21d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/IncredibleHannes[P]QMUL-ChessGame/src/Model/Chessman/Chessman.cpp
// Function: Chessman::isMoveValid(Board const&, Move const&) const
bool Chessman::isMoveValid(const Board &board, const Move &move) const {
  std::list<Move> moves = this->getPossibleMoves(board);
  for (std::list<Move>::iterator it = moves.begin(); it != moves.end(); it++) {
    if (*it == move)
    { return true; }
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %rdx
movq %rdi, %rsi
movq (%rdi), %rax
leaq -0x30(%rbp), %r14
movq %r14, %rdi
callq *0x18(%rax)
movq %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0x3814
leaq 0x10(%r15), %rdi
movq %rbx, %rsi
callq 0x4120
testb %al, %al
je 0x37fc
leaq -0x30(%rbp), %rdi
cmpq %rdi, %r15
setne %bl
callq 0x2b06
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2b06
movq %rbx, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O3/IncredibleHannes[P]QMUL-ChessGame/src/Model/Chessman/Queen.cpp
// Function: Queen::getPossibleMoves[abi:cxx11](Board const&) const
std::list<Move> Queen::getPossibleMoves(const Board &board) const {
  std::list<Move> moves;
  if (!isCaptured()) {
    bool top = true;
    bool right = true;
    bool bottom = true;
    bool left = true;
    bool leftTop = true;
    bool rightTop = true;
    bool leftBottom = true;
    bool rightBottom = true;
    int i = 1;

    while (top || right || bottom || left || leftTop || rightTop || leftBottom || rightBottom) {
      checkMove(board, moves, leftTop, i, -i);
      checkMove(board, moves, rightTop, i, i);
      checkMove(board, moves, leftBottom, -i, -i);
      checkMove(board, moves, rightBottom, -i, i);
      checkMove(board, moves, top, i, 0);
      checkMove(board, moves, right, 0, i);
      checkMove(board, moves, bottom, -i, 0);
      checkMove(board, moves, left, 0, -i);
      i++;
    }
  }
  return moves;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rdi, 0x8(%rdi)
movq %rdi, (%rdi)
movq $0x0, 0x10(%rdi)
movq %rsi, %rdi
callq 0x37c2
testb %al, %al
je 0x3ee6
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
leaq -0x30(%rbp), %rcx
movb %al, (%rcx)
leaq -0x2f(%rbp), %rcx
movb %al, (%rcx)
leaq -0x2e(%rbp), %rcx
movb %al, (%rcx)
leaq -0x2d(%rbp), %rcx
movb %al, (%rcx)
leaq -0x2c(%rbp), %rcx
movb %al, (%rcx)
leaq -0x2b(%rbp), %rcx
movb %al, (%rcx)
leaq -0x2a(%rbp), %rcx
movb %al, (%rcx)
leaq -0x29(%rbp), %rcx
movb %al, (%rcx)
movl $0x1, %r12d
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testb $0x1, %al
jne 0x3f52
cmpb $0x0, -0x2f(%rbp)
jne 0x3f52
cmpb $0x0, -0x2e(%rbp)
jne 0x3f52
cmpb $0x0, -0x2d(%rbp)
jne 0x3f52
cmpb $0x0, -0x2c(%rbp)
jne 0x3f52
cmpb $0x0, -0x2b(%rbp)
jne 0x3f52
cmpb $0x0, -0x2a(%rbp)
jne 0x3f52
cmpb $0x1, -0x29(%rbp)
jne 0x3ed4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x2c(%rbp), %rcx
movl %r12d, %r8d
movl %r13d, %r9d
callq 0x2ee4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x2b(%rbp), %rcx
movl %r12d, %r8d
movl %r12d, %r9d
callq 0x2ee4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x2a(%rbp), %rcx
movl %r13d, %r8d
movl %r13d, %r9d
callq 0x2ee4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x29(%rbp), %rcx
movl %r13d, %r8d
movl %r12d, %r9d
callq 0x2ee4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x30(%rbp), %rcx
movl %r12d, %r8d
xorl %r9d, %r9d
callq 0x2ee4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x2f(%rbp), %rcx
xorl %r8d, %r8d
movl %r12d, %r9d
callq 0x2ee4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x2e(%rbp), %rcx
movl %r13d, %r8d
xorl %r9d, %r9d
callq 0x2ee4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x2d(%rbp), %rcx
xorl %r8d, %r8d
movl %r13d, %r9d
callq 0x2ee4
incl %r12d
movb -0x30(%rbp), %al
decl %r13d
jmp 0x3f24
jmp 0x4022
movq %rax, %r14
movq %rbx, %rdi
callq 0x2b06
movq %r14, %rdi
callq 0x21d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/IncredibleHannes[P]QMUL-ChessGame/src/Model/Move.cpp
// Function: Move::Move(Move const&)
Move::Move(const Move &move)
  : origin(move.origin), target(move.target), type(move.type), capturedChessman(){
    if(move.getCapturedChessman() == nullptr) {
      this->capturedChessman = nullptr;
    } else {
      this->capturedChessman = move.getCapturedChessman()->clone();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %rax
movq %rax, (%rdi)
movq 0x8(%rsi), %rax
movq %rax, 0x8(%rdi)
movl 0x10(%rsi), %eax
movl %eax, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
movq 0x18(%rsi), %rdi
testq %rdi, %rdi
je 0x40a9
movq (%rdi), %rax
callq *(%rax)
jmp 0x40ab
xorl %eax, %eax
movq %rax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/IncredibleHannes[P]QMUL-ChessGame/src/Model/Board.cpp
// Function: Board::Board(std::__cxx11::list<Move*, std::allocator<Move*>>)
Board::Board(std::list<Move *> moves)
  : currentColour(Chessman::Colour::White) {
  this->board = createStartBoard();
  while (moves.size() != 0) {
    applyMove(moves.front());
    delete moves.front();
    moves.pop_front();
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movb $0x1, 0x8(%rdi)
leaq 0x10(%rdi), %r12
movq %r12, 0x18(%rdi)
movq %r12, 0x10(%rdi)
xorl %eax, %eax
movq %rax, 0x20(%rdi)
leaq 0x28(%rdi), %r13
movq %r13, 0x30(%rdi)
movq %r13, 0x28(%rdi)
movq %rax, 0x38(%rdi)
callq 0x41f4
movq %rax, (%r14)
cmpq $0x0, 0x10(%rbx)
je 0x46e7
movq (%rbx), %rax
movq 0x10(%rax), %rsi
movq %r14, %rdi
callq 0x4736
movq (%rbx), %rax
movq 0x10(%rax), %r15
testq %r15, %r15
je 0x46c6
movq %r15, %rdi
callq 0x40c0
movq %r15, %rdi
callq 0x2100
movq (%rbx), %r15
decq 0x10(%rbx)
movq %r15, %rdi
callq 0x21b0
movq %r15, %rdi
callq 0x2100
jmp 0x469c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x46f8
movq %rax, %rbx
movq (%r13), %rdi
cmpq %r13, %rdi
je 0x4714
movq (%rdi), %r14
callq 0x2100
movq %r14, %rdi
cmpq %r13, %r14
jne 0x4704
movq (%r12), %rdi
cmpq %r12, %rdi
je 0x472d
movq (%rdi), %r14
callq 0x2100
movq %r14, %rdi
cmpq %r12, %r14
jne 0x471d
movq %rbx, %rdi
callq 0x21d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/IncredibleHannes[P]QMUL-ChessGame/src/Model/Board.cpp
// Function: Board::Board(Board const&)
Board::Board(const Board &b) {
  this->board = new Chessman**[8];

  for (int x = 0; x < 8; x++) {
    this->board[x] = new Chessman*[8];
    for (int y = 0; y < 8; y++) {
      if (b.getChessman(Position(x,y)) != nullptr) {
        this->board[x][y] = b.getChessman(Position(x,y))->clone();
      }
    }
  }
  for(Chessman* c : b.capturedChessmen) {
    this->capturedChessmen.push_back(c->clone());
  }
  for(Move* m : b.previousMoves) {
    this->previousMoves.push_back(new Move(*m));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, -0x30(%rbp)
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, 0x18(%rdi)
movq %rax, -0x40(%rbp)
movq %rax, 0x10(%rdi)
xorl %eax, %eax
movq %rax, 0x20(%rdi)
leaq 0x28(%rdi), %r14
movq %r14, 0x30(%rdi)
movq %r14, 0x28(%rdi)
movq %rax, 0x38(%rdi)
movl $0x40, %edi
callq 0x2030
movq %rax, (%rbx)
xorl %r13d, %r13d
leaq -0x48(%rbp), %r12
movq %rbx, -0x38(%rbp)
movl $0x40, %edi
callq 0x2030
movq (%rbx), %rcx
movq %rax, (%rcx,%r13,8)
xorl %r15d, %r15d
leaq -0x58(%rbp), %rdi
movl %r13d, %esi
movl %r15d, %edx
callq 0x292a
movq -0x58(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rbx
movq %r12, %rdi
callq 0x2962
cltq
movq (%rbx,%rax,8), %rbx
movq %r12, %rdi
callq 0x296a
cltq
cmpq $0x0, (%rbx,%rax,8)
je 0x4b05
leaq -0x50(%rbp), %rdi
movl %r13d, %esi
movl %r15d, %edx
callq 0x292a
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rbx
movq %r12, %rdi
callq 0x2962
cltq
movq (%rbx,%rax,8), %rbx
movq %r12, %rdi
callq 0x296a
cltq
movq (%rbx,%rax,8), %rdi
movq (%rdi), %rax
callq *(%rax)
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
movq (%rcx,%r13,8), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq $0x8, %r15
jne 0x4a7a
incq %r13
cmpq $0x8, %r13
movq -0x38(%rbp), %rbx
jne 0x4a66
movq -0x30(%rbp), %rax
leaq 0x10(%rax), %r12
movq 0x10(%rax), %r13
cmpq %r12, %r13
je 0x4b64
movq 0x10(%r13), %rdi
movq (%rdi), %rax
callq *(%rax)
movq %rax, %r15
movl $0x18, %edi
callq 0x2120
movq %r15, 0x10(%rax)
movq %rax, %rdi
movq -0x40(%rbp), %rsi
callq 0x2050
incq 0x20(%rbx)
movq (%r13), %r13
jmp 0x4b2f
movq -0x30(%rbp), %rax
movq 0x28(%rax), %r13
addq $0x28, %rax
cmpq %rax, %r13
je 0x4bbe
movq %rax, %rbx
movq 0x10(%r13), %r15
movl $0x20, %edi
callq 0x2120
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x4074
movl $0x18, %edi
callq 0x2120
movq %r12, 0x10(%rax)
movq %rax, %rdi
movq %r14, %rsi
callq 0x2050
movq -0x38(%rbp), %rax
incq 0x38(%rax)
movq (%r13), %r13
cmpq %rbx, %r13
jne 0x4b78
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4be2
movq %rax, %r15
movq %r12, %rdi
callq 0x2100
jmp 0x4be5
jmp 0x4be2
jmp 0x4be2
jmp 0x4be2
movq %rax, %r15
movq (%r14), %rdi
cmpq %r14, %rdi
je 0x4bfd
movq (%rdi), %rbx
callq 0x2100
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x4bed
movq -0x40(%rbp), %r14
movq (%r14), %rdi
cmpq %r14, %rdi
je 0x4c19
movq (%rdi), %rbx
callq 0x2100
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x4c09
movq %r15, %rdi
callq 0x21d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/IncredibleHannes[P]QMUL-ChessGame/src/Model/Board.cpp
// Function: Board::~Board()
Board::~Board() {
  for (int x = 0; x < 8; x++) {
    for (int y = 0; y < 8; y++) {
      if (this->board[x][y] != nullptr) {
        delete this->board[x][y];
      }
    }
  }
  for (int i = 0; i < 8; i++) {
    delete[] this->board[i];
  }
  delete[] this->board;
  for(Chessman* c : this->capturedChessmen) {
    delete c;
  }
  for(Move* m : this->previousMoves) {
    delete m;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
movq (%rbx), %rax
movq (%rax,%r14,8), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x4c86
movq (%rdi), %rax
callq *0x10(%rax)
incq %r15
cmpq $0x8, %r15
jne 0x4c70
incq %r14
cmpq $0x8, %r14
jne 0x4c6d
xorl %r14d, %r14d
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x4cac
callq 0x2170
incq %r14
cmpq $0x8, %r14
jne 0x4c9b
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4cc2
callq 0x2170
leaq 0x10(%rbx), %r12
movq 0x10(%rbx), %r14
cmpq %r12, %r14
je 0x4ce3
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x4cde
movq (%rdi), %rax
callq *0x10(%rax)
movq (%r14), %r14
jmp 0x4cca
movq 0x28(%rbx), %r14
addq $0x28, %rbx
cmpq %rbx, %r14
je 0x4d14
movq 0x10(%r14), %r15
testq %r15, %r15
je 0x4d01
movq %r15, %rdi
callq 0x40c0
movq %r15, %rdi
callq 0x2100
movq (%r14), %r14
cmpq %rbx, %r14
jne 0x4cf0
movq (%rbx), %r14
cmpq %rbx, %r14
je 0x4d2c
movq (%r14), %r15
movq %r14, %rdi
callq 0x2100
movq %r15, %r14
cmpq %rbx, %r15
jne 0x4d19
movq (%r12), %rdi
cmpq %r12, %rdi
je 0x4d45
movq (%rdi), %rbx
callq 0x2100
movq %rbx, %rdi
cmpq %r12, %rbx
jne 0x4d35
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/IncredibleHannes[P]QMUL-ChessGame/src/Model/Board.cpp
// Function: Board::getAllPossibleMoves[abi:cxx11](Chessman::Colour) const
std::list<Move> Board::getAllPossibleMoves(Chessman::Colour colour) const {
  std::list<Move> list;
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 8; j++) {
      if (this->board[i][j] != nullptr && this->board[i][j]->getColour() == colour) {
        list.splice(list.end(), this->board[i][j]->getPossibleMoves(*this));
      }
    }
  }
  return list;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, 0x8(%rdi)
movq %rdi, (%rdi)
movq %rdi, -0x30(%rbp)
movq $0x0, 0x10(%rdi)
xorl %r13d, %r13d
leaq -0x50(%rbp), %r12
movl %edx, -0x34(%rbp)
xorl %ebx, %ebx
movq (%r15), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x4df0
callq 0x37ae
cmpb %r14b, %al
jne 0x4df0
movq (%r15), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbx,8), %rsi
movq (%rsi), %rax
movq %r12, %rdi
movq %r15, %rdx
callq *0x18(%rax)
movq -0x50(%rbp), %rsi
cmpq %r12, %rsi
je 0x4de8
movq %r12, %r14
movq -0x30(%rbp), %r12
movq %r12, %rdi
movq %r14, %rdx
callq 0x20a0
movq -0x40(%rbp), %rax
addq %rax, 0x10(%r12)
movq %r14, %r12
movl -0x34(%rbp), %r14d
movq $0x0, -0x40(%rbp)
movq %r12, %rdi
callq 0x2b06
incq %rbx
cmpq $0x8, %rbx
jne 0x4d84
incq %r13
cmpq $0x8, %r13
jne 0x4d82
movq -0x30(%rbp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4e17
movq %rax, %r14
movq -0x30(%rbp), %rdi
callq 0x2b06
movq %r14, %rdi
callq 0x21d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/IncredibleHannes[P]QMUL-ChessGame/src/Model/Board.cpp
// Function: Board::isCheck() const
bool Board::isCheck() const {
  std::list<Move> moves = getAllPossibleMoves(!this->currentColour);
  for (Move m : moves) {
    Chessman *target = board[m.getTarget().getX()][m.getTarget().getY()];
    if (target != nullptr
        && target->getType() == Chessman::FigureType::King
        && target->getColour() == this->currentColour) {
      return true;
    }
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movzbl 0x8(%rdi), %edi
callq 0x386f
movzbl %al, %edx
leaq -0x50(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4d4e
movq (%r14), %r13
cmpq %r14, %r13
je 0x4ef7
leaq -0x70(%rbp), %r15
leaq 0x10(%r13), %rsi
movq %r15, %rdi
callq 0x4074
movq (%rbx), %r12
movq %r15, %rdi
callq 0x40e0
movq %rax, -0x38(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x2962
cltq
movq (%r12,%rax,8), %r12
movq %r15, %rdi
callq 0x40e0
movq %rax, -0x30(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x296a
cltq
movq (%r12,%rax,8), %r12
testq %r12, %r12
je 0x4ee6
movq %r12, %rdi
callq 0x3844
testl %eax, %eax
jne 0x4ee6
movq %r12, %rdi
callq 0x37ae
cmpb %al, 0x8(%rbx)
je 0x4f13
movq %r15, %rdi
callq 0x40c0
movq (%r13), %r13
cmpq %r14, %r13
jne 0x4e83
xorl %ebx, %ebx
leaq -0x50(%rbp), %rdi
callq 0x2b06
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x70(%rbp), %rdi
callq 0x40c0
movb $0x1, %bl
jmp 0x4ef9
jmp 0x4f29
movq %rax, %rbx
jmp 0x4f35
jmp 0x4f29
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x40c0
leaq -0x50(%rbp), %rdi
callq 0x2b06
movq %rbx, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O3/IncredibleHannes[P]QMUL-ChessGame/src/Model/Board.cpp
// Function: Board::move(Move*)
void Board::move(Move *move) {

  Position origin = move->getOrigin();
  Position target = move->getTarget();
  Chessman *currentChessman = this->board[origin.getX()][origin.getY()];
  this->board[origin.getX()][origin.getY()] = nullptr;

  Chessman *targetChessman = this->board[target.getX()][target.getY()];
  if (targetChessman != nullptr) {
    targetChessman->capture();
    move->setCaptureMove(targetChessman);
    capturedChessmen.push_back(targetChessman);
  }
  this->board[target.getX()][target.getY()] = currentChessman;
  currentChessman->setCurrentPosition(target);
  this->previousMoves.push_back(new Move(*move));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x40d6
leaq -0x40(%rbp), %r13
movq %rax, (%r13)
movq %r14, %rdi
callq 0x40e0
leaq -0x38(%rbp), %r12
movq %rax, (%r12)
movq (%rbx), %r15
movq %r13, %rdi
callq 0x2962
cltq
movq (%r15,%rax,8), %r15
movq %r13, %rdi
callq 0x296a
cltq
movq (%r15,%rax,8), %rax
movq %rax, -0x30(%rbp)
movq (%rbx), %r15
movq %r13, %rdi
callq 0x2962
cltq
movq (%r15,%rax,8), %r15
movq %r13, %rdi
callq 0x296a
cltq
movq $0x0, (%r15,%rax,8)
movq (%rbx), %r15
movq %r12, %rdi
callq 0x2962
cltq
movq (%r15,%rax,8), %r15
movq %r12, %rdi
callq 0x296a
cltq
movq (%r15,%rax,8), %r12
testq %r12, %r12
je 0x501b
movq %r12, %rdi
callq 0x37b8
movq %r14, %rdi
movq %r12, %rsi
callq 0x4100
leaq 0x10(%rbx), %r13
movl $0x18, %edi
callq 0x2120
movq %r12, 0x10(%rax)
movq %rax, %rdi
movq %r13, %rsi
callq 0x2050
incq 0x20(%rbx)
movq (%rbx), %r15
leaq -0x38(%rbp), %r12
movq %r12, %rdi
callq 0x2962
cltq
movq (%r15,%rax,8), %r15
movq %r12, %rdi
callq 0x296a
cltq
movq -0x30(%rbp), %rdi
movq %rdi, (%r15,%rax,8)
movq (%r12), %rsi
callq 0x3858
movl $0x20, %edi
callq 0x2120
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x4074
leaq 0x28(%rbx), %r14
movl $0x18, %edi
callq 0x2120
movq %r15, 0x10(%rax)
movq %rax, %rdi
movq %r14, %rsi
callq 0x2050
incq 0x38(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x21d0