Convert mpmatch_c.c to C++