c version of cim (experimental)