Are you sure `x` will always be negative if there's an overflow? That doesn't seem plausible.