def popcount_uint64(args):
    """Count 1's in uint64 integers"""
    count = 0
    # Up to 8 bytes
    for byte_index in range(8):
        shift = byte_index * 8
        mask = 0xff << shift
        count += args.popcount_table[
            ((args.array_uint64 & mask) >> shift) & 0xff
        ]

    return count