Using legacy C code

Hello,
I am asking for some general guidance on the following task,
There is a legacy code, written in C, that I would like to use directly in Julia. Ideally, I would like to be able to differentiate it as well (the code can be found here ).

So, my questions are:

  • which tools should I be using to write a Julia-wrapper? Clang.jl?
  • Assuming the first step work, how difficult would it be to differentiate it with Enzyme? Which constraint does this put on how the original code and the wrapper must be written?

Thanks in advance!