// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]morat/havannah/board.h
// Function: Morat::Havannah::Board::update_hash(Morat::MoveValid const&, Morat::Side)
void update_hash(const MoveValid & pos, Side side) {
		int turn = side.to_i();
		if(num_moves_ > unique_depth){ //simple update, no rotations/symmetry
			hash.update(0, 3 * pos.xy + turn);
			return;
		}

		//mirror is simply flip x,y
		int x = pos.x - size_r_m1_,
		    y = pos.y - size_r_m1_,
		    z = y - x;

//x,y; y,z; z,-x; -x,-y; -y,-z; -z,x
//y,x; z,y; -x,z; -y,-x; -z,-y; x,-z

		hash.update(0,  3*xyc( x,  y) + turn);
		hash.update(1,  3*xyc( y,  z) + turn);
		hash.update(2,  3*xyc( z, -x) + turn);
		hash.update(3,  3*xyc(-x, -y) + turn);
		hash.update(4,  3*xyc(-y, -z) + turn);
		hash.update(5,  3*xyc(-z,  x) + turn);
		hash.update(6,  3*xyc( y,  x) + turn);
		hash.update(7,  3*xyc( z,  y) + turn);
		hash.update(8,  3*xyc(-x,  z) + turn);
		hash.update(9,  3*xyc(-y, -x) + turn);
		hash.update(10, 3*xyc(-z, -y) + turn);
		hash.update(11, 3*xyc( x, -z) + turn);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpw $0x6, 0x6(%rdi)
movsbl %dl, %eax
jl 0x13c62
movswl 0x2(%rsi), %r15d
addq $0x28, %rdi
jmp 0x13dae
movsbl 0x1(%rsi), %ecx
movsbl (%rsi), %esi
movsbl (%rdi), %r14d
movsbl 0x2(%rdi), %edx
movl %r14d, %r11d
imull %esi, %r11d
movl %esi, %r8d
subl %edx, %r8d
movl %edx, %r9d
movl %ecx, %r10d
subl %edx, %r10d
movl %r8d, %r15d
subl %r8d, %r9d
subl %r10d, %r15d
leal (%r15,%rdx), %r13d
leal (%r11,%rcx), %r8d
addl %r13d, %r11d
leal (%r8,%r8,2), %r8d
addl %eax, %r8d
movslq %r8d, %rbx
leaq 0x25584(%rip), %r8      # 0x39230
movq (%r8,%rbx,8), %rbx
xorq %rbx, 0x28(%rdi)
movl %edx, %ebx
subl %r10d, %ebx
subl %r15d, %edx
movl %ebx, %r10d
imull %r14d, %r10d
movl %edx, %r15d
imull %r14d, %r15d
leal (%r13,%r10), %r12d
imull %r14d, %r13d
leal (%r12,%r12,2), %r12d
leal (%r13,%rsi), %ebp
addl %eax, %r12d
leal (%rbp,%rbp,2), %ebp
movslq %r12d, %r12
addl %eax, %ebp
movslq %ebp, %rbp
movq (%r8,%rbp,8), %rbp
xorq %rbp, 0x30(%rdi)
movq (%r8,%r12,8), %r12
xorq %r12, 0x38(%rdi)
movl %r9d, %r12d
imull %r14d, %r12d
imull %ecx, %r14d
leal (%r12,%rbx), %ebp
addl %r13d, %ebx
leal (%rbp,%rbp,2), %ebp
addl %eax, %ebp
movslq %ebp, %rbp
movq (%r8,%rbp,8), %rbp
xorq %rbp, 0x40(%rdi)
leal (%r15,%r9), %ebp
addl %r10d, %r9d
addl %ecx, %r15d
leal (%rbp,%rbp,2), %ebp
leal (%r9,%r9,2), %r9d
addl %eax, %ebp
addl %eax, %r9d
movslq %ebp, %rbp
movq (%r8,%rbp,8), %rbp
xorq %rbp, 0x48(%rdi)
leal (%rdx,%r14), %ebp
addl %esi, %r14d
addl %r12d, %edx
leal (%rbp,%rbp,2), %ebp
leal (%r14,%r14,2), %esi
leal (%rdx,%rdx,2), %edx
addl %eax, %ebp
addl %eax, %esi
addl %eax, %edx
movslq %ebp, %rbp
movslq %esi, %rsi
movslq %edx, %rdx
movq (%r8,%rbp,8), %rbp
xorq %rbp, 0x50(%rdi)
leal (%r11,%r11,2), %ebp
leal (%rbx,%rbx,2), %r11d
movq (%r8,%rsi,8), %rsi
addl %eax, %ebp
addl %eax, %r11d
xorq %rsi, 0x58(%rdi)
movslq %ebp, %rsi
movq (%r8,%rsi,8), %rsi
xorq %rsi, 0x60(%rdi)
movslq %r11d, %rsi
movq (%r8,%rsi,8), %rsi
xorq %rsi, 0x68(%rdi)
movslq %r9d, %rsi
movq (%r8,%rsi,8), %rsi
xorq %rsi, 0x70(%rdi)
movq (%r8,%rdx,8), %rdx
xorq %rdx, 0x78(%rdi)
subq $-0x80, %rdi
leaq 0x2547b(%rip), %rdx     # 0x39230
leal (%r15,%r15,2), %ecx
addl %eax, %ecx
movslq %ecx, %rax
movq (%rdx,%rax,8), %rax
xorq %rax, (%rdi)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq