int64_t makeint(const char *buff, size_t offset, size_t offsetinint, size_t len, int minus)
{
union
{
int64_t i64;
uint8_t u8[8]
}d64;
offsetinint = offsetinint & 7;
memset(&d64, 0, sizeof(d64));
memcpy(&d64.u8[offsetinint], len > (8 - offsetinint) ? (8 - offsetinint) : len, buff + offset);
d64.i64 *= -1 * !!minus;
return d64.i64;
}