Assertion `InReg && "Value not in map!"' failed

ok 1 last question for the day...
I created a function in C.
void writeToFile(char *str)
FILE *f;
        printf("could not open file");
used this to create .bc then using llc -march=cpp I got the cpp code to create this function.

While instrumenting my code, I place call to this function. Code which is generated by instrumenting is as follows: add is the original instruction. All others are instrumentation code added by my pass.
  %tmp3 = add i32 %b, %a ; <i32> [#uses=1]
  alloca i32 ; <i32*>:0 [#uses=2]
  store i32 210, i32* %0, align 4
  bitcast i32* %0 to i8* ; <i8*>:1 [#uses=1]
  tail call void @writeToFile( i8* %1 )
  ret i32 %tmp3

While executing, I get the following error:
void llvm::CallInst::init(llvm::Value*, llvm::Value* const*, unsigned int): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Params[i]->getType()) && "Calling a function with a bad signature!"' failed.

Why is it a bad signature :(? i8* is being passed to the function? Any ideas as to what could be wrong?