// File: tyhsu[P]Ewn/minimax.cpp
// Function: Minimax::Minimax()
Minimax::Minimax() {
	HEIGHT = 5;
	SIMU_TIMES = 100;

	// pos: a <int,int> , <x,y> coord;
	for (int i = 0; i < 5; i++) {
		for (int j = 0;j < 5; j++) {
			// insert to map => feature_map_A;
			// get the smaller of (x,y)
			int k = (i > j ? j : i);
			k = (k+1) * (k+1) * 3;
			Pos chs_pos;
			chs_pos.first = i;
			chs_pos.second = j;
			this->feature_map_A.insert(make_pair(chs_pos, k));

			// insert to map => feature_map_B;
			// get the bigger of (x,y)
			k = (i > j ? i : j);
			k = (5-k) * (5-k) * 3;
			chs_pos.first = i;
			chs_pos.second = j;
			this->feature_map_B.insert(make_pair(chs_pos, k));
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x90(%rbp)
leaq 0xa05f(%rip), %rax      # 0x11d70
addq $0x10, %rax
movq %rax, (%rdi)
addq $0x18, %rdi
movq %rdi, -0xa0(%rbp)
callq 0x8b90
movq -0x90(%rbp), %rdi
addq $0x48, %rdi
movq %rdi, -0x98(%rbp)
callq 0x8b90
movq -0x90(%rbp), %rax
movl $0x5, 0x8(%rax)
movl $0x64, 0xc(%rax)
movl $0x0, -0xc(%rbp)
cmpl $0x5, -0xc(%rbp)
jge 0x7f55
movl $0x0, -0x10(%rbp)
cmpl $0x5, -0x10(%rbp)
jge 0x7f45
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jle 0x7d89
movl -0x10(%rbp), %eax
movl %eax, -0xa4(%rbp)
jmp 0x7d92
movl -0xc(%rbp), %eax
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %ecx
incl %ecx
imull %ecx, %ecx
movl %ecx, %eax
leal (%rax,%rax,2), %eax
movl %eax, -0x14(%rbp)
leaq -0x1c(%rbp), %rdi
callq 0x4c60
jmp 0x7db6
movq -0x90(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, -0x1c(%rbp)
movl -0x10(%rbp), %ecx
movl %ecx, -0x18(%rbp)
addq $0x18, %rax
movq %rax, -0xc0(%rbp)
leaq -0x1c(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0x8bf0
movl %edx, -0xb4(%rbp)
movq %rax, -0xb0(%rbp)
jmp 0x7df0
movq -0xc0(%rbp), %rdi
movl -0xb4(%rbp), %eax
movq -0xb0(%rbp), %rcx
movq %rcx, -0x48(%rbp)
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x38(%rbp), %rsi
callq 0x8bb0
movb %dl, -0xc9(%rbp)
movq %rax, -0xc8(%rbp)
jmp 0x7e31
movb -0xc9(%rbp), %al
movq -0xc8(%rbp), %rcx
movq %rcx, -0x58(%rbp)
movb %al, -0x50(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jle 0x7e58
movl -0xc(%rbp), %eax
movl %eax, -0xd0(%rbp)
jmp 0x7e61
movl -0x10(%rbp), %eax
movl %eax, -0xd0(%rbp)
movq -0x90(%rbp), %rax
movl -0xd0(%rbp), %ecx
movl %ecx, -0x14(%rbp)
movl -0x14(%rbp), %ecx
movl $0x5, %edx
subl %ecx, %edx
imull %edx, %edx
movl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
movl %ecx, -0x14(%rbp)
movl -0xc(%rbp), %ecx
movl %ecx, -0x1c(%rbp)
movl -0x10(%rbp), %ecx
movl %ecx, -0x18(%rbp)
addq $0x48, %rax
movq %rax, -0xe8(%rbp)
leaq -0x1c(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0x8bf0
movl %edx, -0xdc(%rbp)
movq %rax, -0xd8(%rbp)
jmp 0x7eb9
movq -0xe8(%rbp), %rdi
movl -0xdc(%rbp), %eax
movq -0xd8(%rbp), %rcx
movq %rcx, -0x78(%rbp)
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x60(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x68(%rbp), %rsi
callq 0x8bb0
movb %dl, -0xf1(%rbp)
movq %rax, -0xf0(%rbp)
jmp 0x7efa
movb -0xf1(%rbp), %al
movq -0xf0(%rbp), %rcx
movq %rcx, -0x88(%rbp)
movb %al, -0x80(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x7d6c
movq -0x98(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x4e50
movq -0xa0(%rbp), %rdi
callq 0x4e50
jmp 0x7f5e
jmp 0x7f47
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7d5b
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x2210
nopw (%rax,%rax)