// File: /workspace/github_cpp_makefile_star2_O1/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
movsbl %dl, %eax
cmpw $0x6, 0x6(%rdi)
jl 0x13d2a
addq $0x28, %rdi
movswl 0x2(%rsi), %r15d
jmp 0x13e72
movsbl 0x1(%rsi), %ecx
movsbl 0x2(%rdi), %edx
movl %ecx, %r10d
subl %edx, %r10d
movsbl (%rsi), %esi
movl %esi, %r8d
subl %edx, %r8d
movl %edx, %r9d
subl %r8d, %r9d
movl %r8d, %r15d
subl %r10d, %r15d
movsbl (%rdi), %r14d
movl %r14d, %r11d
imull %esi, %r11d
leal (%r11,%rcx), %r8d
leal (%r8,%r8,2), %r8d
addl %eax, %r8d
movslq %r8d, %rbx
leaq 0x254c3(%rip), %r8      # 0x39230
movq (%r8,%rbx,8), %rbx
xorq %rbx, 0x28(%rdi)
leal (%r15,%rdx), %r13d
movl %edx, %ebx
subl %r10d, %ebx
movl %ebx, %r10d
imull %r14d, %r10d
leal (%r13,%r10), %r12d
addl %r13d, %r11d
imull %r14d, %r13d
leal (%r13,%rsi), %ebp
leal (%rbp,%rbp,2), %ebp
addl %eax, %ebp
movslq %ebp, %rbp
movq (%r8,%rbp,8), %rbp
xorq %rbp, 0x30(%rdi)
leal (%r12,%r12,2), %ebp
addl %eax, %ebp
movslq %ebp, %r12
movq (%r8,%r12,8), %r12
xorq %r12, 0x38(%rdi)
movl %r9d, %r12d
imull %r14d, %r12d
leal (%r12,%rbx), %ebp
leal (%rbp,%rbp,2), %ebp
addl %eax, %ebp
movslq %ebp, %rbp
movq (%r8,%rbp,8), %rbp
xorq %rbp, 0x40(%rdi)
subl %r15d, %edx
movl %edx, %r15d
imull %r14d, %r15d
leal (%r15,%r9), %ebp
leal (%rbp,%rbp,2), %ebp
addl %eax, %ebp
movslq %ebp, %rbp
movq (%r8,%rbp,8), %rbp
xorq %rbp, 0x48(%rdi)
imull %ecx, %r14d
leal (%rdx,%r14), %ebp
leal (%rbp,%rbp,2), %ebp
addl %eax, %ebp
movslq %ebp, %rbp
movq (%r8,%rbp,8), %rbp
xorq %rbp, 0x50(%rdi)
addl %esi, %r14d
leal (%r14,%r14,2), %esi
addl %eax, %esi
movslq %esi, %rsi
movq (%r8,%rsi,8), %rsi
xorq %rsi, 0x58(%rdi)
leal (%r11,%r11,2), %esi
addl %eax, %esi
movslq %esi, %rsi
movq (%r8,%rsi,8), %rsi
xorq %rsi, 0x60(%rdi)
addl %r13d, %ebx
leal (%rbx,%rbx,2), %esi
addl %eax, %esi
movslq %esi, %rsi
movq (%r8,%rsi,8), %rsi
xorq %rsi, 0x68(%rdi)
addl %r10d, %r9d
leal (%r9,%r9,2), %esi
addl %eax, %esi
movslq %esi, %rsi
movq (%r8,%rsi,8), %rsi
xorq %rsi, 0x70(%rdi)
addl %r12d, %edx
leal (%rdx,%rdx,2), %edx
addl %eax, %edx
movslq %edx, %rdx
movq (%r8,%rdx,8), %rdx
xorq %rdx, 0x78(%rdi)
addl %ecx, %r15d
subq $-0x80, %rdi
leal (%r15,%r15,2), %ecx
addl %eax, %ecx
movslq %ecx, %rax
leaq 0x253ae(%rip), %rcx     # 0x39230
movq (%rcx,%rax,8), %rax
xorq %rax, (%rdi)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq