// File: 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:
subq $0x68, %rsp
movb %cl, %al
movb %dl, %cl
movb %cl, 0x67(%rsp)
movq %rdi, 0x58(%rsp)
movl %esi, 0x54(%rsp)
andb $0x1, %al
movb %al, 0x53(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movb 0x67(%rsp), %al
movb %al, 0x51(%rsp)
movzbl 0x51(%rsp), %edi
callq 0x1c680
movb %al, 0x52(%rsp)
leaq 0x44(%rsp), %rdi
callq 0x25410
movq 0x10(%rsp), %rdi
addq $0x2710, %rdi           # imm = 0x2710
leaq 0x44(%rsp), %rsi
callq 0x2b380
testb $0x1, %al
jne 0x2af44
jmp 0x2b15e
movq 0x10(%rsp), %rax
movq 0x9c58(%rax), %rdi
leaq 0x44(%rsp), %rsi
callq 0x2b460
movq %rax, 0x38(%rsp)
movl $0x5, 0x34(%rsp)
cmpl $0x7, 0x34(%rsp)
jg 0x2b159
movl 0x4c(%rsp), %eax
addl 0x34(%rsp), %eax
movl $0x6, %ecx
cltd
idivl %ecx
movl %edx, 0x30(%rsp)
movq 0x38(%rsp), %rax
movslq 0x30(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x20(%rsp)
movl 0x48(%rsp), %edx
movl 0x30(%rsp), %ecx
movl 0x20(%rsp), %esi
leaq 0x24(%rsp), %rdi
callq 0x2b290
movq 0x10(%rsp), %rax
movq 0x9c58(%rax), %rdi
leaq 0x24(%rsp), %rsi
callq 0x29c10
testb $0x1, %al
jne 0x2afcc
jmp 0x2b147
movq 0x10(%rsp), %rax
movq 0x9c58(%rax), %rdi
leaq 0x24(%rsp), %rsi
callq 0x29c30
movb %al, 0x1f(%rsp)
leaq 0x1f(%rsp), %rdi
leaq 0x52(%rsp), %rsi
callq 0x1f930
testb $0x1, %al
jne 0x2affb
jmp 0x2b000
jmp 0x2b149
leaq 0x1f(%rsp), %rdi
leaq 0x424af(%rip), %rsi     # 0x6d4bb
callq 0x1f930
testb $0x1, %al
jne 0x2b01a
jmp 0x2b0d9
xorl %eax, %eax
testb $0x1, 0x53(%rsp)
movb %al, 0xf(%rsp)
jne 0x2b0c2
movq 0x10(%rsp), %rax
movq 0x9c58(%rax), %rdi
movq 0x38(%rsp), %rsi
movl 0x30(%rsp), %eax
addl $0x5, %eax
movl $0x6, %ecx
cltd
idivl %ecx
movslq %edx, %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x29c30
movb %al, 0x1e(%rsp)
leaq 0x1e(%rsp), %rdi
leaq 0x52(%rsp), %rsi
callq 0x1f930
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xf(%rsp)
jne 0x2b07c
jmp 0x2b0c2
movq 0x10(%rsp), %rax
movq 0x9c58(%rax), %rdi
movq 0x38(%rsp), %rsi
movl 0x30(%rsp), %eax
addl $0x7, %eax
movl $0x6, %ecx
cltd
idivl %ecx
movslq %edx, %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x29c30
movb %al, 0x1d(%rsp)
leaq 0x1d(%rsp), %rdi
leaq 0x52(%rsp), %rsi
callq 0x1f930
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x2b0cc
jmp 0x2b0ce
jmp 0x2b149
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
movq 0x10(%rsp), %rdi
movl 0x54(%rsp), %esi
movb 0x67(%rsp), %al
movb %al, 0x1c(%rsp)
leaq 0x24(%rsp), %rcx
movzbl 0x1c(%rsp), %edx
callq 0x2b2c0
movl (%rax), %eax
cmpl 0x28(%rsp), %eax
jle 0x2b145
movq 0x10(%rsp), %rdi
movl 0x28(%rsp), %eax
movl %eax, 0x8(%rsp)
movl 0x54(%rsp), %esi
movb 0x67(%rsp), %al
movb %al, 0x1b(%rsp)
leaq 0x24(%rsp), %rcx
movzbl 0x1b(%rsp), %edx
callq 0x2b2c0
movl 0x8(%rsp), %ecx
movq 0x10(%rsp), %rdi
movl %ecx, (%rax)
addq $0x2710, %rdi           # imm = 0x2710
leaq 0x24(%rsp), %rsi
callq 0x2b200
jmp 0x2b147
jmp 0x2b149
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x2af67
jmp 0x2af25
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)