Negation of values such as -9223372036854775808 can't be represented in signed equivalents (such as long long), leading to signed overflow. Therefore, we can just invert bits and add 1 to perform this behavior with unsigned arithmetic.
Implement shifiting operations that perform consistently across architectures without running into undefined or implemented-defined behaviour.