pub fn clamp_u64_to_u32(x: &u64) -> u32