I want to do a transformation of C-programs to eliminate some
pointers. As C has no reference parameters, they are often emulated
like this:

void add(int a, int b, int* c){
*c = a + b;}

main(){
int z;
add(1, 2, &z);
...}

In my abstract syntax tree of that program I want to transform it into
an extended C with reference parameters. The example would look like
the following, which has a reference paramater notation similar to
C++:

void add(int a, int b, int& c){
c = a + b;}

main(){
int z;
add(1, 2, z);
...}

Has anybody done something like that before? (Of course, you can think
of more complicated examples, where the actual argument is a
pointer...)
Any hint would be appreciated.