re-write nmod_mat_mod_t_half() in C