fn invert_mapping(map: &[u32]) -> Vec<u32>