Optimal regularity of stable manifolds of nonuniformly hyperbolic dynamics