#include <iostream>
using namespace std;
#define foo1( a ) (a * a)
inline int foo2( int a ) { return (a * a); }
inline int goo1( int x ) { return foo1(foo2(x)); }
inline int goo2( int& x ) { return x = foo2(foo1(x)); }
inline int goo3( int& x, int y ) { return foo2(foo1(y + 1)); }
inline void goo4( int& x, int y ) { x = foo1(foo2(y + 1)); }
int main()
{
int i = 2, j = 1;
cout << "foo1 = " << foo1( 1 + 2 ) << "\n";
cout << "foo2 = " << foo2( 2 + 1 ) << "\n";
cout << "goo1 = " << goo1( i ) << "\n";
cout << "goo2 = " << goo2( j ) << "\n";
cout << "goo3 = " << goo3( i, j ) << "\n";
goo4( i, j );
cout << "i = " << i << "\nj = " << j << "\n";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKI2RlZmluZSBmb28xKCBhICkgIChhICogYSkKCmlubGluZSBpbnQgZm9vMiggaW50IGEgKSB7IHJldHVybiAoYSAqIGEpOyB9CgppbmxpbmUgaW50IGdvbzEoIGludCB4ICkgeyByZXR1cm4gZm9vMShmb28yKHgpKTsgfQoKaW5saW5lIGludCBnb28yKCBpbnQmIHggKSB7IHJldHVybiB4ID0gZm9vMihmb28xKHgpKTsgfQoKaW5saW5lIGludCBnb28zKCBpbnQmIHgsIGludCB5ICkgeyByZXR1cm4gZm9vMihmb28xKHkgKyAxKSk7IH0KCmlubGluZSB2b2lkIGdvbzQoIGludCYgeCwgaW50IHkgKSB7IHggPSBmb28xKGZvbzIoeSArIDEpKTsgfQoKaW50IG1haW4oKQp7CiAgICBpbnQgaSA9IDIsIGogPSAxOwoKICAgIGNvdXQgPDwgImZvbzEgPSAiIDw8IGZvbzEoIDEgKyAyICkgPDwgIlxuIjsKICAgIGNvdXQgPDwgImZvbzIgPSAiIDw8IGZvbzIoIDIgKyAxICkgPDwgIlxuIjsKICAgIGNvdXQgPDwgImdvbzEgPSAiIDw8IGdvbzEoIGkgKSA8PCAiXG4iOwogICAgY291dCA8PCAiZ29vMiA9ICIgPDwgZ29vMiggaiApIDw8ICJcbiI7CiAgICBjb3V0IDw8ICJnb28zID0gIiA8PCBnb28zKCBpLCBqICkgPDwgIlxuIjsKICAgIGdvbzQoIGksIGogKTsKICAgIGNvdXQgPDwgICJpID0gIiA8PCBpIDw8ICJcbmogPSAiIDw8ICAgaiA8PCAiXG4iOwogICAgcmV0dXJuIDA7Cn0g