Golden Gait: An Optimization Theory Perspective on Human and Humanoid Walking