Map a range of integers to a 64-bit integer
std::uint64_t get_index(std::uint64_t x)
{
    return 0u == x ? 0u : (x-1u)&gt;&gt; 6;
}


Will it faster, I doubt.

By the way, your code for x = 0 will yield -1, which is not same as your description. if you do not need x = 0 input, then you can remove the if statement as 

std::uint64_t get_index(std::uint64_t x)
{
    return (x-1u)&gt;&gt; 6;  // for this, x must be not 0u.
}