// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq 0x2ce3(%rip), %rdi      # 0x3fd8
xorl %esi, %esi
callq 0x10e0
movq %rax, %rbx
leaq 0xcfe(%rip), %rsi       # 0x2004
movl $0x1, %edx
movq %rax, %rdi
callq 0x10b0
movq %rbx, %rdi
movl $0x1, %esi
callq 0x10e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1050
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xcad(%rip), %rsi       # 0x2006
leaq 0xcae(%rip), %rdx       # 0x200e
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
callq 0x18f8
leaq -0x98(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %rdi
callq 0x185a
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %r14
testq %r14, %r14
je 0x13be
xorl %r13d, %r13d
movsbl (%rbx,%r13), %edi
callq 0x1110
movb %al, (%rbx,%r13)
incq %r13
cmpq %r13, %r14
jne 0x139e
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %rdx
jmp 0x13c0
xorl %edx, %edx
movq 0x2c11(%rip), %rdi      # 0x3fd8
movq %rbx, %rsi
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1050
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %r14
testq %r14, %r14
je 0x1429
xorl %r13d, %r13d
movsbl (%rbx,%r13), %edi
callq 0x10c0
movb %al, (%rbx,%r13)
incq %r13
cmpq %r13, %r14
jne 0x1409
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %rdx
jmp 0x142b
xorl %edx, %edx
movq 0x2ba6(%rip), %rdi      # 0x3fd8
movq %rbx, %rsi
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1050
leaq -0x48(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x1040
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %r14
testq %r14, %r14
je 0x14a4
xorl %r13d, %r13d
movsbl (%rbx,%r13), %edi
callq 0x1110
movb %al, (%rbx,%r13)
incq %r13
cmpq %r13, %r14
jne 0x1484
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %rdx
jmp 0x14a6
xorl %edx, %edx
movq 0x2b2b(%rip), %rdi      # 0x3fd8
movq %rbx, %rsi
callq 0x10b0
movq %rax, %rbx
leaq 0xb45(%rip), %rsi       # 0x2004
movl $0x1, %edx
movq %rax, %rdi
callq 0x10b0
movq -0x48(%rbp), %r14
movq -0x40(%rbp), %r13
testq %r13, %r13
je 0x14fc
xorl %r15d, %r15d
movsbl (%r14,%r15), %edi
callq 0x10c0
movb %al, (%r14,%r15)
incq %r15
cmpq %r15, %r13
jne 0x14dc
movq -0x48(%rbp), %r14
movq -0x40(%rbp), %rdx
jmp 0x14fe
xorl %edx, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1050
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %r14
testq %r14, %r14
je 0x1563
xorl %r15d, %r15d
movsbl (%rbx,%r15), %edi
callq 0x1110
movb %al, (%rbx,%r15)
incq %r15
cmpq %r15, %r14
jne 0x1543
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %rdx
jmp 0x1565
xorl %edx, %edx
leaq -0x78(%rbp), %r14
movq %r14, -0x10(%r14)
addq %rbx, %rdx
leaq -0x88(%rbp), %rdi
movq %rbx, %rsi
callq 0x185a
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %r13
testq %r13, %r13
je 0x15af
xorl %r15d, %r15d
movsbl (%rbx,%r15), %edi
callq 0x10c0
movb %al, (%rbx,%r15)
incq %r15
cmpq %r15, %r13
jne 0x158f
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %rdx
jmp 0x15b1
xorl %edx, %edx
leaq -0x58(%rbp), %r13
movq %r13, -0x10(%r13)
addq %rbx, %rdx
leaq -0x68(%rbp), %rdi
movq %rbx, %rsi
callq 0x185a
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq 0x29fe(%rip), %rdi      # 0x3fd8
callq 0x10b0
movq %rax, %rbx
leaq 0xa1b(%rip), %rsi       # 0x2004
movl $0x1, %edx
movq %rax, %rdi
callq 0x10b0
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %rbx, %rdi
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1050
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq 0x2999(%rip), %rdi      # 0x3fd8
callq 0x10b0
movq %rax, %rbx
leaq 0x9b6(%rip), %rsi       # 0x2004
movl $0x1, %edx
movq %rax, %rdi
callq 0x10b0
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq %rbx, %rdi
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1050
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq 0x292e(%rip), %rdi      # 0x3fd8
callq 0x10b0
movq %rax, %rbx
leaq 0x94b(%rip), %rsi       # 0x2004
movl $0x1, %edx
movq %rax, %rdi
callq 0x10b0
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq %rbx, %rdi
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1050
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq 0x28c6(%rip), %rdi      # 0x3fd8
callq 0x10b0
movq %rax, %rbx
leaq 0x8e3(%rip), %rsi       # 0x2004
movl $0x1, %edx
movq %rax, %rdi
callq 0x10b0
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %rbx, %rdi
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1050
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x177d
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x1795
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0x17b0
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x17c9
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x10a0
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1806
jmp 0x17e9
movq %rax, %rbx
jmp 0x1839
movq %rax, %rbx
jmp 0x181e
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x1806
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x181e
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0x1839
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x1852
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x10a0
movq %rbx, %rdi
callq 0x10f0