/* Return the ZigZag-encoded 64-bit unsigned integer form of a 64-bit signed integer. */
static uint64_t zigzag64(int64_t v)
/* Return the ZigZag-encoded 64-bit unsigned integer form of a 64-bit signed integer. */
static uint64_t zigzag64(int64_t v)
{
	if (v < 0)
		return (-(uint64_t)v) * 2 - 1;
	else
		return (uint64_t)(v) * 2;
}