// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH04_Expressions/examples/oofe.cc
// Function: main
int main()
{
	int i = 0;
	cout << i << " " << ++i << endl;  // undefined

	string s("a string"), orig = s;
	cout << toupper(s) << endl;  // changes s to  uppercase
	cout << tolower(s) << endl;  // changes s to lowercase

	s = orig;
	// the calls to toupper and tolower change the value of s
	// << doesn't guarantee order of evaluation, 
	// so this expression is undefined
	cout << toupper(s) << " " << tolower(s) << endl; 

	string first = toupper(s);  // we control the order of evaluation
	string second = tolower(s); // by storing the results in the order in which we want

	cout << first << " " << second << endl;  // one possible evaluation
	cout << second << " " << first << endl;  // equally legal evaluation!
	cout << first << " " << first << endl;   // another legal evaluation!
	cout << second << " " << second << endl; // and a fourth!

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq 0x2d0f(%rip), %rdi      # 0x3fd8
xorl %esi, %esi
callq 0x10d0
leaq 0xd2d(%rip), %rsi       # 0x2004
movq %rax, %rdi
callq 0x1090
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x10d0
movq %rax, %rdi
callq 0x1050
leaq 0xd0d(%rip), %rsi       # 0x2006
leaq -0x30(%rbp), %rbx
leaq -0x90(%rbp), %rdx
movq %rbx, %rdi
callq 0x1030
leaq -0x90(%rbp), %rdi
movq %rbx, %rsi
callq 0x10a0
movq %rbx, %rdi
callq 0x1278
movq 0x2cae(%rip), %rdi      # 0x3fd8
movq %rbx, %rsi
callq 0x1080
movq %rax, %rdi
callq 0x1050
movq %rbx, %rdi
callq 0x123c
movq 0x2c8f(%rip), %rdi      # 0x3fd8
movq %rbx, %rsi
callq 0x1080
movq %rax, %rdi
callq 0x1050
leaq -0x30(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x1060
movq %rbx, %rdi
callq 0x1278
movq 0x2c60(%rip), %rdi      # 0x3fd8
movq %rbx, %rsi
callq 0x1080
leaq 0xc7d(%rip), %rsi       # 0x2004
movq %rax, %rdi
callq 0x1090
movq %rax, %rbx
leaq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x123c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1080
movq %rax, %rdi
callq 0x1050
leaq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x1278
leaq -0x70(%rbp), %rdi
movq %rbx, %rsi
callq 0x10a0
movq %rbx, %rdi
callq 0x123c
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x10a0
movq 0x2bf4(%rip), %rdi      # 0x3fd8
leaq -0x70(%rbp), %rsi
callq 0x1080
leaq 0xc10(%rip), %rsi       # 0x2004
movq %rax, %rdi
callq 0x1090
leaq -0x50(%rbp), %rsi
movq %rax, %rdi
callq 0x1080
movq %rax, %rdi
callq 0x1050
movq 0x2bc1(%rip), %rdi      # 0x3fd8
leaq -0x50(%rbp), %rsi
callq 0x1080
leaq 0xbdd(%rip), %rsi       # 0x2004
movq %rax, %rdi
callq 0x1090
leaq -0x70(%rbp), %rsi
movq %rax, %rdi
callq 0x1080
movq %rax, %rdi
callq 0x1050
movq 0x2b8e(%rip), %rdi      # 0x3fd8
leaq -0x70(%rbp), %rsi
callq 0x1080
leaq 0xbaa(%rip), %rsi       # 0x2004
movq %rax, %rdi
callq 0x1090
leaq -0x70(%rbp), %rsi
movq %rax, %rdi
callq 0x1080
movq %rax, %rdi
callq 0x1050
movq 0x2b5b(%rip), %rdi      # 0x3fd8
leaq -0x50(%rbp), %rsi
callq 0x1080
leaq 0xb77(%rip), %rsi       # 0x2004
movq %rax, %rdi
callq 0x1090
leaq -0x50(%rbp), %rsi
movq %rax, %rdi
callq 0x1080
movq %rax, %rdi
callq 0x1050
leaq -0x50(%rbp), %rdi
callq 0x1040
leaq -0x70(%rbp), %rdi
callq 0x1040
leaq -0x90(%rbp), %rdi
callq 0x1040
leaq -0x30(%rbp), %rdi
callq 0x1040
xorl %eax, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
jmp 0x14fb
jmp 0x14ea
movq %rax, %rbx
jmp 0x1510
movq %rax, %rbx
jmp 0x1504
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1040
leaq -0x70(%rbp), %rdi
callq 0x1040
leaq -0x90(%rbp), %rdi
callq 0x1040
leaq -0x30(%rbp), %rdi
callq 0x1040
movq %rbx, %rdi
callq 0x10e0