End-point equations and regularity of sub-Riemannian geodesics