I know that the squared distance function from a point $p$ on a Riemann manifold $M$ is smooth in a n-hood of $p$. Therefore for a smooth curve $c:\mathbb{R}\to M$ the concatenation $d(p,\cdot)^2\circ c$ is smooth near a point $t_0$ for $p\in U$, where $U$ is a n-hood of $c(t_0)$.

What I am trying to prove (and where I failed up to now) ist the converse. That is if for $t_0\in \mathbb{R}$ there exists an $\varepsilon>0$ so that $d(p,\cdot)^2\circ c\big|_{(t_0-\varepsilon,t_0+\varepsilon)}$ is smooth for all $p$ in a n-hood of $c(t_0)$ does that mean that $c$ is smooth?

I tried to use the fact that the distance $d(c(t), p)^2 = \langle v_p(t), v_p(t) \rangle_x$ for $v_p(t)=\exp_{c(t)}^{-1}(p)$ and tried to show that $c$ satisfies a differential equation but none of these ideas seems to lead anywhere.

So is there any technique which can help me to prove this? Or does someone know a counterexample to this conjecture? (It holds in any Euclidean space and on $S^n$.)

I highly appreciate your help.