/* Return the ZigZag-encoded 32-bit unsigned integer form of a 32-bit signed integer. */
static uint32_t zigzag32(int32_t v)
/* Return the ZigZag-encoded 32-bit unsigned integer form of a 32-bit signed integer. */
static uint32_t zigzag32(int32_t v)
{
	if (v < 0)
		return (-(uint32_t)v) * 2 - 1;
	else
		return (uint32_t)(v) * 2;
}