// File: /workspace/github_cpp_makefile_star2_O1/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 0x18ce
leaq -0x98(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %rdi
callq 0x1834
movq -0x40(%rbp), %rbx
testq %rbx, %rbx
je 0x13b3
movq -0x48(%rbp), %r12
xorl %r13d, %r13d
movsbl (%r12,%r13), %edi
callq 0x1110
movb %al, (%r12,%r13)
incq %r13
cmpq %r13, %rbx
jne 0x139d
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x2c16(%rip), %rdi      # 0x3fd8
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 -0x40(%rbp), %rbx
testq %rbx, %rbx
je 0x1417
movq -0x48(%rbp), %r12
xorl %r13d, %r13d
movsbl (%r12,%r13), %edi
callq 0x10c0
movb %al, (%r12,%r13)
incq %r13
cmpq %r13, %rbx
jne 0x1401
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x2bb2(%rip), %rdi      # 0x3fd8
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 -0x40(%rbp), %rbx
testq %rbx, %rbx
je 0x148b
movq -0x48(%rbp), %r12
xorl %r13d, %r13d
movsbl (%r12,%r13), %edi
callq 0x1110
movb %al, (%r12,%r13)
incq %r13
cmpq %r13, %rbx
jne 0x1475
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x2b3e(%rip), %rdi      # 0x3fd8
callq 0x10b0
movq %rax, %rbx
leaq 0xb5b(%rip), %rsi       # 0x2004
movl $0x1, %edx
movq %rax, %rdi
callq 0x10b0
movq -0x40(%rbp), %r12
testq %r12, %r12
je 0x14de
movq -0x48(%rbp), %r13
xorl %r14d, %r14d
movsbl (%r13,%r14), %edi
callq 0x10c0
movb %al, (%r13,%r14)
incq %r14
cmpq %r14, %r12
jne 0x14c6
movq -0x48(%rbp), %rsi
movq -0x40(%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 -0x40(%rbp), %rbx
testq %rbx, %rbx
je 0x153e
movq -0x48(%rbp), %r12
xorl %r14d, %r14d
movsbl (%r12,%r14), %edi
callq 0x1110
movb %al, (%r12,%r14)
incq %r14
cmpq %r14, %rbx
jne 0x1528
leaq -0x78(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x1834
movq -0x40(%rbp), %rbx
testq %rbx, %rbx
je 0x1586
movq -0x48(%rbp), %r13
xorl %r14d, %r14d
movsbl (%r13,%r14), %edi
callq 0x10c0
movb %al, (%r13,%r14)
incq %r14
cmpq %r14, %rbx
jne 0x156e
leaq -0x58(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %rdi
callq 0x1834
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq 0x2a24(%rip), %rdi      # 0x3fd8
callq 0x10b0
movq %rax, %rbx
leaq 0xa41(%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 0x29bf(%rip), %rdi      # 0x3fd8
callq 0x10b0
movq %rax, %rbx
leaq 0x9dc(%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 0x2954(%rip), %rdi      # 0x3fd8
callq 0x10b0
movq %rax, %rbx
leaq 0x971(%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 0x28ec(%rip), %rdi      # 0x3fd8
callq 0x10b0
movq %rax, %rbx
leaq 0x909(%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 0x1757
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0x88(%rbp), %rdi
cmpq %r12, %rdi
je 0x176f
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
je 0x178a
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x17a3
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 0x17e0
jmp 0x17c3
movq %rax, %rbx
jmp 0x1813
movq %rax, %rbx
jmp 0x17f8
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x17e0
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0x88(%rbp), %rdi
cmpq %r12, %rdi
je 0x17f8
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
je 0x1813
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x182c
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x10a0
movq %rbx, %rdi
callq 0x10f0