Make certain local variables available to LLVM pass


I have the following situation.

I need to insert certain CallInst in my code.

The prototype of my function is

void __llvmFooBar(int data, int loc);

The parameter loc is generated by the pass. I don't need any external data to generate that.

But, the parameter data is basically calculated by using some variable declared inside my C-code.

int main()
     int k = 0;

void happyEnding(int k)
     int __data = seed(time()) + k%2;
     //callInst to be inserted here, it should be
     //__llvmFooBar(__data, 23);

std::vector<Value *> args(2);
args[0] = ??? //need help here
args[1] = ConstantInt::get(IntegerTy, getLoc());
m_builder->CreateCall(hook, args);

In generic sense, how to make all variable with specific naming convention(like starts with __) make available to llvm pass ?

Can someone tell me how to proceed here ?