While compilation itself , black(a) , black(a+1) and white(a) would be replaced with
a+a*a*a+1+a+1*a+1 - a - a*a
Now a is replaced with 3 ,
3 + 3 * 3 * 3 + 1 + 3 + 1 * 3 + 1 - 3 - 3 * 3 , And then execution based on precedence and associativity is done.