inline C for the Viterbi loops