C language implementation of HMM model