The first operand to a call or invoke instruction is the callee, then comes the arguments. getArgOperand(0) returns the first argument to the call, while getOperand(0) would return the callee.
The function you quoted then checks whether the first argument to the function call is a load and if so switches out ans for the pointer that was being loaded. Then if ans is a bitcast, it peeks through the bitcast to replace ans with the casted value. Why it does this is not clear from the context (what about multiple bitcasts?), but that's what it does.
Update1: I think it's a version issue. It looks like right now all getArgOperand(i) does is return getOperand(i). Instead getCalledOperand(), which returns the callee, now does getOperand(-1)! Regardless, this is why getArgOperand() was originally added.
There are lots of operand accessors, usually provided by the class llvm::User, whose doxygen page is: http://llvm.org/doxygen/classllvm_1_1User.html There's getNumOperands() and getOperand(unsigned int), as well as iterator-style accessors op_begin() and op_end().
For example, given Instruction %X = add i32 %a, 2, I->getOperand(0) will return the Value* for %a, and I->getOperand(1) will return the Value* for i32 2 (castable to ConstantInt).
For instance, if you have Instruction* I1, I1->getOperand(0) will return the first operand of type Value*. You can go further, using I1->getOperand(0)->getName() that will return the name of the operand. See Value class methods.