opt: add an int decrementing helper function