func extract(x, m uint64) uint64 { x &= m var ( holes = ^m shift = uint(1) ) for ; shift < 64; shift *= 2 { odd := holes odd ^= odd << 1 odd ^= odd << 2 odd ^= odd << 4 odd ^= odd << 8 odd ^= odd << 16 holes &^= odd move := x & odd x ^= move x |= move >> shift } return x }
To receive a hint, submit unfixed code.