datasketches-cpp
bit_packing.hpp
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
20 #ifndef BIT_PACKING_HPP_
21 #define BIT_PACKING_HPP_
22 
23 #include <memory>
24 
25 namespace datasketches {
26 
27 static inline uint8_t pack_bits(uint64_t value, uint8_t bits, uint8_t*& ptr, uint8_t offset) {
28  if (offset > 0) {
29  const uint8_t chunk_bits = 8 - offset;
30  const uint8_t mask = (1 << chunk_bits) - 1;
31  if (bits < chunk_bits) {
32  *ptr |= (value << (chunk_bits - bits)) & mask;
33  return offset + bits;
34  }
35  *ptr++ |= (value >> (bits - chunk_bits)) & mask;
36  bits -= chunk_bits;
37  }
38  while (bits >= 8) {
39  *ptr++ = static_cast<uint8_t>(value >> (bits - 8));
40  bits -= 8;
41  }
42  if (bits > 0) {
43  *ptr = static_cast<uint8_t>(value << (8 - bits));
44  return bits;
45  }
46  return 0;
47 }
48 
49 static inline uint8_t unpack_bits(uint64_t& value, uint8_t bits, const uint8_t*& ptr, uint8_t offset) {
50  const uint8_t avail_bits = 8 - offset;
51  const uint8_t chunk_bits = std::min(avail_bits, bits);
52  const uint8_t mask = (1 << chunk_bits) - 1;
53  value = (*ptr >> (avail_bits - chunk_bits)) & mask;
54  ptr += avail_bits == chunk_bits;
55  offset = (offset + chunk_bits) & 7;
56  bits -= chunk_bits;
57  while (bits >= 8) {
58  value <<= 8;
59  value |= *ptr++;
60  bits -= 8;
61  }
62  if (bits > 0) {
63  value <<= bits;
64  value |= *ptr >> (8 - bits);
65  return bits;
66  }
67  return offset;
68 }
69 
70 // pack given number of bits from a block of 8 64-bit values into bytes
71 // we don't need 0 and 64 bits
72 // we assume that higher bits (which we are not packing) are zeros
73 // this assumption allows to avoid masking operations
74 
75 static inline void pack_bits_1(const uint64_t* values, uint8_t* ptr) {
76  *ptr = static_cast<uint8_t>(values[0] << 7);
77  *ptr |= static_cast<uint8_t>(values[1] << 6);
78  *ptr |= static_cast<uint8_t>(values[2] << 5);
79  *ptr |= static_cast<uint8_t>(values[3] << 4);
80  *ptr |= static_cast<uint8_t>(values[4] << 3);
81  *ptr |= static_cast<uint8_t>(values[5] << 2);
82  *ptr |= static_cast<uint8_t>(values[6] << 1);
83  *ptr |= static_cast<uint8_t>(values[7]);
84 }
85 
86 static inline void pack_bits_2(const uint64_t* values, uint8_t* ptr) {
87  *ptr = static_cast<uint8_t>(values[0] << 6);
88  *ptr |= static_cast<uint8_t>(values[1] << 4);
89  *ptr |= static_cast<uint8_t>(values[2] << 2);
90  *ptr++ |= static_cast<uint8_t>(values[3]);
91 
92  *ptr = static_cast<uint8_t>(values[4] << 6);
93  *ptr |= static_cast<uint8_t>(values[5] << 4);
94  *ptr |= static_cast<uint8_t>(values[6] << 2);
95  *ptr |= static_cast<uint8_t>(values[7]);
96 }
97 
98 static inline void pack_bits_3(const uint64_t* values, uint8_t* ptr) {
99  *ptr = static_cast<uint8_t>(values[0] << 5);
100  *ptr |= static_cast<uint8_t>(values[1] << 2);
101  *ptr++ |= static_cast<uint8_t>(values[2] >> 1);
102 
103  *ptr = static_cast<uint8_t>(values[2] << 7);
104  *ptr |= static_cast<uint8_t>(values[3] << 4);
105  *ptr |= static_cast<uint8_t>(values[4] << 1);
106  *ptr++ |= static_cast<uint8_t>(values[5] >> 2);
107 
108  *ptr = static_cast<uint8_t>(values[5] << 6);
109  *ptr |= static_cast<uint8_t>(values[6] << 3);
110  *ptr |= static_cast<uint8_t>(values[7]);
111 }
112 
113 static inline void pack_bits_4(const uint64_t* values, uint8_t* ptr) {
114  *ptr = static_cast<uint8_t>(values[0] << 4);
115  *ptr++ |= static_cast<uint8_t>(values[1]);
116 
117  *ptr = static_cast<uint8_t>(values[2] << 4);
118  *ptr++ |= static_cast<uint8_t>(values[3]);
119 
120  *ptr = static_cast<uint8_t>(values[4] << 4);
121  *ptr++ |= static_cast<uint8_t>(values[5]);
122 
123  *ptr = static_cast<uint8_t>(values[6] << 4);
124  *ptr |= static_cast<uint8_t>(values[7]);
125 }
126 
127 static inline void pack_bits_5(const uint64_t* values, uint8_t* ptr) {
128  *ptr = static_cast<uint8_t>(values[0] << 3);
129  *ptr++ |= static_cast<uint8_t>(values[1] >> 2);
130 
131  *ptr = static_cast<uint8_t>(values[1] << 6);
132  *ptr |= static_cast<uint8_t>(values[2] << 1);
133  *ptr++ |= static_cast<uint8_t>(values[3] >> 4);
134 
135  *ptr = static_cast<uint8_t>(values[3] << 4);
136  *ptr++ |= static_cast<uint8_t>(values[4] >> 1);
137 
138  *ptr = static_cast<uint8_t>(values[4] << 7);
139  *ptr |= static_cast<uint8_t>(values[5] << 2);
140  *ptr++ |= static_cast<uint8_t>(values[6] >> 3);
141 
142  *ptr = static_cast<uint8_t>(values[6] << 5);
143  *ptr |= static_cast<uint8_t>(values[7]);
144 }
145 
146 static inline void pack_bits_6(const uint64_t* values, uint8_t* ptr) {
147  *ptr = static_cast<uint8_t>(values[0] << 2);
148  *ptr++ |= static_cast<uint8_t>(values[1] >> 4);
149 
150  *ptr = static_cast<uint8_t>(values[1] << 4);
151  *ptr++ |= static_cast<uint8_t>(values[2] >> 2);
152 
153  *ptr = static_cast<uint8_t>(values[2] << 6);
154  *ptr++ |= static_cast<uint8_t>(values[3]);
155 
156  *ptr = static_cast<uint8_t>(values[4] << 2);
157  *ptr++ |= static_cast<uint8_t>(values[5] >> 4);
158 
159  *ptr = static_cast<uint8_t>(values[5] << 4);
160  *ptr++ |= static_cast<uint8_t>(values[6] >> 2);
161 
162  *ptr = static_cast<uint8_t>(values[6] << 6);
163  *ptr |= static_cast<uint8_t>(values[7]);
164 }
165 
166 static inline void pack_bits_7(const uint64_t* values, uint8_t* ptr) {
167  *ptr = static_cast<uint8_t>(values[0] << 1);
168  *ptr++ |= static_cast<uint8_t>(values[1] >> 6);
169 
170  *ptr = static_cast<uint8_t>(values[1] << 2);
171  *ptr++ |= static_cast<uint8_t>(values[2] >> 5);
172 
173  *ptr = static_cast<uint8_t>(values[2] << 3);
174  *ptr++ |= static_cast<uint8_t>(values[3] >> 4);
175 
176  *ptr = static_cast<uint8_t>(values[3] << 4);
177  *ptr++ |= static_cast<uint8_t>(values[4] >> 3);
178 
179  *ptr = static_cast<uint8_t>(values[4] << 5);
180  *ptr++ |= static_cast<uint8_t>(values[5] >> 2);
181 
182  *ptr = static_cast<uint8_t>(values[5] << 6);
183  *ptr++ |= static_cast<uint8_t>(values[6] >> 1);
184 
185  *ptr = static_cast<uint8_t>(values[6] << 7);
186  *ptr |= static_cast<uint8_t>(values[7]);
187 }
188 
189 static inline void pack_bits_8(const uint64_t* values, uint8_t* ptr) {
190  *ptr++ = static_cast<uint8_t>(values[0]);
191  *ptr++ = static_cast<uint8_t>(values[1]);
192  *ptr++ = static_cast<uint8_t>(values[2]);
193  *ptr++ = static_cast<uint8_t>(values[3]);
194  *ptr++ = static_cast<uint8_t>(values[4]);
195  *ptr++ = static_cast<uint8_t>(values[5]);
196  *ptr++ = static_cast<uint8_t>(values[6]);
197  *ptr = static_cast<uint8_t>(values[7]);
198 }
199 
200 static inline void pack_bits_9(const uint64_t* values, uint8_t* ptr) {
201  *ptr++ = static_cast<uint8_t>(values[0] >> 1);
202 
203  *ptr = static_cast<uint8_t>(values[0] << 7);
204  *ptr++ |= static_cast<uint8_t>(values[1] >> 2);
205 
206  *ptr = static_cast<uint8_t>(values[1] << 6);
207  *ptr++ |= static_cast<uint8_t>(values[2] >> 3);
208 
209  *ptr = static_cast<uint8_t>(values[2] << 5);
210  *ptr++ |= static_cast<uint8_t>(values[3] >> 4);
211 
212  *ptr = static_cast<uint8_t>(values[3] << 4);
213  *ptr++ |= static_cast<uint8_t>(values[4] >> 5);
214 
215  *ptr = static_cast<uint8_t>(values[4] << 3);
216  *ptr++ |= static_cast<uint8_t>(values[5] >> 6);
217 
218  *ptr = static_cast<uint8_t>(values[5] << 2);
219  *ptr++ |= static_cast<uint8_t>(values[6] >> 7);
220 
221  *ptr = static_cast<uint8_t>(values[6] << 1);
222  *ptr++ |= static_cast<uint8_t>(values[7] >> 8);
223 
224  *ptr = static_cast<uint8_t>(values[7]);
225 }
226 
227 static inline void pack_bits_10(const uint64_t* values, uint8_t* ptr) {
228  *ptr++ = static_cast<uint8_t>(values[0] >> 2);
229 
230  *ptr = static_cast<uint8_t>(values[0] << 6);
231  *ptr++ |= static_cast<uint8_t>(values[1] >> 4);
232 
233  *ptr = static_cast<uint8_t>(values[1] << 4);
234  *ptr++ |= static_cast<uint8_t>(values[2] >> 6);
235 
236  *ptr = static_cast<uint8_t>(values[2] << 2);
237  *ptr++ |= static_cast<uint8_t>(values[3] >> 8);
238 
239  *ptr++ = static_cast<uint8_t>(values[3]);
240 
241  *ptr++ = static_cast<uint8_t>(values[4] >> 2);
242 
243  *ptr = static_cast<uint8_t>(values[4] << 6);
244  *ptr++ |= static_cast<uint8_t>(values[5] >> 4);
245 
246  *ptr = static_cast<uint8_t>(values[5] << 4);
247  *ptr++ |= static_cast<uint8_t>(values[6] >> 6);
248 
249  *ptr = static_cast<uint8_t>(values[6] << 2);
250  *ptr++ |= static_cast<uint8_t>(values[7] >> 8);
251 
252  *ptr = static_cast<uint8_t>(values[7]);
253 }
254 
255 static inline void pack_bits_11(const uint64_t* values, uint8_t* ptr) {
256  *ptr++ = static_cast<uint8_t>(values[0] >> 3);
257 
258  *ptr = static_cast<uint8_t>(values[0] << 5);
259  *ptr++ |= static_cast<uint8_t>(values[1] >> 6);
260 
261  *ptr = static_cast<uint8_t>(values[1] << 2);
262  *ptr++ |= static_cast<uint8_t>(values[2] >> 9);
263 
264  *ptr++ = static_cast<uint8_t>(values[2] >> 1);
265 
266  *ptr = static_cast<uint8_t>(values[2] << 7);
267  *ptr++ |= static_cast<uint8_t>(values[3] >> 4);
268 
269  *ptr = static_cast<uint8_t>(values[3] << 4);
270  *ptr++ |= static_cast<uint8_t>(values[4] >> 7);
271 
272  *ptr = static_cast<uint8_t>(values[4] << 1);
273  *ptr++ |= static_cast<uint8_t>(values[5] >> 10);
274 
275  *ptr++ = static_cast<uint8_t>(values[5] >> 2);
276 
277  *ptr = static_cast<uint8_t>(values[5] << 6);
278  *ptr++ |= static_cast<uint8_t>(values[6] >> 5);
279 
280  *ptr = static_cast<uint8_t>(values[6] << 3);
281  *ptr++ |= static_cast<uint8_t>(values[7] >> 8);
282 
283  *ptr = static_cast<uint8_t>(values[7]);
284 }
285 
286 static inline void pack_bits_12(const uint64_t* values, uint8_t* ptr) {
287  *ptr++ = static_cast<uint8_t>(values[0] >> 4);
288 
289  *ptr = static_cast<uint8_t>(values[0] << 4);
290  *ptr++ |= static_cast<uint8_t>(values[1] >> 8);
291 
292  *ptr++ = static_cast<uint8_t>(values[1]);
293 
294  *ptr++ = static_cast<uint8_t>(values[2] >> 4);
295 
296  *ptr = static_cast<uint8_t>(values[2] << 4);
297  *ptr++ |= static_cast<uint8_t>(values[3] >> 8);
298 
299  *ptr++ = static_cast<uint8_t>(values[3]);
300 
301  *ptr++ = static_cast<uint8_t>(values[4] >> 4);
302 
303  *ptr = static_cast<uint8_t>(values[4] << 4);
304  *ptr++ |= static_cast<uint8_t>(values[5] >> 8);
305 
306  *ptr++ = static_cast<uint8_t>(values[5]);
307 
308  *ptr++ = static_cast<uint8_t>(values[6] >> 4);
309 
310  *ptr = static_cast<uint8_t>(values[6] << 4);
311  *ptr++ |= static_cast<uint8_t>(values[7] >> 8);
312 
313  *ptr = static_cast<uint8_t>(values[7]);
314 }
315 
316 static inline void pack_bits_13(const uint64_t* values, uint8_t* ptr) {
317  *ptr++ = static_cast<uint8_t>(values[0] >> 5);
318 
319  *ptr = static_cast<uint8_t>(values[0] << 3);
320  *ptr++ |= static_cast<uint8_t>(values[1] >> 10);
321 
322  *ptr++ = static_cast<uint8_t>(values[1] >> 2);
323 
324  *ptr = static_cast<uint8_t>(values[1] << 6);
325  *ptr++ |= static_cast<uint8_t>(values[2] >> 7);
326 
327  *ptr = static_cast<uint8_t>(values[2] << 1);
328  *ptr++ |= static_cast<uint8_t>(values[3] >> 12);
329 
330  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
331 
332  *ptr = static_cast<uint8_t>(values[3] >> 4);
333  *ptr++ |= static_cast<uint8_t>(values[4] >> 9);
334 
335  *ptr++ = static_cast<uint8_t>(values[4] >> 1);
336 
337  *ptr = static_cast<uint8_t>(values[4] << 7);
338  *ptr++ |= static_cast<uint8_t>(values[5] >> 6);
339 
340  *ptr = static_cast<uint8_t>(values[5] << 2);
341  *ptr++ |= static_cast<uint8_t>(values[6] >> 11);
342 
343  *ptr++ = static_cast<uint8_t>(values[6] >> 3);
344 
345  *ptr = static_cast<uint8_t>(values[6] << 5);
346  *ptr++ |= static_cast<uint8_t>(values[7] >> 8);
347 
348  *ptr = static_cast<uint8_t>(values[7]);
349 }
350 
351 static inline void pack_bits_14(const uint64_t* values, uint8_t* ptr) {
352  *ptr++ = static_cast<uint8_t>(values[0] >> 6);
353 
354  *ptr = static_cast<uint8_t>(values[0] << 2);
355  *ptr++ |= static_cast<uint8_t>(values[1] >> 12);
356 
357  *ptr++ = static_cast<uint8_t>(values[1] >> 4);
358 
359  *ptr = static_cast<uint8_t>(values[1] << 4);
360  *ptr++ |= static_cast<uint8_t>(values[2] >> 10);
361 
362  *ptr++ = static_cast<uint8_t>(values[2] >> 2);
363 
364  *ptr = static_cast<uint8_t>(values[2] << 6);
365  *ptr++ |= static_cast<uint8_t>(values[3] >> 8);
366 
367  *ptr++ = static_cast<uint8_t>(values[3]);
368 
369  *ptr++ = static_cast<uint8_t>(values[4] >> 6);
370 
371  *ptr = static_cast<uint8_t>(values[4] << 2);
372  *ptr++ |= static_cast<uint8_t>(values[5] >> 12);
373 
374  *ptr++ = static_cast<uint8_t>(values[5] >> 4);
375 
376  *ptr = static_cast<uint8_t>(values[5] << 4);
377  *ptr++ |= static_cast<uint8_t>(values[6] >> 10);
378 
379  *ptr++ = static_cast<uint8_t>(values[6] >> 2);
380 
381  *ptr = static_cast<uint8_t>(values[6] << 6);
382  *ptr++ |= static_cast<uint8_t>(values[7] >> 8);
383 
384  *ptr = static_cast<uint8_t>(values[7]);
385 }
386 
387 static inline void pack_bits_15(const uint64_t* values, uint8_t* ptr) {
388  *ptr++ = static_cast<uint8_t>(values[0] >> 7);
389 
390  *ptr = static_cast<uint8_t>(values[0] << 1);
391  *ptr++ |= static_cast<uint8_t>(values[1] >> 14);
392 
393  *ptr++ = static_cast<uint8_t>(values[1] >> 6);
394 
395  *ptr = static_cast<uint8_t>(values[1] << 2);
396  *ptr++ |= static_cast<uint8_t>(values[2] >> 13);
397 
398  *ptr++ = static_cast<uint8_t>(values[2] >> 5);
399 
400  *ptr = static_cast<uint8_t>(values[2] << 3);
401  *ptr++ |= static_cast<uint8_t>(values[3] >> 12);
402 
403  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
404 
405  *ptr = static_cast<uint8_t>(values[3] << 4);
406  *ptr++ |= static_cast<uint8_t>(values[4] >> 11);
407 
408  *ptr++ = static_cast<uint8_t>(values[4] >> 3);
409 
410  *ptr = static_cast<uint8_t>(values[4] << 5);
411  *ptr++ |= static_cast<uint8_t>(values[5] >> 10);
412 
413  *ptr++ = static_cast<uint8_t>(values[5] >> 2);
414 
415  *ptr = static_cast<uint8_t>(values[5] << 6);
416  *ptr++ |= static_cast<uint8_t>(values[6] >> 9);
417 
418  *ptr++ = static_cast<uint8_t>(values[6] >> 1);
419 
420  *ptr = static_cast<uint8_t>(values[6] << 7);
421  *ptr++ |= static_cast<uint8_t>(values[7] >> 8);
422 
423  *ptr = static_cast<uint8_t>(values[7]);
424 }
425 
426 static inline void pack_bits_16(const uint64_t* values, uint8_t* ptr) {
427  *ptr++ = static_cast<uint8_t>(values[0] >> 8);
428  *ptr++ = static_cast<uint8_t>(values[0]);
429 
430  *ptr++ = static_cast<uint8_t>(values[1] >> 8);
431  *ptr++ = static_cast<uint8_t>(values[1]);
432 
433  *ptr++ = static_cast<uint8_t>(values[2] >> 8);
434  *ptr++ = static_cast<uint8_t>(values[2]);
435 
436  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
437  *ptr++ = static_cast<uint8_t>(values[3]);
438 
439  *ptr++ = static_cast<uint8_t>(values[4] >> 8);
440  *ptr++ = static_cast<uint8_t>(values[4]);
441 
442  *ptr++ = static_cast<uint8_t>(values[5] >> 8);
443  *ptr++ = static_cast<uint8_t>(values[5]);
444 
445  *ptr++ = static_cast<uint8_t>(values[6] >> 8);
446  *ptr++ = static_cast<uint8_t>(values[6]);
447 
448  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
449  *ptr = static_cast<uint8_t>(values[7]);
450 }
451 
452 static inline void pack_bits_17(const uint64_t* values, uint8_t* ptr) {
453  *ptr++ = static_cast<uint8_t>(values[0] >> 9);
454 
455  *ptr++ = static_cast<uint8_t>(values[0] >> 1);
456 
457  *ptr = static_cast<uint8_t>(values[0] << 7);
458  *ptr++ |= static_cast<uint8_t>(values[1] >> 10);
459 
460  *ptr++ = static_cast<uint8_t>(values[1] >> 2);
461 
462  *ptr = static_cast<uint8_t>(values[1] << 6);
463  *ptr++ |= static_cast<uint8_t>(values[2] >> 11);
464 
465  *ptr++ = static_cast<uint8_t>(values[2] >> 3);
466 
467  *ptr = static_cast<uint8_t>(values[2] << 5);
468  *ptr++ |= static_cast<uint8_t>(values[3] >> 12);
469 
470  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
471 
472  *ptr = static_cast<uint8_t>(values[3] << 4);
473  *ptr++ |= static_cast<uint8_t>(values[4] >> 13);
474 
475  *ptr++ = static_cast<uint8_t>(values[4] >> 5);
476 
477  *ptr = static_cast<uint8_t>(values[4] << 3);
478  *ptr++ |= static_cast<uint8_t>(values[5] >> 14);
479 
480  *ptr++ = static_cast<uint8_t>(values[5] >> 6);
481 
482  *ptr = static_cast<uint8_t>(values[5] << 2);
483  *ptr++ |= static_cast<uint8_t>(values[6] >> 15);
484 
485  *ptr++ = static_cast<uint8_t>(values[6] >> 7);
486 
487  *ptr = static_cast<uint8_t>(values[6] << 1);
488  *ptr++ |= static_cast<uint8_t>(values[7] >> 16);
489 
490  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
491 
492  *ptr = static_cast<uint8_t>(values[7]);
493 }
494 
495 static inline void pack_bits_18(const uint64_t* values, uint8_t* ptr) {
496  *ptr++ = static_cast<uint8_t>(values[0] >> 10);
497 
498  *ptr++ = static_cast<uint8_t>(values[0] >> 2);
499 
500  *ptr = static_cast<uint8_t>(values[0] << 6);
501  *ptr++ |= static_cast<uint8_t>(values[1] >> 12);
502 
503  *ptr++ = static_cast<uint8_t>(values[1] >> 4);
504 
505  *ptr = static_cast<uint8_t>(values[1] << 4);
506  *ptr++ |= static_cast<uint8_t>(values[2] >> 14);
507 
508  *ptr++ = static_cast<uint8_t>(values[2] >> 6);
509 
510  *ptr = static_cast<uint8_t>(values[2] << 2);
511  *ptr++ |= static_cast<uint8_t>(values[3] >> 16);
512 
513  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
514 
515  *ptr++ = static_cast<uint8_t>(values[3]);
516 
517  *ptr++ = static_cast<uint8_t>(values[4] >> 10);
518 
519  *ptr++ = static_cast<uint8_t>(values[4] >> 2);
520 
521  *ptr = static_cast<uint8_t>(values[4] << 6);
522  *ptr++ |= static_cast<uint8_t>(values[5] >> 12);
523 
524  *ptr++ = static_cast<uint8_t>(values[5] >> 4);
525 
526  *ptr = static_cast<uint8_t>(values[5] << 4);
527  *ptr++ |= static_cast<uint8_t>(values[6] >> 14);
528 
529  *ptr++ = static_cast<uint8_t>(values[6] >> 6);
530 
531  *ptr = static_cast<uint8_t>(values[6] << 2);
532  *ptr++ |= static_cast<uint8_t>(values[7] >> 16);
533 
534  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
535 
536  *ptr = static_cast<uint8_t>(values[7]);
537 }
538 
539 static inline void pack_bits_19(const uint64_t* values, uint8_t* ptr) {
540  *ptr++ = static_cast<uint8_t>(values[0] >> 11);
541 
542  *ptr++ = static_cast<uint8_t>(values[0] >> 3);
543 
544  *ptr = static_cast<uint8_t>(values[0] << 5);
545  *ptr++ |= static_cast<uint8_t>(values[1] >> 14);
546 
547  *ptr++ = static_cast<uint8_t>(values[1] >> 6);
548 
549  *ptr = static_cast<uint8_t>(values[1] << 2);
550  *ptr++ |= static_cast<uint8_t>(values[2] >> 17);
551 
552  *ptr++ = static_cast<uint8_t>(values[2] >> 9);
553 
554  *ptr++ = static_cast<uint8_t>(values[2] >> 1);
555 
556  *ptr = static_cast<uint8_t>(values[2] << 7);
557  *ptr++ |= static_cast<uint8_t>(values[3] >> 12);
558 
559  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
560 
561  *ptr = static_cast<uint8_t>(values[3] << 4);
562  *ptr++ |= static_cast<uint8_t>(values[4] >> 15);
563 
564  *ptr++ |= static_cast<uint8_t>(values[4] >> 7);
565 
566  *ptr = static_cast<uint8_t>(values[4] << 1);
567  *ptr++ |= static_cast<uint8_t>(values[5] >> 18);
568 
569  *ptr++ = static_cast<uint8_t>(values[5] >> 10);
570 
571  *ptr++ = static_cast<uint8_t>(values[5] >> 2);
572 
573  *ptr = static_cast<uint8_t>(values[5] << 6);
574  *ptr++ |= static_cast<uint8_t>(values[6] >> 13);
575 
576  *ptr++ = static_cast<uint8_t>(values[6] >> 5);
577 
578  *ptr = static_cast<uint8_t>(values[6] << 3);
579  *ptr++ |= static_cast<uint8_t>(values[7] >> 16);
580 
581  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
582 
583  *ptr = static_cast<uint8_t>(values[7]);
584 }
585 
586 static inline void pack_bits_20(const uint64_t* values, uint8_t* ptr) {
587  *ptr++ = static_cast<uint8_t>(values[0] >> 12);
588 
589  *ptr++ = static_cast<uint8_t>(values[0] >> 4);
590 
591  *ptr = static_cast<uint8_t>(values[0] << 4);
592  *ptr++ |= static_cast<uint8_t>(values[1] >> 16);
593 
594  *ptr++ = static_cast<uint8_t>(values[1] >> 8);
595 
596  *ptr++ = static_cast<uint8_t>(values[1]);
597 
598  *ptr++ = static_cast<uint8_t>(values[2] >> 12);
599 
600  *ptr++ = static_cast<uint8_t>(values[2] >> 4);
601 
602  *ptr = static_cast<uint8_t>(values[2] << 4);
603  *ptr++ |= static_cast<uint8_t>(values[3] >> 16);
604 
605  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
606 
607  *ptr++ = static_cast<uint8_t>(values[3]);
608 
609  *ptr++ = static_cast<uint8_t>(values[4] >> 12);
610 
611  *ptr++ = static_cast<uint8_t>(values[4] >> 4);
612 
613  *ptr = static_cast<uint8_t>(values[4] << 4);
614  *ptr++ |= static_cast<uint8_t>(values[5] >> 16);
615 
616  *ptr++ = static_cast<uint8_t>(values[5] >> 8);
617 
618  *ptr++ = static_cast<uint8_t>(values[5]);
619 
620  *ptr++ = static_cast<uint8_t>(values[6] >> 12);
621 
622  *ptr++ = static_cast<uint8_t>(values[6] >> 4);
623 
624  *ptr = static_cast<uint8_t>(values[6] << 4);
625  *ptr++ |= static_cast<uint8_t>(values[7] >> 16);
626 
627  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
628 
629  *ptr = static_cast<uint8_t>(values[7]);
630 }
631 
632 static inline void pack_bits_21(const uint64_t* values, uint8_t* ptr) {
633  *ptr++ = static_cast<uint8_t>(values[0] >> 13);
634 
635  *ptr++ = static_cast<uint8_t>(values[0] >> 5);
636 
637  *ptr = static_cast<uint8_t>(values[0] << 3);
638  *ptr++ |= static_cast<uint8_t>(values[1] >> 18);
639 
640  *ptr++ = static_cast<uint8_t>(values[1] >> 10);
641 
642  *ptr++ = static_cast<uint8_t>(values[1] >> 2);
643 
644  *ptr = static_cast<uint8_t>(values[1] << 6);
645  *ptr++ |= static_cast<uint8_t>(values[2] >> 15);
646 
647  *ptr++ = static_cast<uint8_t>(values[2] >> 7);
648 
649  *ptr = static_cast<uint8_t>(values[2] << 1);
650  *ptr++ |= static_cast<uint8_t>(values[3] >> 20);
651 
652  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
653 
654  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
655 
656  *ptr = static_cast<uint8_t>(values[3] << 4);
657  *ptr++ |= static_cast<uint8_t>(values[4] >> 17);
658 
659  *ptr++ = static_cast<uint8_t>(values[4] >> 9);
660 
661  *ptr++ = static_cast<uint8_t>(values[4] >> 1);
662 
663  *ptr = static_cast<uint8_t>(values[4] << 7);
664  *ptr++ |= static_cast<uint8_t>(values[5] >> 14);
665 
666  *ptr++ = static_cast<uint8_t>(values[5] >> 6);
667 
668  *ptr = static_cast<uint8_t>(values[5] << 2);
669  *ptr++ |= static_cast<uint8_t>(values[6] >> 19);
670 
671  *ptr++ = static_cast<uint8_t>(values[6] >> 11);
672 
673  *ptr++ = static_cast<uint8_t>(values[6] >> 3);
674 
675  *ptr = static_cast<uint8_t>(values[6] << 5);
676  *ptr++ |= static_cast<uint8_t>(values[7] >> 16);
677 
678  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
679 
680  *ptr = static_cast<uint8_t>(values[7]);
681 }
682 
683 static inline void pack_bits_22(const uint64_t* values, uint8_t* ptr) {
684  *ptr++ = static_cast<uint8_t>(values[0] >> 14);
685 
686  *ptr++ = static_cast<uint8_t>(values[0] >> 6);
687 
688  *ptr = static_cast<uint8_t>(values[0] << 2);
689  *ptr++ |= static_cast<uint8_t>(values[1] >> 20);
690 
691  *ptr++ = static_cast<uint8_t>(values[1] >> 12);
692 
693  *ptr++ = static_cast<uint8_t>(values[1] >> 4);
694 
695  *ptr = static_cast<uint8_t>(values[1] << 4);
696  *ptr++ |= static_cast<uint8_t>(values[2] >> 18);
697 
698  *ptr++ = static_cast<uint8_t>(values[2] >> 10);
699 
700  *ptr++ = static_cast<uint8_t>(values[2] >> 2);
701 
702  *ptr = static_cast<uint8_t>(values[2] << 6);
703  *ptr++ |= static_cast<uint8_t>(values[3] >> 16);
704 
705  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
706 
707  *ptr++ = static_cast<uint8_t>(values[3]);
708 
709  *ptr++ = static_cast<uint8_t>(values[4] >> 14);
710 
711  *ptr++ = static_cast<uint8_t>(values[4] >> 6);
712 
713  *ptr = static_cast<uint8_t>(values[4] << 2);
714  *ptr++ |= static_cast<uint8_t>(values[5] >> 20);
715 
716  *ptr++ = static_cast<uint8_t>(values[5] >> 12);
717 
718  *ptr++ = static_cast<uint8_t>(values[5] >> 4);
719 
720  *ptr = static_cast<uint8_t>(values[5] << 4);
721  *ptr++ |= static_cast<uint8_t>(values[6] >> 18);
722 
723  *ptr++ = static_cast<uint8_t>(values[6] >> 10);
724 
725  *ptr++ = static_cast<uint8_t>(values[6] >> 2);
726 
727  *ptr = static_cast<uint8_t>(values[6] << 6);
728  *ptr++ |= static_cast<uint8_t>(values[7] >> 16);
729 
730  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
731 
732  *ptr = static_cast<uint8_t>(values[7]);
733 }
734 
735 static inline void pack_bits_23(const uint64_t* values, uint8_t* ptr) {
736  *ptr++ = static_cast<uint8_t>(values[0] >> 15);
737 
738  *ptr++ = static_cast<uint8_t>(values[0] >> 7);
739 
740  *ptr = static_cast<uint8_t>(values[0] << 1);
741  *ptr++ |= static_cast<uint8_t>(values[1] >> 22);
742 
743  *ptr++ = static_cast<uint8_t>(values[1] >> 14);
744 
745  *ptr++ = static_cast<uint8_t>(values[1] >> 6);
746 
747  *ptr = static_cast<uint8_t>(values[1] << 2);
748  *ptr++ |= static_cast<uint8_t>(values[2] >> 21);
749 
750  *ptr++ = static_cast<uint8_t>(values[2] >> 13);
751 
752  *ptr++ = static_cast<uint8_t>(values[2] >> 5);
753 
754  *ptr = static_cast<uint8_t>(values[2] << 3);
755  *ptr++ |= static_cast<uint8_t>(values[3] >> 20);
756 
757  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
758 
759  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
760 
761  *ptr = static_cast<uint8_t>(values[3] << 4);
762  *ptr++ |= static_cast<uint8_t>(values[4] >> 19);
763 
764  *ptr++ = static_cast<uint8_t>(values[4] >> 11);
765 
766  *ptr++ = static_cast<uint8_t>(values[4] >> 3);
767 
768  *ptr = static_cast<uint8_t>(values[4] << 5);
769  *ptr++ |= static_cast<uint8_t>(values[5] >> 18);
770 
771  *ptr++ = static_cast<uint8_t>(values[5] >> 10);
772 
773  *ptr++ = static_cast<uint8_t>(values[5] >> 2);
774 
775  *ptr = static_cast<uint8_t>(values[5] << 6);
776  *ptr++ |= static_cast<uint8_t>(values[6] >> 17);
777 
778  *ptr++ = static_cast<uint8_t>(values[6] >> 9);
779 
780  *ptr++ = static_cast<uint8_t>(values[6] >> 1);
781 
782  *ptr = static_cast<uint8_t>(values[6] << 7);
783  *ptr++ |= static_cast<uint8_t>(values[7] >> 16);
784 
785  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
786 
787  *ptr = static_cast<uint8_t>(values[7]);
788 }
789 
790 static inline void pack_bits_24(const uint64_t* values, uint8_t* ptr) {
791  *ptr++ = static_cast<uint8_t>(values[0] >> 16);
792  *ptr++ = static_cast<uint8_t>(values[0] >> 8);
793  *ptr++ = static_cast<uint8_t>(values[0]);
794 
795  *ptr++ = static_cast<uint8_t>(values[1] >> 16);
796  *ptr++ = static_cast<uint8_t>(values[1] >> 8);
797  *ptr++ = static_cast<uint8_t>(values[1]);
798 
799  *ptr++ = static_cast<uint8_t>(values[2] >> 16);
800  *ptr++ = static_cast<uint8_t>(values[2] >> 8);
801  *ptr++ = static_cast<uint8_t>(values[2]);
802 
803  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
804  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
805  *ptr++ = static_cast<uint8_t>(values[3]);
806 
807  *ptr++ = static_cast<uint8_t>(values[4] >> 16);
808  *ptr++ = static_cast<uint8_t>(values[4] >> 8);
809  *ptr++ = static_cast<uint8_t>(values[4]);
810 
811  *ptr++ = static_cast<uint8_t>(values[5] >> 16);
812  *ptr++ = static_cast<uint8_t>(values[5] >> 8);
813  *ptr++ = static_cast<uint8_t>(values[5]);
814 
815  *ptr++ = static_cast<uint8_t>(values[6] >> 16);
816  *ptr++ = static_cast<uint8_t>(values[6] >> 8);
817  *ptr++ = static_cast<uint8_t>(values[6]);
818 
819  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
820  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
821  *ptr = static_cast<uint8_t>(values[7]);
822 }
823 
824 static inline void pack_bits_25(const uint64_t* values, uint8_t* ptr) {
825  *ptr++ = static_cast<uint8_t>(values[0] >> 17);
826 
827  *ptr++ = static_cast<uint8_t>(values[0] >> 9);
828 
829  *ptr++ = static_cast<uint8_t>(values[0] >> 1);
830 
831  *ptr = static_cast<uint8_t>(values[0] << 7);
832  *ptr++ |= static_cast<uint8_t>(values[1] >> 18);
833 
834  *ptr++ = static_cast<uint8_t>(values[1] >> 10);
835 
836  *ptr++ = static_cast<uint8_t>(values[1] >> 2);
837 
838  *ptr = static_cast<uint8_t>(values[1] << 6);
839  *ptr++ |= static_cast<uint8_t>(values[2] >> 19);
840 
841  *ptr++ = static_cast<uint8_t>(values[2] >> 11);
842 
843  *ptr++ = static_cast<uint8_t>(values[2] >> 3);
844 
845  *ptr = static_cast<uint8_t>(values[2] << 5);
846  *ptr++ |= static_cast<uint8_t>(values[3] >> 20);
847 
848  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
849 
850  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
851 
852  *ptr = static_cast<uint8_t>(values[3] << 4);
853  *ptr++ |= static_cast<uint8_t>(values[4] >> 21);
854 
855  *ptr++ = static_cast<uint8_t>(values[4] >> 13);
856 
857  *ptr++ = static_cast<uint8_t>(values[4] >> 5);
858 
859  *ptr = static_cast<uint8_t>(values[4] << 3);
860  *ptr++ |= static_cast<uint8_t>(values[5] >> 22);
861 
862  *ptr++ = static_cast<uint8_t>(values[5] >> 14);
863 
864  *ptr++ = static_cast<uint8_t>(values[5] >> 6);
865 
866  *ptr = static_cast<uint8_t>(values[5] << 2);
867  *ptr++ |= static_cast<uint8_t>(values[6] >> 23);
868 
869  *ptr++ = static_cast<uint8_t>(values[6] >> 15);
870 
871  *ptr++ = static_cast<uint8_t>(values[6] >> 7);
872 
873  *ptr = static_cast<uint8_t>(values[6] << 1);
874  *ptr++ |= static_cast<uint8_t>(values[7] >> 24);
875 
876  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
877 
878  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
879 
880  *ptr = static_cast<uint8_t>(values[7]);
881 }
882 
883 static inline void pack_bits_26(const uint64_t* values, uint8_t* ptr) {
884  *ptr++ = static_cast<uint8_t>(values[0] >> 18);
885 
886  *ptr++ = static_cast<uint8_t>(values[0] >> 10);
887 
888  *ptr++ = static_cast<uint8_t>(values[0] >> 2);
889 
890  *ptr = static_cast<uint8_t>(values[0] << 6);
891  *ptr++ |= static_cast<uint8_t>(values[1] >> 20);
892 
893  *ptr++ = static_cast<uint8_t>(values[1] >> 12);
894 
895  *ptr++ = static_cast<uint8_t>(values[1] >> 4);
896 
897  *ptr = static_cast<uint8_t>(values[1] << 4);
898  *ptr++ |= static_cast<uint8_t>(values[2] >> 22);
899 
900  *ptr++ = static_cast<uint8_t>(values[2] >> 14);
901 
902  *ptr++ = static_cast<uint8_t>(values[2] >> 6);
903 
904  *ptr = static_cast<uint8_t>(values[2] << 2);
905  *ptr++ |= static_cast<uint8_t>(values[3] >> 24);
906 
907  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
908 
909  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
910 
911  *ptr++ = static_cast<uint8_t>(values[3]);
912 
913  *ptr++ = static_cast<uint8_t>(values[4] >> 18);
914 
915  *ptr++ = static_cast<uint8_t>(values[4] >> 10);
916 
917  *ptr++ = static_cast<uint8_t>(values[4] >> 2);
918 
919  *ptr = static_cast<uint8_t>(values[4] << 6);
920  *ptr++ |= static_cast<uint8_t>(values[5] >> 20);
921 
922  *ptr++ = static_cast<uint8_t>(values[5] >> 12);
923 
924  *ptr++ = static_cast<uint8_t>(values[5] >> 4);
925 
926  *ptr = static_cast<uint8_t>(values[5] << 4);
927  *ptr++ |= static_cast<uint8_t>(values[6] >> 22);
928 
929  *ptr++ = static_cast<uint8_t>(values[6] >> 14);
930 
931  *ptr++ = static_cast<uint8_t>(values[6] >> 6);
932 
933  *ptr = static_cast<uint8_t>(values[6] << 2);
934  *ptr++ |= static_cast<uint8_t>(values[7] >> 24);
935 
936  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
937 
938  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
939 
940  *ptr = static_cast<uint8_t>(values[7]);
941 }
942 
943 static inline void pack_bits_27(const uint64_t* values, uint8_t* ptr) {
944  *ptr++ = static_cast<uint8_t>(values[0] >> 19);
945 
946  *ptr++ = static_cast<uint8_t>(values[0] >> 11);
947 
948  *ptr++ = static_cast<uint8_t>(values[0] >> 3);
949 
950  *ptr = static_cast<uint8_t>(values[0] << 5);
951  *ptr++ |= static_cast<uint8_t>(values[1] >> 22);
952 
953  *ptr++ = static_cast<uint8_t>(values[1] >> 14);
954 
955  *ptr++ = static_cast<uint8_t>(values[1] >> 6);
956 
957  *ptr = static_cast<uint8_t>(values[1] << 2);
958  *ptr++ |= static_cast<uint8_t>(values[2] >> 25);
959 
960  *ptr++ = static_cast<uint8_t>(values[2] >> 17);
961 
962  *ptr++ = static_cast<uint8_t>(values[2] >> 9);
963 
964  *ptr++ = static_cast<uint8_t>(values[2] >> 1);
965 
966  *ptr = static_cast<uint8_t>(values[2] << 7);
967  *ptr++ |= static_cast<uint8_t>(values[3] >> 20);
968 
969  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
970 
971  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
972 
973  *ptr = static_cast<uint8_t>(values[3] << 4);
974  *ptr++ |= static_cast<uint8_t>(values[4] >> 23);
975 
976  *ptr++ = static_cast<uint8_t>(values[4] >> 15);
977 
978  *ptr++ = static_cast<uint8_t>(values[4] >> 7);
979 
980  *ptr = static_cast<uint8_t>(values[4] << 1);
981  *ptr++ |= static_cast<uint8_t>(values[5] >> 26);
982 
983  *ptr++ = static_cast<uint8_t>(values[5] >> 18);
984 
985  *ptr++ = static_cast<uint8_t>(values[5] >> 10);
986 
987  *ptr++ = static_cast<uint8_t>(values[5] >> 2);
988 
989  *ptr = static_cast<uint8_t>(values[5] << 6);
990  *ptr++ |= static_cast<uint8_t>(values[6] >> 21);
991 
992  *ptr++ = static_cast<uint8_t>(values[6] >> 13);
993 
994  *ptr++ = static_cast<uint8_t>(values[6] >> 5);
995 
996  *ptr = static_cast<uint8_t>(values[6] << 3);
997  *ptr++ |= static_cast<uint8_t>(values[7] >> 24);
998 
999  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1000 
1001  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1002 
1003  *ptr = static_cast<uint8_t>(values[7]);
1004 }
1005 
1006 static inline void pack_bits_28(const uint64_t* values, uint8_t* ptr) {
1007  *ptr++ = static_cast<uint8_t>(values[0] >> 20);
1008  *ptr++ = static_cast<uint8_t>(values[0] >> 12);
1009  *ptr++ = static_cast<uint8_t>(values[0] >> 4);
1010  *ptr = static_cast<uint8_t>(values[0] << 4);
1011  *ptr++ |= static_cast<uint8_t>(values[1] >> 24);
1012  *ptr++ = static_cast<uint8_t>(values[1] >> 16);
1013  *ptr++ = static_cast<uint8_t>(values[1] >> 8);
1014  *ptr++ = static_cast<uint8_t>(values[1]);
1015  *ptr++ = static_cast<uint8_t>(values[2] >> 20);
1016  *ptr++ = static_cast<uint8_t>(values[2] >> 12);
1017  *ptr++ = static_cast<uint8_t>(values[2] >> 4);
1018  *ptr = static_cast<uint8_t>(values[2] << 4);
1019  *ptr++ |= static_cast<uint8_t>(values[3] >> 24);
1020  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
1021  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
1022  *ptr++ = static_cast<uint8_t>(values[3]);
1023  *ptr++ = static_cast<uint8_t>(values[4] >> 20);
1024  *ptr++ = static_cast<uint8_t>(values[4] >> 12);
1025  *ptr++ = static_cast<uint8_t>(values[4] >> 4);
1026  *ptr = static_cast<uint8_t>(values[4] << 4);
1027  *ptr++ |= static_cast<uint8_t>(values[5] >> 24);
1028  *ptr++ = static_cast<uint8_t>(values[5] >> 16);
1029  *ptr++ = static_cast<uint8_t>(values[5] >> 8);
1030  *ptr++ = static_cast<uint8_t>(values[5]);
1031  *ptr++ = static_cast<uint8_t>(values[6] >> 20);
1032  *ptr++ = static_cast<uint8_t>(values[6] >> 12);
1033  *ptr++ = static_cast<uint8_t>(values[6] >> 4);
1034  *ptr = static_cast<uint8_t>(values[6] << 4);
1035  *ptr++ |= static_cast<uint8_t>(values[7] >> 24);
1036  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1037  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1038  *ptr = static_cast<uint8_t>(values[7]);
1039 }
1040 
1041 static inline void pack_bits_29(const uint64_t* values, uint8_t* ptr) {
1042  *ptr++ = static_cast<uint8_t>(values[0] >> 21);
1043 
1044  *ptr++ = static_cast<uint8_t>(values[0] >> 13);
1045 
1046  *ptr++ = static_cast<uint8_t>(values[0] >> 5);
1047 
1048  *ptr = static_cast<uint8_t>(values[0] << 3);
1049  *ptr++ |= static_cast<uint8_t>(values[1] >> 26);
1050 
1051  *ptr++ = static_cast<uint8_t>(values[1] >> 18);
1052 
1053  *ptr++ = static_cast<uint8_t>(values[1] >> 10);
1054 
1055  *ptr++ = static_cast<uint8_t>(values[1] >> 2);
1056 
1057  *ptr = static_cast<uint8_t>(values[1] << 6);
1058  *ptr++ |= static_cast<uint8_t>(values[2] >> 23);
1059 
1060  *ptr++ = static_cast<uint8_t>(values[2] >> 15);
1061 
1062  *ptr++ = static_cast<uint8_t>(values[2] >> 7);
1063 
1064  *ptr = static_cast<uint8_t>(values[2] << 1);
1065  *ptr++ |= static_cast<uint8_t>(values[3] >> 28);
1066 
1067  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
1068 
1069  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
1070 
1071  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
1072 
1073  *ptr = static_cast<uint8_t>(values[3] << 4);
1074  *ptr++ |= static_cast<uint8_t>(values[4] >> 25);
1075 
1076  *ptr++ = static_cast<uint8_t>(values[4] >> 17);
1077 
1078  *ptr++ = static_cast<uint8_t>(values[4] >> 9);
1079 
1080  *ptr++ = static_cast<uint8_t>(values[4] >> 1);
1081 
1082  *ptr = static_cast<uint8_t>(values[4] << 7);
1083  *ptr++ |= static_cast<uint8_t>(values[5] >> 22);
1084 
1085  *ptr++ = static_cast<uint8_t>(values[5] >> 14);
1086 
1087  *ptr++ = static_cast<uint8_t>(values[5] >> 6);
1088 
1089  *ptr = static_cast<uint8_t>(values[5] << 2);
1090  *ptr++ |= static_cast<uint8_t>(values[6] >> 27);
1091 
1092  *ptr++ = static_cast<uint8_t>(values[6] >> 19);
1093 
1094  *ptr++ = static_cast<uint8_t>(values[6] >> 11);
1095 
1096  *ptr++ = static_cast<uint8_t>(values[6] >> 3);
1097 
1098  *ptr = static_cast<uint8_t>(values[6] << 5);
1099  *ptr++ |= static_cast<uint8_t>(values[7] >> 24);
1100 
1101  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1102 
1103  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1104 
1105  *ptr = static_cast<uint8_t>(values[7]);
1106 }
1107 
1108 static inline void pack_bits_30(const uint64_t* values, uint8_t* ptr) {
1109  *ptr++ = static_cast<uint8_t>(values[0] >> 22);
1110  *ptr++ = static_cast<uint8_t>(values[0] >> 14);
1111  *ptr++ = static_cast<uint8_t>(values[0] >> 6);
1112 
1113  *ptr = static_cast<uint8_t>(values[0] << 2);
1114  *ptr++ |= static_cast<uint8_t>(values[1] >> 28);
1115  *ptr++ = static_cast<uint8_t>(values[1] >> 20);
1116  *ptr++ = static_cast<uint8_t>(values[1] >> 12);
1117  *ptr++ = static_cast<uint8_t>(values[1] >> 4);
1118 
1119  *ptr = static_cast<uint8_t>(values[1] << 4);
1120  *ptr++ |= static_cast<uint8_t>(values[2] >> 26);
1121  *ptr++ = static_cast<uint8_t>(values[2] >> 18);
1122  *ptr++ = static_cast<uint8_t>(values[2] >> 10);
1123  *ptr++ = static_cast<uint8_t>(values[2] >> 2);
1124 
1125  *ptr = static_cast<uint8_t>(values[2] << 6);
1126  *ptr++ |= static_cast<uint8_t>(values[3] >> 24);
1127  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
1128  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
1129  *ptr++ = static_cast<uint8_t>(values[3]);
1130 
1131  *ptr++ = static_cast<uint8_t>(values[4] >> 22);
1132  *ptr++ = static_cast<uint8_t>(values[4] >> 14);
1133  *ptr++ = static_cast<uint8_t>(values[4] >> 6);
1134 
1135  *ptr = static_cast<uint8_t>(values[4] << 2);
1136  *ptr++ |= static_cast<uint8_t>(values[5] >> 28);
1137  *ptr++ = static_cast<uint8_t>(values[5] >> 20);
1138  *ptr++ = static_cast<uint8_t>(values[5] >> 12);
1139  *ptr++ = static_cast<uint8_t>(values[5] >> 4);
1140 
1141  *ptr = static_cast<uint8_t>(values[5] << 4);
1142  *ptr++ |= static_cast<uint8_t>(values[6] >> 26);
1143  *ptr++ = static_cast<uint8_t>(values[6] >> 18);
1144  *ptr++ = static_cast<uint8_t>(values[6] >> 10);
1145  *ptr++ = static_cast<uint8_t>(values[6] >> 2);
1146 
1147  *ptr = static_cast<uint8_t>(values[6] << 6);
1148  *ptr++ |= static_cast<uint8_t>(values[7] >> 24);
1149  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1150  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1151  *ptr = static_cast<uint8_t>(values[7]);
1152 }
1153 
1154 static inline void pack_bits_31(const uint64_t* values, uint8_t* ptr) {
1155  *ptr++ = static_cast<uint8_t>(values[0] >> 23);
1156  *ptr++ = static_cast<uint8_t>(values[0] >> 15);
1157  *ptr++ = static_cast<uint8_t>(values[0] >> 7);
1158 
1159  *ptr = static_cast<uint8_t>(values[0] << 1);
1160  *ptr++ |= static_cast<uint8_t>(values[1] >> 30);
1161  *ptr++ = static_cast<uint8_t>(values[1] >> 22);
1162  *ptr++ = static_cast<uint8_t>(values[1] >> 14);
1163  *ptr++ = static_cast<uint8_t>(values[1] >> 6);
1164 
1165  *ptr = static_cast<uint8_t>(values[1] << 2);
1166  *ptr++ |= static_cast<uint8_t>(values[2] >> 29);
1167  *ptr++ = static_cast<uint8_t>(values[2] >> 21);
1168  *ptr++ = static_cast<uint8_t>(values[2] >> 13);
1169  *ptr++ = static_cast<uint8_t>(values[2] >> 5);
1170 
1171  *ptr = static_cast<uint8_t>(values[2] << 3);
1172  *ptr++ |= static_cast<uint8_t>(values[3] >> 28);
1173  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
1174  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
1175  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
1176 
1177  *ptr = static_cast<uint8_t>(values[3] << 4);
1178  *ptr++ |= static_cast<uint8_t>(values[4] >> 27);
1179  *ptr++ = static_cast<uint8_t>(values[4] >> 19);
1180  *ptr++ = static_cast<uint8_t>(values[4] >> 11);
1181  *ptr++ = static_cast<uint8_t>(values[4] >> 3);
1182 
1183  *ptr = static_cast<uint8_t>(values[4] << 5);
1184  *ptr++ |= static_cast<uint8_t>(values[5] >> 26);
1185  *ptr++ = static_cast<uint8_t>(values[5] >> 18);
1186  *ptr++ = static_cast<uint8_t>(values[5] >> 10);
1187  *ptr++ = static_cast<uint8_t>(values[5] >> 2);
1188 
1189  *ptr = static_cast<uint8_t>(values[5] << 6);
1190  *ptr++ |= static_cast<uint8_t>(values[6] >> 25);
1191  *ptr++ = static_cast<uint8_t>(values[6] >> 17);
1192  *ptr++ = static_cast<uint8_t>(values[6] >> 9);
1193  *ptr++ = static_cast<uint8_t>(values[6] >> 1);
1194 
1195  *ptr = static_cast<uint8_t>(values[6] << 7);
1196  *ptr++ |= static_cast<uint8_t>(values[7] >> 24);
1197  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1198  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1199  *ptr = static_cast<uint8_t>(values[7]);
1200 }
1201 
1202 static inline void pack_bits_32(const uint64_t* values, uint8_t* ptr) {
1203  *ptr++ = static_cast<uint8_t>(values[0] >> 24);
1204  *ptr++ = static_cast<uint8_t>(values[0] >> 16);
1205  *ptr++ = static_cast<uint8_t>(values[0] >> 8);
1206  *ptr++ = static_cast<uint8_t>(values[0]);
1207 
1208  *ptr++ = static_cast<uint8_t>(values[1] >> 24);
1209  *ptr++ = static_cast<uint8_t>(values[1] >> 16);
1210  *ptr++ = static_cast<uint8_t>(values[1] >> 8);
1211  *ptr++ = static_cast<uint8_t>(values[1]);
1212 
1213  *ptr++ = static_cast<uint8_t>(values[2] >> 24);
1214  *ptr++ = static_cast<uint8_t>(values[2] >> 16);
1215  *ptr++ = static_cast<uint8_t>(values[2] >> 8);
1216  *ptr++ = static_cast<uint8_t>(values[2]);
1217 
1218  *ptr++ = static_cast<uint8_t>(values[3] >> 24);
1219  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
1220  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
1221  *ptr++ = static_cast<uint8_t>(values[3]);
1222 
1223  *ptr++ = static_cast<uint8_t>(values[4] >> 24);
1224  *ptr++ = static_cast<uint8_t>(values[4] >> 16);
1225  *ptr++ = static_cast<uint8_t>(values[4] >> 8);
1226  *ptr++ = static_cast<uint8_t>(values[4]);
1227 
1228  *ptr++ = static_cast<uint8_t>(values[5] >> 24);
1229  *ptr++ = static_cast<uint8_t>(values[5] >> 16);
1230  *ptr++ = static_cast<uint8_t>(values[5] >> 8);
1231  *ptr++ = static_cast<uint8_t>(values[5]);
1232 
1233  *ptr++ = static_cast<uint8_t>(values[6] >> 24);
1234  *ptr++ = static_cast<uint8_t>(values[6] >> 16);
1235  *ptr++ = static_cast<uint8_t>(values[6] >> 8);
1236  *ptr++ = static_cast<uint8_t>(values[6]);
1237 
1238  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
1239  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1240  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1241  *ptr = static_cast<uint8_t>(values[7]);
1242 }
1243 
1244 static inline void pack_bits_33(const uint64_t* values, uint8_t* ptr) {
1245  *ptr++ = static_cast<uint8_t>(values[0] >> 25);
1246  *ptr++ = static_cast<uint8_t>(values[0] >> 17);
1247  *ptr++ = static_cast<uint8_t>(values[0] >> 9);
1248  *ptr++ = static_cast<uint8_t>(values[0] >> 1);
1249 
1250  *ptr = static_cast<uint8_t>(values[0] << 7);
1251  *ptr++ |= static_cast<uint8_t>(values[1] >> 26);
1252  *ptr++ = static_cast<uint8_t>(values[1] >> 18);
1253  *ptr++ = static_cast<uint8_t>(values[1] >> 10);
1254  *ptr++ = static_cast<uint8_t>(values[1] >> 2);
1255 
1256  *ptr = static_cast<uint8_t>(values[1] << 6);
1257  *ptr++ |= static_cast<uint8_t>(values[2] >> 27);
1258  *ptr++ = static_cast<uint8_t>(values[2] >> 19);
1259  *ptr++ = static_cast<uint8_t>(values[2] >> 11);
1260  *ptr++ = static_cast<uint8_t>(values[2] >> 3);
1261 
1262  *ptr = static_cast<uint8_t>(values[2] << 5);
1263  *ptr++ |= static_cast<uint8_t>(values[3] >> 28);
1264  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
1265  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
1266  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
1267 
1268  *ptr = static_cast<uint8_t>(values[3] << 4);
1269  *ptr++ |= static_cast<uint8_t>(values[4] >> 29);
1270  *ptr++ = static_cast<uint8_t>(values[4] >> 21);
1271  *ptr++ = static_cast<uint8_t>(values[4] >> 13);
1272  *ptr++ = static_cast<uint8_t>(values[4] >> 5);
1273 
1274  *ptr = static_cast<uint8_t>(values[4] << 3);
1275  *ptr++ |= static_cast<uint8_t>(values[5] >> 30);
1276  *ptr++ = static_cast<uint8_t>(values[5] >> 22);
1277  *ptr++ = static_cast<uint8_t>(values[5] >> 14);
1278  *ptr++ = static_cast<uint8_t>(values[5] >> 6);
1279 
1280  *ptr = static_cast<uint8_t>(values[5] << 2);
1281  *ptr++ |= static_cast<uint8_t>(values[6] >> 31);
1282  *ptr++ = static_cast<uint8_t>(values[6] >> 23);
1283  *ptr++ = static_cast<uint8_t>(values[6] >> 15);
1284  *ptr++ = static_cast<uint8_t>(values[6] >> 7);
1285 
1286  *ptr = static_cast<uint8_t>(values[6] << 1);
1287  *ptr++ |= static_cast<uint8_t>(values[7] >> 32);
1288  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
1289  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1290  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1291  *ptr = static_cast<uint8_t>(values[7]);
1292 }
1293 
1294 static inline void pack_bits_34(const uint64_t* values, uint8_t* ptr) {
1295  *ptr++ = static_cast<uint8_t>(values[0] >> 26);
1296  *ptr++ = static_cast<uint8_t>(values[0] >> 18);
1297  *ptr++ = static_cast<uint8_t>(values[0] >> 10);
1298  *ptr++ = static_cast<uint8_t>(values[0] >> 2);
1299 
1300  *ptr = static_cast<uint8_t>(values[0] << 6);
1301  *ptr++ |= static_cast<uint8_t>(values[1] >> 28);
1302  *ptr++ = static_cast<uint8_t>(values[1] >> 20);
1303  *ptr++ = static_cast<uint8_t>(values[1] >> 12);
1304  *ptr++ = static_cast<uint8_t>(values[1] >> 4);
1305 
1306  *ptr = static_cast<uint8_t>(values[1] << 4);
1307  *ptr++ |= static_cast<uint8_t>(values[2] >> 30);
1308  *ptr++ = static_cast<uint8_t>(values[2] >> 22);
1309  *ptr++ = static_cast<uint8_t>(values[2] >> 14);
1310  *ptr++ = static_cast<uint8_t>(values[2] >> 6);
1311 
1312  *ptr = static_cast<uint8_t>(values[2] << 2);
1313  *ptr++ |= static_cast<uint8_t>(values[3] >> 32);
1314  *ptr++ = static_cast<uint8_t>(values[3] >> 24);
1315  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
1316  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
1317  *ptr++ = static_cast<uint8_t>(values[3]);
1318 
1319  *ptr++ = static_cast<uint8_t>(values[4] >> 26);
1320  *ptr++ = static_cast<uint8_t>(values[4] >> 18);
1321  *ptr++ = static_cast<uint8_t>(values[4] >> 10);
1322  *ptr++ = static_cast<uint8_t>(values[4] >> 2);
1323 
1324  *ptr = static_cast<uint8_t>(values[4] << 6);
1325  *ptr++ |= static_cast<uint8_t>(values[5] >> 28);
1326  *ptr++ = static_cast<uint8_t>(values[5] >> 20);
1327  *ptr++ = static_cast<uint8_t>(values[5] >> 12);
1328  *ptr++ = static_cast<uint8_t>(values[5] >> 4);
1329 
1330  *ptr = static_cast<uint8_t>(values[5] << 4);
1331  *ptr++ |= static_cast<uint8_t>(values[6] >> 30);
1332  *ptr++ = static_cast<uint8_t>(values[6] >> 22);
1333  *ptr++ = static_cast<uint8_t>(values[6] >> 14);
1334  *ptr++ = static_cast<uint8_t>(values[6] >> 6);
1335 
1336  *ptr = static_cast<uint8_t>(values[6] << 2);
1337  *ptr++ |= static_cast<uint8_t>(values[7] >> 32);
1338  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
1339  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1340  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1341  *ptr = static_cast<uint8_t>(values[7]);
1342 }
1343 
1344 static inline void pack_bits_35(const uint64_t* values, uint8_t* ptr) {
1345  *ptr++ = static_cast<uint8_t>(values[0] >> 27);
1346  *ptr++ = static_cast<uint8_t>(values[0] >> 19);
1347  *ptr++ = static_cast<uint8_t>(values[0] >> 11);
1348  *ptr++ = static_cast<uint8_t>(values[0] >> 3);
1349 
1350  *ptr = static_cast<uint8_t>(values[0] << 5);
1351  *ptr++ |= static_cast<uint8_t>(values[1] >> 30);
1352  *ptr++ = static_cast<uint8_t>(values[1] >> 22);
1353  *ptr++ = static_cast<uint8_t>(values[1] >> 14);
1354  *ptr++ = static_cast<uint8_t>(values[1] >> 6);
1355 
1356  *ptr = static_cast<uint8_t>(values[1] << 2);
1357  *ptr++ |= static_cast<uint8_t>(values[2] >> 33);
1358  *ptr++ = static_cast<uint8_t>(values[2] >> 25);
1359  *ptr++ = static_cast<uint8_t>(values[2] >> 17);
1360  *ptr++ = static_cast<uint8_t>(values[2] >> 9);
1361  *ptr++ = static_cast<uint8_t>(values[2] >> 1);
1362 
1363  *ptr = static_cast<uint8_t>(values[2] << 7);
1364  *ptr++ |= static_cast<uint8_t>(values[3] >> 28);
1365  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
1366  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
1367  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
1368 
1369  *ptr = static_cast<uint8_t>(values[3] << 4);
1370  *ptr++ |= static_cast<uint8_t>(values[4] >> 31);
1371  *ptr++ = static_cast<uint8_t>(values[4] >> 23);
1372  *ptr++ = static_cast<uint8_t>(values[4] >> 15);
1373  *ptr++ = static_cast<uint8_t>(values[4] >> 7);
1374 
1375  *ptr = static_cast<uint8_t>(values[4] << 1);
1376  *ptr++ |= static_cast<uint8_t>(values[5] >> 34);
1377  *ptr++ = static_cast<uint8_t>(values[5] >> 26);
1378  *ptr++ = static_cast<uint8_t>(values[5] >> 18);
1379  *ptr++ = static_cast<uint8_t>(values[5] >> 10);
1380  *ptr++ = static_cast<uint8_t>(values[5] >> 2);
1381 
1382  *ptr = static_cast<uint8_t>(values[5] << 6);
1383  *ptr++ |= static_cast<uint8_t>(values[6] >> 29);
1384  *ptr++ = static_cast<uint8_t>(values[6] >> 21);
1385  *ptr++ = static_cast<uint8_t>(values[6] >> 13);
1386  *ptr++ = static_cast<uint8_t>(values[6] >> 5);
1387 
1388  *ptr = static_cast<uint8_t>(values[6] << 3);
1389  *ptr++ |= static_cast<uint8_t>(values[7] >> 32);
1390  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
1391  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1392  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1393  *ptr = static_cast<uint8_t>(values[7]);
1394 }
1395 
1396 static inline void pack_bits_36(const uint64_t* values, uint8_t* ptr) {
1397  *ptr++ = static_cast<uint8_t>(values[0] >> 28);
1398  *ptr++ = static_cast<uint8_t>(values[0] >> 20);
1399  *ptr++ = static_cast<uint8_t>(values[0] >> 12);
1400  *ptr++ = static_cast<uint8_t>(values[0] >> 4);
1401 
1402  *ptr = static_cast<uint8_t>(values[0] << 4);
1403  *ptr++ |= static_cast<uint8_t>(values[1] >> 32);
1404  *ptr++ = static_cast<uint8_t>(values[1] >> 24);
1405  *ptr++ = static_cast<uint8_t>(values[1] >> 16);
1406  *ptr++ = static_cast<uint8_t>(values[1] >> 8);
1407  *ptr++ = static_cast<uint8_t>(values[1]);
1408 
1409  *ptr++ = static_cast<uint8_t>(values[2] >> 28);
1410  *ptr++ = static_cast<uint8_t>(values[2] >> 20);
1411  *ptr++ = static_cast<uint8_t>(values[2] >> 12);
1412  *ptr++ = static_cast<uint8_t>(values[2] >> 4);
1413 
1414  *ptr = static_cast<uint8_t>(values[2] << 4);
1415  *ptr++ |= static_cast<uint8_t>(values[3] >> 32);
1416  *ptr++ = static_cast<uint8_t>(values[3] >> 24);
1417  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
1418  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
1419  *ptr++ = static_cast<uint8_t>(values[3]);
1420 
1421  *ptr++ = static_cast<uint8_t>(values[4] >> 28);
1422  *ptr++ = static_cast<uint8_t>(values[4] >> 20);
1423  *ptr++ = static_cast<uint8_t>(values[4] >> 12);
1424  *ptr++ = static_cast<uint8_t>(values[4] >> 4);
1425 
1426  *ptr = static_cast<uint8_t>(values[4] << 4);
1427  *ptr++ |= static_cast<uint8_t>(values[5] >> 32);
1428  *ptr++ = static_cast<uint8_t>(values[5] >> 24);
1429  *ptr++ = static_cast<uint8_t>(values[5] >> 16);
1430  *ptr++ = static_cast<uint8_t>(values[5] >> 8);
1431  *ptr++ = static_cast<uint8_t>(values[5]);
1432 
1433  *ptr++ = static_cast<uint8_t>(values[6] >> 28);
1434  *ptr++ = static_cast<uint8_t>(values[6] >> 20);
1435  *ptr++ = static_cast<uint8_t>(values[6] >> 12);
1436  *ptr++ = static_cast<uint8_t>(values[6] >> 4);
1437 
1438  *ptr = static_cast<uint8_t>(values[6] << 4);
1439  *ptr++ |= static_cast<uint8_t>(values[7] >> 32);
1440  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
1441  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1442  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1443  *ptr = static_cast<uint8_t>(values[7]);
1444 }
1445 
1446 static inline void pack_bits_37(const uint64_t* values, uint8_t* ptr) {
1447  *ptr++ = static_cast<uint8_t>(values[0] >> 29);
1448  *ptr++ = static_cast<uint8_t>(values[0] >> 21);
1449  *ptr++ = static_cast<uint8_t>(values[0] >> 13);
1450  *ptr++ = static_cast<uint8_t>(values[0] >> 5);
1451 
1452  *ptr = static_cast<uint8_t>(values[0] << 3);
1453  *ptr++ |= static_cast<uint8_t>(values[1] >> 34);
1454  *ptr++ = static_cast<uint8_t>(values[1] >> 26);
1455  *ptr++ = static_cast<uint8_t>(values[1] >> 18);
1456  *ptr++ = static_cast<uint8_t>(values[1] >> 10);
1457  *ptr++ = static_cast<uint8_t>(values[1] >> 2);
1458 
1459  *ptr = static_cast<uint8_t>(values[1] << 6);
1460  *ptr++ |= static_cast<uint8_t>(values[2] >> 31);
1461  *ptr++ = static_cast<uint8_t>(values[2] >> 23);
1462  *ptr++ = static_cast<uint8_t>(values[2] >> 15);
1463  *ptr++ = static_cast<uint8_t>(values[2] >> 7);
1464 
1465  *ptr = static_cast<uint8_t>(values[2] << 1);
1466  *ptr++ |= static_cast<uint8_t>(values[3] >> 36);
1467  *ptr++ = static_cast<uint8_t>(values[3] >> 28);
1468  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
1469  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
1470  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
1471 
1472  *ptr = static_cast<uint8_t>(values[3] << 4);
1473  *ptr++ |= static_cast<uint8_t>(values[4] >> 33);
1474  *ptr++ = static_cast<uint8_t>(values[4] >> 25);
1475  *ptr++ = static_cast<uint8_t>(values[4] >> 17);
1476  *ptr++ = static_cast<uint8_t>(values[4] >> 9);
1477  *ptr++ = static_cast<uint8_t>(values[4] >> 1);
1478 
1479  *ptr = static_cast<uint8_t>(values[4] << 7);
1480  *ptr++ |= static_cast<uint8_t>(values[5] >> 30);
1481  *ptr++ = static_cast<uint8_t>(values[5] >> 22);
1482  *ptr++ = static_cast<uint8_t>(values[5] >> 14);
1483  *ptr++ = static_cast<uint8_t>(values[5] >> 6);
1484 
1485  *ptr = static_cast<uint8_t>(values[5] << 2);
1486  *ptr++ |= static_cast<uint8_t>(values[6] >> 35);
1487  *ptr++ = static_cast<uint8_t>(values[6] >> 27);
1488  *ptr++ = static_cast<uint8_t>(values[6] >> 19);
1489  *ptr++ = static_cast<uint8_t>(values[6] >> 11);
1490  *ptr++ = static_cast<uint8_t>(values[6] >> 3);
1491 
1492  *ptr = static_cast<uint8_t>(values[6] << 5);
1493  *ptr++ |= static_cast<uint8_t>(values[7] >> 32);
1494  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
1495  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1496  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1497  *ptr = static_cast<uint8_t>(values[7]);
1498 }
1499 
1500 static inline void pack_bits_38(const uint64_t* values, uint8_t* ptr) {
1501  *ptr++ = static_cast<uint8_t>(values[0] >> 30);
1502  *ptr++ = static_cast<uint8_t>(values[0] >> 22);
1503  *ptr++ = static_cast<uint8_t>(values[0] >> 14);
1504  *ptr++ = static_cast<uint8_t>(values[0] >> 6);
1505 
1506  *ptr = static_cast<uint8_t>(values[0] << 2);
1507  *ptr++ |= static_cast<uint8_t>(values[1] >> 36);
1508  *ptr++ = static_cast<uint8_t>(values[1] >> 28);
1509  *ptr++ = static_cast<uint8_t>(values[1] >> 20);
1510  *ptr++ = static_cast<uint8_t>(values[1] >> 12);
1511  *ptr++ = static_cast<uint8_t>(values[1] >> 4);
1512 
1513  *ptr = static_cast<uint8_t>(values[1] << 4);
1514  *ptr++ |= static_cast<uint8_t>(values[2] >> 34);
1515  *ptr++ = static_cast<uint8_t>(values[2] >> 26);
1516  *ptr++ = static_cast<uint8_t>(values[2] >> 18);
1517  *ptr++ = static_cast<uint8_t>(values[2] >> 10);
1518  *ptr++ = static_cast<uint8_t>(values[2] >> 2);
1519 
1520  *ptr = static_cast<uint8_t>(values[2] << 6);
1521  *ptr++ |= static_cast<uint8_t>(values[3] >> 32);
1522  *ptr++ = static_cast<uint8_t>(values[3] >> 24);
1523  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
1524  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
1525  *ptr++ = static_cast<uint8_t>(values[3]);
1526 
1527  *ptr++ = static_cast<uint8_t>(values[4] >> 30);
1528  *ptr++ = static_cast<uint8_t>(values[4] >> 22);
1529  *ptr++ = static_cast<uint8_t>(values[4] >> 14);
1530  *ptr++ = static_cast<uint8_t>(values[4] >> 6);
1531 
1532  *ptr = static_cast<uint8_t>(values[4] << 2);
1533  *ptr++ |= static_cast<uint8_t>(values[5] >> 36);
1534  *ptr++ = static_cast<uint8_t>(values[5] >> 28);
1535  *ptr++ = static_cast<uint8_t>(values[5] >> 20);
1536  *ptr++ = static_cast<uint8_t>(values[5] >> 12);
1537  *ptr++ = static_cast<uint8_t>(values[5] >> 4);
1538 
1539  *ptr = static_cast<uint8_t>(values[5] << 4);
1540  *ptr++ |= static_cast<uint8_t>(values[6] >> 34);
1541  *ptr++ = static_cast<uint8_t>(values[6] >> 26);
1542  *ptr++ = static_cast<uint8_t>(values[6] >> 18);
1543  *ptr++ = static_cast<uint8_t>(values[6] >> 10);
1544  *ptr++ = static_cast<uint8_t>(values[6] >> 2);
1545 
1546  *ptr = static_cast<uint8_t>(values[6] << 6);
1547  *ptr++ |= static_cast<uint8_t>(values[7] >> 32);
1548  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
1549  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1550  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1551  *ptr = static_cast<uint8_t>(values[7]);
1552 }
1553 
1554 static inline void pack_bits_39(const uint64_t* values, uint8_t* ptr) {
1555  *ptr++ = static_cast<uint8_t>(values[0] >> 31);
1556  *ptr++ = static_cast<uint8_t>(values[0] >> 23);
1557  *ptr++ = static_cast<uint8_t>(values[0] >> 15);
1558  *ptr++ = static_cast<uint8_t>(values[0] >> 7);
1559 
1560  *ptr = static_cast<uint8_t>(values[0] << 1);
1561  *ptr++ |= static_cast<uint8_t>(values[1] >> 38);
1562  *ptr++ = static_cast<uint8_t>(values[1] >> 30);
1563  *ptr++ = static_cast<uint8_t>(values[1] >> 22);
1564  *ptr++ = static_cast<uint8_t>(values[1] >> 14);
1565  *ptr++ = static_cast<uint8_t>(values[1] >> 6);
1566 
1567  *ptr = static_cast<uint8_t>(values[1] << 2);
1568  *ptr++ |= static_cast<uint8_t>(values[2] >> 37);
1569  *ptr++ = static_cast<uint8_t>(values[2] >> 29);
1570  *ptr++ = static_cast<uint8_t>(values[2] >> 21);
1571  *ptr++ = static_cast<uint8_t>(values[2] >> 13);
1572  *ptr++ = static_cast<uint8_t>(values[2] >> 5);
1573 
1574  *ptr = static_cast<uint8_t>(values[2] << 3);
1575  *ptr++ |= static_cast<uint8_t>(values[3] >> 36);
1576  *ptr++ = static_cast<uint8_t>(values[3] >> 28);
1577  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
1578  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
1579  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
1580 
1581  *ptr = static_cast<uint8_t>(values[3] << 4);
1582  *ptr++ |= static_cast<uint8_t>(values[4] >> 35);
1583  *ptr++ = static_cast<uint8_t>(values[4] >> 27);
1584  *ptr++ = static_cast<uint8_t>(values[4] >> 19);
1585  *ptr++ = static_cast<uint8_t>(values[4] >> 11);
1586  *ptr++ = static_cast<uint8_t>(values[4] >> 3);
1587 
1588  *ptr = static_cast<uint8_t>(values[4] << 5);
1589  *ptr++ |= static_cast<uint8_t>(values[5] >> 34);
1590  *ptr++ = static_cast<uint8_t>(values[5] >> 26);
1591  *ptr++ = static_cast<uint8_t>(values[5] >> 18);
1592  *ptr++ = static_cast<uint8_t>(values[5] >> 10);
1593  *ptr++ = static_cast<uint8_t>(values[5] >> 2);
1594 
1595  *ptr = static_cast<uint8_t>(values[5] << 6);
1596  *ptr++ |= static_cast<uint8_t>(values[6] >> 33);
1597  *ptr++ = static_cast<uint8_t>(values[6] >> 25);
1598  *ptr++ = static_cast<uint8_t>(values[6] >> 17);
1599  *ptr++ = static_cast<uint8_t>(values[6] >> 9);
1600  *ptr++ = static_cast<uint8_t>(values[6] >> 1);
1601 
1602  *ptr = static_cast<uint8_t>(values[6] << 7);
1603  *ptr++ |= static_cast<uint8_t>(values[7] >> 32);
1604  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
1605  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1606  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1607  *ptr = static_cast<uint8_t>(values[7]);
1608 }
1609 
1610 static inline void pack_bits_40(const uint64_t* values, uint8_t* ptr) {
1611  *ptr++ = static_cast<uint8_t>(values[0] >> 32);
1612  *ptr++ = static_cast<uint8_t>(values[0] >> 24);
1613  *ptr++ = static_cast<uint8_t>(values[0] >> 16);
1614  *ptr++ = static_cast<uint8_t>(values[0] >> 8);
1615  *ptr++ = static_cast<uint8_t>(values[0]);
1616 
1617  *ptr++ = static_cast<uint8_t>(values[1] >> 32);
1618  *ptr++ = static_cast<uint8_t>(values[1] >> 24);
1619  *ptr++ = static_cast<uint8_t>(values[1] >> 16);
1620  *ptr++ = static_cast<uint8_t>(values[1] >> 8);
1621  *ptr++ = static_cast<uint8_t>(values[1]);
1622 
1623  *ptr++ = static_cast<uint8_t>(values[2] >> 32);
1624  *ptr++ = static_cast<uint8_t>(values[2] >> 24);
1625  *ptr++ = static_cast<uint8_t>(values[2] >> 16);
1626  *ptr++ = static_cast<uint8_t>(values[2] >> 8);
1627  *ptr++ = static_cast<uint8_t>(values[2]);
1628 
1629  *ptr++ = static_cast<uint8_t>(values[3] >> 32);
1630  *ptr++ = static_cast<uint8_t>(values[3] >> 24);
1631  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
1632  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
1633  *ptr++ = static_cast<uint8_t>(values[3]);
1634 
1635  *ptr++ = static_cast<uint8_t>(values[4] >> 32);
1636  *ptr++ = static_cast<uint8_t>(values[4] >> 24);
1637  *ptr++ = static_cast<uint8_t>(values[4] >> 16);
1638  *ptr++ = static_cast<uint8_t>(values[4] >> 8);
1639  *ptr++ = static_cast<uint8_t>(values[4]);
1640 
1641  *ptr++ = static_cast<uint8_t>(values[5] >> 32);
1642  *ptr++ = static_cast<uint8_t>(values[5] >> 24);
1643  *ptr++ = static_cast<uint8_t>(values[5] >> 16);
1644  *ptr++ = static_cast<uint8_t>(values[5] >> 8);
1645  *ptr++ = static_cast<uint8_t>(values[5]);
1646 
1647  *ptr++ = static_cast<uint8_t>(values[6] >> 32);
1648  *ptr++ = static_cast<uint8_t>(values[6] >> 24);
1649  *ptr++ = static_cast<uint8_t>(values[6] >> 16);
1650  *ptr++ = static_cast<uint8_t>(values[6] >> 8);
1651  *ptr++ = static_cast<uint8_t>(values[6]);
1652 
1653  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
1654  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
1655  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1656  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1657  *ptr = static_cast<uint8_t>(values[7]);
1658 }
1659 
1660 static inline void pack_bits_41(const uint64_t* values, uint8_t* ptr) {
1661  *ptr++ = static_cast<uint8_t>(values[0] >> 33);
1662  *ptr++ = static_cast<uint8_t>(values[0] >> 25);
1663  *ptr++ = static_cast<uint8_t>(values[0] >> 17);
1664  *ptr++ = static_cast<uint8_t>(values[0] >> 9);
1665  *ptr++ = static_cast<uint8_t>(values[0] >> 1);
1666 
1667  *ptr = static_cast<uint8_t>(values[0] << 7);
1668  *ptr++ |= static_cast<uint8_t>(values[1] >> 34);
1669  *ptr++ = static_cast<uint8_t>(values[1] >> 26);
1670  *ptr++ = static_cast<uint8_t>(values[1] >> 18);
1671  *ptr++ = static_cast<uint8_t>(values[1] >> 10);
1672  *ptr++ = static_cast<uint8_t>(values[1] >> 2);
1673 
1674  *ptr = static_cast<uint8_t>(values[1] << 6);
1675  *ptr++ |= static_cast<uint8_t>(values[2] >> 35);
1676  *ptr++ = static_cast<uint8_t>(values[2] >> 27);
1677  *ptr++ = static_cast<uint8_t>(values[2] >> 19);
1678  *ptr++ = static_cast<uint8_t>(values[2] >> 11);
1679  *ptr++ = static_cast<uint8_t>(values[2] >> 3);
1680 
1681  *ptr = static_cast<uint8_t>(values[2] << 5);
1682  *ptr++ |= static_cast<uint8_t>(values[3] >> 36);
1683  *ptr++ = static_cast<uint8_t>(values[3] >> 28);
1684  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
1685  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
1686  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
1687 
1688  *ptr = static_cast<uint8_t>(values[3] << 4);
1689  *ptr++ |= static_cast<uint8_t>(values[4] >> 37);
1690  *ptr++ = static_cast<uint8_t>(values[4] >> 29);
1691  *ptr++ = static_cast<uint8_t>(values[4] >> 21);
1692  *ptr++ = static_cast<uint8_t>(values[4] >> 13);
1693  *ptr++ = static_cast<uint8_t>(values[4] >> 5);
1694 
1695  *ptr = static_cast<uint8_t>(values[4] << 3);
1696  *ptr++ |= static_cast<uint8_t>(values[5] >> 38);
1697  *ptr++ = static_cast<uint8_t>(values[5] >> 30);
1698  *ptr++ = static_cast<uint8_t>(values[5] >> 22);
1699  *ptr++ = static_cast<uint8_t>(values[5] >> 14);
1700  *ptr++ = static_cast<uint8_t>(values[5] >> 6);
1701 
1702  *ptr = static_cast<uint8_t>(values[5] << 2);
1703  *ptr++ |= static_cast<uint8_t>(values[6] >> 39);
1704  *ptr++ = static_cast<uint8_t>(values[6] >> 31);
1705  *ptr++ = static_cast<uint8_t>(values[6] >> 23);
1706  *ptr++ = static_cast<uint8_t>(values[6] >> 15);
1707  *ptr++ = static_cast<uint8_t>(values[6] >> 7);
1708 
1709  *ptr = static_cast<uint8_t>(values[6] << 1);
1710  *ptr++ |= static_cast<uint8_t>(values[7] >> 40);
1711  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
1712  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
1713  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1714  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1715  *ptr = static_cast<uint8_t>(values[7]);
1716 }
1717 
1718 static inline void pack_bits_42(const uint64_t* values, uint8_t* ptr) {
1719  *ptr++ = static_cast<uint8_t>(values[0] >> 34);
1720  *ptr++ = static_cast<uint8_t>(values[0] >> 26);
1721  *ptr++ = static_cast<uint8_t>(values[0] >> 18);
1722  *ptr++ = static_cast<uint8_t>(values[0] >> 10);
1723  *ptr++ = static_cast<uint8_t>(values[0] >> 2);
1724 
1725  *ptr = static_cast<uint8_t>(values[0] << 6);
1726  *ptr++ |= static_cast<uint8_t>(values[1] >> 36);
1727  *ptr++ = static_cast<uint8_t>(values[1] >> 28);
1728  *ptr++ = static_cast<uint8_t>(values[1] >> 20);
1729  *ptr++ = static_cast<uint8_t>(values[1] >> 12);
1730  *ptr++ = static_cast<uint8_t>(values[1] >> 4);
1731 
1732  *ptr = static_cast<uint8_t>(values[1] << 4);
1733  *ptr++ |= static_cast<uint8_t>(values[2] >> 38);
1734  *ptr++ = static_cast<uint8_t>(values[2] >> 30);
1735  *ptr++ = static_cast<uint8_t>(values[2] >> 22);
1736  *ptr++ = static_cast<uint8_t>(values[2] >> 14);
1737  *ptr++ = static_cast<uint8_t>(values[2] >> 6);
1738 
1739  *ptr = static_cast<uint8_t>(values[2] << 2);
1740  *ptr++ |= static_cast<uint8_t>(values[3] >> 40);
1741  *ptr++ = static_cast<uint8_t>(values[3] >> 32);
1742  *ptr++ = static_cast<uint8_t>(values[3] >> 24);
1743  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
1744  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
1745  *ptr++ = static_cast<uint8_t>(values[3]);
1746 
1747  *ptr++ = static_cast<uint8_t>(values[4] >> 34);
1748  *ptr++ = static_cast<uint8_t>(values[4] >> 26);
1749  *ptr++ = static_cast<uint8_t>(values[4] >> 18);
1750  *ptr++ = static_cast<uint8_t>(values[4] >> 10);
1751  *ptr++ = static_cast<uint8_t>(values[4] >> 2);
1752 
1753  *ptr = static_cast<uint8_t>(values[4] << 6);
1754  *ptr++ |= static_cast<uint8_t>(values[5] >> 36);
1755  *ptr++ = static_cast<uint8_t>(values[5] >> 28);
1756  *ptr++ = static_cast<uint8_t>(values[5] >> 20);
1757  *ptr++ = static_cast<uint8_t>(values[5] >> 12);
1758  *ptr++ = static_cast<uint8_t>(values[5] >> 4);
1759 
1760  *ptr = static_cast<uint8_t>(values[5] << 4);
1761  *ptr++ |= static_cast<uint8_t>(values[6] >> 38);
1762  *ptr++ = static_cast<uint8_t>(values[6] >> 30);
1763  *ptr++ = static_cast<uint8_t>(values[6] >> 22);
1764  *ptr++ = static_cast<uint8_t>(values[6] >> 14);
1765  *ptr++ = static_cast<uint8_t>(values[6] >> 6);
1766 
1767  *ptr = static_cast<uint8_t>(values[6] << 2);
1768  *ptr++ |= static_cast<uint8_t>(values[7] >> 40);
1769  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
1770  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
1771  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1772  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1773  *ptr = static_cast<uint8_t>(values[7]);
1774 }
1775 
1776 static inline void pack_bits_43(const uint64_t* values, uint8_t* ptr) {
1777  *ptr++ = static_cast<uint8_t>(values[0] >> 35);
1778  *ptr++ = static_cast<uint8_t>(values[0] >> 27);
1779  *ptr++ = static_cast<uint8_t>(values[0] >> 19);
1780  *ptr++ = static_cast<uint8_t>(values[0] >> 11);
1781  *ptr++ = static_cast<uint8_t>(values[0] >> 3);
1782 
1783  *ptr = static_cast<uint8_t>(values[0] << 5);
1784  *ptr++ |= static_cast<uint8_t>(values[1] >> 38);
1785  *ptr++ = static_cast<uint8_t>(values[1] >> 30);
1786  *ptr++ = static_cast<uint8_t>(values[1] >> 22);
1787  *ptr++ = static_cast<uint8_t>(values[1] >> 14);
1788  *ptr++ = static_cast<uint8_t>(values[1] >> 6);
1789 
1790  *ptr = static_cast<uint8_t>(values[1] << 2);
1791  *ptr++ |= static_cast<uint8_t>(values[2] >> 41);
1792  *ptr++ = static_cast<uint8_t>(values[2] >> 33);
1793  *ptr++ = static_cast<uint8_t>(values[2] >> 25);
1794  *ptr++ = static_cast<uint8_t>(values[2] >> 17);
1795  *ptr++ = static_cast<uint8_t>(values[2] >> 9);
1796  *ptr++ = static_cast<uint8_t>(values[2] >> 1);
1797 
1798  *ptr = static_cast<uint8_t>(values[2] << 7);
1799  *ptr++ |= static_cast<uint8_t>(values[3] >> 36);
1800  *ptr++ = static_cast<uint8_t>(values[3] >> 28);
1801  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
1802  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
1803  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
1804 
1805  *ptr = static_cast<uint8_t>(values[3] << 4);
1806  *ptr++ |= static_cast<uint8_t>(values[4] >> 39);
1807  *ptr++ = static_cast<uint8_t>(values[4] >> 31);
1808  *ptr++ = static_cast<uint8_t>(values[4] >> 23);
1809  *ptr++ = static_cast<uint8_t>(values[4] >> 15);
1810  *ptr++ = static_cast<uint8_t>(values[4] >> 7);
1811 
1812  *ptr = static_cast<uint8_t>(values[4] << 1);
1813  *ptr++ |= static_cast<uint8_t>(values[5] >> 42);
1814  *ptr++ = static_cast<uint8_t>(values[5] >> 34);
1815  *ptr++ = static_cast<uint8_t>(values[5] >> 26);
1816  *ptr++ = static_cast<uint8_t>(values[5] >> 18);
1817  *ptr++ = static_cast<uint8_t>(values[5] >> 10);
1818  *ptr++ = static_cast<uint8_t>(values[5] >> 2);
1819 
1820  *ptr = static_cast<uint8_t>(values[5] << 6);
1821  *ptr++ |= static_cast<uint8_t>(values[6] >> 37);
1822  *ptr++ = static_cast<uint8_t>(values[6] >> 29);
1823  *ptr++ = static_cast<uint8_t>(values[6] >> 21);
1824  *ptr++ = static_cast<uint8_t>(values[6] >> 13);
1825  *ptr++ = static_cast<uint8_t>(values[6] >> 5);
1826 
1827  *ptr = static_cast<uint8_t>(values[6] << 3);
1828  *ptr++ |= static_cast<uint8_t>(values[7] >> 40);
1829  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
1830  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
1831  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1832  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1833  *ptr = static_cast<uint8_t>(values[7]);
1834 }
1835 
1836 static inline void pack_bits_44(const uint64_t* values, uint8_t* ptr) {
1837  *ptr++ = static_cast<uint8_t>(values[0] >> 36);
1838  *ptr++ = static_cast<uint8_t>(values[0] >> 28);
1839  *ptr++ = static_cast<uint8_t>(values[0] >> 20);
1840  *ptr++ = static_cast<uint8_t>(values[0] >> 12);
1841  *ptr++ = static_cast<uint8_t>(values[0] >> 4);
1842 
1843  *ptr = static_cast<uint8_t>(values[0] << 4);
1844  *ptr++ |= static_cast<uint8_t>(values[1] >> 40);
1845  *ptr++ = static_cast<uint8_t>(values[1] >> 32);
1846  *ptr++ = static_cast<uint8_t>(values[1] >> 24);
1847  *ptr++ = static_cast<uint8_t>(values[1] >> 16);
1848  *ptr++ = static_cast<uint8_t>(values[1] >> 8);
1849  *ptr++ = static_cast<uint8_t>(values[1]);
1850 
1851  *ptr++ = static_cast<uint8_t>(values[2] >> 36);
1852  *ptr++ = static_cast<uint8_t>(values[2] >> 28);
1853  *ptr++ = static_cast<uint8_t>(values[2] >> 20);
1854  *ptr++ = static_cast<uint8_t>(values[2] >> 12);
1855  *ptr++ = static_cast<uint8_t>(values[2] >> 4);
1856 
1857  *ptr = static_cast<uint8_t>(values[2] << 4);
1858  *ptr++ |= static_cast<uint8_t>(values[3] >> 40);
1859  *ptr++ = static_cast<uint8_t>(values[3] >> 32);
1860  *ptr++ = static_cast<uint8_t>(values[3] >> 24);
1861  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
1862  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
1863  *ptr++ = static_cast<uint8_t>(values[3]);
1864 
1865  *ptr++ = static_cast<uint8_t>(values[4] >> 36);
1866  *ptr++ = static_cast<uint8_t>(values[4] >> 28);
1867  *ptr++ = static_cast<uint8_t>(values[4] >> 20);
1868  *ptr++ = static_cast<uint8_t>(values[4] >> 12);
1869  *ptr++ = static_cast<uint8_t>(values[4] >> 4);
1870 
1871  *ptr = static_cast<uint8_t>(values[4] << 4);
1872  *ptr++ |= static_cast<uint8_t>(values[5] >> 40);
1873  *ptr++ = static_cast<uint8_t>(values[5] >> 32);
1874  *ptr++ = static_cast<uint8_t>(values[5] >> 24);
1875  *ptr++ = static_cast<uint8_t>(values[5] >> 16);
1876  *ptr++ = static_cast<uint8_t>(values[5] >> 8);
1877  *ptr++ = static_cast<uint8_t>(values[5]);
1878 
1879  *ptr++ = static_cast<uint8_t>(values[6] >> 36);
1880  *ptr++ = static_cast<uint8_t>(values[6] >> 28);
1881  *ptr++ = static_cast<uint8_t>(values[6] >> 20);
1882  *ptr++ = static_cast<uint8_t>(values[6] >> 12);
1883  *ptr++ = static_cast<uint8_t>(values[6] >> 4);
1884 
1885  *ptr = static_cast<uint8_t>(values[6] << 4);
1886  *ptr++ |= static_cast<uint8_t>(values[7] >> 40);
1887  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
1888  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
1889  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1890  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1891  *ptr = static_cast<uint8_t>(values[7]);
1892 }
1893 
1894 static inline void pack_bits_45(const uint64_t* values, uint8_t* ptr) {
1895  *ptr++ = static_cast<uint8_t>(values[0] >> 37);
1896  *ptr++ = static_cast<uint8_t>(values[0] >> 29);
1897  *ptr++ = static_cast<uint8_t>(values[0] >> 21);
1898  *ptr++ = static_cast<uint8_t>(values[0] >> 13);
1899  *ptr++ = static_cast<uint8_t>(values[0] >> 5);
1900 
1901  *ptr = static_cast<uint8_t>(values[0] << 3);
1902  *ptr++ |= static_cast<uint8_t>(values[1] >> 42);
1903  *ptr++ = static_cast<uint8_t>(values[1] >> 34);
1904  *ptr++ = static_cast<uint8_t>(values[1] >> 26);
1905  *ptr++ = static_cast<uint8_t>(values[1] >> 18);
1906  *ptr++ = static_cast<uint8_t>(values[1] >> 10);
1907  *ptr++ = static_cast<uint8_t>(values[1] >> 2);
1908 
1909  *ptr = static_cast<uint8_t>(values[1] << 6);
1910  *ptr++ |= static_cast<uint8_t>(values[2] >> 39);
1911  *ptr++ = static_cast<uint8_t>(values[2] >> 31);
1912  *ptr++ = static_cast<uint8_t>(values[2] >> 23);
1913  *ptr++ = static_cast<uint8_t>(values[2] >> 15);
1914  *ptr++ = static_cast<uint8_t>(values[2] >> 7);
1915 
1916  *ptr = static_cast<uint8_t>(values[2] << 1);
1917  *ptr++ |= static_cast<uint8_t>(values[3] >> 44);
1918  *ptr++ = static_cast<uint8_t>(values[3] >> 36);
1919  *ptr++ = static_cast<uint8_t>(values[3] >> 28);
1920  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
1921  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
1922  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
1923 
1924  *ptr = static_cast<uint8_t>(values[3] << 4);
1925  *ptr++ |= static_cast<uint8_t>(values[4] >> 41);
1926  *ptr++ = static_cast<uint8_t>(values[4] >> 33);
1927  *ptr++ = static_cast<uint8_t>(values[4] >> 25);
1928  *ptr++ = static_cast<uint8_t>(values[4] >> 17);
1929  *ptr++ = static_cast<uint8_t>(values[4] >> 9);
1930  *ptr++ = static_cast<uint8_t>(values[4] >> 1);
1931 
1932  *ptr = static_cast<uint8_t>(values[4] << 7);
1933  *ptr++ |= static_cast<uint8_t>(values[5] >> 38);
1934  *ptr++ = static_cast<uint8_t>(values[5] >> 30);
1935  *ptr++ = static_cast<uint8_t>(values[5] >> 22);
1936  *ptr++ = static_cast<uint8_t>(values[5] >> 14);
1937  *ptr++ = static_cast<uint8_t>(values[5] >> 6);
1938 
1939  *ptr = static_cast<uint8_t>(values[5] << 2);
1940  *ptr++ |= static_cast<uint8_t>(values[6] >> 43);
1941  *ptr++ = static_cast<uint8_t>(values[6] >> 35);
1942  *ptr++ = static_cast<uint8_t>(values[6] >> 27);
1943  *ptr++ = static_cast<uint8_t>(values[6] >> 19);
1944  *ptr++ = static_cast<uint8_t>(values[6] >> 11);
1945  *ptr++ = static_cast<uint8_t>(values[6] >> 3);
1946 
1947  *ptr = static_cast<uint8_t>(values[6] << 5);
1948  *ptr++ |= static_cast<uint8_t>(values[7] >> 40);
1949  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
1950  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
1951  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
1952  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
1953  *ptr = static_cast<uint8_t>(values[7]);
1954 }
1955 
1956 static inline void pack_bits_46(const uint64_t* values, uint8_t* ptr) {
1957  *ptr++ = static_cast<uint8_t>(values[0] >> 38);
1958  *ptr++ = static_cast<uint8_t>(values[0] >> 30);
1959  *ptr++ = static_cast<uint8_t>(values[0] >> 22);
1960  *ptr++ = static_cast<uint8_t>(values[0] >> 14);
1961  *ptr++ = static_cast<uint8_t>(values[0] >> 6);
1962 
1963  *ptr = static_cast<uint8_t>(values[0] << 2);
1964  *ptr++ |= static_cast<uint8_t>(values[1] >> 44);
1965  *ptr++ = static_cast<uint8_t>(values[1] >> 36);
1966  *ptr++ = static_cast<uint8_t>(values[1] >> 28);
1967  *ptr++ = static_cast<uint8_t>(values[1] >> 20);
1968  *ptr++ = static_cast<uint8_t>(values[1] >> 12);
1969  *ptr++ = static_cast<uint8_t>(values[1] >> 4);
1970 
1971  *ptr = static_cast<uint8_t>(values[1] << 4);
1972  *ptr++ |= static_cast<uint8_t>(values[2] >> 42);
1973  *ptr++ = static_cast<uint8_t>(values[2] >> 34);
1974  *ptr++ = static_cast<uint8_t>(values[2] >> 26);
1975  *ptr++ = static_cast<uint8_t>(values[2] >> 18);
1976  *ptr++ = static_cast<uint8_t>(values[2] >> 10);
1977  *ptr++ = static_cast<uint8_t>(values[2] >> 2);
1978 
1979  *ptr = static_cast<uint8_t>(values[2] << 6);
1980  *ptr++ |= static_cast<uint8_t>(values[3] >> 40);
1981  *ptr++ = static_cast<uint8_t>(values[3] >> 32);
1982  *ptr++ = static_cast<uint8_t>(values[3] >> 24);
1983  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
1984  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
1985  *ptr++ = static_cast<uint8_t>(values[3]);
1986 
1987  *ptr++ = static_cast<uint8_t>(values[4] >> 38);
1988  *ptr++ = static_cast<uint8_t>(values[4] >> 30);
1989  *ptr++ = static_cast<uint8_t>(values[4] >> 22);
1990  *ptr++ = static_cast<uint8_t>(values[4] >> 14);
1991  *ptr++ = static_cast<uint8_t>(values[4] >> 6);
1992 
1993  *ptr = static_cast<uint8_t>(values[4] << 2);
1994  *ptr++ |= static_cast<uint8_t>(values[5] >> 44);
1995  *ptr++ = static_cast<uint8_t>(values[5] >> 36);
1996  *ptr++ = static_cast<uint8_t>(values[5] >> 28);
1997  *ptr++ = static_cast<uint8_t>(values[5] >> 20);
1998  *ptr++ = static_cast<uint8_t>(values[5] >> 12);
1999  *ptr++ = static_cast<uint8_t>(values[5] >> 4);
2000 
2001  *ptr = static_cast<uint8_t>(values[5] << 4);
2002  *ptr++ |= static_cast<uint8_t>(values[6] >> 42);
2003  *ptr++ = static_cast<uint8_t>(values[6] >> 34);
2004  *ptr++ = static_cast<uint8_t>(values[6] >> 26);
2005  *ptr++ = static_cast<uint8_t>(values[6] >> 18);
2006  *ptr++ = static_cast<uint8_t>(values[6] >> 10);
2007  *ptr++ = static_cast<uint8_t>(values[6] >> 2);
2008 
2009  *ptr = static_cast<uint8_t>(values[6] << 6);
2010  *ptr++ |= static_cast<uint8_t>(values[7] >> 40);
2011  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
2012  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
2013  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
2014  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
2015  *ptr = static_cast<uint8_t>(values[7]);
2016 }
2017 
2018 static inline void pack_bits_47(const uint64_t* values, uint8_t* ptr) {
2019  *ptr++ = static_cast<uint8_t>(values[0] >> 39);
2020  *ptr++ = static_cast<uint8_t>(values[0] >> 31);
2021  *ptr++ = static_cast<uint8_t>(values[0] >> 23);
2022  *ptr++ = static_cast<uint8_t>(values[0] >> 15);
2023  *ptr++ = static_cast<uint8_t>(values[0] >> 7);
2024 
2025  *ptr = static_cast<uint8_t>(values[0] << 1);
2026  *ptr++ |= static_cast<uint8_t>(values[1] >> 46);
2027  *ptr++ = static_cast<uint8_t>(values[1] >> 38);
2028  *ptr++ = static_cast<uint8_t>(values[1] >> 30);
2029  *ptr++ = static_cast<uint8_t>(values[1] >> 22);
2030  *ptr++ = static_cast<uint8_t>(values[1] >> 14);
2031  *ptr++ = static_cast<uint8_t>(values[1] >> 6);
2032 
2033  *ptr = static_cast<uint8_t>(values[1] << 2);
2034  *ptr++ |= static_cast<uint8_t>(values[2] >> 45);
2035  *ptr++ = static_cast<uint8_t>(values[2] >> 37);
2036  *ptr++ = static_cast<uint8_t>(values[2] >> 29);
2037  *ptr++ = static_cast<uint8_t>(values[2] >> 21);
2038  *ptr++ = static_cast<uint8_t>(values[2] >> 13);
2039  *ptr++ = static_cast<uint8_t>(values[2] >> 5);
2040 
2041  *ptr = static_cast<uint8_t>(values[2] << 3);
2042  *ptr++ |= static_cast<uint8_t>(values[3] >> 44);
2043  *ptr++ = static_cast<uint8_t>(values[3] >> 36);
2044  *ptr++ = static_cast<uint8_t>(values[3] >> 28);
2045  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
2046  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
2047  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
2048 
2049  *ptr = static_cast<uint8_t>(values[3] << 4);
2050  *ptr++ |= static_cast<uint8_t>(values[4] >> 43);
2051  *ptr++ = static_cast<uint8_t>(values[4] >> 35);
2052  *ptr++ = static_cast<uint8_t>(values[4] >> 27);
2053  *ptr++ = static_cast<uint8_t>(values[4] >> 19);
2054  *ptr++ = static_cast<uint8_t>(values[4] >> 11);
2055  *ptr++ = static_cast<uint8_t>(values[4] >> 3);
2056 
2057  *ptr = static_cast<uint8_t>(values[4] << 5);
2058  *ptr++ |= static_cast<uint8_t>(values[5] >> 42);
2059  *ptr++ = static_cast<uint8_t>(values[5] >> 34);
2060  *ptr++ = static_cast<uint8_t>(values[5] >> 26);
2061  *ptr++ = static_cast<uint8_t>(values[5] >> 18);
2062  *ptr++ = static_cast<uint8_t>(values[5] >> 10);
2063  *ptr++ = static_cast<uint8_t>(values[5] >> 2);
2064 
2065  *ptr = static_cast<uint8_t>(values[5] << 6);
2066  *ptr++ |= static_cast<uint8_t>(values[6] >> 41);
2067  *ptr++ = static_cast<uint8_t>(values[6] >> 33);
2068  *ptr++ = static_cast<uint8_t>(values[6] >> 25);
2069  *ptr++ = static_cast<uint8_t>(values[6] >> 17);
2070  *ptr++ = static_cast<uint8_t>(values[6] >> 9);
2071  *ptr++ = static_cast<uint8_t>(values[6] >> 1);
2072 
2073  *ptr = static_cast<uint8_t>(values[6] << 7);
2074  *ptr++ |= static_cast<uint8_t>(values[7] >> 40);
2075  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
2076  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
2077  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
2078  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
2079  *ptr = static_cast<uint8_t>(values[7]);
2080 }
2081 
2082 static inline void pack_bits_48(const uint64_t* values, uint8_t* ptr) {
2083  *ptr++ = static_cast<uint8_t>(values[0] >> 40);
2084  *ptr++ = static_cast<uint8_t>(values[0] >> 32);
2085  *ptr++ = static_cast<uint8_t>(values[0] >> 24);
2086  *ptr++ = static_cast<uint8_t>(values[0] >> 16);
2087  *ptr++ = static_cast<uint8_t>(values[0] >> 8);
2088  *ptr++ = static_cast<uint8_t>(values[0]);
2089 
2090  *ptr++ = static_cast<uint8_t>(values[1] >> 40);
2091  *ptr++ = static_cast<uint8_t>(values[1] >> 32);
2092  *ptr++ = static_cast<uint8_t>(values[1] >> 24);
2093  *ptr++ = static_cast<uint8_t>(values[1] >> 16);
2094  *ptr++ = static_cast<uint8_t>(values[1] >> 8);
2095  *ptr++ = static_cast<uint8_t>(values[1]);
2096 
2097  *ptr++ = static_cast<uint8_t>(values[2] >> 40);
2098  *ptr++ = static_cast<uint8_t>(values[2] >> 32);
2099  *ptr++ = static_cast<uint8_t>(values[2] >> 24);
2100  *ptr++ = static_cast<uint8_t>(values[2] >> 16);
2101  *ptr++ = static_cast<uint8_t>(values[2] >> 8);
2102  *ptr++ = static_cast<uint8_t>(values[2]);
2103 
2104  *ptr++ = static_cast<uint8_t>(values[3] >> 40);
2105  *ptr++ = static_cast<uint8_t>(values[3] >> 32);
2106  *ptr++ = static_cast<uint8_t>(values[3] >> 24);
2107  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
2108  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
2109  *ptr++ = static_cast<uint8_t>(values[3]);
2110 
2111  *ptr++ = static_cast<uint8_t>(values[4] >> 40);
2112  *ptr++ = static_cast<uint8_t>(values[4] >> 32);
2113  *ptr++ = static_cast<uint8_t>(values[4] >> 24);
2114  *ptr++ = static_cast<uint8_t>(values[4] >> 16);
2115  *ptr++ = static_cast<uint8_t>(values[4] >> 8);
2116  *ptr++ = static_cast<uint8_t>(values[4]);
2117 
2118  *ptr++ = static_cast<uint8_t>(values[5] >> 40);
2119  *ptr++ = static_cast<uint8_t>(values[5] >> 32);
2120  *ptr++ = static_cast<uint8_t>(values[5] >> 24);
2121  *ptr++ = static_cast<uint8_t>(values[5] >> 16);
2122  *ptr++ = static_cast<uint8_t>(values[5] >> 8);
2123  *ptr++ = static_cast<uint8_t>(values[5]);
2124 
2125  *ptr++ = static_cast<uint8_t>(values[6] >> 40);
2126  *ptr++ = static_cast<uint8_t>(values[6] >> 32);
2127  *ptr++ = static_cast<uint8_t>(values[6] >> 24);
2128  *ptr++ = static_cast<uint8_t>(values[6] >> 16);
2129  *ptr++ = static_cast<uint8_t>(values[6] >> 8);
2130  *ptr++ = static_cast<uint8_t>(values[6]);
2131 
2132  *ptr++ = static_cast<uint8_t>(values[7] >> 40);
2133  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
2134  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
2135  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
2136  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
2137  *ptr = static_cast<uint8_t>(values[7]);
2138 }
2139 
2140 static inline void pack_bits_49(const uint64_t* values, uint8_t* ptr) {
2141  *ptr++ = static_cast<uint8_t>(values[0] >> 41);
2142  *ptr++ = static_cast<uint8_t>(values[0] >> 33);
2143  *ptr++ = static_cast<uint8_t>(values[0] >> 25);
2144  *ptr++ = static_cast<uint8_t>(values[0] >> 17);
2145  *ptr++ = static_cast<uint8_t>(values[0] >> 9);
2146  *ptr++ = static_cast<uint8_t>(values[0] >> 1);
2147 
2148  *ptr = static_cast<uint8_t>(values[0] << 7);
2149  *ptr++ |= static_cast<uint8_t>(values[1] >> 42);
2150  *ptr++ = static_cast<uint8_t>(values[1] >> 34);
2151  *ptr++ = static_cast<uint8_t>(values[1] >> 26);
2152  *ptr++ = static_cast<uint8_t>(values[1] >> 18);
2153  *ptr++ = static_cast<uint8_t>(values[1] >> 10);
2154  *ptr++ = static_cast<uint8_t>(values[1] >> 2);
2155 
2156  *ptr = static_cast<uint8_t>(values[1] << 6);
2157  *ptr++ |= static_cast<uint8_t>(values[2] >> 43);
2158  *ptr++ = static_cast<uint8_t>(values[2] >> 35);
2159  *ptr++ = static_cast<uint8_t>(values[2] >> 27);
2160  *ptr++ = static_cast<uint8_t>(values[2] >> 19);
2161  *ptr++ = static_cast<uint8_t>(values[2] >> 11);
2162  *ptr++ = static_cast<uint8_t>(values[2] >> 3);
2163 
2164  *ptr = static_cast<uint8_t>(values[2] << 5);
2165  *ptr++ |= static_cast<uint8_t>(values[3] >> 44);
2166  *ptr++ = static_cast<uint8_t>(values[3] >> 36);
2167  *ptr++ = static_cast<uint8_t>(values[3] >> 28);
2168  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
2169  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
2170  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
2171 
2172  *ptr = static_cast<uint8_t>(values[3] << 4);
2173  *ptr++ |= static_cast<uint8_t>(values[4] >> 45);
2174  *ptr++ = static_cast<uint8_t>(values[4] >> 37);
2175  *ptr++ = static_cast<uint8_t>(values[4] >> 29);
2176  *ptr++ = static_cast<uint8_t>(values[4] >> 21);
2177  *ptr++ = static_cast<uint8_t>(values[4] >> 13);
2178  *ptr++ = static_cast<uint8_t>(values[4] >> 5);
2179 
2180  *ptr = static_cast<uint8_t>(values[4] << 3);
2181  *ptr++ |= static_cast<uint8_t>(values[5] >> 46);
2182  *ptr++ = static_cast<uint8_t>(values[5] >> 38);
2183  *ptr++ = static_cast<uint8_t>(values[5] >> 30);
2184  *ptr++ = static_cast<uint8_t>(values[5] >> 22);
2185  *ptr++ = static_cast<uint8_t>(values[5] >> 14);
2186  *ptr++ = static_cast<uint8_t>(values[5] >> 6);
2187 
2188  *ptr = static_cast<uint8_t>(values[5] << 2);
2189  *ptr++ |= static_cast<uint8_t>(values[6] >> 47);
2190  *ptr++ = static_cast<uint8_t>(values[6] >> 39);
2191  *ptr++ = static_cast<uint8_t>(values[6] >> 31);
2192  *ptr++ = static_cast<uint8_t>(values[6] >> 23);
2193  *ptr++ = static_cast<uint8_t>(values[6] >> 15);
2194  *ptr++ = static_cast<uint8_t>(values[6] >> 7);
2195 
2196  *ptr = static_cast<uint8_t>(values[6] << 1);
2197  *ptr++ |= static_cast<uint8_t>(values[7] >> 48);
2198  *ptr++ = static_cast<uint8_t>(values[7] >> 40);
2199  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
2200  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
2201  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
2202  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
2203  *ptr = static_cast<uint8_t>(values[7]);
2204 }
2205 
2206 static inline void pack_bits_50(const uint64_t* values, uint8_t* ptr) {
2207  *ptr++ = static_cast<uint8_t>(values[0] >> 42);
2208  *ptr++ = static_cast<uint8_t>(values[0] >> 34);
2209  *ptr++ = static_cast<uint8_t>(values[0] >> 26);
2210  *ptr++ = static_cast<uint8_t>(values[0] >> 18);
2211  *ptr++ = static_cast<uint8_t>(values[0] >> 10);
2212  *ptr++ = static_cast<uint8_t>(values[0] >> 2);
2213 
2214  *ptr = static_cast<uint8_t>(values[0] << 6);
2215  *ptr++ |= static_cast<uint8_t>(values[1] >> 44);
2216  *ptr++ = static_cast<uint8_t>(values[1] >> 36);
2217  *ptr++ = static_cast<uint8_t>(values[1] >> 28);
2218  *ptr++ = static_cast<uint8_t>(values[1] >> 20);
2219  *ptr++ = static_cast<uint8_t>(values[1] >> 12);
2220  *ptr++ = static_cast<uint8_t>(values[1] >> 4);
2221 
2222  *ptr = static_cast<uint8_t>(values[1] << 4);
2223  *ptr++ |= static_cast<uint8_t>(values[2] >> 46);
2224  *ptr++ = static_cast<uint8_t>(values[2] >> 38);
2225  *ptr++ = static_cast<uint8_t>(values[2] >> 30);
2226  *ptr++ = static_cast<uint8_t>(values[2] >> 22);
2227  *ptr++ = static_cast<uint8_t>(values[2] >> 14);
2228  *ptr++ = static_cast<uint8_t>(values[2] >> 6);
2229 
2230  *ptr = static_cast<uint8_t>(values[2] << 2);
2231  *ptr++ |= static_cast<uint8_t>(values[3] >> 48);
2232  *ptr++ = static_cast<uint8_t>(values[3] >> 40);
2233  *ptr++ = static_cast<uint8_t>(values[3] >> 32);
2234  *ptr++ = static_cast<uint8_t>(values[3] >> 24);
2235  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
2236  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
2237  *ptr++ = static_cast<uint8_t>(values[3]);
2238 
2239  *ptr++ = static_cast<uint8_t>(values[4] >> 42);
2240  *ptr++ = static_cast<uint8_t>(values[4] >> 34);
2241  *ptr++ = static_cast<uint8_t>(values[4] >> 26);
2242  *ptr++ = static_cast<uint8_t>(values[4] >> 18);
2243  *ptr++ = static_cast<uint8_t>(values[4] >> 10);
2244  *ptr++ = static_cast<uint8_t>(values[4] >> 2);
2245 
2246  *ptr = static_cast<uint8_t>(values[4] << 6);
2247  *ptr++ |= static_cast<uint8_t>(values[5] >> 44);
2248  *ptr++ = static_cast<uint8_t>(values[5] >> 36);
2249  *ptr++ = static_cast<uint8_t>(values[5] >> 28);
2250  *ptr++ = static_cast<uint8_t>(values[5] >> 20);
2251  *ptr++ = static_cast<uint8_t>(values[5] >> 12);
2252  *ptr++ = static_cast<uint8_t>(values[5] >> 4);
2253 
2254  *ptr = static_cast<uint8_t>(values[5] << 4);
2255  *ptr++ |= static_cast<uint8_t>(values[6] >> 46);
2256  *ptr++ = static_cast<uint8_t>(values[6] >> 38);
2257  *ptr++ = static_cast<uint8_t>(values[6] >> 30);
2258  *ptr++ = static_cast<uint8_t>(values[6] >> 22);
2259  *ptr++ = static_cast<uint8_t>(values[6] >> 14);
2260  *ptr++ = static_cast<uint8_t>(values[6] >> 6);
2261 
2262  *ptr = static_cast<uint8_t>(values[6] << 2);
2263  *ptr++ |= static_cast<uint8_t>(values[7] >> 48);
2264  *ptr++ = static_cast<uint8_t>(values[7] >> 40);
2265  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
2266  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
2267  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
2268  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
2269  *ptr = static_cast<uint8_t>(values[7]);
2270 }
2271 
2272 static inline void pack_bits_51(const uint64_t* values, uint8_t* ptr) {
2273  *ptr++ = static_cast<uint8_t>(values[0] >> 43);
2274  *ptr++ = static_cast<uint8_t>(values[0] >> 35);
2275  *ptr++ = static_cast<uint8_t>(values[0] >> 27);
2276  *ptr++ = static_cast<uint8_t>(values[0] >> 19);
2277  *ptr++ = static_cast<uint8_t>(values[0] >> 11);
2278  *ptr++ = static_cast<uint8_t>(values[0] >> 3);
2279 
2280  *ptr = static_cast<uint8_t>(values[0] << 5);
2281  *ptr++ |= static_cast<uint8_t>(values[1] >> 46);
2282  *ptr++ = static_cast<uint8_t>(values[1] >> 38);
2283  *ptr++ = static_cast<uint8_t>(values[1] >> 30);
2284  *ptr++ = static_cast<uint8_t>(values[1] >> 22);
2285  *ptr++ = static_cast<uint8_t>(values[1] >> 14);
2286  *ptr++ = static_cast<uint8_t>(values[1] >> 6);
2287 
2288  *ptr = static_cast<uint8_t>(values[1] << 2);
2289  *ptr++ |= static_cast<uint8_t>(values[2] >> 49);
2290  *ptr++ = static_cast<uint8_t>(values[2] >> 41);
2291  *ptr++ = static_cast<uint8_t>(values[2] >> 33);
2292  *ptr++ = static_cast<uint8_t>(values[2] >> 25);
2293  *ptr++ = static_cast<uint8_t>(values[2] >> 17);
2294  *ptr++ = static_cast<uint8_t>(values[2] >> 9);
2295  *ptr++ = static_cast<uint8_t>(values[2] >> 1);
2296 
2297  *ptr = static_cast<uint8_t>(values[2] << 7);
2298  *ptr++ |= static_cast<uint8_t>(values[3] >> 44);
2299  *ptr++ = static_cast<uint8_t>(values[3] >> 36);
2300  *ptr++ = static_cast<uint8_t>(values[3] >> 28);
2301  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
2302  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
2303  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
2304 
2305  *ptr = static_cast<uint8_t>(values[3] << 4);
2306  *ptr++ |= static_cast<uint8_t>(values[4] >> 47);
2307  *ptr++ = static_cast<uint8_t>(values[4] >> 39);
2308  *ptr++ = static_cast<uint8_t>(values[4] >> 31);
2309  *ptr++ = static_cast<uint8_t>(values[4] >> 23);
2310  *ptr++ = static_cast<uint8_t>(values[4] >> 15);
2311  *ptr++ = static_cast<uint8_t>(values[4] >> 7);
2312 
2313  *ptr = static_cast<uint8_t>(values[4] << 1);
2314  *ptr++ |= static_cast<uint8_t>(values[5] >> 50);
2315  *ptr++ = static_cast<uint8_t>(values[5] >> 42);
2316  *ptr++ = static_cast<uint8_t>(values[5] >> 34);
2317  *ptr++ = static_cast<uint8_t>(values[5] >> 26);
2318  *ptr++ = static_cast<uint8_t>(values[5] >> 18);
2319  *ptr++ = static_cast<uint8_t>(values[5] >> 10);
2320  *ptr++ = static_cast<uint8_t>(values[5] >> 2);
2321 
2322  *ptr = static_cast<uint8_t>(values[5] << 6);
2323  *ptr++ |= static_cast<uint8_t>(values[6] >> 45);
2324  *ptr++ = static_cast<uint8_t>(values[6] >> 37);
2325  *ptr++ = static_cast<uint8_t>(values[6] >> 29);
2326  *ptr++ = static_cast<uint8_t>(values[6] >> 21);
2327  *ptr++ = static_cast<uint8_t>(values[6] >> 13);
2328  *ptr++ = static_cast<uint8_t>(values[6] >> 5);
2329 
2330  *ptr = static_cast<uint8_t>(values[6] << 3);
2331  *ptr++ |= static_cast<uint8_t>(values[7] >> 48);
2332  *ptr++ = static_cast<uint8_t>(values[7] >> 40);
2333  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
2334  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
2335  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
2336  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
2337  *ptr = static_cast<uint8_t>(values[7]);
2338 }
2339 
2340 static inline void pack_bits_52(const uint64_t* values, uint8_t* ptr) {
2341  *ptr++ = static_cast<uint8_t>(values[0] >> 44);
2342  *ptr++ = static_cast<uint8_t>(values[0] >> 36);
2343  *ptr++ = static_cast<uint8_t>(values[0] >> 28);
2344  *ptr++ = static_cast<uint8_t>(values[0] >> 20);
2345  *ptr++ = static_cast<uint8_t>(values[0] >> 12);
2346  *ptr++ = static_cast<uint8_t>(values[0] >> 4);
2347 
2348  *ptr = static_cast<uint8_t>(values[0] << 4);
2349  *ptr++ |= static_cast<uint8_t>(values[1] >> 48);
2350  *ptr++ = static_cast<uint8_t>(values[1] >> 40);
2351  *ptr++ = static_cast<uint8_t>(values[1] >> 32);
2352  *ptr++ = static_cast<uint8_t>(values[1] >> 24);
2353  *ptr++ = static_cast<uint8_t>(values[1] >> 16);
2354  *ptr++ = static_cast<uint8_t>(values[1] >> 8);
2355  *ptr++ = static_cast<uint8_t>(values[1]);
2356 
2357  *ptr++ = static_cast<uint8_t>(values[2] >> 44);
2358  *ptr++ = static_cast<uint8_t>(values[2] >> 36);
2359  *ptr++ = static_cast<uint8_t>(values[2] >> 28);
2360  *ptr++ = static_cast<uint8_t>(values[2] >> 20);
2361  *ptr++ = static_cast<uint8_t>(values[2] >> 12);
2362  *ptr++ = static_cast<uint8_t>(values[2] >> 4);
2363 
2364  *ptr = static_cast<uint8_t>(values[2] << 4);
2365  *ptr++ |= static_cast<uint8_t>(values[3] >> 48);
2366  *ptr++ = static_cast<uint8_t>(values[3] >> 40);
2367  *ptr++ = static_cast<uint8_t>(values[3] >> 32);
2368  *ptr++ = static_cast<uint8_t>(values[3] >> 24);
2369  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
2370  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
2371  *ptr++ = static_cast<uint8_t>(values[3]);
2372 
2373  *ptr++ = static_cast<uint8_t>(values[4] >> 44);
2374  *ptr++ = static_cast<uint8_t>(values[4] >> 36);
2375  *ptr++ = static_cast<uint8_t>(values[4] >> 28);
2376  *ptr++ = static_cast<uint8_t>(values[4] >> 20);
2377  *ptr++ = static_cast<uint8_t>(values[4] >> 12);
2378  *ptr++ = static_cast<uint8_t>(values[4] >> 4);
2379 
2380  *ptr = static_cast<uint8_t>(values[4] << 4);
2381  *ptr++ |= static_cast<uint8_t>(values[5] >> 48);
2382  *ptr++ = static_cast<uint8_t>(values[5] >> 40);
2383  *ptr++ = static_cast<uint8_t>(values[5] >> 32);
2384  *ptr++ = static_cast<uint8_t>(values[5] >> 24);
2385  *ptr++ = static_cast<uint8_t>(values[5] >> 16);
2386  *ptr++ = static_cast<uint8_t>(values[5] >> 8);
2387  *ptr++ = static_cast<uint8_t>(values[5]);
2388 
2389  *ptr++ = static_cast<uint8_t>(values[6] >> 44);
2390  *ptr++ = static_cast<uint8_t>(values[6] >> 36);
2391  *ptr++ = static_cast<uint8_t>(values[6] >> 28);
2392  *ptr++ = static_cast<uint8_t>(values[6] >> 20);
2393  *ptr++ = static_cast<uint8_t>(values[6] >> 12);
2394  *ptr++ = static_cast<uint8_t>(values[6] >> 4);
2395 
2396  *ptr = static_cast<uint8_t>(values[6] << 4);
2397  *ptr++ |= static_cast<uint8_t>(values[7] >> 48);
2398  *ptr++ = static_cast<uint8_t>(values[7] >> 40);
2399  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
2400  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
2401  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
2402  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
2403  *ptr = static_cast<uint8_t>(values[7]);
2404 }
2405 
2406 static inline void pack_bits_53(const uint64_t* values, uint8_t* ptr) {
2407  *ptr++ = static_cast<uint8_t>(values[0] >> 45);
2408  *ptr++ = static_cast<uint8_t>(values[0] >> 37);
2409  *ptr++ = static_cast<uint8_t>(values[0] >> 29);
2410  *ptr++ = static_cast<uint8_t>(values[0] >> 21);
2411  *ptr++ = static_cast<uint8_t>(values[0] >> 13);
2412  *ptr++ = static_cast<uint8_t>(values[0] >> 5);
2413 
2414  *ptr = static_cast<uint8_t>(values[0] << 3);
2415  *ptr++ |= static_cast<uint8_t>(values[1] >> 50);
2416  *ptr++ = static_cast<uint8_t>(values[1] >> 42);
2417  *ptr++ = static_cast<uint8_t>(values[1] >> 34);
2418  *ptr++ = static_cast<uint8_t>(values[1] >> 26);
2419  *ptr++ = static_cast<uint8_t>(values[1] >> 18);
2420  *ptr++ = static_cast<uint8_t>(values[1] >> 10);
2421  *ptr++ = static_cast<uint8_t>(values[1] >> 2);
2422 
2423  *ptr = static_cast<uint8_t>(values[1] << 6);
2424  *ptr++ |= static_cast<uint8_t>(values[2] >> 47);
2425  *ptr++ = static_cast<uint8_t>(values[2] >> 39);
2426  *ptr++ = static_cast<uint8_t>(values[2] >> 31);
2427  *ptr++ = static_cast<uint8_t>(values[2] >> 23);
2428  *ptr++ = static_cast<uint8_t>(values[2] >> 15);
2429  *ptr++ = static_cast<uint8_t>(values[2] >> 7);
2430 
2431  *ptr = static_cast<uint8_t>(values[2] << 1);
2432  *ptr++ |= static_cast<uint8_t>(values[3] >> 52);
2433  *ptr++ = static_cast<uint8_t>(values[3] >> 44);
2434  *ptr++ = static_cast<uint8_t>(values[3] >> 36);
2435  *ptr++ = static_cast<uint8_t>(values[3] >> 28);
2436  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
2437  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
2438  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
2439 
2440  *ptr = static_cast<uint8_t>(values[3] << 4);
2441  *ptr++ |= static_cast<uint8_t>(values[4] >> 49);
2442  *ptr++ = static_cast<uint8_t>(values[4] >> 41);
2443  *ptr++ = static_cast<uint8_t>(values[4] >> 33);
2444  *ptr++ = static_cast<uint8_t>(values[4] >> 25);
2445  *ptr++ = static_cast<uint8_t>(values[4] >> 17);
2446  *ptr++ = static_cast<uint8_t>(values[4] >> 9);
2447  *ptr++ = static_cast<uint8_t>(values[4] >> 1);
2448 
2449  *ptr = static_cast<uint8_t>(values[4] << 7);
2450  *ptr++ |= static_cast<uint8_t>(values[5] >> 46);
2451  *ptr++ = static_cast<uint8_t>(values[5] >> 38);
2452  *ptr++ = static_cast<uint8_t>(values[5] >> 30);
2453  *ptr++ = static_cast<uint8_t>(values[5] >> 22);
2454  *ptr++ = static_cast<uint8_t>(values[5] >> 14);
2455  *ptr++ = static_cast<uint8_t>(values[5] >> 6);
2456 
2457  *ptr = static_cast<uint8_t>(values[5] << 2);
2458  *ptr++ |= static_cast<uint8_t>(values[6] >> 51);
2459  *ptr++ = static_cast<uint8_t>(values[6] >> 43);
2460  *ptr++ = static_cast<uint8_t>(values[6] >> 35);
2461  *ptr++ = static_cast<uint8_t>(values[6] >> 27);
2462  *ptr++ = static_cast<uint8_t>(values[6] >> 19);
2463  *ptr++ = static_cast<uint8_t>(values[6] >> 11);
2464  *ptr++ = static_cast<uint8_t>(values[6] >> 3);
2465 
2466  *ptr = static_cast<uint8_t>(values[6] << 5);
2467  *ptr++ |= static_cast<uint8_t>(values[7] >> 48);
2468  *ptr++ = static_cast<uint8_t>(values[7] >> 40);
2469  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
2470  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
2471  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
2472  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
2473  *ptr = static_cast<uint8_t>(values[7]);
2474 }
2475 
2476 static inline void pack_bits_54(const uint64_t* values, uint8_t* ptr) {
2477  *ptr++ = static_cast<uint8_t>(values[0] >> 46);
2478  *ptr++ = static_cast<uint8_t>(values[0] >> 38);
2479  *ptr++ = static_cast<uint8_t>(values[0] >> 30);
2480  *ptr++ = static_cast<uint8_t>(values[0] >> 22);
2481  *ptr++ = static_cast<uint8_t>(values[0] >> 14);
2482  *ptr++ = static_cast<uint8_t>(values[0] >> 6);
2483 
2484  *ptr = static_cast<uint8_t>(values[0] << 2);
2485  *ptr++ |= static_cast<uint8_t>(values[1] >> 52);
2486  *ptr++ = static_cast<uint8_t>(values[1] >> 44);
2487  *ptr++ = static_cast<uint8_t>(values[1] >> 36);
2488  *ptr++ = static_cast<uint8_t>(values[1] >> 28);
2489  *ptr++ = static_cast<uint8_t>(values[1] >> 20);
2490  *ptr++ = static_cast<uint8_t>(values[1] >> 12);
2491  *ptr++ = static_cast<uint8_t>(values[1] >> 4);
2492 
2493  *ptr = static_cast<uint8_t>(values[1] << 4);
2494  *ptr++ |= static_cast<uint8_t>(values[2] >> 50);
2495  *ptr++ = static_cast<uint8_t>(values[2] >> 42);
2496  *ptr++ = static_cast<uint8_t>(values[2] >> 34);
2497  *ptr++ = static_cast<uint8_t>(values[2] >> 26);
2498  *ptr++ = static_cast<uint8_t>(values[2] >> 18);
2499  *ptr++ = static_cast<uint8_t>(values[2] >> 10);
2500  *ptr++ = static_cast<uint8_t>(values[2] >> 2);
2501 
2502  *ptr = static_cast<uint8_t>(values[2] << 6);
2503  *ptr++ |= static_cast<uint8_t>(values[3] >> 48);
2504  *ptr++ = static_cast<uint8_t>(values[3] >> 40);
2505  *ptr++ = static_cast<uint8_t>(values[3] >> 32);
2506  *ptr++ = static_cast<uint8_t>(values[3] >> 24);
2507  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
2508  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
2509  *ptr++ = static_cast<uint8_t>(values[3]);
2510 
2511  *ptr++ = static_cast<uint8_t>(values[4] >> 46);
2512  *ptr++ = static_cast<uint8_t>(values[4] >> 38);
2513  *ptr++ = static_cast<uint8_t>(values[4] >> 30);
2514  *ptr++ = static_cast<uint8_t>(values[4] >> 22);
2515  *ptr++ = static_cast<uint8_t>(values[4] >> 14);
2516  *ptr++ = static_cast<uint8_t>(values[4] >> 6);
2517 
2518  *ptr = static_cast<uint8_t>(values[4] << 2);
2519  *ptr++ |= static_cast<uint8_t>(values[5] >> 52);
2520  *ptr++ = static_cast<uint8_t>(values[5] >> 44);
2521  *ptr++ = static_cast<uint8_t>(values[5] >> 36);
2522  *ptr++ = static_cast<uint8_t>(values[5] >> 28);
2523  *ptr++ = static_cast<uint8_t>(values[5] >> 20);
2524  *ptr++ = static_cast<uint8_t>(values[5] >> 12);
2525  *ptr++ = static_cast<uint8_t>(values[5] >> 4);
2526 
2527  *ptr = static_cast<uint8_t>(values[5] << 4);
2528  *ptr++ |= static_cast<uint8_t>(values[6] >> 50);
2529  *ptr++ = static_cast<uint8_t>(values[6] >> 42);
2530  *ptr++ = static_cast<uint8_t>(values[6] >> 34);
2531  *ptr++ = static_cast<uint8_t>(values[6] >> 26);
2532  *ptr++ = static_cast<uint8_t>(values[6] >> 18);
2533  *ptr++ = static_cast<uint8_t>(values[6] >> 10);
2534  *ptr++ = static_cast<uint8_t>(values[6] >> 2);
2535 
2536  *ptr = static_cast<uint8_t>(values[6] << 6);
2537  *ptr++ |= static_cast<uint8_t>(values[7] >> 48);
2538  *ptr++ = static_cast<uint8_t>(values[7] >> 40);
2539  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
2540  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
2541  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
2542  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
2543  *ptr = static_cast<uint8_t>(values[7]);
2544 }
2545 
2546 static inline void pack_bits_55(const uint64_t* values, uint8_t* ptr) {
2547  *ptr++ = static_cast<uint8_t>(values[0] >> 47);
2548  *ptr++ = static_cast<uint8_t>(values[0] >> 39);
2549  *ptr++ = static_cast<uint8_t>(values[0] >> 31);
2550  *ptr++ = static_cast<uint8_t>(values[0] >> 23);
2551  *ptr++ = static_cast<uint8_t>(values[0] >> 15);
2552  *ptr++ = static_cast<uint8_t>(values[0] >> 7);
2553 
2554  *ptr = static_cast<uint8_t>(values[0] << 1);
2555  *ptr++ |= static_cast<uint8_t>(values[1] >> 54);
2556  *ptr++ = static_cast<uint8_t>(values[1] >> 46);
2557  *ptr++ = static_cast<uint8_t>(values[1] >> 38);
2558  *ptr++ = static_cast<uint8_t>(values[1] >> 30);
2559  *ptr++ = static_cast<uint8_t>(values[1] >> 22);
2560  *ptr++ = static_cast<uint8_t>(values[1] >> 14);
2561  *ptr++ = static_cast<uint8_t>(values[1] >> 6);
2562 
2563  *ptr = static_cast<uint8_t>(values[1] << 2);
2564  *ptr++ |= static_cast<uint8_t>(values[2] >> 53);
2565  *ptr++ = static_cast<uint8_t>(values[2] >> 45);
2566  *ptr++ = static_cast<uint8_t>(values[2] >> 37);
2567  *ptr++ = static_cast<uint8_t>(values[2] >> 29);
2568  *ptr++ = static_cast<uint8_t>(values[2] >> 21);
2569  *ptr++ = static_cast<uint8_t>(values[2] >> 13);
2570  *ptr++ = static_cast<uint8_t>(values[2] >> 5);
2571 
2572  *ptr = static_cast<uint8_t>(values[2] << 3);
2573  *ptr++ |= static_cast<uint8_t>(values[3] >> 52);
2574  *ptr++ = static_cast<uint8_t>(values[3] >> 44);
2575  *ptr++ = static_cast<uint8_t>(values[3] >> 36);
2576  *ptr++ = static_cast<uint8_t>(values[3] >> 28);
2577  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
2578  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
2579  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
2580 
2581  *ptr = static_cast<uint8_t>(values[3] << 4);
2582  *ptr++ |= static_cast<uint8_t>(values[4] >> 51);
2583  *ptr++ = static_cast<uint8_t>(values[4] >> 43);
2584  *ptr++ = static_cast<uint8_t>(values[4] >> 35);
2585  *ptr++ = static_cast<uint8_t>(values[4] >> 27);
2586  *ptr++ = static_cast<uint8_t>(values[4] >> 19);
2587  *ptr++ = static_cast<uint8_t>(values[4] >> 11);
2588  *ptr++ = static_cast<uint8_t>(values[4] >> 3);
2589 
2590  *ptr = static_cast<uint8_t>(values[4] << 5);
2591  *ptr++ |= static_cast<uint8_t>(values[5] >> 50);
2592  *ptr++ = static_cast<uint8_t>(values[5] >> 42);
2593  *ptr++ = static_cast<uint8_t>(values[5] >> 34);
2594  *ptr++ = static_cast<uint8_t>(values[5] >> 26);
2595  *ptr++ = static_cast<uint8_t>(values[5] >> 18);
2596  *ptr++ = static_cast<uint8_t>(values[5] >> 10);
2597  *ptr++ = static_cast<uint8_t>(values[5] >> 2);
2598 
2599  *ptr = static_cast<uint8_t>(values[5] << 6);
2600  *ptr++ |= static_cast<uint8_t>(values[6] >> 49);
2601  *ptr++ = static_cast<uint8_t>(values[6] >> 41);
2602  *ptr++ = static_cast<uint8_t>(values[6] >> 33);
2603  *ptr++ = static_cast<uint8_t>(values[6] >> 25);
2604  *ptr++ = static_cast<uint8_t>(values[6] >> 17);
2605  *ptr++ = static_cast<uint8_t>(values[6] >> 9);
2606  *ptr++ = static_cast<uint8_t>(values[6] >> 1);
2607 
2608  *ptr = static_cast<uint8_t>(values[6] << 7);
2609  *ptr++ |= static_cast<uint8_t>(values[7] >> 48);
2610  *ptr++ = static_cast<uint8_t>(values[7] >> 40);
2611  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
2612  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
2613  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
2614  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
2615  *ptr = static_cast<uint8_t>(values[7]);
2616 }
2617 
2618 static inline void pack_bits_56(const uint64_t* values, uint8_t* ptr) {
2619  *ptr++ = static_cast<uint8_t>(values[0] >> 48);
2620  *ptr++ = static_cast<uint8_t>(values[0] >> 40);
2621  *ptr++ = static_cast<uint8_t>(values[0] >> 32);
2622  *ptr++ = static_cast<uint8_t>(values[0] >> 24);
2623  *ptr++ = static_cast<uint8_t>(values[0] >> 16);
2624  *ptr++ = static_cast<uint8_t>(values[0] >> 8);
2625  *ptr++ = static_cast<uint8_t>(values[0]);
2626 
2627  *ptr++ = static_cast<uint8_t>(values[1] >> 48);
2628  *ptr++ = static_cast<uint8_t>(values[1] >> 40);
2629  *ptr++ = static_cast<uint8_t>(values[1] >> 32);
2630  *ptr++ = static_cast<uint8_t>(values[1] >> 24);
2631  *ptr++ = static_cast<uint8_t>(values[1] >> 16);
2632  *ptr++ = static_cast<uint8_t>(values[1] >> 8);
2633  *ptr++ = static_cast<uint8_t>(values[1]);
2634 
2635  *ptr++ = static_cast<uint8_t>(values[2] >> 48);
2636  *ptr++ = static_cast<uint8_t>(values[2] >> 40);
2637  *ptr++ = static_cast<uint8_t>(values[2] >> 32);
2638  *ptr++ = static_cast<uint8_t>(values[2] >> 24);
2639  *ptr++ = static_cast<uint8_t>(values[2] >> 16);
2640  *ptr++ = static_cast<uint8_t>(values[2] >> 8);
2641  *ptr++ = static_cast<uint8_t>(values[2]);
2642 
2643  *ptr++ = static_cast<uint8_t>(values[3] >> 48);
2644  *ptr++ = static_cast<uint8_t>(values[3] >> 40);
2645  *ptr++ = static_cast<uint8_t>(values[3] >> 32);
2646  *ptr++ = static_cast<uint8_t>(values[3] >> 24);
2647  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
2648  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
2649  *ptr++ = static_cast<uint8_t>(values[3]);
2650 
2651  *ptr++ = static_cast<uint8_t>(values[4] >> 48);
2652  *ptr++ = static_cast<uint8_t>(values[4] >> 40);
2653  *ptr++ = static_cast<uint8_t>(values[4] >> 32);
2654  *ptr++ = static_cast<uint8_t>(values[4] >> 24);
2655  *ptr++ = static_cast<uint8_t>(values[4] >> 16);
2656  *ptr++ = static_cast<uint8_t>(values[4] >> 8);
2657  *ptr++ = static_cast<uint8_t>(values[4]);
2658 
2659  *ptr++ = static_cast<uint8_t>(values[5] >> 48);
2660  *ptr++ = static_cast<uint8_t>(values[5] >> 40);
2661  *ptr++ = static_cast<uint8_t>(values[5] >> 32);
2662  *ptr++ = static_cast<uint8_t>(values[5] >> 24);
2663  *ptr++ = static_cast<uint8_t>(values[5] >> 16);
2664  *ptr++ = static_cast<uint8_t>(values[5] >> 8);
2665  *ptr++ = static_cast<uint8_t>(values[5]);
2666 
2667  *ptr++ = static_cast<uint8_t>(values[6] >> 48);
2668  *ptr++ = static_cast<uint8_t>(values[6] >> 40);
2669  *ptr++ = static_cast<uint8_t>(values[6] >> 32);
2670  *ptr++ = static_cast<uint8_t>(values[6] >> 24);
2671  *ptr++ = static_cast<uint8_t>(values[6] >> 16);
2672  *ptr++ = static_cast<uint8_t>(values[6] >> 8);
2673  *ptr++ = static_cast<uint8_t>(values[6]);
2674 
2675  *ptr++ = static_cast<uint8_t>(values[7] >> 48);
2676  *ptr++ = static_cast<uint8_t>(values[7] >> 40);
2677  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
2678  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
2679  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
2680  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
2681  *ptr = static_cast<uint8_t>(values[7]);
2682 }
2683 
2684 static inline void pack_bits_57(const uint64_t* values, uint8_t* ptr) {
2685  *ptr++ = static_cast<uint8_t>(values[0] >> 49);
2686  *ptr++ = static_cast<uint8_t>(values[0] >> 41);
2687  *ptr++ = static_cast<uint8_t>(values[0] >> 33);
2688  *ptr++ = static_cast<uint8_t>(values[0] >> 25);
2689  *ptr++ = static_cast<uint8_t>(values[0] >> 17);
2690  *ptr++ = static_cast<uint8_t>(values[0] >> 9);
2691  *ptr++ = static_cast<uint8_t>(values[0] >> 1);
2692 
2693  *ptr = static_cast<uint8_t>(values[0] << 7);
2694  *ptr++ |= static_cast<uint8_t>(values[1] >> 50);
2695  *ptr++ = static_cast<uint8_t>(values[1] >> 42);
2696  *ptr++ = static_cast<uint8_t>(values[1] >> 34);
2697  *ptr++ = static_cast<uint8_t>(values[1] >> 26);
2698  *ptr++ = static_cast<uint8_t>(values[1] >> 18);
2699  *ptr++ = static_cast<uint8_t>(values[1] >> 10);
2700  *ptr++ = static_cast<uint8_t>(values[1] >> 2);
2701 
2702  *ptr = static_cast<uint8_t>(values[1] << 6);
2703  *ptr++ |= static_cast<uint8_t>(values[2] >> 51);
2704  *ptr++ = static_cast<uint8_t>(values[2] >> 43);
2705  *ptr++ = static_cast<uint8_t>(values[2] >> 35);
2706  *ptr++ = static_cast<uint8_t>(values[2] >> 27);
2707  *ptr++ = static_cast<uint8_t>(values[2] >> 19);
2708  *ptr++ = static_cast<uint8_t>(values[2] >> 11);
2709  *ptr++ = static_cast<uint8_t>(values[2] >> 3);
2710 
2711  *ptr = static_cast<uint8_t>(values[2] << 5);
2712  *ptr++ |= static_cast<uint8_t>(values[3] >> 52);
2713  *ptr++ = static_cast<uint8_t>(values[3] >> 44);
2714  *ptr++ = static_cast<uint8_t>(values[3] >> 36);
2715  *ptr++ = static_cast<uint8_t>(values[3] >> 28);
2716  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
2717  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
2718  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
2719 
2720  *ptr = static_cast<uint8_t>(values[3] << 4);
2721  *ptr++ |= static_cast<uint8_t>(values[4] >> 53);
2722  *ptr++ = static_cast<uint8_t>(values[4] >> 45);
2723  *ptr++ = static_cast<uint8_t>(values[4] >> 37);
2724  *ptr++ = static_cast<uint8_t>(values[4] >> 29);
2725  *ptr++ = static_cast<uint8_t>(values[4] >> 21);
2726  *ptr++ = static_cast<uint8_t>(values[4] >> 13);
2727  *ptr++ = static_cast<uint8_t>(values[4] >> 5);
2728 
2729  *ptr = static_cast<uint8_t>(values[4] << 3);
2730  *ptr++ |= static_cast<uint8_t>(values[5] >> 54);
2731  *ptr++ = static_cast<uint8_t>(values[5] >> 46);
2732  *ptr++ = static_cast<uint8_t>(values[5] >> 38);
2733  *ptr++ = static_cast<uint8_t>(values[5] >> 30);
2734  *ptr++ = static_cast<uint8_t>(values[5] >> 22);
2735  *ptr++ = static_cast<uint8_t>(values[5] >> 14);
2736  *ptr++ = static_cast<uint8_t>(values[5] >> 6);
2737 
2738  *ptr = static_cast<uint8_t>(values[5] << 2);
2739  *ptr++ |= static_cast<uint8_t>(values[6] >> 55);
2740  *ptr++ = static_cast<uint8_t>(values[6] >> 47);
2741  *ptr++ = static_cast<uint8_t>(values[6] >> 39);
2742  *ptr++ = static_cast<uint8_t>(values[6] >> 31);
2743  *ptr++ = static_cast<uint8_t>(values[6] >> 23);
2744  *ptr++ = static_cast<uint8_t>(values[6] >> 15);
2745  *ptr++ = static_cast<uint8_t>(values[6] >> 7);
2746 
2747  *ptr = static_cast<uint8_t>(values[6] << 1);
2748  *ptr++ |= static_cast<uint8_t>(values[7] >> 56);
2749  *ptr++ = static_cast<uint8_t>(values[7] >> 48);
2750  *ptr++ = static_cast<uint8_t>(values[7] >> 40);
2751  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
2752  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
2753  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
2754  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
2755  *ptr = static_cast<uint8_t>(values[7]);
2756 }
2757 
2758 static inline void pack_bits_58(const uint64_t* values, uint8_t* ptr) {
2759  *ptr++ = static_cast<uint8_t>(values[0] >> 50);
2760  *ptr++ = static_cast<uint8_t>(values[0] >> 42);
2761  *ptr++ = static_cast<uint8_t>(values[0] >> 34);
2762  *ptr++ = static_cast<uint8_t>(values[0] >> 26);
2763  *ptr++ = static_cast<uint8_t>(values[0] >> 18);
2764  *ptr++ = static_cast<uint8_t>(values[0] >> 10);
2765  *ptr++ = static_cast<uint8_t>(values[0] >> 2);
2766 
2767  *ptr = static_cast<uint8_t>(values[0] << 6);
2768  *ptr++ |= static_cast<uint8_t>(values[1] >> 52);
2769  *ptr++ = static_cast<uint8_t>(values[1] >> 44);
2770  *ptr++ = static_cast<uint8_t>(values[1] >> 36);
2771  *ptr++ = static_cast<uint8_t>(values[1] >> 28);
2772  *ptr++ = static_cast<uint8_t>(values[1] >> 20);
2773  *ptr++ = static_cast<uint8_t>(values[1] >> 12);
2774  *ptr++ = static_cast<uint8_t>(values[1] >> 4);
2775 
2776  *ptr = static_cast<uint8_t>(values[1] << 4);
2777  *ptr++ |= static_cast<uint8_t>(values[2] >> 54);
2778  *ptr++ = static_cast<uint8_t>(values[2] >> 46);
2779  *ptr++ = static_cast<uint8_t>(values[2] >> 38);
2780  *ptr++ = static_cast<uint8_t>(values[2] >> 30);
2781  *ptr++ = static_cast<uint8_t>(values[2] >> 22);
2782  *ptr++ = static_cast<uint8_t>(values[2] >> 14);
2783  *ptr++ = static_cast<uint8_t>(values[2] >> 6);
2784 
2785  *ptr = static_cast<uint8_t>(values[2] << 2);
2786  *ptr++ |= static_cast<uint8_t>(values[3] >> 56);
2787  *ptr++ = static_cast<uint8_t>(values[3] >> 48);
2788  *ptr++ = static_cast<uint8_t>(values[3] >> 40);
2789  *ptr++ = static_cast<uint8_t>(values[3] >> 32);
2790  *ptr++ = static_cast<uint8_t>(values[3] >> 24);
2791  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
2792  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
2793  *ptr++ = static_cast<uint8_t>(values[3]);
2794 
2795  *ptr++ = static_cast<uint8_t>(values[4] >> 50);
2796  *ptr++ = static_cast<uint8_t>(values[4] >> 42);
2797  *ptr++ = static_cast<uint8_t>(values[4] >> 34);
2798  *ptr++ = static_cast<uint8_t>(values[4] >> 26);
2799  *ptr++ = static_cast<uint8_t>(values[4] >> 18);
2800  *ptr++ = static_cast<uint8_t>(values[4] >> 10);
2801  *ptr++ = static_cast<uint8_t>(values[4] >> 2);
2802 
2803  *ptr = static_cast<uint8_t>(values[4] << 6);
2804  *ptr++ |= static_cast<uint8_t>(values[5] >> 52);
2805  *ptr++ = static_cast<uint8_t>(values[5] >> 44);
2806  *ptr++ = static_cast<uint8_t>(values[5] >> 36);
2807  *ptr++ = static_cast<uint8_t>(values[5] >> 28);
2808  *ptr++ = static_cast<uint8_t>(values[5] >> 20);
2809  *ptr++ = static_cast<uint8_t>(values[5] >> 12);
2810  *ptr++ = static_cast<uint8_t>(values[5] >> 4);
2811 
2812  *ptr = static_cast<uint8_t>(values[5] << 4);
2813  *ptr++ |= static_cast<uint8_t>(values[6] >> 54);
2814  *ptr++ = static_cast<uint8_t>(values[6] >> 46);
2815  *ptr++ = static_cast<uint8_t>(values[6] >> 38);
2816  *ptr++ = static_cast<uint8_t>(values[6] >> 30);
2817  *ptr++ = static_cast<uint8_t>(values[6] >> 22);
2818  *ptr++ = static_cast<uint8_t>(values[6] >> 14);
2819  *ptr++ = static_cast<uint8_t>(values[6] >> 6);
2820 
2821  *ptr = static_cast<uint8_t>(values[6] << 2);
2822  *ptr++ |= static_cast<uint8_t>(values[7] >> 56);
2823  *ptr++ = static_cast<uint8_t>(values[7] >> 48);
2824  *ptr++ = static_cast<uint8_t>(values[7] >> 40);
2825  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
2826  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
2827  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
2828  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
2829  *ptr = static_cast<uint8_t>(values[7]);
2830 }
2831 
2832 static inline void pack_bits_59(const uint64_t* values, uint8_t* ptr) {
2833  *ptr++ = static_cast<uint8_t>(values[0] >> 51);
2834  *ptr++ = static_cast<uint8_t>(values[0] >> 43);
2835  *ptr++ = static_cast<uint8_t>(values[0] >> 35);
2836  *ptr++ = static_cast<uint8_t>(values[0] >> 27);
2837  *ptr++ = static_cast<uint8_t>(values[0] >> 19);
2838  *ptr++ = static_cast<uint8_t>(values[0] >> 11);
2839  *ptr++ = static_cast<uint8_t>(values[0] >> 3);
2840 
2841  *ptr = static_cast<uint8_t>(values[0] << 5);
2842  *ptr++ |= static_cast<uint8_t>(values[1] >> 54);
2843  *ptr++ = static_cast<uint8_t>(values[1] >> 46);
2844  *ptr++ = static_cast<uint8_t>(values[1] >> 38);
2845  *ptr++ = static_cast<uint8_t>(values[1] >> 30);
2846  *ptr++ = static_cast<uint8_t>(values[1] >> 22);
2847  *ptr++ = static_cast<uint8_t>(values[1] >> 14);
2848  *ptr++ = static_cast<uint8_t>(values[1] >> 6);
2849 
2850  *ptr = static_cast<uint8_t>(values[1] << 2);
2851  *ptr++ |= static_cast<uint8_t>(values[2] >> 57);
2852  *ptr++ = static_cast<uint8_t>(values[2] >> 49);
2853  *ptr++ = static_cast<uint8_t>(values[2] >> 41);
2854  *ptr++ = static_cast<uint8_t>(values[2] >> 33);
2855  *ptr++ = static_cast<uint8_t>(values[2] >> 25);
2856  *ptr++ = static_cast<uint8_t>(values[2] >> 17);
2857  *ptr++ = static_cast<uint8_t>(values[2] >> 9);
2858  *ptr++ = static_cast<uint8_t>(values[2] >> 1);
2859 
2860  *ptr = static_cast<uint8_t>(values[2] << 7);
2861  *ptr++ |= static_cast<uint8_t>(values[3] >> 52);
2862  *ptr++ = static_cast<uint8_t>(values[3] >> 44);
2863  *ptr++ = static_cast<uint8_t>(values[3] >> 36);
2864  *ptr++ = static_cast<uint8_t>(values[3] >> 28);
2865  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
2866  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
2867  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
2868 
2869  *ptr = static_cast<uint8_t>(values[3] << 4);
2870  *ptr++ |= static_cast<uint8_t>(values[4] >> 55);
2871  *ptr++ = static_cast<uint8_t>(values[4] >> 47);
2872  *ptr++ = static_cast<uint8_t>(values[4] >> 39);
2873  *ptr++ = static_cast<uint8_t>(values[4] >> 31);
2874  *ptr++ = static_cast<uint8_t>(values[4] >> 23);
2875  *ptr++ = static_cast<uint8_t>(values[4] >> 15);
2876  *ptr++ = static_cast<uint8_t>(values[4] >> 7);
2877 
2878  *ptr = static_cast<uint8_t>(values[4] << 1);
2879  *ptr++ |= static_cast<uint8_t>(values[5] >> 58);
2880  *ptr++ = static_cast<uint8_t>(values[5] >> 50);
2881  *ptr++ = static_cast<uint8_t>(values[5] >> 42);
2882  *ptr++ = static_cast<uint8_t>(values[5] >> 34);
2883  *ptr++ = static_cast<uint8_t>(values[5] >> 26);
2884  *ptr++ = static_cast<uint8_t>(values[5] >> 18);
2885  *ptr++ = static_cast<uint8_t>(values[5] >> 10);
2886  *ptr++ = static_cast<uint8_t>(values[5] >> 2);
2887 
2888  *ptr = static_cast<uint8_t>(values[5] << 6);
2889  *ptr++ |= static_cast<uint8_t>(values[6] >> 53);
2890  *ptr++ = static_cast<uint8_t>(values[6] >> 45);
2891  *ptr++ = static_cast<uint8_t>(values[6] >> 37);
2892  *ptr++ = static_cast<uint8_t>(values[6] >> 29);
2893  *ptr++ = static_cast<uint8_t>(values[6] >> 21);
2894  *ptr++ = static_cast<uint8_t>(values[6] >> 13);
2895  *ptr++ = static_cast<uint8_t>(values[6] >> 5);
2896 
2897  *ptr = static_cast<uint8_t>(values[6] << 3);
2898  *ptr++ |= static_cast<uint8_t>(values[7] >> 56);
2899  *ptr++ = static_cast<uint8_t>(values[7] >> 48);
2900  *ptr++ = static_cast<uint8_t>(values[7] >> 40);
2901  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
2902  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
2903  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
2904  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
2905  *ptr = static_cast<uint8_t>(values[7]);
2906 }
2907 
2908 static inline void pack_bits_60(const uint64_t* values, uint8_t* ptr) {
2909  *ptr++ = static_cast<uint8_t>(values[0] >> 52);
2910  *ptr++ = static_cast<uint8_t>(values[0] >> 44);
2911  *ptr++ = static_cast<uint8_t>(values[0] >> 36);
2912  *ptr++ = static_cast<uint8_t>(values[0] >> 28);
2913  *ptr++ = static_cast<uint8_t>(values[0] >> 20);
2914  *ptr++ = static_cast<uint8_t>(values[0] >> 12);
2915  *ptr++ = static_cast<uint8_t>(values[0] >> 4);
2916 
2917  *ptr = static_cast<uint8_t>(values[0] << 4);
2918  *ptr++ |= static_cast<uint8_t>(values[1] >> 56);
2919  *ptr++ = static_cast<uint8_t>(values[1] >> 48);
2920  *ptr++ = static_cast<uint8_t>(values[1] >> 40);
2921  *ptr++ = static_cast<uint8_t>(values[1] >> 32);
2922  *ptr++ = static_cast<uint8_t>(values[1] >> 24);
2923  *ptr++ = static_cast<uint8_t>(values[1] >> 16);
2924  *ptr++ = static_cast<uint8_t>(values[1] >> 8);
2925  *ptr++ = static_cast<uint8_t>(values[1]);
2926 
2927  *ptr++ = static_cast<uint8_t>(values[2] >> 52);
2928  *ptr++ = static_cast<uint8_t>(values[2] >> 44);
2929  *ptr++ = static_cast<uint8_t>(values[2] >> 36);
2930  *ptr++ = static_cast<uint8_t>(values[2] >> 28);
2931  *ptr++ = static_cast<uint8_t>(values[2] >> 20);
2932  *ptr++ = static_cast<uint8_t>(values[2] >> 12);
2933  *ptr++ = static_cast<uint8_t>(values[2] >> 4);
2934 
2935  *ptr = static_cast<uint8_t>(values[2] << 4);
2936  *ptr++ |= static_cast<uint8_t>(values[3] >> 56);
2937  *ptr++ = static_cast<uint8_t>(values[3] >> 48);
2938  *ptr++ = static_cast<uint8_t>(values[3] >> 40);
2939  *ptr++ = static_cast<uint8_t>(values[3] >> 32);
2940  *ptr++ = static_cast<uint8_t>(values[3] >> 24);
2941  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
2942  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
2943  *ptr++ = static_cast<uint8_t>(values[3]);
2944 
2945  *ptr++ = static_cast<uint8_t>(values[4] >> 52);
2946  *ptr++ = static_cast<uint8_t>(values[4] >> 44);
2947  *ptr++ = static_cast<uint8_t>(values[4] >> 36);
2948  *ptr++ = static_cast<uint8_t>(values[4] >> 28);
2949  *ptr++ = static_cast<uint8_t>(values[4] >> 20);
2950  *ptr++ = static_cast<uint8_t>(values[4] >> 12);
2951  *ptr++ = static_cast<uint8_t>(values[4] >> 4);
2952 
2953  *ptr = static_cast<uint8_t>(values[4] << 4);
2954  *ptr++ |= static_cast<uint8_t>(values[5] >> 56);
2955  *ptr++ = static_cast<uint8_t>(values[5] >> 48);
2956  *ptr++ = static_cast<uint8_t>(values[5] >> 40);
2957  *ptr++ = static_cast<uint8_t>(values[5] >> 32);
2958  *ptr++ = static_cast<uint8_t>(values[5] >> 24);
2959  *ptr++ = static_cast<uint8_t>(values[5] >> 16);
2960  *ptr++ = static_cast<uint8_t>(values[5] >> 8);
2961  *ptr++ = static_cast<uint8_t>(values[5]);
2962 
2963  *ptr++ = static_cast<uint8_t>(values[6] >> 52);
2964  *ptr++ = static_cast<uint8_t>(values[6] >> 44);
2965  *ptr++ = static_cast<uint8_t>(values[6] >> 36);
2966  *ptr++ = static_cast<uint8_t>(values[6] >> 28);
2967  *ptr++ = static_cast<uint8_t>(values[6] >> 20);
2968  *ptr++ = static_cast<uint8_t>(values[6] >> 12);
2969  *ptr++ = static_cast<uint8_t>(values[6] >> 4);
2970 
2971  *ptr = static_cast<uint8_t>(values[6] << 4);
2972  *ptr++ |= static_cast<uint8_t>(values[7] >> 56);
2973  *ptr++ = static_cast<uint8_t>(values[7] >> 48);
2974  *ptr++ = static_cast<uint8_t>(values[7] >> 40);
2975  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
2976  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
2977  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
2978  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
2979  *ptr = static_cast<uint8_t>(values[7]);
2980 }
2981 
2982 static inline void pack_bits_61(const uint64_t* values, uint8_t* ptr) {
2983  *ptr++ = static_cast<uint8_t>(values[0] >> 53);
2984  *ptr++ = static_cast<uint8_t>(values[0] >> 45);
2985  *ptr++ = static_cast<uint8_t>(values[0] >> 37);
2986  *ptr++ = static_cast<uint8_t>(values[0] >> 29);
2987  *ptr++ = static_cast<uint8_t>(values[0] >> 21);
2988  *ptr++ = static_cast<uint8_t>(values[0] >> 13);
2989  *ptr++ = static_cast<uint8_t>(values[0] >> 5);
2990 
2991  *ptr = static_cast<uint8_t>(values[0] << 3);
2992  *ptr++ |= static_cast<uint8_t>(values[1] >> 58);
2993  *ptr++ = static_cast<uint8_t>(values[1] >> 50);
2994  *ptr++ = static_cast<uint8_t>(values[1] >> 42);
2995  *ptr++ = static_cast<uint8_t>(values[1] >> 34);
2996  *ptr++ = static_cast<uint8_t>(values[1] >> 26);
2997  *ptr++ = static_cast<uint8_t>(values[1] >> 18);
2998  *ptr++ = static_cast<uint8_t>(values[1] >> 10);
2999  *ptr++ = static_cast<uint8_t>(values[1] >> 2);
3000 
3001  *ptr = static_cast<uint8_t>(values[1] << 6);
3002  *ptr++ |= static_cast<uint8_t>(values[2] >> 55);
3003  *ptr++ = static_cast<uint8_t>(values[2] >> 47);
3004  *ptr++ = static_cast<uint8_t>(values[2] >> 39);
3005  *ptr++ = static_cast<uint8_t>(values[2] >> 31);
3006  *ptr++ = static_cast<uint8_t>(values[2] >> 23);
3007  *ptr++ = static_cast<uint8_t>(values[2] >> 15);
3008  *ptr++ = static_cast<uint8_t>(values[2] >> 7);
3009 
3010  *ptr = static_cast<uint8_t>(values[2] << 1);
3011  *ptr++ |= static_cast<uint8_t>(values[3] >> 60);
3012  *ptr++ = static_cast<uint8_t>(values[3] >> 52);
3013  *ptr++ = static_cast<uint8_t>(values[3] >> 44);
3014  *ptr++ = static_cast<uint8_t>(values[3] >> 36);
3015  *ptr++ = static_cast<uint8_t>(values[3] >> 28);
3016  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
3017  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
3018  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
3019 
3020  *ptr = static_cast<uint8_t>(values[3] << 4);
3021  *ptr++ |= static_cast<uint8_t>(values[4] >> 57);
3022  *ptr++ = static_cast<uint8_t>(values[4] >> 49);
3023  *ptr++ = static_cast<uint8_t>(values[4] >> 41);
3024  *ptr++ = static_cast<uint8_t>(values[4] >> 33);
3025  *ptr++ = static_cast<uint8_t>(values[4] >> 25);
3026  *ptr++ = static_cast<uint8_t>(values[4] >> 17);
3027  *ptr++ = static_cast<uint8_t>(values[4] >> 9);
3028  *ptr++ = static_cast<uint8_t>(values[4] >> 1);
3029 
3030  *ptr = static_cast<uint8_t>(values[4] << 7);
3031  *ptr++ |= static_cast<uint8_t>(values[5] >> 54);
3032  *ptr++ = static_cast<uint8_t>(values[5] >> 46);
3033  *ptr++ = static_cast<uint8_t>(values[5] >> 38);
3034  *ptr++ = static_cast<uint8_t>(values[5] >> 30);
3035  *ptr++ = static_cast<uint8_t>(values[5] >> 22);
3036  *ptr++ = static_cast<uint8_t>(values[5] >> 14);
3037  *ptr++ = static_cast<uint8_t>(values[5] >> 6);
3038 
3039  *ptr = static_cast<uint8_t>(values[5] << 2);
3040  *ptr++ |= static_cast<uint8_t>(values[6] >> 59);
3041  *ptr++ = static_cast<uint8_t>(values[6] >> 51);
3042  *ptr++ = static_cast<uint8_t>(values[6] >> 43);
3043  *ptr++ = static_cast<uint8_t>(values[6] >> 35);
3044  *ptr++ = static_cast<uint8_t>(values[6] >> 27);
3045  *ptr++ = static_cast<uint8_t>(values[6] >> 19);
3046  *ptr++ = static_cast<uint8_t>(values[6] >> 11);
3047  *ptr++ = static_cast<uint8_t>(values[6] >> 3);
3048 
3049  *ptr = static_cast<uint8_t>(values[6] << 5);
3050  *ptr++ |= static_cast<uint8_t>(values[7] >> 56);
3051  *ptr++ = static_cast<uint8_t>(values[7] >> 48);
3052  *ptr++ = static_cast<uint8_t>(values[7] >> 40);
3053  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
3054  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
3055  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
3056  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
3057  *ptr = static_cast<uint8_t>(values[7]);
3058 }
3059 
3060 static inline void pack_bits_62(const uint64_t* values, uint8_t* ptr) {
3061  *ptr++ = static_cast<uint8_t>(values[0] >> 54);
3062  *ptr++ = static_cast<uint8_t>(values[0] >> 46);
3063  *ptr++ = static_cast<uint8_t>(values[0] >> 38);
3064  *ptr++ = static_cast<uint8_t>(values[0] >> 30);
3065  *ptr++ = static_cast<uint8_t>(values[0] >> 22);
3066  *ptr++ = static_cast<uint8_t>(values[0] >> 14);
3067  *ptr++ = static_cast<uint8_t>(values[0] >> 6);
3068 
3069  *ptr = static_cast<uint8_t>(values[0] << 2);
3070  *ptr++ |= static_cast<uint8_t>(values[1] >> 60);
3071  *ptr++ = static_cast<uint8_t>(values[1] >> 52);
3072  *ptr++ = static_cast<uint8_t>(values[1] >> 44);
3073  *ptr++ = static_cast<uint8_t>(values[1] >> 36);
3074  *ptr++ = static_cast<uint8_t>(values[1] >> 28);
3075  *ptr++ = static_cast<uint8_t>(values[1] >> 20);
3076  *ptr++ = static_cast<uint8_t>(values[1] >> 12);
3077  *ptr++ = static_cast<uint8_t>(values[1] >> 4);
3078 
3079  *ptr = static_cast<uint8_t>(values[1] << 4);
3080  *ptr++ |= static_cast<uint8_t>(values[2] >> 58);
3081  *ptr++ = static_cast<uint8_t>(values[2] >> 50);
3082  *ptr++ = static_cast<uint8_t>(values[2] >> 42);
3083  *ptr++ = static_cast<uint8_t>(values[2] >> 34);
3084  *ptr++ = static_cast<uint8_t>(values[2] >> 26);
3085  *ptr++ = static_cast<uint8_t>(values[2] >> 18);
3086  *ptr++ = static_cast<uint8_t>(values[2] >> 10);
3087  *ptr++ = static_cast<uint8_t>(values[2] >> 2);
3088 
3089  *ptr = static_cast<uint8_t>(values[2] << 6);
3090  *ptr++ |= static_cast<uint8_t>(values[3] >> 56);
3091  *ptr++ = static_cast<uint8_t>(values[3] >> 48);
3092  *ptr++ = static_cast<uint8_t>(values[3] >> 40);
3093  *ptr++ = static_cast<uint8_t>(values[3] >> 32);
3094  *ptr++ = static_cast<uint8_t>(values[3] >> 24);
3095  *ptr++ = static_cast<uint8_t>(values[3] >> 16);
3096  *ptr++ = static_cast<uint8_t>(values[3] >> 8);
3097  *ptr++ = static_cast<uint8_t>(values[3]);
3098 
3099  *ptr++ = static_cast<uint8_t>(values[4] >> 54);
3100  *ptr++ = static_cast<uint8_t>(values[4] >> 46);
3101  *ptr++ = static_cast<uint8_t>(values[4] >> 38);
3102  *ptr++ = static_cast<uint8_t>(values[4] >> 30);
3103  *ptr++ = static_cast<uint8_t>(values[4] >> 22);
3104  *ptr++ = static_cast<uint8_t>(values[4] >> 14);
3105  *ptr++ = static_cast<uint8_t>(values[4] >> 6);
3106 
3107  *ptr = static_cast<uint8_t>(values[4] << 2);
3108  *ptr++ |= static_cast<uint8_t>(values[5] >> 60);
3109  *ptr++ = static_cast<uint8_t>(values[5] >> 52);
3110  *ptr++ = static_cast<uint8_t>(values[5] >> 44);
3111  *ptr++ = static_cast<uint8_t>(values[5] >> 36);
3112  *ptr++ = static_cast<uint8_t>(values[5] >> 28);
3113  *ptr++ = static_cast<uint8_t>(values[5] >> 20);
3114  *ptr++ = static_cast<uint8_t>(values[5] >> 12);
3115  *ptr++ = static_cast<uint8_t>(values[5] >> 4);
3116 
3117  *ptr = static_cast<uint8_t>(values[5] << 4);
3118  *ptr++ |= static_cast<uint8_t>(values[6] >> 58);
3119  *ptr++ = static_cast<uint8_t>(values[6] >> 50);
3120  *ptr++ = static_cast<uint8_t>(values[6] >> 42);
3121  *ptr++ = static_cast<uint8_t>(values[6] >> 34);
3122  *ptr++ = static_cast<uint8_t>(values[6] >> 26);
3123  *ptr++ = static_cast<uint8_t>(values[6] >> 18);
3124  *ptr++ = static_cast<uint8_t>(values[6] >> 10);
3125  *ptr++ = static_cast<uint8_t>(values[6] >> 2);
3126 
3127  *ptr = static_cast<uint8_t>(values[6] << 6);
3128  *ptr++ |= static_cast<uint8_t>(values[7] >> 56);
3129  *ptr++ = static_cast<uint8_t>(values[7] >> 48);
3130  *ptr++ = static_cast<uint8_t>(values[7] >> 40);
3131  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
3132  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
3133  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
3134  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
3135  *ptr = static_cast<uint8_t>(values[7]);
3136 }
3137 
3138 static inline void pack_bits_63(const uint64_t* values, uint8_t* ptr) {
3139  *ptr++ = static_cast<uint8_t>(values[0] >> 55);
3140  *ptr++ = static_cast<uint8_t>(values[0] >> 47);
3141  *ptr++ = static_cast<uint8_t>(values[0] >> 39);
3142  *ptr++ = static_cast<uint8_t>(values[0] >> 31);
3143  *ptr++ = static_cast<uint8_t>(values[0] >> 23);
3144  *ptr++ = static_cast<uint8_t>(values[0] >> 15);
3145  *ptr++ = static_cast<uint8_t>(values[0] >> 7);
3146 
3147  *ptr = static_cast<uint8_t>(values[0] << 1);
3148  *ptr++ |= static_cast<uint8_t>(values[1] >> 62);
3149  *ptr++ = static_cast<uint8_t>(values[1] >> 54);
3150  *ptr++ = static_cast<uint8_t>(values[1] >> 46);
3151  *ptr++ = static_cast<uint8_t>(values[1] >> 38);
3152  *ptr++ = static_cast<uint8_t>(values[1] >> 30);
3153  *ptr++ = static_cast<uint8_t>(values[1] >> 22);
3154  *ptr++ = static_cast<uint8_t>(values[1] >> 14);
3155  *ptr++ = static_cast<uint8_t>(values[1] >> 6);
3156 
3157  *ptr = static_cast<uint8_t>(values[1] << 2);
3158  *ptr++ |= static_cast<uint8_t>(values[2] >> 61);
3159  *ptr++ = static_cast<uint8_t>(values[2] >> 53);
3160  *ptr++ = static_cast<uint8_t>(values[2] >> 45);
3161  *ptr++ = static_cast<uint8_t>(values[2] >> 37);
3162  *ptr++ = static_cast<uint8_t>(values[2] >> 29);
3163  *ptr++ = static_cast<uint8_t>(values[2] >> 21);
3164  *ptr++ = static_cast<uint8_t>(values[2] >> 13);
3165  *ptr++ = static_cast<uint8_t>(values[2] >> 5);
3166 
3167  *ptr = static_cast<uint8_t>(values[2] << 3);
3168  *ptr++ |= static_cast<uint8_t>(values[3] >> 60);
3169  *ptr++ = static_cast<uint8_t>(values[3] >> 52);
3170  *ptr++ = static_cast<uint8_t>(values[3] >> 44);
3171  *ptr++ = static_cast<uint8_t>(values[3] >> 36);
3172  *ptr++ = static_cast<uint8_t>(values[3] >> 28);
3173  *ptr++ = static_cast<uint8_t>(values[3] >> 20);
3174  *ptr++ = static_cast<uint8_t>(values[3] >> 12);
3175  *ptr++ = static_cast<uint8_t>(values[3] >> 4);
3176 
3177  *ptr = static_cast<uint8_t>(values[3] << 4);
3178  *ptr++ |= static_cast<uint8_t>(values[4] >> 59);
3179  *ptr++ = static_cast<uint8_t>(values[4] >> 51);
3180  *ptr++ = static_cast<uint8_t>(values[4] >> 43);
3181  *ptr++ = static_cast<uint8_t>(values[4] >> 35);
3182  *ptr++ = static_cast<uint8_t>(values[4] >> 27);
3183  *ptr++ = static_cast<uint8_t>(values[4] >> 19);
3184  *ptr++ = static_cast<uint8_t>(values[4] >> 11);
3185  *ptr++ = static_cast<uint8_t>(values[4] >> 3);
3186 
3187  *ptr = static_cast<uint8_t>(values[4] << 5);
3188  *ptr++ |= static_cast<uint8_t>(values[5] >> 58);
3189  *ptr++ = static_cast<uint8_t>(values[5] >> 50);
3190  *ptr++ = static_cast<uint8_t>(values[5] >> 42);
3191  *ptr++ = static_cast<uint8_t>(values[5] >> 34);
3192  *ptr++ = static_cast<uint8_t>(values[5] >> 26);
3193  *ptr++ = static_cast<uint8_t>(values[5] >> 18);
3194  *ptr++ = static_cast<uint8_t>(values[5] >> 10);
3195  *ptr++ = static_cast<uint8_t>(values[5] >> 2);
3196 
3197  *ptr = static_cast<uint8_t>(values[5] << 6);
3198  *ptr++ |= static_cast<uint8_t>(values[6] >> 57);
3199  *ptr++ = static_cast<uint8_t>(values[6] >> 49);
3200  *ptr++ = static_cast<uint8_t>(values[6] >> 41);
3201  *ptr++ = static_cast<uint8_t>(values[6] >> 33);
3202  *ptr++ = static_cast<uint8_t>(values[6] >> 25);
3203  *ptr++ = static_cast<uint8_t>(values[6] >> 17);
3204  *ptr++ = static_cast<uint8_t>(values[6] >> 9);
3205  *ptr++ = static_cast<uint8_t>(values[6] >> 1);
3206 
3207  *ptr = static_cast<uint8_t>(values[6] << 7);
3208  *ptr++ |= static_cast<uint8_t>(values[7] >> 56);
3209  *ptr++ = static_cast<uint8_t>(values[7] >> 48);
3210  *ptr++ = static_cast<uint8_t>(values[7] >> 40);
3211  *ptr++ = static_cast<uint8_t>(values[7] >> 32);
3212  *ptr++ = static_cast<uint8_t>(values[7] >> 24);
3213  *ptr++ = static_cast<uint8_t>(values[7] >> 16);
3214  *ptr++ = static_cast<uint8_t>(values[7] >> 8);
3215  *ptr = static_cast<uint8_t>(values[7]);
3216 }
3217 
3218 static inline void unpack_bits_1(uint64_t* values, const uint8_t* ptr) {
3219  values[0] = *ptr >> 7;
3220  values[1] = (*ptr >> 6) & 1;
3221  values[2] = (*ptr >> 5) & 1;
3222  values[3] = (*ptr >> 4) & 1;
3223  values[4] = (*ptr >> 3) & 1;
3224  values[5] = (*ptr >> 2) & 1;
3225  values[6] = (*ptr >> 1) & 1;
3226  values[7] = *ptr & 1;
3227 }
3228 
3229 static inline void unpack_bits_2(uint64_t* values, const uint8_t* ptr) {
3230  values[0] = *ptr >> 6;
3231  values[1] = (*ptr >> 4) & 3;
3232  values[2] = (*ptr >> 2) & 3;
3233  values[3] = *ptr++ & 3;
3234  values[4] = *ptr >> 6;
3235  values[5] = (*ptr >> 4) & 3;
3236  values[6] = (*ptr >> 2) & 3;
3237  values[7] = *ptr & 3;
3238 }
3239 
3240 static inline void unpack_bits_3(uint64_t* values, const uint8_t* ptr) {
3241  values[0] = *ptr >> 5;
3242  values[1] = (*ptr >> 2) & 7;
3243  values[2] = (*ptr++ & 3) << 1;
3244  values[2] |= *ptr >> 7;
3245  values[3] = (*ptr >> 4) & 7;
3246  values[4] = (*ptr >> 1) & 7;
3247  values[5] = (*ptr++ & 1) << 2;
3248  values[5] |= *ptr >> 6;
3249  values[6] = (*ptr >> 3) & 7;
3250  values[7] = *ptr & 7;
3251 }
3252 
3253 static inline void unpack_bits_4(uint64_t* values, const uint8_t* ptr) {
3254  values[0] = *ptr >> 4;
3255  values[1] = *ptr++ & 0xf;
3256  values[2] = *ptr >> 4;
3257  values[3] = *ptr++ & 0xf;
3258  values[4] = *ptr >> 4;
3259  values[5] = *ptr++ & 0xf;
3260  values[6] = *ptr >> 4;
3261  values[7] = *ptr & 0xf;
3262 }
3263 
3264 static inline void unpack_bits_5(uint64_t* values, const uint8_t* ptr) {
3265  values[0] = *ptr >> 3;
3266 
3267  values[1] = (*ptr++ & 7) << 2;
3268  values[1] |= *ptr >> 6;
3269 
3270  values[2] = (*ptr >> 1) & 0x1f;
3271 
3272  values[3] = (*ptr++ & 1) << 4;
3273  values[3] |= *ptr >> 4;
3274 
3275  values[4] = (*ptr++ & 0xf) << 1;
3276  values[4] |= *ptr >> 7;
3277 
3278  values[5] = (*ptr >> 2) & 0x1f;
3279 
3280  values[6] = (*ptr++ & 3) << 3;
3281  values[6] |= *ptr >> 5;
3282 
3283  values[7] = *ptr & 0x1f;
3284 }
3285 
3286 static inline void unpack_bits_6(uint64_t* values, const uint8_t* ptr) {
3287  values[0] = *ptr >> 2;
3288 
3289  values[1] = (*ptr++ & 3) << 4;
3290  values[1] |= *ptr >> 4;
3291 
3292  values[2] = (*ptr++ & 0xf) << 2;
3293  values[2] |= *ptr >> 6;
3294 
3295  values[3] = *ptr++ & 0x3f;
3296 
3297  values[4] = *ptr >> 2;
3298 
3299  values[5] = (*ptr++ & 3) << 4;
3300  values[5] |= *ptr >> 4;
3301 
3302  values[6] = (*ptr++ & 0xf) << 2;
3303  values[6] |= *ptr >> 6;
3304 
3305  values[7] = *ptr & 0x3f;
3306 }
3307 
3308 static inline void unpack_bits_7(uint64_t* values, const uint8_t* ptr) {
3309  values[0] = *ptr >> 1;
3310 
3311  values[1] = (*ptr++ & 1) << 6;
3312  values[1] |= *ptr >> 2;
3313 
3314  values[2] = (*ptr++ & 3) << 5;
3315  values[2] |= *ptr >> 3;
3316 
3317  values[3] = (*ptr++ & 7) << 4;
3318  values[3] |= *ptr >> 4;
3319 
3320  values[4] = (*ptr++ & 0xf) << 3;
3321  values[4] |= *ptr >> 5;
3322 
3323  values[5] = (*ptr++ & 0x1f) << 2;
3324  values[5] |= *ptr >> 6;
3325 
3326  values[6] = (*ptr++ & 0x3f) << 1;
3327  values[6] |= *ptr >> 7;
3328 
3329  values[7] = *ptr & 0x7f;
3330 }
3331 
3332 static inline void unpack_bits_8(uint64_t* values, const uint8_t* ptr) {
3333  values[0] = *ptr++;
3334  values[1] = *ptr++;
3335  values[2] = *ptr++;
3336  values[3] = *ptr++;
3337  values[4] = *ptr++;
3338  values[5] = *ptr++;
3339  values[6] = *ptr++;
3340  values[7] = *ptr;
3341 }
3342 
3343 static inline void unpack_bits_9(uint64_t* values, const uint8_t* ptr) {
3344  values[0] = *ptr++ << 1;
3345  values[0] |= *ptr >> 7;
3346 
3347  values[1] = (*ptr++ & 0x7f) << 2;
3348  values[1] |= *ptr >> 6;
3349 
3350  values[2] = (*ptr++ & 0x3f) << 3;
3351  values[2] |= *ptr >> 5;
3352 
3353  values[3] = (*ptr++ & 0x1f) << 4;
3354  values[3] |= *ptr >> 4;
3355 
3356  values[4] = (*ptr++ & 0xf) << 5;
3357  values[4] |= *ptr >> 3;
3358 
3359  values[5] = (*ptr++ & 7) << 6;
3360  values[5] |= *ptr >> 2;
3361 
3362  values[6] = (*ptr++ & 3) << 7;
3363  values[6] |= *ptr >> 1;
3364 
3365  values[7] = (*ptr++ & 1) << 8;
3366  values[7] |= *ptr;
3367 }
3368 
3369 static inline void unpack_bits_10(uint64_t* values, const uint8_t* ptr) {
3370  values[0] = *ptr++ << 2;
3371  values[0] |= *ptr >> 6;
3372 
3373  values[1] = (*ptr++ & 0x3f) << 4;
3374  values[1] |= *ptr >> 4;
3375 
3376  values[2] = (*ptr++ & 0xf) << 6;
3377  values[2] |= *ptr >> 2;
3378 
3379  values[3] = (*ptr++ & 3) << 8;
3380  values[3] |= *ptr++;
3381 
3382  values[4] = *ptr++ << 2;
3383  values[4] |= *ptr >> 6;
3384 
3385  values[5] = (*ptr++ & 0x3f) << 4;
3386  values[5] |= *ptr >> 4;
3387 
3388  values[6] = (*ptr++ & 0xf) << 6;
3389  values[6] |= *ptr >> 2;
3390 
3391  values[7] = (*ptr++ & 3) << 8;
3392  values[7] |= *ptr;
3393 }
3394 
3395 static inline void unpack_bits_11(uint64_t* values, const uint8_t* ptr) {
3396  values[0] = *ptr++ << 3;
3397  values[0] |= *ptr >> 5;
3398 
3399  values[1] = (*ptr++ & 0x1f) << 6;
3400  values[1] |= *ptr >> 2;
3401 
3402  values[2] = (*ptr++ & 3) << 9;
3403  values[2] |= *ptr++ << 1;
3404  values[2] |= *ptr >> 7;
3405 
3406  values[3] = (*ptr++ & 0x7f) << 4;
3407  values[3] |= *ptr >> 4;
3408 
3409  values[4] = (*ptr++ & 0xf) << 7;
3410  values[4] |= *ptr >> 1;
3411 
3412  values[5] = (*ptr++ & 1) << 10;
3413  values[5] |= *ptr++ << 2;
3414  values[5] |= *ptr >> 6;
3415 
3416  values[6] = (*ptr++ & 0x3f) << 5;
3417  values[6] |= *ptr >> 3;
3418 
3419  values[7] = (*ptr++ & 7) << 8;
3420  values[7] |= *ptr;
3421 }
3422 
3423 static inline void unpack_bits_12(uint64_t* values, const uint8_t* ptr) {
3424  values[0] = *ptr++ << 4;
3425  values[0] |= *ptr >> 4;
3426 
3427  values[1] = (*ptr++ & 0xf) << 8;
3428  values[1] |= *ptr++;
3429 
3430  values[2] = *ptr++ << 4;
3431  values[2] |= *ptr >> 4;
3432 
3433  values[3] = (*ptr++ & 0xf) << 8;
3434  values[3] |= *ptr++;
3435 
3436  values[4] = *ptr++ << 4;
3437  values[4] |= *ptr >> 4;
3438 
3439  values[5] = (*ptr++ & 0xf) << 8;
3440  values[5] |= *ptr++;
3441 
3442  values[6] = *ptr++ << 4;
3443  values[6] |= *ptr >> 4;
3444 
3445  values[7] = (*ptr++ & 0xf) << 8;
3446  values[7] |= *ptr;
3447 }
3448 
3449 static inline void unpack_bits_13(uint64_t* values, const uint8_t* ptr) {
3450  values[0] = *ptr++ << 5;
3451  values[0] |= *ptr >> 3;
3452 
3453  values[1] = (*ptr++ & 7) << 10;
3454  values[1] |= *ptr++ << 2;
3455  values[1] |= *ptr >> 6;
3456 
3457  values[2] = (*ptr++ & 0x3f) << 7;
3458  values[2] |= *ptr >> 1;
3459 
3460  values[3] = (*ptr++ & 1) << 12;
3461  values[3] |= *ptr++ << 4;
3462  values[3] |= *ptr >> 4;
3463 
3464  values[4] = (*ptr++ & 0xf) << 9;
3465  values[4] |= *ptr++ << 1;
3466  values[4] |= *ptr >> 7;
3467 
3468  values[5] = (*ptr++ & 0x7f) << 6;
3469  values[5] |= *ptr >> 2;
3470 
3471  values[6] = (*ptr++ & 3) << 11;
3472  values[6] |= *ptr++ << 3;
3473  values[6] |= *ptr >> 5;
3474 
3475  values[7] = (*ptr++ & 0x1f) << 8;
3476  values[7] |= *ptr;
3477 }
3478 
3479 static inline void unpack_bits_14(uint64_t* values, const uint8_t* ptr) {
3480  values[0] = *ptr++ << 6;
3481  values[0] |= *ptr >> 2;
3482 
3483  values[1] = (*ptr++ & 3) << 12;
3484  values[1] |= *ptr++ << 4;
3485  values[1] |= *ptr >> 4;
3486 
3487  values[2] = (*ptr++ & 0xf) << 10;
3488  values[2] |= *ptr++ << 2;
3489  values[2] |= *ptr >> 6;
3490 
3491  values[3] = (*ptr++ & 0x3f) << 8;
3492  values[3] |= *ptr++;
3493 
3494  values[4] = *ptr++ << 6;
3495  values[4] |= *ptr >> 2;
3496 
3497  values[5] = (*ptr++ & 3) << 12;
3498  values[5] |= *ptr++ << 4;
3499  values[5] |= *ptr >> 4;
3500 
3501  values[6] = (*ptr++ & 0xf) << 10;
3502  values[6] |= *ptr++ << 2;
3503  values[6] |= *ptr >> 6;
3504 
3505  values[7] = (*ptr++ & 0x3f) << 8;
3506  values[7] |= *ptr;
3507 }
3508 
3509 static inline void unpack_bits_15(uint64_t* values, const uint8_t* ptr) {
3510  values[0] = *ptr++ << 7;
3511  values[0] |= *ptr >> 1;
3512 
3513  values[1] = (*ptr++ & 1) << 14;
3514  values[1] |= *ptr++ << 6;
3515  values[1] |= *ptr >> 2;
3516 
3517  values[2] = (*ptr++ & 3) << 13;
3518  values[2] |= *ptr++ << 5;
3519  values[2] |= *ptr >> 3;
3520 
3521  values[3] = (*ptr++ & 7) << 12;
3522  values[3] |= *ptr++ << 4;
3523  values[3] |= *ptr >> 4;
3524 
3525  values[4] = (*ptr++ & 0xf) << 11;
3526  values[4] |= *ptr++ << 3;
3527  values[4] |= *ptr >> 5;
3528 
3529  values[5] = (*ptr++ & 0x1f) << 10;
3530  values[5] |= *ptr++ << 2;
3531  values[5] |= *ptr >> 6;
3532 
3533  values[6] = (*ptr++ & 0x3f) << 9;
3534  values[6] |= *ptr++ << 1;
3535  values[6] |= *ptr >> 7;
3536 
3537  values[7] = (*ptr++ & 0x7f) << 8;
3538  values[7] |= *ptr;
3539 }
3540 
3541 static inline void unpack_bits_16(uint64_t* values, const uint8_t* ptr) {
3542  values[0] = *ptr++ << 8;
3543  values[0] |= *ptr++;
3544  values[1] = *ptr++ << 8;
3545  values[1] |= *ptr++;
3546  values[2] = *ptr++ << 8;
3547  values[2] |= *ptr++;
3548  values[3] = *ptr++ << 8;
3549  values[3] |= *ptr++;
3550  values[4] = *ptr++ << 8;
3551  values[4] |= *ptr++;
3552  values[5] = *ptr++ << 8;
3553  values[5] |= *ptr++;
3554  values[6] = *ptr++ << 8;
3555  values[6] |= *ptr++;
3556  values[7] = *ptr++ << 8;
3557  values[7] |= *ptr;
3558 }
3559 
3560 static inline void unpack_bits_17(uint64_t* values, const uint8_t* ptr) {
3561  values[0] = *ptr++ << 9;
3562  values[0] |= *ptr++ << 1;
3563  values[0] |= *ptr >> 7;
3564 
3565  values[1] = (*ptr++ & 0x7f) << 10;
3566  values[1] |= *ptr++ << 2;
3567  values[1] |= *ptr >> 6;
3568 
3569  values[2] = (*ptr++ & 0x3f) << 11;
3570  values[2] |= *ptr++ << 3;
3571  values[2] |= *ptr >> 5;
3572 
3573  values[3] = (*ptr++ & 0x1f) << 12;
3574  values[3] |= *ptr++ << 4;
3575  values[3] |= *ptr >> 4;
3576 
3577  values[4] = (*ptr++ & 0xf) << 13;
3578  values[4] |= *ptr++ << 5;
3579  values[4] |= *ptr >> 3;
3580 
3581  values[5] = (*ptr++ & 7) << 14;
3582  values[5] |= *ptr++ << 6;
3583  values[5] |= *ptr >> 2;
3584 
3585  values[6] = (*ptr++ & 3) << 15;
3586  values[6] |= *ptr++ << 7;
3587  values[6] |= *ptr >> 1;
3588 
3589  values[7] = (*ptr++ & 1) << 16;
3590  values[7] |= *ptr++ << 8;
3591  values[7] |= *ptr;
3592 }
3593 
3594 static inline void unpack_bits_18(uint64_t* values, const uint8_t* ptr) {
3595  values[0] = *ptr++ << 10;
3596  values[0] |= *ptr++ << 2;
3597  values[0] |= *ptr >> 6;
3598 
3599  values[1] = (*ptr++ & 0x3f) << 12;
3600  values[1] |= *ptr++ << 4;
3601  values[1] |= *ptr >> 4;
3602 
3603  values[2] = (*ptr++ & 0xf) << 14;
3604  values[2] |= *ptr++ << 6;
3605  values[2] |= *ptr >> 2;
3606 
3607  values[3] = (*ptr++ & 3) << 16;
3608  values[3] |= *ptr++ << 8;
3609  values[3] |= *ptr++;
3610 
3611  values[4] = *ptr++ << 10;
3612  values[4] |= *ptr++ << 2;
3613  values[4] |= *ptr >> 6;
3614 
3615  values[5] = (*ptr++ & 0x3f) << 12;
3616  values[5] |= *ptr++ << 4;
3617  values[5] |= *ptr >> 4;
3618 
3619  values[6] = (*ptr++ & 0xf) << 14;
3620  values[6] |= *ptr++ << 6;
3621  values[6] |= *ptr >> 2;
3622 
3623  values[7] = (*ptr++ & 3) << 16;
3624  values[7] |= *ptr++ << 8;
3625  values[7] |= *ptr;
3626 }
3627 
3628 static inline void unpack_bits_19(uint64_t* values, const uint8_t* ptr) {
3629  values[0] = *ptr++ << 11;
3630  values[0] |= *ptr++ << 3;
3631  values[0] |= *ptr >> 5;
3632 
3633  values[1] = (*ptr++ & 0x1f) << 14;
3634  values[1] |= *ptr++ << 6;
3635  values[1] |= *ptr >> 2;
3636 
3637  values[2] = (*ptr++ & 3) << 17;
3638  values[2] |= *ptr++ << 9;
3639  values[2] |= *ptr++ << 1;
3640  values[2] |= *ptr >> 7;
3641 
3642  values[3] = (*ptr++ & 0x7f) << 12;
3643  values[3] |= *ptr++ << 4;
3644  values[3] |= *ptr >> 4;
3645 
3646  values[4] = (*ptr++ & 0xf) << 15;
3647  values[4] |= *ptr++ << 7;
3648  values[4] |= *ptr >> 1;
3649 
3650  values[5] = (*ptr++ & 1) << 18;
3651  values[5] |= *ptr++ << 10;
3652  values[5] |= *ptr++ << 2;
3653  values[5] |= *ptr >> 6;
3654 
3655  values[6] = (*ptr++ & 0x3f) << 13;
3656  values[6] |= *ptr++ << 5;
3657  values[6] |= *ptr >> 3;
3658 
3659  values[7] = (*ptr++ & 7) << 16;
3660  values[7] |= *ptr++ << 8;
3661  values[7] |= *ptr;
3662 }
3663 
3664 static inline void unpack_bits_20(uint64_t* values, const uint8_t* ptr) {
3665  values[0] = *ptr++ << 12;
3666  values[0] |= *ptr++ << 4;
3667  values[0] |= *ptr >> 4;
3668 
3669  values[1] = (*ptr++ & 0xf) << 16;
3670  values[1] |= *ptr++ << 8;
3671  values[1] |= *ptr++;
3672 
3673  values[2] = *ptr++ << 12;
3674  values[2] |= *ptr++ << 4;
3675  values[2] |= *ptr >> 4;
3676 
3677  values[3] = (*ptr++ & 0xf) << 16;
3678  values[3] |= *ptr++ << 8;
3679  values[3] |= *ptr++;
3680 
3681  values[4] = *ptr++ << 12;
3682  values[4] |= *ptr++ << 4;
3683  values[4] |= *ptr >> 4;
3684 
3685  values[5] = (*ptr++ & 0xf) << 16;
3686  values[5] |= *ptr++ << 8;
3687  values[5] |= *ptr++;
3688 
3689  values[6] = *ptr++ << 12;
3690  values[6] |= *ptr++ << 4;
3691  values[6] |= *ptr >> 4;
3692 
3693  values[7] = (*ptr++ & 0xf) << 16;
3694  values[7] |= *ptr++ << 8;
3695  values[7] |= *ptr;
3696 }
3697 
3698 static inline void unpack_bits_21(uint64_t* values, const uint8_t* ptr) {
3699  values[0] = *ptr++ << 13;
3700  values[0] |= *ptr++ << 5;
3701  values[0] |= *ptr >> 3;
3702 
3703  values[1] = (*ptr++ & 7) << 18;
3704  values[1] |= *ptr++ << 10;
3705  values[1] |= *ptr++ << 2;
3706  values[1] |= *ptr >> 6;
3707 
3708  values[2] = (*ptr++ & 0x3f) << 15;
3709  values[2] |= *ptr++ << 7;
3710  values[2] |= *ptr >> 1;
3711 
3712  values[3] = (*ptr++ & 1) << 20;
3713  values[3] |= *ptr++ << 12;
3714  values[3] |= *ptr++ << 4;
3715  values[3] |= *ptr >> 4;
3716 
3717  values[4] = (*ptr++ & 0xf) << 17;
3718  values[4] |= *ptr++ << 9;
3719  values[4] |= *ptr++ << 1;
3720  values[4] |= *ptr >> 7;
3721 
3722  values[5] = (*ptr++ & 0x7f) << 14;
3723  values[5] |= *ptr++ << 6;
3724  values[5] |= *ptr >> 2;
3725 
3726  values[6] = (*ptr++ & 3) << 19;
3727  values[6] |= *ptr++ << 11;
3728  values[6] |= *ptr++ << 3;
3729  values[6] |= *ptr >> 5;
3730 
3731  values[7] = (*ptr++ & 0x1f) << 16;
3732  values[7] |= *ptr++ << 8;
3733  values[7] |= *ptr;
3734 }
3735 
3736 static inline void unpack_bits_22(uint64_t* values, const uint8_t* ptr) {
3737  values[0] = *ptr++ << 14;
3738  values[0] |= *ptr++ << 6;
3739  values[0] |= *ptr >> 2;
3740 
3741  values[1] = (*ptr++ & 3) << 20;
3742  values[1] |= *ptr++ << 12;
3743  values[1] |= *ptr++ << 4;
3744  values[1] |= *ptr >> 4;
3745 
3746  values[2] = (*ptr++ & 0xf) << 18;
3747  values[2] |= *ptr++ << 10;
3748  values[2] |= *ptr++ << 2;
3749  values[2] |= *ptr >> 6;
3750 
3751  values[3] = (*ptr++ & 0x3f) << 16;
3752  values[3] |= *ptr++ << 8;
3753  values[3] |= *ptr++;
3754 
3755  values[4] = *ptr++ << 14;
3756  values[4] |= *ptr++ << 6;
3757  values[4] |= *ptr >> 2;
3758 
3759  values[5] = (*ptr++ & 3) << 20;
3760  values[5] |= *ptr++ << 12;
3761  values[5] |= *ptr++ << 4;
3762  values[5] |= *ptr >> 4;
3763 
3764  values[6] = (*ptr++ & 0xf) << 18;
3765  values[6] |= *ptr++ << 10;
3766  values[6] |= *ptr++ << 2;
3767  values[6] |= *ptr >> 6;
3768 
3769  values[7] = (*ptr++ & 0x3f) << 16;
3770  values[7] |= *ptr++ << 8;
3771  values[7] |= *ptr;
3772 }
3773 
3774 static inline void unpack_bits_23(uint64_t* values, const uint8_t* ptr) {
3775  values[0] = *ptr++ << 15;
3776  values[0] |= *ptr++ << 7;
3777  values[0] |= *ptr >> 1;
3778 
3779  values[1] = (*ptr++ & 1) << 22;
3780  values[1] |= *ptr++ << 14;
3781  values[1] |= *ptr++ << 6;
3782  values[1] |= *ptr >> 2;
3783 
3784  values[2] = (*ptr++ & 3) << 21;
3785  values[2] |= *ptr++ << 13;
3786  values[2] |= *ptr++ << 5;
3787  values[2] |= *ptr >> 3;
3788 
3789  values[3] = (*ptr++ & 7) << 20;
3790  values[3] |= *ptr++ << 12;
3791  values[3] |= *ptr++ << 4;
3792  values[3] |= *ptr >> 4;
3793 
3794  values[4] = (*ptr++ & 0xf) << 19;
3795  values[4] |= *ptr++ << 11;
3796  values[4] |= *ptr++ << 3;
3797  values[4] |= *ptr >> 5;
3798 
3799  values[5] = (*ptr++ & 0x1f) << 18;
3800  values[5] |= *ptr++ << 10;
3801  values[5] |= *ptr++ << 2;
3802  values[5] |= *ptr >> 6;
3803 
3804  values[6] = (*ptr++ & 0x3f) << 17;
3805  values[6] |= *ptr++ << 9;
3806  values[6] |= *ptr++ << 1;
3807  values[6] |= *ptr >> 7;
3808 
3809  values[7] = (*ptr++ & 0x7f) << 16;
3810  values[7] |= *ptr++ << 8;
3811  values[7] |= *ptr;
3812 }
3813 
3814 static inline void unpack_bits_24(uint64_t* values, const uint8_t* ptr) {
3815  values[0] = *ptr++ << 16;
3816  values[0] |= *ptr++ << 8;
3817  values[0] |= *ptr++;
3818  values[1] = *ptr++ << 16;
3819  values[1] |= *ptr++ << 8;
3820  values[1] |= *ptr++;
3821  values[2] = *ptr++ << 16;
3822  values[2] |= *ptr++ << 8;
3823  values[2] |= *ptr++;
3824  values[3] = *ptr++ << 16;
3825  values[3] |= *ptr++ << 8;
3826  values[3] |= *ptr++;
3827  values[4] = *ptr++ << 16;
3828  values[4] |= *ptr++ << 8;
3829  values[4] |= *ptr++;
3830  values[5] = *ptr++ << 16;
3831  values[5] |= *ptr++ << 8;
3832  values[5] |= *ptr++;
3833  values[6] = *ptr++ << 16;
3834  values[6] |= *ptr++ << 8;
3835  values[6] |= *ptr++;
3836  values[7] = *ptr++ << 16;
3837  values[7] |= *ptr++ << 8;
3838  values[7] |= *ptr;
3839 }
3840 
3841 static inline void unpack_bits_25(uint64_t* values, const uint8_t* ptr) {
3842  values[0] = *ptr++ << 17;
3843  values[0] |= *ptr++ << 9;
3844  values[0] |= *ptr++ << 1;
3845  values[0] |= *ptr >> 7;
3846 
3847  values[1] = (*ptr++ & 0x7f) << 18;
3848  values[1] |= *ptr++ << 10;
3849  values[1] |= *ptr++ << 2;
3850  values[1] |= *ptr >> 6;
3851 
3852  values[2] = (*ptr++ & 0x3f) << 19;
3853  values[2] |= *ptr++ << 11;
3854  values[2] |= *ptr++ << 3;
3855  values[2] |= *ptr >> 5;
3856 
3857  values[3] = (*ptr++ & 0x1f) << 20;
3858  values[3] |= *ptr++ << 12;
3859  values[3] |= *ptr++ << 4;
3860  values[3] |= *ptr >> 4;
3861 
3862  values[4] = (*ptr++ & 0xf) << 21;
3863  values[4] |= *ptr++ << 13;
3864  values[4] |= *ptr++ << 5;
3865  values[4] |= *ptr >> 3;
3866 
3867  values[5] = (*ptr++ & 7) << 22;
3868  values[5] |= *ptr++ << 14;
3869  values[5] |= *ptr++ << 6;
3870  values[5] |= *ptr >> 2;
3871 
3872  values[6] = (*ptr++ & 3) << 23;
3873  values[6] |= *ptr++ << 15;
3874  values[6] |= *ptr++ << 7;
3875  values[6] |= *ptr >> 1;
3876 
3877  values[7] = static_cast<uint64_t>(*ptr++ & 1) << 24;
3878  values[7] |= *ptr++ << 16;
3879  values[7] |= *ptr++ << 8;
3880  values[7] |= *ptr;
3881 }
3882 
3883 static inline void unpack_bits_26(uint64_t* values, const uint8_t* ptr) {
3884  values[0] = *ptr++ << 18;
3885  values[0] |= *ptr++ << 10;
3886  values[0] |= *ptr++ << 2;
3887  values[0] |= *ptr >> 6;
3888 
3889  values[1] = (*ptr++ & 0x3f) << 20;
3890  values[1] |= *ptr++ << 12;
3891  values[1] |= *ptr++ << 4;
3892  values[1] |= *ptr >> 4;
3893 
3894  values[2] = (*ptr++ & 0xf) << 22;
3895  values[2] |= *ptr++ << 14;
3896  values[2] |= *ptr++ << 6;
3897  values[2] |= *ptr >> 2;
3898 
3899  values[3] = static_cast<uint64_t>(*ptr++ & 3) << 24;
3900  values[3] |= *ptr++ << 16;
3901  values[3] |= *ptr++ << 8;
3902  values[3] |= *ptr++;
3903 
3904  values[4] = *ptr++ << 18;
3905  values[4] |= *ptr++ << 10;
3906  values[4] |= *ptr++ << 2;
3907  values[4] |= *ptr >> 6;
3908 
3909  values[5] = (*ptr++ & 0x3f) << 20;
3910  values[5] |= *ptr++ << 12;
3911  values[5] |= *ptr++ << 4;
3912  values[5] |= *ptr >> 4;
3913 
3914  values[6] = (*ptr++ & 0xf) << 22;
3915  values[6] |= *ptr++ << 14;
3916  values[6] |= *ptr++ << 6;
3917  values[6] |= *ptr >> 2;
3918 
3919  values[7] = static_cast<uint64_t>(*ptr++ & 3) << 24;
3920  values[7] |= *ptr++ << 16;
3921  values[7] |= *ptr++ << 8;
3922  values[7] |= *ptr;
3923 }
3924 
3925 static inline void unpack_bits_27(uint64_t* values, const uint8_t* ptr) {
3926  values[0] = *ptr++ << 19;
3927  values[0] |= *ptr++ << 11;
3928  values[0] |= *ptr++ << 3;
3929  values[0] |= *ptr >> 5;
3930 
3931  values[1] = (*ptr++ & 0x1f) << 22;
3932  values[1] |= *ptr++ << 14;
3933  values[1] |= *ptr++ << 6;
3934  values[1] |= *ptr >> 2;
3935 
3936  values[2] = static_cast<uint64_t>(*ptr++ & 3) << 25;
3937  values[2] |= *ptr++ << 17;
3938  values[2] |= *ptr++ << 9;
3939  values[2] |= *ptr++ << 1;
3940  values[2] |= *ptr >> 7;
3941 
3942  values[3] = (*ptr++ & 0x7f) << 20;
3943  values[3] |= *ptr++ << 12;
3944  values[3] |= *ptr++ << 4;
3945  values[3] |= *ptr >> 4;
3946 
3947  values[4] = (*ptr++ & 0xf) << 23;
3948  values[4] |= *ptr++ << 15;
3949  values[4] |= *ptr++ << 7;
3950  values[4] |= *ptr >> 1;
3951 
3952  values[5] = static_cast<uint64_t>(*ptr++ & 1) << 26;
3953  values[5] |= *ptr++ << 18;
3954  values[5] |= *ptr++ << 10;
3955  values[5] |= *ptr++ << 2;
3956  values[5] |= *ptr >> 6;
3957 
3958  values[6] = (*ptr++ & 0x3f) << 21;
3959  values[6] |= *ptr++ << 13;
3960  values[6] |= *ptr++ << 5;
3961  values[6] |= *ptr >> 3;
3962 
3963  values[7] = static_cast<uint64_t>(*ptr++ & 7) << 24;
3964  values[7] |= *ptr++ << 16;
3965  values[7] |= *ptr++ << 8;
3966  values[7] |= *ptr;
3967 }
3968 
3969 static inline void unpack_bits_28(uint64_t* values, const uint8_t* ptr) {
3970  values[0] = *ptr++ << 20;
3971  values[0] |= *ptr++ << 12;
3972  values[0] |= *ptr++ << 4;
3973  values[0] |= *ptr >> 4;
3974 
3975  values[1] = static_cast<uint64_t>(*ptr++ & 0xf) << 24;
3976  values[1] |= *ptr++ << 16;
3977  values[1] |= *ptr++ << 8;
3978  values[1] |= *ptr++;
3979 
3980  values[2] = *ptr++ << 20;
3981  values[2] |= *ptr++ << 12;
3982  values[2] |= *ptr++ << 4;
3983  values[2] |= *ptr >> 4;
3984 
3985  values[3] = static_cast<uint64_t>(*ptr++ & 0xf) << 24;
3986  values[3] |= *ptr++ << 16;
3987  values[3] |= *ptr++ << 8;
3988  values[3] |= *ptr++;
3989 
3990  values[4] = *ptr++ << 20;
3991  values[4] |= *ptr++ << 12;
3992  values[4] |= *ptr++ << 4;
3993  values[4] |= *ptr >> 4;
3994 
3995  values[5] = static_cast<uint64_t>(*ptr++ & 0xf) << 24;
3996  values[5] |= *ptr++ << 16;
3997  values[5] |= *ptr++ << 8;
3998  values[5] |= *ptr++;
3999 
4000  values[6] = *ptr++ << 20;
4001  values[6] |= *ptr++ << 12;
4002  values[6] |= *ptr++ << 4;
4003  values[6] |= *ptr >> 4;
4004 
4005  values[7] = static_cast<uint64_t>(*ptr++ & 0xf) << 24;
4006  values[7] |= *ptr++ << 16;
4007  values[7] |= *ptr++ << 8;
4008  values[7] |= *ptr;
4009 }
4010 
4011 static inline void unpack_bits_29(uint64_t* values, const uint8_t* ptr) {
4012  values[0] = *ptr++ << 21;
4013  values[0] |= *ptr++ << 13;
4014  values[0] |= *ptr++ << 5;
4015  values[0] |= *ptr >> 3;
4016 
4017  values[1] = static_cast<uint64_t>(*ptr++ & 7) << 26;
4018  values[1] |= *ptr++ << 18;
4019  values[1] |= *ptr++ << 10;
4020  values[1] |= *ptr++ << 2;
4021  values[1] |= *ptr >> 6;
4022 
4023  values[2] = (*ptr++ & 0x3f) << 23;
4024  values[2] |= *ptr++ << 15;
4025  values[2] |= *ptr++ << 7;
4026  values[2] |= *ptr >> 1;
4027 
4028  values[3] = static_cast<uint64_t>(*ptr++ & 1) << 28;
4029  values[3] |= *ptr++ << 20;
4030  values[3] |= *ptr++ << 12;
4031  values[3] |= *ptr++ << 4;
4032  values[3] |= *ptr >> 4;
4033 
4034  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 25;
4035  values[4] |= *ptr++ << 17;
4036  values[4] |= *ptr++ << 9;
4037  values[4] |= *ptr++ << 1;
4038  values[4] |= *ptr >> 7;
4039 
4040  values[5] = (*ptr++ & 0x7f) << 22;
4041  values[5] |= *ptr++ << 14;
4042  values[5] |= *ptr++ << 6;
4043  values[5] |= *ptr >> 2;
4044 
4045  values[6] = static_cast<uint64_t>(*ptr++ & 3) << 27;
4046  values[6] |= *ptr++ << 19;
4047  values[6] |= *ptr++ << 11;
4048  values[6] |= *ptr++ << 3;
4049  values[6] |= *ptr >> 5;
4050 
4051  values[7] = static_cast<uint64_t>(*ptr++ & 0x1f) << 24;
4052  values[7] |= *ptr++ << 16;
4053  values[7] |= *ptr++ << 8;
4054  values[7] |= *ptr;
4055 }
4056 
4057 static inline void unpack_bits_30(uint64_t* values, const uint8_t* ptr) {
4058  values[0] = *ptr++ << 22;
4059  values[0] |= *ptr++ << 14;
4060  values[0] |= *ptr++ << 6;
4061  values[0] |= *ptr >> 2;
4062 
4063  values[1] = static_cast<uint64_t>(*ptr++ & 3) << 28;
4064  values[1] |= *ptr++ << 20;
4065  values[1] |= *ptr++ << 12;
4066  values[1] |= *ptr++ << 4;
4067  values[1] |= *ptr >> 4;
4068 
4069  values[2] = static_cast<uint64_t>(*ptr++ & 0xf) << 26;
4070  values[2] |= *ptr++ << 18;
4071  values[2] |= *ptr++ << 10;
4072  values[2] |= *ptr++ << 2;
4073  values[2] |= *ptr >> 6;
4074 
4075  values[3] = static_cast<uint64_t>(*ptr++ & 0x3f) << 24;
4076  values[3] |= *ptr++ << 16;
4077  values[3] |= *ptr++ << 8;
4078  values[3] |= *ptr++;
4079 
4080  values[4] = *ptr++ << 22;
4081  values[4] |= *ptr++ << 14;
4082  values[4] |= *ptr++ << 6;
4083  values[4] |= *ptr >> 2;
4084 
4085  values[5] = static_cast<uint64_t>(*ptr++ & 3) << 28;
4086  values[5] |= *ptr++ << 20;
4087  values[5] |= *ptr++ << 12;
4088  values[5] |= *ptr++ << 4;
4089  values[5] |= *ptr >> 4;
4090 
4091  values[6] = static_cast<uint64_t>(*ptr++ & 0xf) << 26;
4092  values[6] |= *ptr++ << 18;
4093  values[6] |= *ptr++ << 10;
4094  values[6] |= *ptr++ << 2;
4095  values[6] |= *ptr >> 6;
4096 
4097  values[7] = static_cast<uint64_t>(*ptr++ & 0x3f) << 24;
4098  values[7] |= *ptr++ << 16;
4099  values[7] |= *ptr++ << 8;
4100  values[7] |= *ptr;
4101 }
4102 
4103 static inline void unpack_bits_31(uint64_t* values, const uint8_t* ptr) {
4104  values[0] = *ptr++ << 23;
4105  values[0] |= *ptr++ << 15;
4106  values[0] |= *ptr++ << 7;
4107  values[0] |= *ptr >> 1;
4108 
4109  values[1] = static_cast<uint64_t>(*ptr++ & 1) << 30;
4110  values[1] |= *ptr++ << 22;
4111  values[1] |= *ptr++ << 14;
4112  values[1] |= *ptr++ << 6;
4113  values[1] |= *ptr >> 2;
4114 
4115  values[2] = static_cast<uint64_t>(*ptr++ & 3) << 29;
4116  values[2] |= *ptr++ << 21;
4117  values[2] |= *ptr++ << 13;
4118  values[2] |= *ptr++ << 5;
4119  values[2] |= *ptr >> 3;
4120 
4121  values[3] = static_cast<uint64_t>(*ptr++ & 7) << 28;
4122  values[3] |= *ptr++ << 20;
4123  values[3] |= *ptr++ << 12;
4124  values[3] |= *ptr++ << 4;
4125  values[3] |= *ptr >> 4;
4126 
4127  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 27;
4128  values[4] |= *ptr++ << 19;
4129  values[4] |= *ptr++ << 11;
4130  values[4] |= *ptr++ << 3;
4131  values[4] |= *ptr >> 5;
4132 
4133  values[5] = static_cast<uint64_t>(*ptr++ & 0x1f) << 26;
4134  values[5] |= *ptr++ << 18;
4135  values[5] |= *ptr++ << 10;
4136  values[5] |= *ptr++ << 2;
4137  values[5] |= *ptr >> 6;
4138 
4139  values[6] = static_cast<uint64_t>(*ptr++ & 0x3f) << 25;
4140  values[6] |= *ptr++ << 17;
4141  values[6] |= *ptr++ << 9;
4142  values[6] |= *ptr++ << 1;
4143  values[6] |= *ptr >> 7;
4144 
4145  values[7] = static_cast<uint64_t>(*ptr++ & 0x7f) << 24;
4146  values[7] |= *ptr++ << 16;
4147  values[7] |= *ptr++ << 8;
4148  values[7] |= *ptr;
4149 }
4150 
4151 static inline void unpack_bits_32(uint64_t* values, const uint8_t* ptr) {
4152  values[0] = static_cast<uint64_t>(*ptr++) << 24;
4153  values[0] |= *ptr++ << 16;
4154  values[0] |= *ptr++ << 8;
4155  values[0] |= *ptr++;
4156  values[1] = static_cast<uint64_t>(*ptr++) << 24;
4157  values[1] |= *ptr++ << 16;
4158  values[1] |= *ptr++ << 8;
4159  values[1] |= *ptr++;
4160  values[2] = static_cast<uint64_t>(*ptr++) << 24;
4161  values[2] |= *ptr++ << 16;
4162  values[2] |= *ptr++ << 8;
4163  values[2] |= *ptr++;
4164  values[3] = static_cast<uint64_t>(*ptr++) << 24;
4165  values[3] |= *ptr++ << 16;
4166  values[3] |= *ptr++ << 8;
4167  values[3] |= *ptr++;
4168  values[4] = static_cast<uint64_t>(*ptr++) << 24;
4169  values[4] |= *ptr++ << 16;
4170  values[4] |= *ptr++ << 8;
4171  values[4] |= *ptr++;
4172  values[5] = static_cast<uint64_t>(*ptr++) << 24;
4173  values[5] |= *ptr++ << 16;
4174  values[5] |= *ptr++ << 8;
4175  values[5] |= *ptr++;
4176  values[6] = static_cast<uint64_t>(*ptr++) << 24;
4177  values[6] |= *ptr++ << 16;
4178  values[6] |= *ptr++ << 8;
4179  values[6] |= *ptr++;
4180  values[7] = static_cast<uint64_t>(*ptr++) << 24;
4181  values[7] |= *ptr++ << 16;
4182  values[7] |= *ptr++ << 8;
4183  values[7] |= *ptr;
4184 }
4185 
4186 static inline void unpack_bits_33(uint64_t* values, const uint8_t* ptr) {
4187  values[0] = static_cast<uint64_t>(*ptr++) << 25;
4188  values[0] |= *ptr++ << 17;
4189  values[0] |= *ptr++ << 9;
4190  values[0] |= *ptr++ << 1;
4191  values[0] |= *ptr >> 7;
4192 
4193  values[1] = static_cast<uint64_t>(*ptr++ & 0x7f) << 26;
4194  values[1] |= *ptr++ << 18;
4195  values[1] |= *ptr++ << 10;
4196  values[1] |= *ptr++ << 2;
4197  values[1] |= *ptr >> 6;
4198 
4199  values[2] = static_cast<uint64_t>(*ptr++ & 0x3f) << 27;
4200  values[2] |= *ptr++ << 19;
4201  values[2] |= *ptr++ << 11;
4202  values[2] |= *ptr++ << 3;
4203  values[2] |= *ptr >> 5;
4204 
4205  values[3] = static_cast<uint64_t>(*ptr++ & 0x1f) << 28;
4206  values[3] |= *ptr++ << 20;
4207  values[3] |= *ptr++ << 12;
4208  values[3] |= *ptr++ << 4;
4209  values[3] |= *ptr >> 4;
4210 
4211  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 29;
4212  values[4] |= *ptr++ << 21;
4213  values[4] |= *ptr++ << 13;
4214  values[4] |= *ptr++ << 5;
4215  values[4] |= *ptr >> 3;
4216 
4217  values[5] = static_cast<uint64_t>(*ptr++ & 7) << 30;
4218  values[5] |= *ptr++ << 22;
4219  values[5] |= *ptr++ << 14;
4220  values[5] |= *ptr++ << 6;
4221  values[5] |= *ptr >> 2;
4222 
4223  values[6] = static_cast<uint64_t>(*ptr++ & 3) << 31;
4224  values[6] |= *ptr++ << 23;
4225  values[6] |= *ptr++ << 15;
4226  values[6] |= *ptr++ << 7;
4227  values[6] |= *ptr >> 1;
4228 
4229  values[7] = static_cast<uint64_t>(*ptr++ & 1) << 32;
4230  values[7] |= *ptr++ << 24;
4231  values[7] |= *ptr++ << 16;
4232  values[7] |= *ptr++ << 8;
4233  values[7] |= *ptr;
4234 }
4235 
4236 static inline void unpack_bits_34(uint64_t* values, const uint8_t* ptr) {
4237  values[0] = static_cast<uint64_t>(*ptr++) << 26;
4238  values[0] |= *ptr++ << 18;
4239  values[0] |= *ptr++ << 10;
4240  values[0] |= *ptr++ << 2;
4241  values[0] |= *ptr >> 6;
4242 
4243  values[1] = static_cast<uint64_t>(*ptr++ & 0x3f) << 28;
4244  values[1] |= *ptr++ << 20;
4245  values[1] |= *ptr++ << 12;
4246  values[1] |= *ptr++ << 4;
4247  values[1] |= *ptr >> 4;
4248 
4249  values[2] = static_cast<uint64_t>(*ptr++ & 0xf) << 30;
4250  values[2] |= *ptr++ << 22;
4251  values[2] |= *ptr++ << 14;
4252  values[2] |= *ptr++ << 6;
4253  values[2] |= *ptr >> 2;
4254 
4255  values[3] = static_cast<uint64_t>(*ptr++ & 3) << 32;
4256  values[3] |= static_cast<uint64_t>(*ptr++) << 24;
4257  values[3] |= *ptr++ << 16;
4258  values[3] |= *ptr++ << 8;
4259  values[3] |= *ptr++;
4260 
4261  values[4] = static_cast<uint64_t>(*ptr++) << 26;
4262  values[4] |= *ptr++ << 18;
4263  values[4] |= *ptr++ << 10;
4264  values[4] |= *ptr++ << 2;
4265  values[4] |= *ptr >> 6;
4266 
4267  values[5] = static_cast<uint64_t>(*ptr++ & 0x3f) << 28;
4268  values[5] |= *ptr++ << 20;
4269  values[5] |= *ptr++ << 12;
4270  values[5] |= *ptr++ << 4;
4271  values[5] |= *ptr >> 4;
4272 
4273  values[6] = static_cast<uint64_t>(*ptr++ & 0xf) << 30;
4274  values[6] |= *ptr++ << 22;
4275  values[6] |= *ptr++ << 14;
4276  values[6] |= *ptr++ << 6;
4277  values[6] |= *ptr >> 2;
4278 
4279  values[7] = static_cast<uint64_t>(*ptr++ & 3) << 32;
4280  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
4281  values[7] |= *ptr++ << 16;
4282  values[7] |= *ptr++ << 8;
4283  values[7] |= *ptr++;
4284 }
4285 
4286 static inline void unpack_bits_35(uint64_t* values, const uint8_t* ptr) {
4287  values[0] = static_cast<uint64_t>(*ptr++) << 27;
4288  values[0] |= *ptr++ << 19;
4289  values[0] |= *ptr++ << 11;
4290  values[0] |= *ptr++ << 3;
4291  values[0] |= *ptr >> 5;
4292 
4293  values[1] = static_cast<uint64_t>(*ptr++ & 0x1f) << 30;
4294  values[1] |= *ptr++ << 22;
4295  values[1] |= *ptr++ << 14;
4296  values[1] |= *ptr++ << 6;
4297  values[1] |= *ptr >> 2;
4298 
4299  values[2] = static_cast<uint64_t>(*ptr++ & 2) << 33;
4300  values[2] |= static_cast<uint64_t>(*ptr++) << 25;
4301  values[2] |= *ptr++ << 17;
4302  values[2] |= *ptr++ << 9;
4303  values[2] |= *ptr++ << 1;
4304  values[2] |= *ptr >> 7;
4305 
4306  values[3] = static_cast<uint64_t>(*ptr++ & 0x7f) << 28;
4307  values[3] |= *ptr++ << 20;
4308  values[3] |= *ptr++ << 12;
4309  values[3] |= *ptr++ << 4;
4310  values[3] |= *ptr >> 4;
4311 
4312  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 31;
4313  values[4] |= *ptr++ << 23;
4314  values[4] |= *ptr++ << 15;
4315  values[4] |= *ptr++ << 7;
4316  values[4] |= *ptr >> 1;
4317 
4318  values[5] = static_cast<uint64_t>(*ptr++ & 1) << 34;
4319  values[5] |= static_cast<uint64_t>(*ptr++) << 26;
4320  values[5] |= *ptr++ << 18;
4321  values[5] |= *ptr++ << 10;
4322  values[5] |= *ptr++ << 2;
4323  values[5] |= *ptr >> 6;
4324 
4325  values[6] = static_cast<uint64_t>(*ptr++ & 0x3f) << 29;
4326  values[6] |= *ptr++ << 21;
4327  values[6] |= *ptr++ << 13;
4328  values[6] |= *ptr++ << 5;
4329  values[6] |= *ptr >> 3;
4330 
4331  values[7] = static_cast<uint64_t>(*ptr++ & 7) << 32;
4332  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
4333  values[7] |= *ptr++ << 16;
4334  values[7] |= *ptr++ << 8;
4335  values[7] |= *ptr;
4336 }
4337 
4338 static inline void unpack_bits_36(uint64_t* values, const uint8_t* ptr) {
4339  values[0] = static_cast<uint64_t>(*ptr++) << 28;
4340  values[0] |= *ptr++ << 20;
4341  values[0] |= *ptr++ << 12;
4342  values[0] |= *ptr++ << 4;
4343  values[0] |= *ptr >> 4;
4344 
4345  values[1] = static_cast<uint64_t>(*ptr++ & 0xf) << 32;
4346  values[1] |= static_cast<uint64_t>(*ptr++) << 24;
4347  values[1] |= *ptr++ << 16;
4348  values[1] |= *ptr++ << 8;
4349  values[1] |= *ptr++;
4350 
4351  values[2] = static_cast<uint64_t>(*ptr++) << 28;
4352  values[2] |= *ptr++ << 20;
4353  values[2] |= *ptr++ << 12;
4354  values[2] |= *ptr++ << 4;
4355  values[2] |= *ptr >> 4;
4356 
4357  values[3] = static_cast<uint64_t>(*ptr++ & 0xf) << 32;
4358  values[3] |= static_cast<uint64_t>(*ptr++) << 24;
4359  values[3] |= *ptr++ << 16;
4360  values[3] |= *ptr++ << 8;
4361  values[3] |= *ptr++;
4362 
4363  values[4] = static_cast<uint64_t>(*ptr++) << 28;
4364  values[4] |= *ptr++ << 20;
4365  values[4] |= *ptr++ << 12;
4366  values[4] |= *ptr++ << 4;
4367  values[4] |= *ptr >> 4;
4368 
4369  values[5] = static_cast<uint64_t>(*ptr++ & 0xf) << 32;
4370  values[5] |= static_cast<uint64_t>(*ptr++) << 24;
4371  values[5] |= *ptr++ << 16;
4372  values[5] |= *ptr++ << 8;
4373  values[5] |= *ptr++;
4374 
4375  values[6] = static_cast<uint64_t>(*ptr++) << 28;
4376  values[6] |= *ptr++ << 20;
4377  values[6] |= *ptr++ << 12;
4378  values[6] |= *ptr++ << 4;
4379  values[6] |= *ptr >> 4;
4380 
4381  values[7] = static_cast<uint64_t>(*ptr++ & 0xf) << 32;
4382  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
4383  values[7] |= *ptr++ << 16;
4384  values[7] |= *ptr++ << 8;
4385  values[7] |= *ptr;
4386 }
4387 
4388 static inline void unpack_bits_37(uint64_t* values, const uint8_t* ptr) {
4389  values[0] = static_cast<uint64_t>(*ptr++) << 29;
4390  values[0] |= *ptr++ << 21;
4391  values[0] |= *ptr++ << 13;
4392  values[0] |= *ptr++ << 5;
4393  values[0] |= *ptr >> 3;
4394 
4395  values[1] = static_cast<uint64_t>(*ptr++ & 7) << 34;
4396  values[1] |= static_cast<uint64_t>(*ptr++) << 26;
4397  values[1] |= *ptr++ << 18;
4398  values[1] |= *ptr++ << 10;
4399  values[1] |= *ptr++ << 2;
4400  values[1] |= *ptr >> 6;
4401 
4402  values[2] = static_cast<uint64_t>(*ptr++ & 0x3f) << 31;
4403  values[2] |= static_cast<uint64_t>(*ptr++) << 23;
4404  values[2] |= *ptr++ << 15;
4405  values[2] |= *ptr++ << 7;
4406  values[2] |= *ptr >> 1;
4407 
4408  values[3] = static_cast<uint64_t>(*ptr++ & 1) << 36;
4409  values[3] |= static_cast<uint64_t>(*ptr++) << 28;
4410  values[3] |= *ptr++ << 20;
4411  values[3] |= *ptr++ << 12;
4412  values[3] |= *ptr++ << 4;
4413  values[3] |= *ptr >> 4;
4414 
4415  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 33;
4416  values[4] |= static_cast<uint64_t>(*ptr++) << 25;
4417  values[4] |= *ptr++ << 17;
4418  values[4] |= *ptr++ << 9;
4419  values[4] |= *ptr++ << 1;
4420  values[4] |= *ptr >> 7;
4421 
4422  values[5] = static_cast<uint64_t>(*ptr++ & 0x7f) << 30;
4423  values[5] |= static_cast<uint64_t>(*ptr++) << 22;
4424  values[5] |= *ptr++ << 14;
4425  values[5] |= *ptr++ << 6;
4426  values[5] |= *ptr >> 2;
4427 
4428  values[6] = static_cast<uint64_t>(*ptr++ & 3) << 35;
4429  values[6] |= static_cast<uint64_t>(*ptr++) << 27;
4430  values[6] |= *ptr++ << 19;
4431  values[6] |= *ptr++ << 11;
4432  values[6] |= *ptr++ << 3;
4433  values[6] |= *ptr >> 5;
4434 
4435  values[7] = static_cast<uint64_t>(*ptr++ & 0x1f) << 32;
4436  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
4437  values[7] |= *ptr++ << 16;
4438  values[7] |= *ptr++ << 8;
4439  values[7] |= *ptr;
4440 }
4441 
4442 static inline void unpack_bits_38(uint64_t* values, const uint8_t* ptr) {
4443  values[0] = static_cast<uint64_t>(*ptr++) << 30;
4444  values[0] |= *ptr++ << 22;
4445  values[0] |= *ptr++ << 14;
4446  values[0] |= *ptr++ << 6;
4447  values[0] |= *ptr >> 2;
4448 
4449  values[1] = static_cast<uint64_t>(*ptr++ & 3) << 36;
4450  values[1] |= static_cast<uint64_t>(*ptr++) << 28;
4451  values[1] |= *ptr++ << 20;
4452  values[1] |= *ptr++ << 12;
4453  values[1] |= *ptr++ << 4;
4454  values[1] |= *ptr >> 4;
4455 
4456  values[2] = static_cast<uint64_t>(*ptr++ & 0xf) << 34;
4457  values[2] |= static_cast<uint64_t>(*ptr++) << 26;
4458  values[2] |= *ptr++ << 18;
4459  values[2] |= *ptr++ << 10;
4460  values[2] |= *ptr++ << 2;
4461  values[2] |= *ptr >> 6;
4462 
4463  values[3] = static_cast<uint64_t>(*ptr++ & 0x3f) << 32;
4464  values[3] |= static_cast<uint64_t>(*ptr++) << 24;
4465  values[3] |= *ptr++ << 16;
4466  values[3] |= *ptr++ << 8;
4467  values[3] |= *ptr++;
4468 
4469  values[4] = static_cast<uint64_t>(*ptr++) << 30;
4470  values[4] |= *ptr++ << 22;
4471  values[4] |= *ptr++ << 14;
4472  values[4] |= *ptr++ << 6;
4473  values[4] |= *ptr >> 2;
4474 
4475  values[5] = static_cast<uint64_t>(*ptr++ & 3) << 36;
4476  values[5] |= static_cast<uint64_t>(*ptr++) << 28;
4477  values[5] |= *ptr++ << 20;
4478  values[5] |= *ptr++ << 12;
4479  values[5] |= *ptr++ << 4;
4480  values[5] |= *ptr >> 4;
4481 
4482  values[6] = static_cast<uint64_t>(*ptr++ & 0xf) << 34;
4483  values[6] |= static_cast<uint64_t>(*ptr++) << 26;
4484  values[6] |= *ptr++ << 18;
4485  values[6] |= *ptr++ << 10;
4486  values[6] |= *ptr++ << 2;
4487  values[6] |= *ptr >> 6;
4488 
4489  values[7] = static_cast<uint64_t>(*ptr++ & 0x3f) << 32;
4490  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
4491  values[7] |= *ptr++ << 16;
4492  values[7] |= *ptr++ << 8;
4493  values[7] |= *ptr;
4494 }
4495 
4496 static inline void unpack_bits_39(uint64_t* values, const uint8_t* ptr) {
4497  values[0] = static_cast<uint64_t>(*ptr++) << 31;
4498  values[0] |= *ptr++ << 23;
4499  values[0] |= *ptr++ << 15;
4500  values[0] |= *ptr++ << 7;
4501  values[0] |= *ptr >> 1;
4502 
4503  values[1] = static_cast<uint64_t>(*ptr++ & 1) << 38;
4504  values[1] |= static_cast<uint64_t>(*ptr++) << 30;
4505  values[1] |= *ptr++ << 22;
4506  values[1] |= *ptr++ << 14;
4507  values[1] |= *ptr++ << 6;
4508  values[1] |= *ptr >> 2;
4509 
4510  values[2] = static_cast<uint64_t>(*ptr++ & 3) << 37;
4511  values[2] |= static_cast<uint64_t>(*ptr++) << 29;
4512  values[2] |= *ptr++ << 21;
4513  values[2] |= *ptr++ << 13;
4514  values[2] |= *ptr++ << 5;
4515  values[2] |= *ptr >> 3;
4516 
4517  values[3] = static_cast<uint64_t>(*ptr++ & 7) << 36;
4518  values[3] |= static_cast<uint64_t>(*ptr++) << 28;
4519  values[3] |= *ptr++ << 20;
4520  values[3] |= *ptr++ << 12;
4521  values[3] |= *ptr++ << 4;
4522  values[3] |= *ptr >> 4;
4523 
4524  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 35;
4525  values[4] |= static_cast<uint64_t>(*ptr++) << 27;
4526  values[4] |= *ptr++ << 19;
4527  values[4] |= *ptr++ << 11;
4528  values[4] |= *ptr++ << 3;
4529  values[4] |= *ptr >> 5;
4530 
4531  values[5] = static_cast<uint64_t>(*ptr++ & 0x1f) << 34;
4532  values[5] |= static_cast<uint64_t>(*ptr++) << 26;
4533  values[5] |= *ptr++ << 18;
4534  values[5] |= *ptr++ << 10;
4535  values[5] |= *ptr++ << 2;
4536  values[5] |= *ptr >> 6;
4537 
4538  values[6] = static_cast<uint64_t>(*ptr++ & 0x3f) << 33;
4539  values[6] |= static_cast<uint64_t>(*ptr++) << 25;
4540  values[6] |= *ptr++ << 17;
4541  values[6] |= *ptr++ << 9;
4542  values[6] |= *ptr++ << 1;
4543  values[6] |= *ptr >> 7;
4544 
4545  values[7] = static_cast<uint64_t>(*ptr++ & 0x7f) << 32;
4546  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
4547  values[7] |= *ptr++ << 16;
4548  values[7] |= *ptr++ << 8;
4549  values[7] |= *ptr;
4550 }
4551 
4552 static inline void unpack_bits_40(uint64_t* values, const uint8_t* ptr) {
4553  values[0] = static_cast<uint64_t>(*ptr++) << 32;
4554  values[0] |= static_cast<uint64_t>(*ptr++) << 24;
4555  values[0] |= *ptr++ << 16;
4556  values[0] |= *ptr++ << 8;
4557  values[0] |= *ptr++;
4558  values[1] = static_cast<uint64_t>(*ptr++) << 32;
4559  values[1] |= static_cast<uint64_t>(*ptr++) << 24;
4560  values[1] |= *ptr++ << 16;
4561  values[1] |= *ptr++ << 8;
4562  values[1] |= *ptr++;
4563  values[2] = static_cast<uint64_t>(*ptr++) << 32;
4564  values[2] |= static_cast<uint64_t>(*ptr++) << 24;
4565  values[2] |= *ptr++ << 16;
4566  values[2] |= *ptr++ << 8;
4567  values[2] |= *ptr++;
4568  values[3] = static_cast<uint64_t>(*ptr++) << 32;
4569  values[3] |= static_cast<uint64_t>(*ptr++) << 24;
4570  values[3] |= *ptr++ << 16;
4571  values[3] |= *ptr++ << 8;
4572  values[3] |= *ptr++;
4573  values[4] = static_cast<uint64_t>(*ptr++) << 32;
4574  values[4] |= static_cast<uint64_t>(*ptr++) << 24;
4575  values[4] |= *ptr++ << 16;
4576  values[4] |= *ptr++ << 8;
4577  values[4] |= *ptr++;
4578  values[5] = static_cast<uint64_t>(*ptr++) << 32;
4579  values[5] |= static_cast<uint64_t>(*ptr++) << 24;
4580  values[5] |= *ptr++ << 16;
4581  values[5] |= *ptr++ << 8;
4582  values[5] |= *ptr++;
4583  values[6] = static_cast<uint64_t>(*ptr++) << 32;
4584  values[6] |= static_cast<uint64_t>(*ptr++) << 24;
4585  values[6] |= *ptr++ << 16;
4586  values[6] |= *ptr++ << 8;
4587  values[6] |= *ptr++;
4588  values[7] = static_cast<uint64_t>(*ptr++) << 32;
4589  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
4590  values[7] |= *ptr++ << 16;
4591  values[7] |= *ptr++ << 8;
4592  values[7] |= *ptr;
4593 }
4594 
4595 static inline void unpack_bits_41(uint64_t* values, const uint8_t* ptr) {
4596  values[0] = static_cast<uint64_t>(*ptr++) << 33;
4597  values[0] |= static_cast<uint64_t>(*ptr++) << 25;
4598  values[0] |= *ptr++ << 17;
4599  values[0] |= *ptr++ << 9;
4600  values[0] |= *ptr++ << 1;
4601  values[0] |= *ptr >> 7;
4602 
4603  values[1] = static_cast<uint64_t>(*ptr++ & 0x7f) << 34;
4604  values[1] |= static_cast<uint64_t>(*ptr++) << 26;
4605  values[1] |= *ptr++ << 18;
4606  values[1] |= *ptr++ << 10;
4607  values[1] |= *ptr++ << 2;
4608  values[1] |= *ptr >> 6;
4609 
4610  values[2] = static_cast<uint64_t>(*ptr++ & 0x3f) << 35;
4611  values[2] |= static_cast<uint64_t>(*ptr++) << 27;
4612  values[2] |= *ptr++ << 19;
4613  values[2] |= *ptr++ << 11;
4614  values[2] |= *ptr++ << 3;
4615  values[2] |= *ptr >> 5;
4616 
4617  values[3] = static_cast<uint64_t>(*ptr++ & 0x1f) << 36;
4618  values[3] |= static_cast<uint64_t>(*ptr++) << 28;
4619  values[3] |= *ptr++ << 20;
4620  values[3] |= *ptr++ << 12;
4621  values[3] |= *ptr++ << 4;
4622  values[3] |= *ptr >> 4;
4623 
4624  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 37;
4625  values[4] |= static_cast<uint64_t>(*ptr++) << 29;
4626  values[4] |= *ptr++ << 21;
4627  values[4] |= *ptr++ << 13;
4628  values[4] |= *ptr++ << 5;
4629  values[4] |= *ptr >> 3;
4630 
4631  values[5] = static_cast<uint64_t>(*ptr++ & 7) << 38;
4632  values[5] |= static_cast<uint64_t>(*ptr++) << 30;
4633  values[5] |= *ptr++ << 22;
4634  values[5] |= *ptr++ << 14;
4635  values[5] |= *ptr++ << 6;
4636  values[5] |= *ptr >> 2;
4637 
4638  values[6] = static_cast<uint64_t>(*ptr++ & 3) << 39;
4639  values[6] |= static_cast<uint64_t>(*ptr++) << 31;
4640  values[6] |= *ptr++ << 23;
4641  values[6] |= *ptr++ << 15;
4642  values[6] |= *ptr++ << 7;
4643  values[6] |= *ptr >> 1;
4644 
4645  values[7] = static_cast<uint64_t>(*ptr++ & 1) << 40;
4646  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
4647  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
4648  values[7] |= *ptr++ << 16;
4649  values[7] |= *ptr++ << 8;
4650  values[7] |= *ptr;
4651 }
4652 
4653 static inline void unpack_bits_42(uint64_t* values, const uint8_t* ptr) {
4654  values[0] = static_cast<uint64_t>(*ptr++) << 34;
4655  values[0] |= static_cast<uint64_t>(*ptr++) << 26;
4656  values[0] |= *ptr++ << 18;
4657  values[0] |= *ptr++ << 10;
4658  values[0] |= *ptr++ << 2;
4659  values[0] |= *ptr >> 6;
4660 
4661  values[1] = static_cast<uint64_t>(*ptr++ & 0x3f) << 36;
4662  values[1] |= static_cast<uint64_t>(*ptr++) << 28;
4663  values[1] |= *ptr++ << 20;
4664  values[1] |= *ptr++ << 12;
4665  values[1] |= *ptr++ << 4;
4666  values[1] |= *ptr >> 4;
4667 
4668  values[2] = static_cast<uint64_t>(*ptr++ & 0xf) << 38;
4669  values[2] |= static_cast<uint64_t>(*ptr++) << 30;
4670  values[2] |= *ptr++ << 22;
4671  values[2] |= *ptr++ << 14;
4672  values[2] |= *ptr++ << 6;
4673  values[2] |= *ptr >> 2;
4674 
4675  values[3] = static_cast<uint64_t>(*ptr++ & 3) << 40;
4676  values[3] |= static_cast<uint64_t>(*ptr++) << 32;
4677  values[3] |= static_cast<uint64_t>(*ptr++) << 24;
4678  values[3] |= *ptr++ << 16;
4679  values[3] |= *ptr++ << 8;
4680  values[3] |= *ptr++;
4681 
4682  values[4] = static_cast<uint64_t>(*ptr++) << 34;
4683  values[4] |= static_cast<uint64_t>(*ptr++) << 26;
4684  values[4] |= *ptr++ << 18;
4685  values[4] |= *ptr++ << 10;
4686  values[4] |= *ptr++ << 2;
4687  values[4] |= *ptr >> 6;
4688 
4689  values[5] = static_cast<uint64_t>(*ptr++ & 0x3f) << 36;
4690  values[5] |= static_cast<uint64_t>(*ptr++) << 28;
4691  values[5] |= *ptr++ << 20;
4692  values[5] |= *ptr++ << 12;
4693  values[5] |= *ptr++ << 4;
4694  values[5] |= *ptr >> 4;
4695 
4696  values[6] = static_cast<uint64_t>(*ptr++ & 0xf) << 38;
4697  values[6] |= static_cast<uint64_t>(*ptr++) << 30;
4698  values[6] |= *ptr++ << 22;
4699  values[6] |= *ptr++ << 14;
4700  values[6] |= *ptr++ << 6;
4701  values[6] |= *ptr >> 2;
4702 
4703  values[7] = static_cast<uint64_t>(*ptr++ & 3) << 40;
4704  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
4705  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
4706  values[7] |= *ptr++ << 16;
4707  values[7] |= *ptr++ << 8;
4708  values[7] |= *ptr;
4709 }
4710 
4711 static inline void unpack_bits_43(uint64_t* values, const uint8_t* ptr) {
4712  values[0] = static_cast<uint64_t>(*ptr++) << 35;
4713  values[0] |= static_cast<uint64_t>(*ptr++) << 27;
4714  values[0] |= *ptr++ << 19;
4715  values[0] |= *ptr++ << 11;
4716  values[0] |= *ptr++ << 3;
4717  values[0] |= *ptr >> 5;
4718 
4719  values[1] = static_cast<uint64_t>(*ptr++ & 0x1f) << 38;
4720  values[1] |= static_cast<uint64_t>(*ptr++) << 30;
4721  values[1] |= *ptr++ << 22;
4722  values[1] |= *ptr++ << 14;
4723  values[1] |= *ptr++ << 6;
4724  values[1] |= *ptr >> 2;
4725 
4726  values[2] = static_cast<uint64_t>(*ptr++ & 3) << 41;
4727  values[2] |= static_cast<uint64_t>(*ptr++) << 33;
4728  values[2] |= static_cast<uint64_t>(*ptr++) << 25;
4729  values[2] |= *ptr++ << 17;
4730  values[2] |= *ptr++ << 9;
4731  values[2] |= *ptr++ << 1;
4732  values[2] |= *ptr >> 7;
4733 
4734  values[3] = static_cast<uint64_t>(*ptr++ & 0x7f) << 36;
4735  values[3] |= static_cast<uint64_t>(*ptr++) << 28;
4736  values[3] |= *ptr++ << 20;
4737  values[3] |= *ptr++ << 12;
4738  values[3] |= *ptr++ << 4;
4739  values[3] |= *ptr >> 4;
4740 
4741  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 39;
4742  values[4] |= static_cast<uint64_t>(*ptr++) << 31;
4743  values[4] |= *ptr++ << 23;
4744  values[4] |= *ptr++ << 15;
4745  values[4] |= *ptr++ << 7;
4746  values[4] |= *ptr >> 1;
4747 
4748  values[5] = static_cast<uint64_t>(*ptr++ & 1) << 42;
4749  values[5] |= static_cast<uint64_t>(*ptr++) << 34;
4750  values[5] |= static_cast<uint64_t>(*ptr++) << 26;
4751  values[5] |= *ptr++ << 18;
4752  values[5] |= *ptr++ << 10;
4753  values[5] |= *ptr++ << 2;
4754  values[5] |= *ptr >> 6;
4755 
4756  values[6] = static_cast<uint64_t>(*ptr++ & 0x3f) << 37;
4757  values[6] |= static_cast<uint64_t>(*ptr++) << 29;
4758  values[6] |= *ptr++ << 21;
4759  values[6] |= *ptr++ << 13;
4760  values[6] |= *ptr++ << 5;
4761  values[6] |= *ptr >> 3;
4762 
4763  values[7] = static_cast<uint64_t>(*ptr++ & 7) << 40;
4764  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
4765  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
4766  values[7] |= *ptr++ << 16;
4767  values[7] |= *ptr++ << 8;
4768  values[7] |= *ptr;
4769 }
4770 
4771 static inline void unpack_bits_44(uint64_t* values, const uint8_t* ptr) {
4772  values[0] = static_cast<uint64_t>(*ptr++) << 36;
4773  values[0] |= static_cast<uint64_t>(*ptr++) << 28;
4774  values[0] |= *ptr++ << 20;
4775  values[0] |= *ptr++ << 12;
4776  values[0] |= *ptr++ << 4;
4777  values[0] |= *ptr >> 4;
4778 
4779  values[1] = static_cast<uint64_t>(*ptr++ & 0xf) << 40;
4780  values[1] |= static_cast<uint64_t>(*ptr++) << 32;
4781  values[1] |= static_cast<uint64_t>(*ptr++) << 24;
4782  values[1] |= *ptr++ << 16;
4783  values[1] |= *ptr++ << 8;
4784  values[1] |= *ptr++;
4785 
4786  values[2] = static_cast<uint64_t>(*ptr++) << 36;
4787  values[2] |= static_cast<uint64_t>(*ptr++) << 28;
4788  values[2] |= *ptr++ << 20;
4789  values[2] |= *ptr++ << 12;
4790  values[2] |= *ptr++ << 4;
4791  values[2] |= *ptr >> 4;
4792 
4793  values[3] = static_cast<uint64_t>(*ptr++ & 0xf) << 40;
4794  values[3] |= static_cast<uint64_t>(*ptr++) << 32;
4795  values[3] |= static_cast<uint64_t>(*ptr++) << 24;
4796  values[3] |= *ptr++ << 16;
4797  values[3] |= *ptr++ << 8;
4798  values[3] |= *ptr++;
4799 
4800  values[4] = static_cast<uint64_t>(*ptr++) << 36;
4801  values[4] |= static_cast<uint64_t>(*ptr++) << 28;
4802  values[4] |= *ptr++ << 20;
4803  values[4] |= *ptr++ << 12;
4804  values[4] |= *ptr++ << 4;
4805  values[4] |= *ptr >> 4;
4806 
4807  values[5] = static_cast<uint64_t>(*ptr++ & 0xf) << 40;
4808  values[5] |= static_cast<uint64_t>(*ptr++) << 32;
4809  values[5] |= static_cast<uint64_t>(*ptr++) << 24;
4810  values[5] |= *ptr++ << 16;
4811  values[5] |= *ptr++ << 8;
4812  values[5] |= *ptr++;
4813 
4814  values[6] = static_cast<uint64_t>(*ptr++) << 36;
4815  values[6] |= static_cast<uint64_t>(*ptr++) << 28;
4816  values[6] |= *ptr++ << 20;
4817  values[6] |= *ptr++ << 12;
4818  values[6] |= *ptr++ << 4;
4819  values[6] |= *ptr >> 4;
4820 
4821  values[7] = static_cast<uint64_t>(*ptr++ & 0xf) << 40;
4822  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
4823  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
4824  values[7] |= *ptr++ << 16;
4825  values[7] |= *ptr++ << 8;
4826  values[7] |= *ptr;
4827 }
4828 
4829 static inline void unpack_bits_45(uint64_t* values, const uint8_t* ptr) {
4830  values[0] = static_cast<uint64_t>(*ptr++) << 37;
4831  values[0] |= static_cast<uint64_t>(*ptr++) << 29;
4832  values[0] |= *ptr++ << 21;
4833  values[0] |= *ptr++ << 13;
4834  values[0] |= *ptr++ << 5;
4835  values[0] |= *ptr >> 3;
4836 
4837  values[1] = static_cast<uint64_t>(*ptr++ & 7) << 42;
4838  values[1] |= static_cast<uint64_t>(*ptr++) << 34;
4839  values[1] |= static_cast<uint64_t>(*ptr++) << 26;
4840  values[1] |= *ptr++ << 18;
4841  values[1] |= *ptr++ << 10;
4842  values[1] |= *ptr++ << 2;
4843  values[1] |= *ptr >> 6;
4844 
4845  values[2] = static_cast<uint64_t>(*ptr++ & 0x3f) << 39;
4846  values[2] |= static_cast<uint64_t>(*ptr++) << 31;
4847  values[2] |= static_cast<uint64_t>(*ptr++) << 23;
4848  values[2] |= *ptr++ << 15;
4849  values[2] |= *ptr++ << 7;
4850  values[2] |= *ptr >> 1;
4851 
4852  values[3] = static_cast<uint64_t>(*ptr++ & 1) << 44;
4853  values[3] |= static_cast<uint64_t>(*ptr++) << 36;
4854  values[3] |= static_cast<uint64_t>(*ptr++) << 28;
4855  values[3] |= *ptr++ << 20;
4856  values[3] |= *ptr++ << 12;
4857  values[3] |= *ptr++ << 4;
4858  values[3] |= *ptr >> 4;
4859 
4860  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 41;
4861  values[4] |= static_cast<uint64_t>(*ptr++) << 33;
4862  values[4] |= static_cast<uint64_t>(*ptr++) << 25;
4863  values[4] |= *ptr++ << 17;
4864  values[4] |= *ptr++ << 9;
4865  values[4] |= *ptr++ << 1;
4866  values[4] |= *ptr >> 7;
4867 
4868  values[5] = static_cast<uint64_t>(*ptr++ & 0x7f) << 38;
4869  values[5] |= static_cast<uint64_t>(*ptr++) << 30;
4870  values[5] |= static_cast<uint64_t>(*ptr++) << 22;
4871  values[5] |= *ptr++ << 14;
4872  values[5] |= *ptr++ << 6;
4873  values[5] |= *ptr >> 2;
4874 
4875  values[6] = static_cast<uint64_t>(*ptr++ & 3) << 43;
4876  values[6] |= static_cast<uint64_t>(*ptr++) << 35;
4877  values[6] |= static_cast<uint64_t>(*ptr++) << 27;
4878  values[6] |= *ptr++ << 19;
4879  values[6] |= *ptr++ << 11;
4880  values[6] |= *ptr++ << 3;
4881  values[6] |= *ptr >> 5;
4882 
4883  values[7] = static_cast<uint64_t>(*ptr++ & 0x1f) << 40;
4884  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
4885  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
4886  values[7] |= *ptr++ << 16;
4887  values[7] |= *ptr++ << 8;
4888  values[7] |= *ptr;
4889 }
4890 
4891 static inline void unpack_bits_46(uint64_t* values, const uint8_t* ptr) {
4892  values[0] = static_cast<uint64_t>(*ptr++) << 38;
4893  values[0] |= static_cast<uint64_t>(*ptr++) << 30;
4894  values[0] |= *ptr++ << 22;
4895  values[0] |= *ptr++ << 14;
4896  values[0] |= *ptr++ << 6;
4897  values[0] |= *ptr >> 2;
4898 
4899  values[1] = static_cast<uint64_t>(*ptr++ & 3) << 44;
4900  values[1] |= static_cast<uint64_t>(*ptr++) << 36;
4901  values[1] |= static_cast<uint64_t>(*ptr++) << 28;
4902  values[1] |= *ptr++ << 20;
4903  values[1] |= *ptr++ << 12;
4904  values[1] |= *ptr++ << 4;
4905  values[1] |= *ptr >> 4;
4906 
4907  values[2] = static_cast<uint64_t>(*ptr++ & 0xf) << 42;
4908  values[2] |= static_cast<uint64_t>(*ptr++) << 34;
4909  values[2] |= static_cast<uint64_t>(*ptr++) << 26;
4910  values[2] |= *ptr++ << 18;
4911  values[2] |= *ptr++ << 10;
4912  values[2] |= *ptr++ << 2;
4913  values[2] |= *ptr >> 6;
4914 
4915  values[3] = static_cast<uint64_t>(*ptr++ & 0x3f) << 40;
4916  values[3] |= static_cast<uint64_t>(*ptr++) << 32;
4917  values[3] |= static_cast<uint64_t>(*ptr++) << 24;
4918  values[3] |= *ptr++ << 16;
4919  values[3] |= *ptr++ << 8;
4920  values[3] |= *ptr++;
4921 
4922  values[4] = static_cast<uint64_t>(*ptr++) << 38;
4923  values[4] |= static_cast<uint64_t>(*ptr++) << 30;
4924  values[4] |= *ptr++ << 22;
4925  values[4] |= *ptr++ << 14;
4926  values[4] |= *ptr++ << 6;
4927  values[4] |= *ptr >> 2;
4928 
4929  values[5] = static_cast<uint64_t>(*ptr++ & 3) << 44;
4930  values[5] |= static_cast<uint64_t>(*ptr++) << 36;
4931  values[5] |= static_cast<uint64_t>(*ptr++) << 28;
4932  values[5] |= *ptr++ << 20;
4933  values[5] |= *ptr++ << 12;
4934  values[5] |= *ptr++ << 4;
4935  values[5] |= *ptr >> 4;
4936 
4937  values[6] = static_cast<uint64_t>(*ptr++ & 0xf) << 42;
4938  values[6] |= static_cast<uint64_t>(*ptr++) << 34;
4939  values[6] |= static_cast<uint64_t>(*ptr++) << 26;
4940  values[6] |= *ptr++ << 18;
4941  values[6] |= *ptr++ << 10;
4942  values[6] |= *ptr++ << 2;
4943  values[6] |= *ptr >> 6;
4944 
4945  values[7] = static_cast<uint64_t>(*ptr++ & 0x3f) << 40;
4946  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
4947  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
4948  values[7] |= *ptr++ << 16;
4949  values[7] |= *ptr++ << 8;
4950  values[7] |= *ptr;
4951 }
4952 
4953 static inline void unpack_bits_47(uint64_t* values, const uint8_t* ptr) {
4954  values[0] = static_cast<uint64_t>(*ptr++) << 39;
4955  values[0] |= static_cast<uint64_t>(*ptr++) << 31;
4956  values[0] |= *ptr++ << 23;
4957  values[0] |= *ptr++ << 15;
4958  values[0] |= *ptr++ << 7;
4959  values[0] |= *ptr >> 1;
4960 
4961  values[1] = static_cast<uint64_t>(*ptr++ & 1) << 46;
4962  values[1] |= static_cast<uint64_t>(*ptr++) << 38;
4963  values[1] |= static_cast<uint64_t>(*ptr++) << 30;
4964  values[1] |= *ptr++ << 22;
4965  values[1] |= *ptr++ << 14;
4966  values[1] |= *ptr++ << 6;
4967  values[1] |= *ptr >> 2;
4968 
4969  values[2] = static_cast<uint64_t>(*ptr++ & 3) << 45;
4970  values[2] |= static_cast<uint64_t>(*ptr++) << 37;
4971  values[2] |= static_cast<uint64_t>(*ptr++) << 29;
4972  values[2] |= *ptr++ << 21;
4973  values[2] |= *ptr++ << 13;
4974  values[2] |= *ptr++ << 5;
4975  values[2] |= *ptr >> 3;
4976 
4977  values[3] = static_cast<uint64_t>(*ptr++ & 7) << 44;
4978  values[3] |= static_cast<uint64_t>(*ptr++) << 36;
4979  values[3] |= static_cast<uint64_t>(*ptr++) << 28;
4980  values[3] |= *ptr++ << 20;
4981  values[3] |= *ptr++ << 12;
4982  values[3] |= *ptr++ << 4;
4983  values[3] |= *ptr >> 4;
4984 
4985  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 43;
4986  values[4] |= static_cast<uint64_t>(*ptr++) << 35;
4987  values[4] |= static_cast<uint64_t>(*ptr++) << 27;
4988  values[4] |= *ptr++ << 19;
4989  values[4] |= *ptr++ << 11;
4990  values[4] |= *ptr++ << 3;
4991  values[4] |= *ptr >> 5;
4992 
4993  values[5] = static_cast<uint64_t>(*ptr++ & 0x1f) << 42;
4994  values[5] |= static_cast<uint64_t>(*ptr++) << 34;
4995  values[5] |= static_cast<uint64_t>(*ptr++) << 26;
4996  values[5] |= *ptr++ << 18;
4997  values[5] |= *ptr++ << 10;
4998  values[5] |= *ptr++ << 2;
4999  values[5] |= *ptr >> 6;
5000 
5001  values[6] = static_cast<uint64_t>(*ptr++ & 0x3f) << 41;
5002  values[6] |= static_cast<uint64_t>(*ptr++) << 33;
5003  values[6] |= static_cast<uint64_t>(*ptr++) << 25;
5004  values[6] |= *ptr++ << 17;
5005  values[6] |= *ptr++ << 9;
5006  values[6] |= *ptr++ << 1;
5007  values[6] |= *ptr >> 7;
5008 
5009  values[7] = static_cast<uint64_t>(*ptr++ & 0x7f) << 40;
5010  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
5011  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
5012  values[7] |= *ptr++ << 16;
5013  values[7] |= *ptr++ << 8;
5014  values[7] |= *ptr;
5015 }
5016 
5017 static inline void unpack_bits_48(uint64_t* values, const uint8_t* ptr) {
5018  values[0] = static_cast<uint64_t>(*ptr++) << 40;
5019  values[0] |= static_cast<uint64_t>(*ptr++) << 32;
5020  values[0] |= static_cast<uint64_t>(*ptr++) << 24;
5021  values[0] |= *ptr++ << 16;
5022  values[0] |= *ptr++ << 8;
5023  values[0] |= *ptr++;
5024  values[1] = static_cast<uint64_t>(*ptr++) << 40;
5025  values[1] |= static_cast<uint64_t>(*ptr++) << 32;
5026  values[1] |= static_cast<uint64_t>(*ptr++) << 24;
5027  values[1] |= *ptr++ << 16;
5028  values[1] |= *ptr++ << 8;
5029  values[1] |= *ptr++;
5030  values[2] = static_cast<uint64_t>(*ptr++) << 40;
5031  values[2] |= static_cast<uint64_t>(*ptr++) << 32;
5032  values[2] |= static_cast<uint64_t>(*ptr++) << 24;
5033  values[2] |= *ptr++ << 16;
5034  values[2] |= *ptr++ << 8;
5035  values[2] |= *ptr++;
5036  values[3] = static_cast<uint64_t>(*ptr++) << 40;
5037  values[3] |= static_cast<uint64_t>(*ptr++) << 32;
5038  values[3] |= static_cast<uint64_t>(*ptr++) << 24;
5039  values[3] |= *ptr++ << 16;
5040  values[3] |= *ptr++ << 8;
5041  values[3] |= *ptr++;
5042  values[4] = static_cast<uint64_t>(*ptr++) << 40;
5043  values[4] |= static_cast<uint64_t>(*ptr++) << 32;
5044  values[4] |= static_cast<uint64_t>(*ptr++) << 24;
5045  values[4] |= *ptr++ << 16;
5046  values[4] |= *ptr++ << 8;
5047  values[4] |= *ptr++;
5048  values[5] = static_cast<uint64_t>(*ptr++) << 40;
5049  values[5] |= static_cast<uint64_t>(*ptr++) << 32;
5050  values[5] |= static_cast<uint64_t>(*ptr++) << 24;
5051  values[5] |= *ptr++ << 16;
5052  values[5] |= *ptr++ << 8;
5053  values[5] |= *ptr++;
5054  values[6] = static_cast<uint64_t>(*ptr++) << 40;
5055  values[6] |= static_cast<uint64_t>(*ptr++) << 32;
5056  values[6] |= static_cast<uint64_t>(*ptr++) << 24;
5057  values[6] |= *ptr++ << 16;
5058  values[6] |= *ptr++ << 8;
5059  values[6] |= *ptr++;
5060  values[7] = static_cast<uint64_t>(*ptr++) << 40;
5061  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
5062  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
5063  values[7] |= *ptr++ << 16;
5064  values[7] |= *ptr++ << 8;
5065  values[7] |= *ptr;
5066 }
5067 
5068 static inline void unpack_bits_49(uint64_t* values, const uint8_t* ptr) {
5069  values[0] = static_cast<uint64_t>(*ptr++) << 41;
5070  values[0] |= static_cast<uint64_t>(*ptr++) << 33;
5071  values[0] |= static_cast<uint64_t>(*ptr++) << 25;
5072  values[0] |= *ptr++ << 17;
5073  values[0] |= *ptr++ << 9;
5074  values[0] |= *ptr++ << 1;
5075  values[0] |= *ptr >> 7;
5076 
5077  values[1] = static_cast<uint64_t>(*ptr++ & 0x7f) << 42;
5078  values[1] |= static_cast<uint64_t>(*ptr++) << 34;
5079  values[1] |= static_cast<uint64_t>(*ptr++) << 26;
5080  values[1] |= *ptr++ << 18;
5081  values[1] |= *ptr++ << 10;
5082  values[1] |= *ptr++ << 2;
5083  values[1] |= *ptr >> 6;
5084 
5085  values[2] = static_cast<uint64_t>(*ptr++ & 0x3f) << 43;
5086  values[2] |= static_cast<uint64_t>(*ptr++) << 35;
5087  values[2] |= static_cast<uint64_t>(*ptr++) << 27;
5088  values[2] |= *ptr++ << 19;
5089  values[2] |= *ptr++ << 11;
5090  values[2] |= *ptr++ << 3;
5091  values[2] |= *ptr >> 5;
5092 
5093  values[3] = static_cast<uint64_t>(*ptr++ & 0x1f) << 44;
5094  values[3] |= static_cast<uint64_t>(*ptr++) << 36;
5095  values[3] |= static_cast<uint64_t>(*ptr++) << 28;
5096  values[3] |= *ptr++ << 20;
5097  values[3] |= *ptr++ << 12;
5098  values[3] |= *ptr++ << 4;
5099  values[3] |= *ptr >> 4;
5100 
5101  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 45;
5102  values[4] |= static_cast<uint64_t>(*ptr++) << 37;
5103  values[4] |= static_cast<uint64_t>(*ptr++) << 29;
5104  values[4] |= *ptr++ << 21;
5105  values[4] |= *ptr++ << 13;
5106  values[4] |= *ptr++ << 5;
5107  values[4] |= *ptr >> 3;
5108 
5109  values[5] = static_cast<uint64_t>(*ptr++ & 7) << 46;
5110  values[5] |= static_cast<uint64_t>(*ptr++) << 38;
5111  values[5] |= static_cast<uint64_t>(*ptr++) << 30;
5112  values[5] |= *ptr++ << 22;
5113  values[5] |= *ptr++ << 14;
5114  values[5] |= *ptr++ << 6;
5115  values[5] |= *ptr >> 2;
5116 
5117  values[6] = static_cast<uint64_t>(*ptr++ & 3) << 47;
5118  values[6] |= static_cast<uint64_t>(*ptr++) << 39;
5119  values[6] |= static_cast<uint64_t>(*ptr++) << 31;
5120  values[6] |= *ptr++ << 23;
5121  values[6] |= *ptr++ << 15;
5122  values[6] |= *ptr++ << 7;
5123  values[6] |= *ptr >> 1;
5124 
5125  values[7] = static_cast<uint64_t>(*ptr++ & 1) << 48;
5126  values[7] |= static_cast<uint64_t>(*ptr++) << 40;
5127  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
5128  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
5129  values[7] |= *ptr++ << 16;
5130  values[7] |= *ptr++ << 8;
5131  values[7] |= *ptr;
5132 }
5133 
5134 static inline void unpack_bits_50(uint64_t* values, const uint8_t* ptr) {
5135  values[0] = static_cast<uint64_t>(*ptr++) << 42;
5136  values[0] |= static_cast<uint64_t>(*ptr++) << 34;
5137  values[0] |= static_cast<uint64_t>(*ptr++) << 26;
5138  values[0] |= *ptr++ << 18;
5139  values[0] |= *ptr++ << 10;
5140  values[0] |= *ptr++ << 2;
5141  values[0] |= *ptr >> 6;
5142 
5143  values[1] = static_cast<uint64_t>(*ptr++ & 0x3f) << 44;
5144  values[1] |= static_cast<uint64_t>(*ptr++) << 36;
5145  values[1] |= static_cast<uint64_t>(*ptr++) << 28;
5146  values[1] |= *ptr++ << 20;
5147  values[1] |= *ptr++ << 12;
5148  values[1] |= *ptr++ << 4;
5149  values[1] |= *ptr >> 4;
5150 
5151  values[2] = static_cast<uint64_t>(*ptr++ & 0xf) << 46;
5152  values[2] |= static_cast<uint64_t>(*ptr++) << 38;
5153  values[2] |= static_cast<uint64_t>(*ptr++) << 30;
5154  values[2] |= *ptr++ << 22;
5155  values[2] |= *ptr++ << 14;
5156  values[2] |= *ptr++ << 6;
5157  values[2] |= *ptr >> 2;
5158 
5159  values[3] = static_cast<uint64_t>(*ptr++ & 3) << 48;
5160  values[3] |= static_cast<uint64_t>(*ptr++) << 40;
5161  values[3] |= static_cast<uint64_t>(*ptr++) << 32;
5162  values[3] |= static_cast<uint64_t>(*ptr++) << 24;
5163  values[3] |= *ptr++ << 16;
5164  values[3] |= *ptr++ << 8;
5165  values[3] |= *ptr++;
5166 
5167  values[4] = static_cast<uint64_t>(*ptr++) << 42;
5168  values[4] |= static_cast<uint64_t>(*ptr++) << 34;
5169  values[4] |= static_cast<uint64_t>(*ptr++) << 26;
5170  values[4] |= *ptr++ << 18;
5171  values[4] |= *ptr++ << 10;
5172  values[4] |= *ptr++ << 2;
5173  values[4] |= *ptr >> 6;
5174 
5175  values[5] = static_cast<uint64_t>(*ptr++ & 0x3f) << 44;
5176  values[5] |= static_cast<uint64_t>(*ptr++) << 36;
5177  values[5] |= static_cast<uint64_t>(*ptr++) << 28;
5178  values[5] |= *ptr++ << 20;
5179  values[5] |= *ptr++ << 12;
5180  values[5] |= *ptr++ << 4;
5181  values[5] |= *ptr >> 4;
5182 
5183  values[6] = static_cast<uint64_t>(*ptr++ & 0xf) << 46;
5184  values[6] |= static_cast<uint64_t>(*ptr++) << 38;
5185  values[6] |= static_cast<uint64_t>(*ptr++) << 30;
5186  values[6] |= *ptr++ << 22;
5187  values[6] |= *ptr++ << 14;
5188  values[6] |= *ptr++ << 6;
5189  values[6] |= *ptr >> 2;
5190 
5191  values[7] = static_cast<uint64_t>(*ptr++ & 3) << 48;
5192  values[7] |= static_cast<uint64_t>(*ptr++) << 40;
5193  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
5194  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
5195  values[7] |= *ptr++ << 16;
5196  values[7] |= *ptr++ << 8;
5197  values[7] |= *ptr;
5198 }
5199 
5200 static inline void unpack_bits_51(uint64_t* values, const uint8_t* ptr) {
5201  values[0] = static_cast<uint64_t>(*ptr++) << 43;
5202  values[0] |= static_cast<uint64_t>(*ptr++) << 35;
5203  values[0] |= static_cast<uint64_t>(*ptr++) << 27;
5204  values[0] |= *ptr++ << 19;
5205  values[0] |= *ptr++ << 11;
5206  values[0] |= *ptr++ << 3;
5207  values[0] |= *ptr >> 5;
5208 
5209  values[1] = static_cast<uint64_t>(*ptr++ & 0x1f) << 46;
5210  values[1] |= static_cast<uint64_t>(*ptr++) << 38;
5211  values[1] |= static_cast<uint64_t>(*ptr++) << 30;
5212  values[1] |= *ptr++ << 22;
5213  values[1] |= *ptr++ << 14;
5214  values[1] |= *ptr++ << 6;
5215  values[1] |= *ptr >> 2;
5216 
5217  values[2] = static_cast<uint64_t>(*ptr++ & 3) << 49;
5218  values[2] |= static_cast<uint64_t>(*ptr++) << 41;
5219  values[2] |= static_cast<uint64_t>(*ptr++) << 33;
5220  values[2] |= static_cast<uint64_t>(*ptr++) << 25;
5221  values[2] |= *ptr++ << 17;
5222  values[2] |= *ptr++ << 9;
5223  values[2] |= *ptr++ << 1;
5224  values[2] |= *ptr >> 7;
5225 
5226  values[3] = static_cast<uint64_t>(*ptr++ & 0x7f) << 44;
5227  values[3] |= static_cast<uint64_t>(*ptr++) << 36;
5228  values[3] |= static_cast<uint64_t>(*ptr++) << 28;
5229  values[3] |= *ptr++ << 20;
5230  values[3] |= *ptr++ << 12;
5231  values[3] |= *ptr++ << 4;
5232  values[3] |= *ptr >> 4;
5233 
5234  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 47;
5235  values[4] |= static_cast<uint64_t>(*ptr++) << 39;
5236  values[4] |= static_cast<uint64_t>(*ptr++) << 31;
5237  values[4] |= *ptr++ << 23;
5238  values[4] |= *ptr++ << 15;
5239  values[4] |= *ptr++ << 7;
5240  values[4] |= *ptr >> 1;
5241 
5242  values[5] = static_cast<uint64_t>(*ptr++ & 1) << 50;
5243  values[5] |= static_cast<uint64_t>(*ptr++) << 42;
5244  values[5] |= static_cast<uint64_t>(*ptr++) << 34;
5245  values[5] |= static_cast<uint64_t>(*ptr++) << 26;
5246  values[5] |= *ptr++ << 18;
5247  values[5] |= *ptr++ << 10;
5248  values[5] |= *ptr++ << 2;
5249  values[5] |= *ptr >> 6;
5250 
5251  values[6] = static_cast<uint64_t>(*ptr++ & 0x3f) << 45;
5252  values[6] |= static_cast<uint64_t>(*ptr++) << 37;
5253  values[6] |= static_cast<uint64_t>(*ptr++) << 29;
5254  values[6] |= *ptr++ << 21;
5255  values[6] |= *ptr++ << 13;
5256  values[6] |= *ptr++ << 5;
5257  values[6] |= *ptr >> 3;
5258 
5259  values[7] = static_cast<uint64_t>(*ptr++ & 7) << 48;
5260  values[7] |= static_cast<uint64_t>(*ptr++) << 40;
5261  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
5262  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
5263  values[7] |= *ptr++ << 16;
5264  values[7] |= *ptr++ << 8;
5265  values[7] |= *ptr;
5266 }
5267 
5268 static inline void unpack_bits_52(uint64_t* values, const uint8_t* ptr) {
5269  values[0] = static_cast<uint64_t>(*ptr++) << 44;
5270  values[0] |= static_cast<uint64_t>(*ptr++) << 36;
5271  values[0] |= static_cast<uint64_t>(*ptr++) << 28;
5272  values[0] |= *ptr++ << 20;
5273  values[0] |= *ptr++ << 12;
5274  values[0] |= *ptr++ << 4;
5275  values[0] |= *ptr >> 4;
5276 
5277  values[1] = static_cast<uint64_t>(*ptr++ & 0xf) << 48;
5278  values[1] |= static_cast<uint64_t>(*ptr++) << 40;
5279  values[1] |= static_cast<uint64_t>(*ptr++) << 32;
5280  values[1] |= static_cast<uint64_t>(*ptr++) << 24;
5281  values[1] |= *ptr++ << 16;
5282  values[1] |= *ptr++ << 8;
5283  values[1] |= *ptr++;
5284 
5285  values[2] = static_cast<uint64_t>(*ptr++) << 44;
5286  values[2] |= static_cast<uint64_t>(*ptr++) << 36;
5287  values[2] |= static_cast<uint64_t>(*ptr++) << 28;
5288  values[2] |= *ptr++ << 20;
5289  values[2] |= *ptr++ << 12;
5290  values[2] |= *ptr++ << 4;
5291  values[2] |= *ptr >> 4;
5292 
5293  values[3] = static_cast<uint64_t>(*ptr++ & 0xf) << 48;
5294  values[3] |= static_cast<uint64_t>(*ptr++) << 40;
5295  values[3] |= static_cast<uint64_t>(*ptr++) << 32;
5296  values[3] |= static_cast<uint64_t>(*ptr++) << 24;
5297  values[3] |= *ptr++ << 16;
5298  values[3] |= *ptr++ << 8;
5299  values[3] |= *ptr++;
5300 
5301  values[4] = static_cast<uint64_t>(*ptr++) << 44;
5302  values[4] |= static_cast<uint64_t>(*ptr++) << 36;
5303  values[4] |= static_cast<uint64_t>(*ptr++) << 28;
5304  values[4] |= *ptr++ << 20;
5305  values[4] |= *ptr++ << 12;
5306  values[4] |= *ptr++ << 4;
5307  values[4] |= *ptr >> 4;
5308 
5309  values[5] = static_cast<uint64_t>(*ptr++ & 0xf) << 48;
5310  values[5] |= static_cast<uint64_t>(*ptr++) << 40;
5311  values[5] |= static_cast<uint64_t>(*ptr++) << 32;
5312  values[5] |= static_cast<uint64_t>(*ptr++) << 24;
5313  values[5] |= *ptr++ << 16;
5314  values[5] |= *ptr++ << 8;
5315  values[5] |= *ptr++;
5316 
5317  values[6] = static_cast<uint64_t>(*ptr++) << 44;
5318  values[6] |= static_cast<uint64_t>(*ptr++) << 36;
5319  values[6] |= static_cast<uint64_t>(*ptr++) << 28;
5320  values[6] |= *ptr++ << 20;
5321  values[6] |= *ptr++ << 12;
5322  values[6] |= *ptr++ << 4;
5323  values[6] |= *ptr >> 4;
5324 
5325  values[7] = static_cast<uint64_t>(*ptr++ & 0xf) << 48;
5326  values[7] |= static_cast<uint64_t>(*ptr++) << 40;
5327  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
5328  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
5329  values[7] |= *ptr++ << 16;
5330  values[7] |= *ptr++ << 8;
5331  values[7] |= *ptr;
5332 }
5333 
5334 static inline void unpack_bits_53(uint64_t* values, const uint8_t* ptr) {
5335  values[0] = static_cast<uint64_t>(*ptr++) << 45;
5336  values[0] |= static_cast<uint64_t>(*ptr++) << 37;
5337  values[0] |= static_cast<uint64_t>(*ptr++) << 29;
5338  values[0] |= *ptr++ << 21;
5339  values[0] |= *ptr++ << 13;
5340  values[0] |= *ptr++ << 5;
5341  values[0] |= *ptr >> 3;
5342 
5343  values[1] = static_cast<uint64_t>(*ptr++ & 7) << 50;
5344  values[1] |= static_cast<uint64_t>(*ptr++) << 42;
5345  values[1] |= static_cast<uint64_t>(*ptr++) << 34;
5346  values[1] |= static_cast<uint64_t>(*ptr++) << 26;
5347  values[1] |= *ptr++ << 18;
5348  values[1] |= *ptr++ << 10;
5349  values[1] |= *ptr++ << 2;
5350  values[1] |= *ptr >> 6;
5351 
5352  values[2] = static_cast<uint64_t>(*ptr++ & 0x3f) << 47;
5353  values[2] |= static_cast<uint64_t>(*ptr++) << 39;
5354  values[2] |= static_cast<uint64_t>(*ptr++) << 31;
5355  values[2] |= static_cast<uint64_t>(*ptr++) << 23;
5356  values[2] |= *ptr++ << 15;
5357  values[2] |= *ptr++ << 7;
5358  values[2] |= *ptr >> 1;
5359 
5360  values[3] = static_cast<uint64_t>(*ptr++ & 1) << 52;
5361  values[3] |= static_cast<uint64_t>(*ptr++) << 44;
5362  values[3] |= static_cast<uint64_t>(*ptr++) << 36;
5363  values[3] |= static_cast<uint64_t>(*ptr++) << 28;
5364  values[3] |= *ptr++ << 20;
5365  values[3] |= *ptr++ << 12;
5366  values[3] |= *ptr++ << 4;
5367  values[3] |= *ptr >> 4;
5368 
5369  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 49;
5370  values[4] |= static_cast<uint64_t>(*ptr++) << 41;
5371  values[4] |= static_cast<uint64_t>(*ptr++) << 33;
5372  values[4] |= static_cast<uint64_t>(*ptr++) << 25;
5373  values[4] |= *ptr++ << 17;
5374  values[4] |= *ptr++ << 9;
5375  values[4] |= *ptr++ << 1;
5376  values[4] |= *ptr >> 7;
5377 
5378  values[5] = static_cast<uint64_t>(*ptr++ & 0x7f) << 46;
5379  values[5] |= static_cast<uint64_t>(*ptr++) << 38;
5380  values[5] |= static_cast<uint64_t>(*ptr++) << 30;
5381  values[5] |= *ptr++ << 22;
5382  values[5] |= *ptr++ << 14;
5383  values[5] |= *ptr++ << 6;
5384  values[5] |= *ptr >> 2;
5385 
5386  values[6] = static_cast<uint64_t>(*ptr++ & 3) << 51;
5387  values[6] |= static_cast<uint64_t>(*ptr++) << 43;
5388  values[6] |= static_cast<uint64_t>(*ptr++) << 35;
5389  values[6] |= static_cast<uint64_t>(*ptr++) << 27;
5390  values[6] |= *ptr++ << 19;
5391  values[6] |= *ptr++ << 11;
5392  values[6] |= *ptr++ << 3;
5393  values[6] |= *ptr >> 5;
5394 
5395  values[7] = static_cast<uint64_t>(*ptr++ & 0x1f) << 48;
5396  values[7] |= static_cast<uint64_t>(*ptr++) << 40;
5397  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
5398  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
5399  values[7] |= *ptr++ << 16;
5400  values[7] |= *ptr++ << 8;
5401  values[7] |= *ptr;
5402 }
5403 
5404 static inline void unpack_bits_54(uint64_t* values, const uint8_t* ptr) {
5405  values[0] = static_cast<uint64_t>(*ptr++) << 46;
5406  values[0] |= static_cast<uint64_t>(*ptr++) << 38;
5407  values[0] |= static_cast<uint64_t>(*ptr++) << 30;
5408  values[0] |= *ptr++ << 22;
5409  values[0] |= *ptr++ << 14;
5410  values[0] |= *ptr++ << 6;
5411  values[0] |= *ptr >> 2;
5412 
5413  values[1] = static_cast<uint64_t>(*ptr++ & 3) << 52;
5414  values[1] |= static_cast<uint64_t>(*ptr++) << 44;
5415  values[1] |= static_cast<uint64_t>(*ptr++) << 36;
5416  values[1] |= static_cast<uint64_t>(*ptr++) << 28;
5417  values[1] |= *ptr++ << 20;
5418  values[1] |= *ptr++ << 12;
5419  values[1] |= *ptr++ << 4;
5420  values[1] |= *ptr >> 4;
5421 
5422  values[2] = static_cast<uint64_t>(*ptr++ & 0xf) << 50;
5423  values[2] |= static_cast<uint64_t>(*ptr++) << 42;
5424  values[2] |= static_cast<uint64_t>(*ptr++) << 34;
5425  values[2] |= static_cast<uint64_t>(*ptr++) << 26;
5426  values[2] |= *ptr++ << 18;
5427  values[2] |= *ptr++ << 10;
5428  values[2] |= *ptr++ << 2;
5429  values[2] |= *ptr >> 6;
5430 
5431  values[3] = static_cast<uint64_t>(*ptr++ & 0x3f) << 48;
5432  values[3] |= static_cast<uint64_t>(*ptr++) << 40;
5433  values[3] |= static_cast<uint64_t>(*ptr++) << 32;
5434  values[3] |= static_cast<uint64_t>(*ptr++) << 24;
5435  values[3] |= *ptr++ << 16;
5436  values[3] |= *ptr++ << 8;
5437  values[3] |= *ptr++;
5438 
5439  values[4] = static_cast<uint64_t>(*ptr++) << 46;
5440  values[4] |= static_cast<uint64_t>(*ptr++) << 38;
5441  values[4] |= static_cast<uint64_t>(*ptr++) << 30;
5442  values[4] |= *ptr++ << 22;
5443  values[4] |= *ptr++ << 14;
5444  values[4] |= *ptr++ << 6;
5445  values[4] |= *ptr >> 2;
5446 
5447  values[5] = static_cast<uint64_t>(*ptr++ & 3) << 52;
5448  values[5] |= static_cast<uint64_t>(*ptr++) << 44;
5449  values[5] |= static_cast<uint64_t>(*ptr++) << 36;
5450  values[5] |= static_cast<uint64_t>(*ptr++) << 28;
5451  values[5] |= *ptr++ << 20;
5452  values[5] |= *ptr++ << 12;
5453  values[5] |= *ptr++ << 4;
5454  values[5] |= *ptr >> 4;
5455 
5456  values[6] = static_cast<uint64_t>(*ptr++ & 0xf) << 50;
5457  values[6] |= static_cast<uint64_t>(*ptr++) << 42;
5458  values[6] |= static_cast<uint64_t>(*ptr++) << 34;
5459  values[6] |= static_cast<uint64_t>(*ptr++) << 26;
5460  values[6] |= *ptr++ << 18;
5461  values[6] |= *ptr++ << 10;
5462  values[6] |= *ptr++ << 2;
5463  values[6] |= *ptr >> 6;
5464 
5465  values[7] = static_cast<uint64_t>(*ptr++ & 0x3f) << 48;
5466  values[7] |= static_cast<uint64_t>(*ptr++) << 40;
5467  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
5468  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
5469  values[7] |= *ptr++ << 16;
5470  values[7] |= *ptr++ << 8;
5471  values[7] |= *ptr++;
5472 }
5473 
5474 static inline void unpack_bits_55(uint64_t* values, const uint8_t* ptr) {
5475  values[0] = static_cast<uint64_t>(*ptr++) << 47;
5476  values[0] |= static_cast<uint64_t>(*ptr++) << 39;
5477  values[0] |= static_cast<uint64_t>(*ptr++) << 31;
5478  values[0] |= *ptr++ << 23;
5479  values[0] |= *ptr++ << 15;
5480  values[0] |= *ptr++ << 7;
5481  values[0] |= *ptr >> 1;
5482 
5483  values[1] = static_cast<uint64_t>(*ptr++ & 1) << 54;
5484  values[1] |= static_cast<uint64_t>(*ptr++) << 46;
5485  values[1] |= static_cast<uint64_t>(*ptr++) << 38;
5486  values[1] |= static_cast<uint64_t>(*ptr++) << 30;
5487  values[1] |= *ptr++ << 22;
5488  values[1] |= *ptr++ << 14;
5489  values[1] |= *ptr++ << 6;
5490  values[1] |= *ptr >> 2;
5491 
5492  values[2] = static_cast<uint64_t>(*ptr++ & 3) << 53;
5493  values[2] |= static_cast<uint64_t>(*ptr++) << 45;
5494  values[2] |= static_cast<uint64_t>(*ptr++) << 37;
5495  values[2] |= static_cast<uint64_t>(*ptr++) << 29;
5496  values[2] |= *ptr++ << 21;
5497  values[2] |= *ptr++ << 13;
5498  values[2] |= *ptr++ << 5;
5499  values[2] |= *ptr >> 3;
5500 
5501  values[3] = static_cast<uint64_t>(*ptr++ & 7) << 52;
5502  values[3] |= static_cast<uint64_t>(*ptr++) << 44;
5503  values[3] |= static_cast<uint64_t>(*ptr++) << 36;
5504  values[3] |= static_cast<uint64_t>(*ptr++) << 28;
5505  values[3] |= *ptr++ << 20;
5506  values[3] |= *ptr++ << 12;
5507  values[3] |= *ptr++ << 4;
5508  values[3] |= *ptr >> 4;
5509 
5510  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 51;
5511  values[4] |= static_cast<uint64_t>(*ptr++) << 43;
5512  values[4] |= static_cast<uint64_t>(*ptr++) << 35;
5513  values[4] |= static_cast<uint64_t>(*ptr++) << 27;
5514  values[4] |= *ptr++ << 19;
5515  values[4] |= *ptr++ << 11;
5516  values[4] |= *ptr++ << 3;
5517  values[4] |= *ptr >> 5;
5518 
5519  values[5] = static_cast<uint64_t>(*ptr++ & 0x1f) << 50;
5520  values[5] |= static_cast<uint64_t>(*ptr++) << 42;
5521  values[5] |= static_cast<uint64_t>(*ptr++) << 34;
5522  values[5] |= static_cast<uint64_t>(*ptr++) << 26;
5523  values[5] |= *ptr++ << 18;
5524  values[5] |= *ptr++ << 10;
5525  values[5] |= *ptr++ << 2;
5526  values[5] |= *ptr >> 6;
5527 
5528  values[6] = static_cast<uint64_t>(*ptr++ & 0x3f) << 49;
5529  values[6] |= static_cast<uint64_t>(*ptr++) << 41;
5530  values[6] |= static_cast<uint64_t>(*ptr++) << 33;
5531  values[6] |= static_cast<uint64_t>(*ptr++) << 25;
5532  values[6] |= *ptr++ << 17;
5533  values[6] |= *ptr++ << 9;
5534  values[6] |= *ptr++ << 1;
5535  values[6] |= *ptr >> 7;
5536 
5537  values[7] = static_cast<uint64_t>(*ptr++ & 0x7f) << 48;
5538  values[7] |= static_cast<uint64_t>(*ptr++) << 40;
5539  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
5540  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
5541  values[7] |= *ptr++ << 16;
5542  values[7] |= *ptr++ << 8;
5543  values[7] |= *ptr;
5544 }
5545 
5546 static inline void unpack_bits_56(uint64_t* values, const uint8_t* ptr) {
5547  values[0] = static_cast<uint64_t>(*ptr++) << 48;
5548  values[0] |= static_cast<uint64_t>(*ptr++) << 40;
5549  values[0] |= static_cast<uint64_t>(*ptr++) << 32;
5550  values[0] |= static_cast<uint64_t>(*ptr++) << 24;
5551  values[0] |= *ptr++ << 16;
5552  values[0] |= *ptr++ << 8;
5553  values[0] |= *ptr++;
5554  values[1] = static_cast<uint64_t>(*ptr++) << 48;
5555  values[1] |= static_cast<uint64_t>(*ptr++) << 40;
5556  values[1] |= static_cast<uint64_t>(*ptr++) << 32;
5557  values[1] |= static_cast<uint64_t>(*ptr++) << 24;
5558  values[1] |= *ptr++ << 16;
5559  values[1] |= *ptr++ << 8;
5560  values[1] |= *ptr++;
5561  values[2] = static_cast<uint64_t>(*ptr++) << 48;
5562  values[2] |= static_cast<uint64_t>(*ptr++) << 40;
5563  values[2] |= static_cast<uint64_t>(*ptr++) << 32;
5564  values[2] |= static_cast<uint64_t>(*ptr++) << 24;
5565  values[2] |= *ptr++ << 16;
5566  values[2] |= *ptr++ << 8;
5567  values[2] |= *ptr++;
5568  values[3] = static_cast<uint64_t>(*ptr++) << 48;
5569  values[3] |= static_cast<uint64_t>(*ptr++) << 40;
5570  values[3] |= static_cast<uint64_t>(*ptr++) << 32;
5571  values[3] |= static_cast<uint64_t>(*ptr++) << 24;
5572  values[3] |= *ptr++ << 16;
5573  values[3] |= *ptr++ << 8;
5574  values[3] |= *ptr++;
5575  values[4] = static_cast<uint64_t>(*ptr++) << 48;
5576  values[4] |= static_cast<uint64_t>(*ptr++) << 40;
5577  values[4] |= static_cast<uint64_t>(*ptr++) << 32;
5578  values[4] |= static_cast<uint64_t>(*ptr++) << 24;
5579  values[4] |= *ptr++ << 16;
5580  values[4] |= *ptr++ << 8;
5581  values[4] |= *ptr++;
5582  values[5] = static_cast<uint64_t>(*ptr++) << 48;
5583  values[5] |= static_cast<uint64_t>(*ptr++) << 40;
5584  values[5] |= static_cast<uint64_t>(*ptr++) << 32;
5585  values[5] |= static_cast<uint64_t>(*ptr++) << 24;
5586  values[5] |= *ptr++ << 16;
5587  values[5] |= *ptr++ << 8;
5588  values[5] |= *ptr++;
5589  values[6] = static_cast<uint64_t>(*ptr++) << 48;
5590  values[6] |= static_cast<uint64_t>(*ptr++) << 40;
5591  values[6] |= static_cast<uint64_t>(*ptr++) << 32;
5592  values[6] |= static_cast<uint64_t>(*ptr++) << 24;
5593  values[6] |= *ptr++ << 16;
5594  values[6] |= *ptr++ << 8;
5595  values[6] |= *ptr++;
5596  values[7] = static_cast<uint64_t>(*ptr++) << 48;
5597  values[7] |= static_cast<uint64_t>(*ptr++) << 40;
5598  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
5599  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
5600  values[7] |= *ptr++ << 16;
5601  values[7] |= *ptr++ << 8;
5602  values[7] |= *ptr;
5603 }
5604 
5605 static inline void unpack_bits_57(uint64_t* values, const uint8_t* ptr) {
5606  values[0] = static_cast<uint64_t>(*ptr++) << 49;
5607  values[0] |= static_cast<uint64_t>(*ptr++) << 41;
5608  values[0] |= static_cast<uint64_t>(*ptr++) << 33;
5609  values[0] |= static_cast<uint64_t>(*ptr++) << 25;
5610  values[0] |= *ptr++ << 17;
5611  values[0] |= *ptr++ << 9;
5612  values[0] |= *ptr++ << 1;
5613  values[0] |= *ptr >> 7;
5614 
5615  values[1] = static_cast<uint64_t>(*ptr++ & 0x7f) << 50;
5616  values[1] |= static_cast<uint64_t>(*ptr++) << 42;
5617  values[1] |= static_cast<uint64_t>(*ptr++) << 34;
5618  values[1] |= static_cast<uint64_t>(*ptr++) << 26;
5619  values[1] |= *ptr++ << 18;
5620  values[1] |= *ptr++ << 10;
5621  values[1] |= *ptr++ << 2;
5622  values[1] |= *ptr >> 6;
5623 
5624  values[2] = static_cast<uint64_t>(*ptr++ & 0x3f) << 51;
5625  values[2] |= static_cast<uint64_t>(*ptr++) << 43;
5626  values[2] |= static_cast<uint64_t>(*ptr++) << 35;
5627  values[2] |= static_cast<uint64_t>(*ptr++) << 27;
5628  values[2] |= *ptr++ << 19;
5629  values[2] |= *ptr++ << 11;
5630  values[2] |= *ptr++ << 3;
5631  values[2] |= *ptr >> 5;
5632 
5633  values[3] = static_cast<uint64_t>(*ptr++ & 0x1f) << 52;
5634  values[3] |= static_cast<uint64_t>(*ptr++) << 44;
5635  values[3] |= static_cast<uint64_t>(*ptr++) << 36;
5636  values[3] |= static_cast<uint64_t>(*ptr++) << 28;
5637  values[3] |= *ptr++ << 20;
5638  values[3] |= *ptr++ << 12;
5639  values[3] |= *ptr++ << 4;
5640  values[3] |= *ptr >> 4;
5641 
5642  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 53;
5643  values[4] |= static_cast<uint64_t>(*ptr++) << 45;
5644  values[4] |= static_cast<uint64_t>(*ptr++) << 37;
5645  values[4] |= static_cast<uint64_t>(*ptr++) << 29;
5646  values[4] |= *ptr++ << 21;
5647  values[4] |= *ptr++ << 13;
5648  values[4] |= *ptr++ << 5;
5649  values[4] |= *ptr >> 3;
5650 
5651  values[5] = static_cast<uint64_t>(*ptr++ & 7) << 54;
5652  values[5] |= static_cast<uint64_t>(*ptr++) << 46;
5653  values[5] |= static_cast<uint64_t>(*ptr++) << 38;
5654  values[5] |= static_cast<uint64_t>(*ptr++) << 30;
5655  values[5] |= *ptr++ << 22;
5656  values[5] |= *ptr++ << 14;
5657  values[5] |= *ptr++ << 6;
5658  values[5] |= *ptr >> 2;
5659 
5660  values[6] = static_cast<uint64_t>(*ptr++ & 3) << 55;
5661  values[6] |= static_cast<uint64_t>(*ptr++) << 47;
5662  values[6] |= static_cast<uint64_t>(*ptr++) << 39;
5663  values[6] |= static_cast<uint64_t>(*ptr++) << 31;
5664  values[6] |= *ptr++ << 23;
5665  values[6] |= *ptr++ << 15;
5666  values[6] |= *ptr++ << 7;
5667  values[6] |= *ptr >> 1;
5668 
5669  values[7] = static_cast<uint64_t>(*ptr++ & 1) << 56;
5670  values[7] |= static_cast<uint64_t>(*ptr++) << 48;
5671  values[7] |= static_cast<uint64_t>(*ptr++) << 40;
5672  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
5673  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
5674  values[7] |= *ptr++ << 16;
5675  values[7] |= *ptr++ << 8;
5676  values[7] |= *ptr;
5677 }
5678 
5679 static inline void unpack_bits_58(uint64_t* values, const uint8_t* ptr) {
5680  values[0] = static_cast<uint64_t>(*ptr++) << 50;
5681  values[0] |= static_cast<uint64_t>(*ptr++) << 42;
5682  values[0] |= static_cast<uint64_t>(*ptr++) << 34;
5683  values[0] |= static_cast<uint64_t>(*ptr++) << 26;
5684  values[0] |= *ptr++ << 18;
5685  values[0] |= *ptr++ << 10;
5686  values[0] |= *ptr++ << 2;
5687  values[0] |= *ptr >> 6;
5688 
5689  values[1] = static_cast<uint64_t>(*ptr++ & 0x3f) << 52;
5690  values[1] |= static_cast<uint64_t>(*ptr++) << 44;
5691  values[1] |= static_cast<uint64_t>(*ptr++) << 36;
5692  values[1] |= static_cast<uint64_t>(*ptr++) << 28;
5693  values[1] |= *ptr++ << 20;
5694  values[1] |= *ptr++ << 12;
5695  values[1] |= *ptr++ << 4;
5696  values[1] |= *ptr >> 4;
5697 
5698  values[2] = static_cast<uint64_t>(*ptr++ & 0xf) << 54;
5699  values[2] |= static_cast<uint64_t>(*ptr++) << 46;
5700  values[2] |= static_cast<uint64_t>(*ptr++) << 38;
5701  values[2] |= static_cast<uint64_t>(*ptr++) << 30;
5702  values[2] |= *ptr++ << 22;
5703  values[2] |= *ptr++ << 14;
5704  values[2] |= *ptr++ << 6;
5705  values[2] |= *ptr >> 2;
5706 
5707  values[3] = static_cast<uint64_t>(*ptr++ & 3) << 56;
5708  values[3] |= static_cast<uint64_t>(*ptr++) << 48;
5709  values[3] |= static_cast<uint64_t>(*ptr++) << 40;
5710  values[3] |= static_cast<uint64_t>(*ptr++) << 32;
5711  values[3] |= static_cast<uint64_t>(*ptr++) << 24;
5712  values[3] |= *ptr++ << 16;
5713  values[3] |= *ptr++ << 8;
5714  values[3] |= *ptr++;
5715 
5716  values[4] = static_cast<uint64_t>(*ptr++) << 50;
5717  values[4] |= static_cast<uint64_t>(*ptr++) << 42;
5718  values[4] |= static_cast<uint64_t>(*ptr++) << 34;
5719  values[4] |= static_cast<uint64_t>(*ptr++) << 26;
5720  values[4] |= *ptr++ << 18;
5721  values[4] |= *ptr++ << 10;
5722  values[4] |= *ptr++ << 2;
5723  values[4] |= *ptr >> 6;
5724 
5725  values[5] = static_cast<uint64_t>(*ptr++ & 0x3f) << 52;
5726  values[5] |= static_cast<uint64_t>(*ptr++) << 44;
5727  values[5] |= static_cast<uint64_t>(*ptr++) << 36;
5728  values[5] |= static_cast<uint64_t>(*ptr++) << 28;
5729  values[5] |= *ptr++ << 20;
5730  values[5] |= *ptr++ << 12;
5731  values[5] |= *ptr++ << 4;
5732  values[5] |= *ptr >> 4;
5733 
5734  values[6] = static_cast<uint64_t>(*ptr++ & 0xf) << 54;
5735  values[6] |= static_cast<uint64_t>(*ptr++) << 46;
5736  values[6] |= static_cast<uint64_t>(*ptr++) << 38;
5737  values[6] |= static_cast<uint64_t>(*ptr++) << 30;
5738  values[6] |= *ptr++ << 22;
5739  values[6] |= *ptr++ << 14;
5740  values[6] |= *ptr++ << 6;
5741  values[6] |= *ptr >> 2;
5742 
5743  values[7] = static_cast<uint64_t>(*ptr++ & 3) << 56;
5744  values[7] |= static_cast<uint64_t>(*ptr++) << 48;
5745  values[7] |= static_cast<uint64_t>(*ptr++) << 40;
5746  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
5747  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
5748  values[7] |= *ptr++ << 16;
5749  values[7] |= *ptr++ << 8;
5750  values[7] |= *ptr++;
5751 }
5752 
5753 static inline void unpack_bits_59(uint64_t* values, const uint8_t* ptr) {
5754  values[0] = static_cast<uint64_t>(*ptr++) << 51;
5755  values[0] |= static_cast<uint64_t>(*ptr++) << 43;
5756  values[0] |= static_cast<uint64_t>(*ptr++) << 35;
5757  values[0] |= static_cast<uint64_t>(*ptr++) << 27;
5758  values[0] |= *ptr++ << 19;
5759  values[0] |= *ptr++ << 11;
5760  values[0] |= *ptr++ << 3;
5761  values[0] |= *ptr >> 5;
5762 
5763  values[1] = static_cast<uint64_t>(*ptr++ & 0x1f) << 54;
5764  values[1] |= static_cast<uint64_t>(*ptr++) << 46;
5765  values[1] |= static_cast<uint64_t>(*ptr++) << 38;
5766  values[1] |= static_cast<uint64_t>(*ptr++) << 30;
5767  values[1] |= *ptr++ << 22;
5768  values[1] |= *ptr++ << 14;
5769  values[1] |= *ptr++ << 6;
5770  values[1] |= *ptr >> 2;
5771 
5772  values[2] = static_cast<uint64_t>(*ptr++ & 3) << 57;
5773  values[2] |= static_cast<uint64_t>(*ptr++) << 49;
5774  values[2] |= static_cast<uint64_t>(*ptr++) << 41;
5775  values[2] |= static_cast<uint64_t>(*ptr++) << 33;
5776  values[2] |= static_cast<uint64_t>(*ptr++) << 25;
5777  values[2] |= *ptr++ << 17;
5778  values[2] |= *ptr++ << 9;
5779  values[2] |= *ptr++ << 1;
5780  values[2] |= *ptr >> 7;
5781 
5782  values[3] = static_cast<uint64_t>(*ptr++ & 0x7f) << 52;
5783  values[3] |= static_cast<uint64_t>(*ptr++) << 44;
5784  values[3] |= static_cast<uint64_t>(*ptr++) << 36;
5785  values[3] |= static_cast<uint64_t>(*ptr++) << 28;
5786  values[3] |= *ptr++ << 20;
5787  values[3] |= *ptr++ << 12;
5788  values[3] |= *ptr++ << 4;
5789  values[3] |= *ptr >> 4;
5790 
5791  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 55;
5792  values[4] |= static_cast<uint64_t>(*ptr++) << 47;
5793  values[4] |= static_cast<uint64_t>(*ptr++) << 39;
5794  values[4] |= static_cast<uint64_t>(*ptr++) << 31;
5795  values[4] |= *ptr++ << 23;
5796  values[4] |= *ptr++ << 15;
5797  values[4] |= *ptr++ << 7;
5798  values[4] |= *ptr >> 1;
5799 
5800  values[5] = static_cast<uint64_t>(*ptr++ & 1) << 58;
5801  values[5] |= static_cast<uint64_t>(*ptr++) << 50;
5802  values[5] |= static_cast<uint64_t>(*ptr++) << 42;
5803  values[5] |= static_cast<uint64_t>(*ptr++) << 34;
5804  values[5] |= static_cast<uint64_t>(*ptr++) << 26;
5805  values[5] |= *ptr++ << 18;
5806  values[5] |= *ptr++ << 10;
5807  values[5] |= *ptr++ << 2;
5808  values[5] |= *ptr >> 6;
5809 
5810  values[6] = static_cast<uint64_t>(*ptr++ & 0x3f) << 53;
5811  values[6] |= static_cast<uint64_t>(*ptr++) << 45;
5812  values[6] |= static_cast<uint64_t>(*ptr++) << 37;
5813  values[6] |= static_cast<uint64_t>(*ptr++) << 29;
5814  values[6] |= *ptr++ << 21;
5815  values[6] |= *ptr++ << 13;
5816  values[6] |= *ptr++ << 5;
5817  values[6] |= *ptr >> 3;
5818 
5819  values[7] = static_cast<uint64_t>(*ptr++ & 7) << 56;
5820  values[7] |= static_cast<uint64_t>(*ptr++) << 48;
5821  values[7] |= static_cast<uint64_t>(*ptr++) << 40;
5822  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
5823  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
5824  values[7] |= *ptr++ << 16;
5825  values[7] |= *ptr++ << 8;
5826  values[7] |= *ptr;
5827 }
5828 
5829 static inline void unpack_bits_60(uint64_t* values, const uint8_t* ptr) {
5830  values[0] = static_cast<uint64_t>(*ptr++) << 52;
5831  values[0] |= static_cast<uint64_t>(*ptr++) << 44;
5832  values[0] |= static_cast<uint64_t>(*ptr++) << 36;
5833  values[0] |= static_cast<uint64_t>(*ptr++) << 28;
5834  values[0] |= *ptr++ << 20;
5835  values[0] |= *ptr++ << 12;
5836  values[0] |= *ptr++ << 4;
5837  values[0] |= *ptr >> 4;
5838 
5839  values[1] = static_cast<uint64_t>(*ptr++ & 0xf) << 56;
5840  values[1] |= static_cast<uint64_t>(*ptr++) << 48;
5841  values[1] |= static_cast<uint64_t>(*ptr++) << 40;
5842  values[1] |= static_cast<uint64_t>(*ptr++) << 32;
5843  values[1] |= static_cast<uint64_t>(*ptr++) << 24;
5844  values[1] |= *ptr++ << 16;
5845  values[1] |= *ptr++ << 8;
5846  values[1] |= *ptr++;
5847 
5848  values[2] = static_cast<uint64_t>(*ptr++) << 52;
5849  values[2] |= static_cast<uint64_t>(*ptr++) << 44;
5850  values[2] |= static_cast<uint64_t>(*ptr++) << 36;
5851  values[2] |= static_cast<uint64_t>(*ptr++) << 28;
5852  values[2] |= *ptr++ << 20;
5853  values[2] |= *ptr++ << 12;
5854  values[2] |= *ptr++ << 4;
5855  values[2] |= *ptr >> 4;
5856 
5857  values[3] = static_cast<uint64_t>(*ptr++ & 0xf) << 56;
5858  values[3] |= static_cast<uint64_t>(*ptr++) << 48;
5859  values[3] |= static_cast<uint64_t>(*ptr++) << 40;
5860  values[3] |= static_cast<uint64_t>(*ptr++) << 32;
5861  values[3] |= static_cast<uint64_t>(*ptr++) << 24;
5862  values[3] |= *ptr++ << 16;
5863  values[3] |= *ptr++ << 8;
5864  values[3] |= *ptr++;
5865 
5866  values[4] = static_cast<uint64_t>(*ptr++) << 52;
5867  values[4] |= static_cast<uint64_t>(*ptr++) << 44;
5868  values[4] |= static_cast<uint64_t>(*ptr++) << 36;
5869  values[4] |= static_cast<uint64_t>(*ptr++) << 28;
5870  values[4] |= *ptr++ << 20;
5871  values[4] |= *ptr++ << 12;
5872  values[4] |= *ptr++ << 4;
5873  values[4] |= *ptr >> 4;
5874 
5875  values[5] = static_cast<uint64_t>(*ptr++ & 0xf) << 56;
5876  values[5] |= static_cast<uint64_t>(*ptr++) << 48;
5877  values[5] |= static_cast<uint64_t>(*ptr++) << 40;
5878  values[5] |= static_cast<uint64_t>(*ptr++) << 32;
5879  values[5] |= static_cast<uint64_t>(*ptr++) << 24;
5880  values[5] |= *ptr++ << 16;
5881  values[5] |= *ptr++ << 8;
5882  values[5] |= *ptr++;
5883 
5884  values[6] = static_cast<uint64_t>(*ptr++) << 52;
5885  values[6] |= static_cast<uint64_t>(*ptr++) << 44;
5886  values[6] |= static_cast<uint64_t>(*ptr++) << 36;
5887  values[6] |= static_cast<uint64_t>(*ptr++) << 28;
5888  values[6] |= *ptr++ << 20;
5889  values[6] |= *ptr++ << 12;
5890  values[6] |= *ptr++ << 4;
5891  values[6] |= *ptr >> 4;
5892 
5893  values[7] = static_cast<uint64_t>(*ptr++ & 0xf) << 56;
5894  values[7] |= static_cast<uint64_t>(*ptr++) << 48;
5895  values[7] |= static_cast<uint64_t>(*ptr++) << 40;
5896  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
5897  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
5898  values[7] |= *ptr++ << 16;
5899  values[7] |= *ptr++ << 8;
5900  values[7] |= *ptr;
5901 }
5902 
5903 static inline void unpack_bits_61(uint64_t* values, const uint8_t* ptr) {
5904  values[0] = static_cast<uint64_t>(*ptr++) << 53;
5905  values[0] |= static_cast<uint64_t>(*ptr++) << 45;
5906  values[0] |= static_cast<uint64_t>(*ptr++) << 37;
5907  values[0] |= static_cast<uint64_t>(*ptr++) << 29;
5908  values[0] |= *ptr++ << 21;
5909  values[0] |= *ptr++ << 13;
5910  values[0] |= *ptr++ << 5;
5911  values[0] |= *ptr >> 3;
5912 
5913  values[1] = static_cast<uint64_t>(*ptr++ & 7) << 58;
5914  values[1] |= static_cast<uint64_t>(*ptr++) << 50;
5915  values[1] |= static_cast<uint64_t>(*ptr++) << 42;
5916  values[1] |= static_cast<uint64_t>(*ptr++) << 34;
5917  values[1] |= static_cast<uint64_t>(*ptr++) << 26;
5918  values[1] |= *ptr++ << 18;
5919  values[1] |= *ptr++ << 10;
5920  values[1] |= *ptr++ << 2;
5921  values[1] |= *ptr >> 6;
5922 
5923  values[2] = static_cast<uint64_t>(*ptr++ & 0x3f) << 55;
5924  values[2] |= static_cast<uint64_t>(*ptr++) << 47;
5925  values[2] |= static_cast<uint64_t>(*ptr++) << 39;
5926  values[2] |= static_cast<uint64_t>(*ptr++) << 31;
5927  values[2] |= *ptr++ << 23;
5928  values[2] |= *ptr++ << 15;
5929  values[2] |= *ptr++ << 7;
5930  values[2] |= *ptr >> 1;
5931 
5932  values[3] = static_cast<uint64_t>(*ptr++ & 1) << 60;
5933  values[3] |= static_cast<uint64_t>(*ptr++) << 52;
5934  values[3] |= static_cast<uint64_t>(*ptr++) << 44;
5935  values[3] |= static_cast<uint64_t>(*ptr++) << 36;
5936  values[3] |= static_cast<uint64_t>(*ptr++) << 28;
5937  values[3] |= *ptr++ << 20;
5938  values[3] |= *ptr++ << 12;
5939  values[3] |= *ptr++ << 4;
5940  values[3] |= *ptr >> 4;
5941 
5942  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 57;
5943  values[4] |= static_cast<uint64_t>(*ptr++) << 49;
5944  values[4] |= static_cast<uint64_t>(*ptr++) << 41;
5945  values[4] |= static_cast<uint64_t>(*ptr++) << 33;
5946  values[4] |= static_cast<uint64_t>(*ptr++) << 25;
5947  values[4] |= *ptr++ << 17;
5948  values[4] |= *ptr++ << 9;
5949  values[4] |= *ptr++ << 1;
5950  values[4] |= *ptr >> 7;
5951 
5952  values[5] = static_cast<uint64_t>(*ptr++ & 0x7f) << 54;
5953  values[5] |= static_cast<uint64_t>(*ptr++) << 46;
5954  values[5] |= static_cast<uint64_t>(*ptr++) << 38;
5955  values[5] |= static_cast<uint64_t>(*ptr++) << 30;
5956  values[5] |= *ptr++ << 22;
5957  values[5] |= *ptr++ << 14;
5958  values[5] |= *ptr++ << 6;
5959  values[5] |= *ptr >> 2;
5960 
5961  values[6] = static_cast<uint64_t>(*ptr++ & 3) << 59;
5962  values[6] |= static_cast<uint64_t>(*ptr++) << 51;
5963  values[6] |= static_cast<uint64_t>(*ptr++) << 43;
5964  values[6] |= static_cast<uint64_t>(*ptr++) << 35;
5965  values[6] |= static_cast<uint64_t>(*ptr++) << 27;
5966  values[6] |= *ptr++ << 19;
5967  values[6] |= *ptr++ << 11;
5968  values[6] |= *ptr++ << 3;
5969  values[6] |= *ptr >> 5;
5970 
5971  values[7] = static_cast<uint64_t>(*ptr++ & 0x1f) << 56;
5972  values[7] |= static_cast<uint64_t>(*ptr++) << 48;
5973  values[7] |= static_cast<uint64_t>(*ptr++) << 40;
5974  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
5975  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
5976  values[7] |= *ptr++ << 16;
5977  values[7] |= *ptr++ << 8;
5978  values[7] |= *ptr;
5979 }
5980 
5981 static inline void unpack_bits_62(uint64_t* values, const uint8_t* ptr) {
5982  values[0] = static_cast<uint64_t>(*ptr++) << 54;
5983  values[0] |= static_cast<uint64_t>(*ptr++) << 46;
5984  values[0] |= static_cast<uint64_t>(*ptr++) << 38;
5985  values[0] |= static_cast<uint64_t>(*ptr++) << 30;
5986  values[0] |= *ptr++ << 22;
5987  values[0] |= *ptr++ << 14;
5988  values[0] |= *ptr++ << 6;
5989  values[0] |= *ptr >> 2;
5990 
5991  values[1] = static_cast<uint64_t>(*ptr++ & 3) << 60;
5992  values[1] |= static_cast<uint64_t>(*ptr++) << 52;
5993  values[1] |= static_cast<uint64_t>(*ptr++) << 44;
5994  values[1] |= static_cast<uint64_t>(*ptr++) << 36;
5995  values[1] |= static_cast<uint64_t>(*ptr++) << 28;
5996  values[1] |= *ptr++ << 20;
5997  values[1] |= *ptr++ << 12;
5998  values[1] |= *ptr++ << 4;
5999  values[1] |= *ptr >> 4;
6000 
6001  values[2] = static_cast<uint64_t>(*ptr++ & 0xf) << 58;
6002  values[2] |= static_cast<uint64_t>(*ptr++) << 50;
6003  values[2] |= static_cast<uint64_t>(*ptr++) << 42;
6004  values[2] |= static_cast<uint64_t>(*ptr++) << 34;
6005  values[2] |= static_cast<uint64_t>(*ptr++) << 26;
6006  values[2] |= *ptr++ << 18;
6007  values[2] |= *ptr++ << 10;
6008  values[2] |= *ptr++ << 2;
6009  values[2] |= *ptr >> 6;
6010 
6011  values[3] = static_cast<uint64_t>(*ptr++ & 0x3f) << 56;
6012  values[3] |= static_cast<uint64_t>(*ptr++) << 48;
6013  values[3] |= static_cast<uint64_t>(*ptr++) << 40;
6014  values[3] |= static_cast<uint64_t>(*ptr++) << 32;
6015  values[3] |= static_cast<uint64_t>(*ptr++) << 24;
6016  values[3] |= *ptr++ << 16;
6017  values[3] |= *ptr++ << 8;
6018  values[3] |= *ptr++;
6019 
6020  values[4] = static_cast<uint64_t>(*ptr++) << 54;
6021  values[4] |= static_cast<uint64_t>(*ptr++) << 46;
6022  values[4] |= static_cast<uint64_t>(*ptr++) << 38;
6023  values[4] |= static_cast<uint64_t>(*ptr++) << 30;
6024  values[4] |= *ptr++ << 22;
6025  values[4] |= *ptr++ << 14;
6026  values[4] |= *ptr++ << 6;
6027  values[4] |= *ptr >> 2;
6028 
6029  values[5] = static_cast<uint64_t>(*ptr++ & 3) << 60;
6030  values[5] |= static_cast<uint64_t>(*ptr++) << 52;
6031  values[5] |= static_cast<uint64_t>(*ptr++) << 44;
6032  values[5] |= static_cast<uint64_t>(*ptr++) << 36;
6033  values[5] |= static_cast<uint64_t>(*ptr++) << 28;
6034  values[5] |= *ptr++ << 20;
6035  values[5] |= *ptr++ << 12;
6036  values[5] |= *ptr++ << 4;
6037  values[5] |= *ptr >> 4;
6038 
6039  values[6] = static_cast<uint64_t>(*ptr++ & 0xf) << 58;
6040  values[6] |= static_cast<uint64_t>(*ptr++) << 50;
6041  values[6] |= static_cast<uint64_t>(*ptr++) << 42;
6042  values[6] |= static_cast<uint64_t>(*ptr++) << 34;
6043  values[6] |= static_cast<uint64_t>(*ptr++) << 26;
6044  values[6] |= *ptr++ << 18;
6045  values[6] |= *ptr++ << 10;
6046  values[6] |= *ptr++ << 2;
6047  values[6] |= *ptr >> 6;
6048 
6049  values[7] = static_cast<uint64_t>(*ptr++ & 0x3f) << 56;
6050  values[7] |= static_cast<uint64_t>(*ptr++) << 48;
6051  values[7] |= static_cast<uint64_t>(*ptr++) << 40;
6052  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
6053  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
6054  values[7] |= *ptr++ << 16;
6055  values[7] |= *ptr++ << 8;
6056  values[7] |= *ptr;
6057 }
6058 
6059 static inline void unpack_bits_63(uint64_t* values, const uint8_t* ptr) {
6060  values[0] = static_cast<uint64_t>(*ptr++) << 55;
6061  values[0] |= static_cast<uint64_t>(*ptr++) << 47;
6062  values[0] |= static_cast<uint64_t>(*ptr++) << 39;
6063  values[0] |= static_cast<uint64_t>(*ptr++) << 31;
6064  values[0] |= *ptr++ << 23;
6065  values[0] |= *ptr++ << 15;
6066  values[0] |= *ptr++ << 7;
6067  values[0] |= *ptr >> 1;
6068 
6069  values[1] = static_cast<uint64_t>(*ptr++ & 1) << 62;
6070  values[1] |= static_cast<uint64_t>(*ptr++) << 54;
6071  values[1] |= static_cast<uint64_t>(*ptr++) << 46;
6072  values[1] |= static_cast<uint64_t>(*ptr++) << 38;
6073  values[1] |= static_cast<uint64_t>(*ptr++) << 30;
6074  values[1] |= *ptr++ << 22;
6075  values[1] |= *ptr++ << 14;
6076  values[1] |= *ptr++ << 6;
6077  values[1] |= *ptr >> 2;
6078 
6079  values[2] = static_cast<uint64_t>(*ptr++ & 3) << 61;
6080  values[2] |= static_cast<uint64_t>(*ptr++) << 53;
6081  values[2] |= static_cast<uint64_t>(*ptr++) << 45;
6082  values[2] |= static_cast<uint64_t>(*ptr++) << 37;
6083  values[2] |= static_cast<uint64_t>(*ptr++) << 29;
6084  values[2] |= *ptr++ << 21;
6085  values[2] |= *ptr++ << 13;
6086  values[2] |= *ptr++ << 5;
6087  values[2] |= *ptr >> 3;
6088 
6089  values[3] = static_cast<uint64_t>(*ptr++ & 7) << 60;
6090  values[3] |= static_cast<uint64_t>(*ptr++) << 52;
6091  values[3] |= static_cast<uint64_t>(*ptr++) << 44;
6092  values[3] |= static_cast<uint64_t>(*ptr++) << 36;
6093  values[3] |= static_cast<uint64_t>(*ptr++) << 28;
6094  values[3] |= *ptr++ << 20;
6095  values[3] |= *ptr++ << 12;
6096  values[3] |= *ptr++ << 4;
6097  values[3] |= *ptr >> 4;
6098 
6099  values[4] = static_cast<uint64_t>(*ptr++ & 0xf) << 59;
6100  values[4] |= static_cast<uint64_t>(*ptr++) << 51;
6101  values[4] |= static_cast<uint64_t>(*ptr++) << 43;
6102  values[4] |= static_cast<uint64_t>(*ptr++) << 35;
6103  values[4] |= static_cast<uint64_t>(*ptr++) << 27;
6104  values[4] |= *ptr++ << 19;
6105  values[4] |= *ptr++ << 11;
6106  values[4] |= *ptr++ << 3;
6107  values[4] |= *ptr >> 5;
6108 
6109  values[5] = static_cast<uint64_t>(*ptr++ & 0x1f) << 58;
6110  values[5] |= static_cast<uint64_t>(*ptr++) << 50;
6111  values[5] |= static_cast<uint64_t>(*ptr++) << 42;
6112  values[5] |= static_cast<uint64_t>(*ptr++) << 34;
6113  values[5] |= static_cast<uint64_t>(*ptr++) << 26;
6114  values[5] |= *ptr++ << 18;
6115  values[5] |= *ptr++ << 10;
6116  values[5] |= *ptr++ << 2;
6117  values[5] |= *ptr >> 6;
6118 
6119  values[6] = static_cast<uint64_t>(*ptr++ & 0x3f) << 57;
6120  values[6] |= static_cast<uint64_t>(*ptr++) << 49;
6121  values[6] |= static_cast<uint64_t>(*ptr++) << 41;
6122  values[6] |= static_cast<uint64_t>(*ptr++) << 33;
6123  values[6] |= static_cast<uint64_t>(*ptr++) << 25;
6124  values[6] |= *ptr++ << 17;
6125  values[6] |= *ptr++ << 9;
6126  values[6] |= *ptr++ << 1;
6127  values[6] |= *ptr >> 7;
6128 
6129  values[7] = static_cast<uint64_t>(*ptr++ & 0x7f) << 56;
6130  values[7] |= static_cast<uint64_t>(*ptr++) << 48;
6131  values[7] |= static_cast<uint64_t>(*ptr++) << 40;
6132  values[7] |= static_cast<uint64_t>(*ptr++) << 32;
6133  values[7] |= static_cast<uint64_t>(*ptr++) << 24;
6134  values[7] |= *ptr++ << 16;
6135  values[7] |= *ptr++ << 8;
6136  values[7] |= *ptr;
6137 }
6138 
6139 static inline void pack_bits_block8(const uint64_t* values, uint8_t* ptr, uint8_t bits) {
6140  switch (bits) {
6141  case 1: pack_bits_1(values, ptr); break;
6142  case 2: pack_bits_2(values, ptr); break;
6143  case 3: pack_bits_3(values, ptr); break;
6144  case 4: pack_bits_4(values, ptr); break;
6145  case 5: pack_bits_5(values, ptr); break;
6146  case 6: pack_bits_6(values, ptr); break;
6147  case 7: pack_bits_7(values, ptr); break;
6148  case 8: pack_bits_8(values, ptr); break;
6149  case 9: pack_bits_9(values, ptr); break;
6150  case 10: pack_bits_10(values, ptr); break;
6151  case 11: pack_bits_11(values, ptr); break;
6152  case 12: pack_bits_12(values, ptr); break;
6153  case 13: pack_bits_13(values, ptr); break;
6154  case 14: pack_bits_14(values, ptr); break;
6155  case 15: pack_bits_15(values, ptr); break;
6156  case 16: pack_bits_16(values, ptr); break;
6157  case 17: pack_bits_17(values, ptr); break;
6158  case 18: pack_bits_18(values, ptr); break;
6159  case 19: pack_bits_19(values, ptr); break;
6160  case 20: pack_bits_20(values, ptr); break;
6161  case 21: pack_bits_21(values, ptr); break;
6162  case 22: pack_bits_22(values, ptr); break;
6163  case 23: pack_bits_23(values, ptr); break;
6164  case 24: pack_bits_24(values, ptr); break;
6165  case 25: pack_bits_25(values, ptr); break;
6166  case 26: pack_bits_26(values, ptr); break;
6167  case 27: pack_bits_27(values, ptr); break;
6168  case 28: pack_bits_28(values, ptr); break;
6169  case 29: pack_bits_29(values, ptr); break;
6170  case 30: pack_bits_30(values, ptr); break;
6171  case 31: pack_bits_31(values, ptr); break;
6172  case 32: pack_bits_32(values, ptr); break;
6173  case 33: pack_bits_33(values, ptr); break;
6174  case 34: pack_bits_34(values, ptr); break;
6175  case 35: pack_bits_35(values, ptr); break;
6176  case 36: pack_bits_36(values, ptr); break;
6177  case 37: pack_bits_37(values, ptr); break;
6178  case 38: pack_bits_38(values, ptr); break;
6179  case 39: pack_bits_39(values, ptr); break;
6180  case 40: pack_bits_40(values, ptr); break;
6181  case 41: pack_bits_41(values, ptr); break;
6182  case 42: pack_bits_42(values, ptr); break;
6183  case 43: pack_bits_43(values, ptr); break;
6184  case 44: pack_bits_44(values, ptr); break;
6185  case 45: pack_bits_45(values, ptr); break;
6186  case 46: pack_bits_46(values, ptr); break;
6187  case 47: pack_bits_47(values, ptr); break;
6188  case 48: pack_bits_48(values, ptr); break;
6189  case 49: pack_bits_49(values, ptr); break;
6190  case 50: pack_bits_50(values, ptr); break;
6191  case 51: pack_bits_51(values, ptr); break;
6192  case 52: pack_bits_52(values, ptr); break;
6193  case 53: pack_bits_53(values, ptr); break;
6194  case 54: pack_bits_54(values, ptr); break;
6195  case 55: pack_bits_55(values, ptr); break;
6196  case 56: pack_bits_56(values, ptr); break;
6197  case 57: pack_bits_57(values, ptr); break;
6198  case 58: pack_bits_58(values, ptr); break;
6199  case 59: pack_bits_59(values, ptr); break;
6200  case 60: pack_bits_60(values, ptr); break;
6201  case 61: pack_bits_61(values, ptr); break;
6202  case 62: pack_bits_62(values, ptr); break;
6203  case 63: pack_bits_63(values, ptr); break;
6204  default: throw std::logic_error("wrong number of bits " + std::to_string(bits));
6205  }
6206 }
6207 
6208 static inline void unpack_bits_block8(uint64_t* values, const uint8_t* ptr, uint8_t bits) {
6209  switch (bits) {
6210  case 1: unpack_bits_1(values, ptr); break;
6211  case 2: unpack_bits_2(values, ptr); break;
6212  case 3: unpack_bits_3(values, ptr); break;
6213  case 4: unpack_bits_4(values, ptr); break;
6214  case 5: unpack_bits_5(values, ptr); break;
6215  case 6: unpack_bits_6(values, ptr); break;
6216  case 7: unpack_bits_7(values, ptr); break;
6217  case 8: unpack_bits_8(values, ptr); break;
6218  case 9: unpack_bits_9(values, ptr); break;
6219  case 10: unpack_bits_10(values, ptr); break;
6220  case 11: unpack_bits_11(values, ptr); break;
6221  case 12: unpack_bits_12(values, ptr); break;
6222  case 13: unpack_bits_13(values, ptr); break;
6223  case 14: unpack_bits_14(values, ptr); break;
6224  case 15: unpack_bits_15(values, ptr); break;
6225  case 16: unpack_bits_16(values, ptr); break;
6226  case 17: unpack_bits_17(values, ptr); break;
6227  case 18: unpack_bits_18(values, ptr); break;
6228  case 19: unpack_bits_19(values, ptr); break;
6229  case 20: unpack_bits_20(values, ptr); break;
6230  case 21: unpack_bits_21(values, ptr); break;
6231  case 22: unpack_bits_22(values, ptr); break;
6232  case 23: unpack_bits_23(values, ptr); break;
6233  case 24: unpack_bits_24(values, ptr); break;
6234  case 25: unpack_bits_25(values, ptr); break;
6235  case 26: unpack_bits_26(values, ptr); break;
6236  case 27: unpack_bits_27(values, ptr); break;
6237  case 28: unpack_bits_28(values, ptr); break;
6238  case 29: unpack_bits_29(values, ptr); break;
6239  case 30: unpack_bits_30(values, ptr); break;
6240  case 31: unpack_bits_31(values, ptr); break;
6241  case 32: unpack_bits_32(values, ptr); break;
6242  case 33: unpack_bits_33(values, ptr); break;
6243  case 34: unpack_bits_34(values, ptr); break;
6244  case 35: unpack_bits_35(values, ptr); break;
6245  case 36: unpack_bits_36(values, ptr); break;
6246  case 37: unpack_bits_37(values, ptr); break;
6247  case 38: unpack_bits_38(values, ptr); break;
6248  case 39: unpack_bits_39(values, ptr); break;
6249  case 40: unpack_bits_40(values, ptr); break;
6250  case 41: unpack_bits_41(values, ptr); break;
6251  case 42: unpack_bits_42(values, ptr); break;
6252  case 43: unpack_bits_43(values, ptr); break;
6253  case 44: unpack_bits_44(values, ptr); break;
6254  case 45: unpack_bits_45(values, ptr); break;
6255  case 46: unpack_bits_46(values, ptr); break;
6256  case 47: unpack_bits_47(values, ptr); break;
6257  case 48: unpack_bits_48(values, ptr); break;
6258  case 49: unpack_bits_49(values, ptr); break;
6259  case 50: unpack_bits_50(values, ptr); break;
6260  case 51: unpack_bits_51(values, ptr); break;
6261  case 52: unpack_bits_52(values, ptr); break;
6262  case 53: unpack_bits_53(values, ptr); break;
6263  case 54: unpack_bits_54(values, ptr); break;
6264  case 55: unpack_bits_55(values, ptr); break;
6265  case 56: unpack_bits_56(values, ptr); break;
6266  case 57: unpack_bits_57(values, ptr); break;
6267  case 58: unpack_bits_58(values, ptr); break;
6268  case 59: unpack_bits_59(values, ptr); break;
6269  case 60: unpack_bits_60(values, ptr); break;
6270  case 61: unpack_bits_61(values, ptr); break;
6271  case 62: unpack_bits_62(values, ptr); break;
6272  case 63: unpack_bits_63(values, ptr); break;
6273  default: throw std::logic_error("wrong number of bits " + std::to_string(bits));
6274  }
6275 }
6276 
6277 } // namespace
6278 
6279 #endif // BIT_PACKING_HPP_
DataSketches namespace.
Definition: binomial_bounds.hpp:38