c code for dfa