This is not as easy as you may think, you have to be able to take libraries, change special constructs (assembly does not have a FOR loop), etc.
In order to do something like this you first have to parse the C file into its
syntax tree[
^], you can search google for AST tools to help you do this. This will let you verify that the C program is syntax correct, since you don't want to compile to a bad file.
Next, you need to start changing parts of the AST into equivalent assembly, also not an easy task since you need to keep track of things like stacks and registers. You will have to be responsible for push-ing all the right things on a stack before a method call for example.
While the steps here aren't great, there is a somewhat easier way. You could take the C file and pass it to an actual C compiler, saving the intermediate output (assembly files) when its done. You should leverage tools that are out there and work than try to reinvent the wheel, especially since this wheel is about as complicated as you can get.