Curves of maximal slope for a certain class of nonregular functions