LLVM C Program

I have a program which take inline argument of c/c++ program and convert it into IR module . I want to go one step further, I want to add a function in my program which takes that IR module as argument and returns Assembly language module . Please help me how to write this function or tell me about some references.

You can use llc to compile IR code into assembly code