Loading IR function into module


I need to find a way to correctly add an extra function to an existing module. Note that my function is in LLVM IR format.

I tried the ‘LoadAssemblyInto(Module *M, const char *assembly).

It loads the first basic block of the function correctly, but other basic blocks are empty or not exist.

Please advice

Sara Elshobaky