Try creating a global variable and then pass the argument value to that variable as in the code
#define get_caller_incoming_arg(call) 0
int value=0;
void B(int z)
{
int _arg0 = get_caller_incoming_arg(0);
int valueofA=value;
printf ("in A(arg0): %x\n", _arg0);
printf ("in B: %x\n", z);
}
void A(int x)
{
int buff[10];
value=x;
for (int i = 0; i < 10; ++i)
buff[i] = i + 5;
B(buff[1]);
}
int main(int argc, const char * argv[])
{
A(0xdeadbeef);
return 0;
}