M12 C code