About the 2 small problems you can't figure out, this code solves them:
#include <cstdio>
int main() {
// These are numbers like magic sums, designed so every combination
// of white and black occupation is tested
long white = 0x0000000123012010l;
long black = 0x0000000000111223l;
// White's count ends in "10" while black's count ends in "0"
long white_blocked_mills = ~white & (white>>1) & black & 0x1111111111111111l;
// White's count ends in "10" while black's count ends in "1"
long white_open_mills = ~white & (white>>1) & ~black & 0x1111111111111111l;
std::printf("%016lx\n", white);
std::printf("%016lx\n", black);
std::printf("%016lx\n", white_blocked_mills);
std::printf("%016lx\n", white_open_mills);
}
[EDIT: I found an easier way to code it than what I originally posted.]