avl: change some void pointers to struct sm_state pointers