Optimal control and anti-control of the nonlinear dynamics of a rigid block