Hold it right there. You're writing a C function. If it wants to take values from other functions, put them in the argument list, not in registers.
C is not assembler, so don't pretend otherwise. One of the differences is that you *have to* give up control over the CPU registers, and leave them to the C compiler to work with.
You're fighting the C compiler instead of using it. Don't.