Second-order analysis of optimal control problems with control and initial-final state constraints