Sard's theorem and Cantor set

Sard's famous theorem asserts that

Theorem. The set of critical values of a smooth function from a manifold to another has Lebesgue measure $$0$$.

I am asking for the curiosity that is it possible to find such a function whose set of critical values is

1. Cantor set or
2. Any other uncountably infinite set?
• You might have looked at the first version of Sard's Theorem, which is more heavily cited. He published a follow-up paper where he gave an upper bound on the Hausdorff dimension. – Ryan Budney Mar 24 '20 at 17:19

It is not hard to construct a smooth function $$f$$ on $$\mathbb R$$ such that $$f \ge 0$$ with $$f(x) = 0$$ if and only if $$x$$ is in the Cantor set $$E$$. If $$F$$ is an antiderivative of $$f$$, the critical values of $$F$$ will be an uncountably infinite perfect set.