Optimal Control Of Odes With State Suprema