Rewriting the cython code in plain C.