C code for analysing dihedral codes