Source Rewrite while parsing

Respected Sir,

I want clang to transform some specially written comments in C:

/*
@requires { x >= 0 }
@ensures { result = 0 }
*/
int reduce_to_zero (int x)
{
while (x != 0) {
x = x - 1;
}
return x;
}

should be parsed as:

int reduce_to_zero (int x)
{
if( x >= 0 )
{
while (x != 0) {
x = x - 1;
}
}
if( result = 0 )
return x;
}
Here the requires keyword in the comment serves as the pre-condition and ensures keyword serves as the post-condition for this function.
Could you please tell me how should I approach to this problem.

Thanks in advance

Arpit

Respected Sir,

I am not able to find any existing thread on this. Please tell me where can I find it.

Arpit