// File: /workspace/github_cpp_makefile_star2_O1/tewalds[P]morat/hex/../lib/lbdist.h
// Function: Morat::LBDistsBase<Morat::Hex::LBDists, Morat::Hex::Board>::flood(int, Morat::Side, bool)
void flood(int edge, Side player, bool crossvcs){
		Side otherplayer = ~player;

		MoveDist cur;
		while(Q.pop(cur)){
			const MoveValid* neighbors = board->neighbors(cur.pos);
			for(int i = 5; i <= 7; i++){
				int nd = (cur.dir + i) % 6;
				MoveDist next(neighbors[nd], cur.dist, nd);

				if(board->on_board(next.pos)){
					Side colour = board->get(next.pos);

					if(colour == otherplayer)
						continue;

					if(colour == Side::NONE){
						if(!crossvcs && //forms a vc
						   board->get(neighbors[(nd + 5) % 6]) == otherplayer &&
						   board->get(neighbors[(nd + 7) % 6]) == otherplayer)
							continue;

						next.dist++;
					}

					if( dist(edge, player, next.pos) > next.dist){
						dist(edge, player, next.pos) = next.dist;
						Q.push(next);
					}
				}
			}
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, (%rsp)
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r14
leaq 0x4(%rsp), %rsi
movl $0xffff78fc, (%rsi)     # imm = 0xFFFF78FC
addq $0x2710, %rdi           # imm = 0x2710
movq %rdi, 0x10(%rsp)
callq 0x18742
testb %al, %al
je 0x18733
movb $0x3, %r13b
subb %bpl, %r13b
movslq %r12d, %rax
movsbq %bpl, %rcx
decq %rcx
imulq $0x1388, %rax, %rax     # imm = 0x1388
addq %r14, %rax
imulq $0x9c4, %rcx, %r12      # imm = 0x9C4
addq %rax, %r12
movq 0x9c58(%r14), %rcx
movswq 0x6(%rsp), %rax
leaq (%rax,%rax,8), %rax
shlq $0x3, %rax
addq 0x38(%rcx), %rax
movl 0x8(%rsp), %ebp
movl 0xc(%rsp), %edx
leal 0x1(%rbp), %esi
addl $0x5, %edx
xorl %edi, %edi
leal (%rdx,%rdi), %ecx
movslq %ecx, %r8
imulq $0x2aaaaaab, %r8, %rcx  # imm = 0x2AAAAAAB
movq %rcx, %r9
shrq $0x3f, %r9
shrq $0x20, %rcx
addl %r9d, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %r8d
movslq %r8d, %rcx
movl (%rax,%rcx,4), %r9d
movl %r9d, %ecx
shrl $0x10, %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
je 0x18711
movq 0x9c58(%r14), %r11
movswq %cx, %r10
movq 0x10(%r11), %r11
movq %r10, %rcx
shlq $0x4, %rcx
movb (%r11,%rcx), %r15b
cmpb %r13b, %r15b
je 0x18711
movl %ebp, %ecx
leaq 0x1dd61(%rip), %rbx     # 0x363a9
cmpb (%rbx), %r15b
setne %r15b
jne 0x18653
movl %esi, %ecx
orb (%rsp), %r15b
jne 0x186b4
leal 0x5(%r8), %ecx
movq %rcx, %r15
movl $0xaaaaaaab, %ebx       # imm = 0xAAAAAAAB
imulq %rbx, %r15
shrq $0x22, %r15
addl %r15d, %r15d
leal (%r15,%r15,2), %r15d
subl %r15d, %ecx
movswq 0x2(%rax,%rcx,4), %r15
shlq $0x4, %r15
movl %esi, %ecx
cmpb %r13b, (%r11,%r15)
jne 0x186b4
leal 0x7(%r8), %ecx
movq %rcx, %r15
imulq %rbx, %r15
shrq $0x22, %r15
addl %r15d, %r15d
leal (%r15,%r15,2), %r15d
subl %r15d, %ecx
movswq 0x2(%rax,%rcx,4), %r15
shlq $0x4, %r15
movl %esi, %ecx
cmpb %r13b, (%r11,%r15)
je 0x18711
cmpl %ecx, (%r12,%r10,4)
jle 0x18711
leaq (%r12,%r10,4), %r10
movl %ecx, (%r10)
leal 0x3(%rcx), %r10d
testl %ecx, %ecx
cmovnsl %ecx, %r10d
andl $-0x4, %r10d
movl %ecx, %r11d
subl %r10d, %r11d
movslq %r11d, %r10
movslq 0x9c40(%r14,%r10,4), %r11
leal 0x1(%r11), %r15d
movl %r15d, 0x9c40(%r14,%r10,4)
imulq $0x1d4c, %r10, %r10     # imm = 0x1D4C
addq 0x10(%rsp), %r10
leaq (%r11,%r11,2), %r11
movl %r9d, (%r10,%r11,4)
movl %ecx, 0x4(%r10,%r11,4)
movl %r8d, 0x8(%r10,%r11,4)
incl 0x9c54(%r14)
incl %edi
cmpl $0x3, %edi
jne 0x185e0
movq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x18742
testb %al, %al
jne 0x185b7
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq