// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH06_Functions/examples/errMsg_initList.cc
// Function: main
int main()
{
	string expected = "description", actual = "some other case";
	initializer_list<int> li = {0,1,2,3};

	// expected, actual are strings 
	if (expected != actual)
		error_msg({"functionX", expected, actual});
	else
		error_msg({"functionX", "okay"});

	// expected, actual are strings 
	if (expected != actual)
		error_msg(ErrCode(42), {"functionX", expected, actual});
	else
		error_msg(ErrCode(0), {"functionX", "okay"});
	
	// can pass an empty list, calls second version of error_msg
	error_msg({}); // prints blank line

	// call function that list initializes its return value
	// results is a vector<string>
	auto results = functionX();
	for (auto i : results) 
		cout << i << " ";
	cout << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
leaq 0xa13(%rip), %rsi       # 0x2007
leaq -0xe8(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0x1060
leaq 0xa05(%rip), %rsi       # 0x2013
leaq -0xc8(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0x1060
leaq -0xe8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x1a95
testb %al, %al
je 0x16a9
leaq 0x9e4(%rip), %rsi       # 0x2023
leaq -0xa8(%rbp), %r14
leaq -0x48(%rbp), %rdx
movq %r14, %rdi
callq 0x1060
leaq -0x88(%rbp), %r15
leaq -0xe8(%rbp), %rsi
movq %r15, %rdi
callq 0x1130
leaq -0x68(%rbp), %r15
leaq -0xc8(%rbp), %rsi
movq %r15, %rdi
callq 0x1130
leaq -0xa8(%rbp), %rdi
pushq $0x3
popq %rsi
callq 0x138e
pushq $0x40
popq %rbx
leaq (%rbx,%rbp), %rdi
addq $-0xa8, %rdi
callq 0x1090
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x168d
jmp 0x1703
leaq 0x973(%rip), %rsi       # 0x2023
leaq -0xa8(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x1060
leaq -0x88(%rbp), %rdi
leaq 0x95f(%rip), %rsi       # 0x202d
leaq -0x29(%rbp), %rdx
callq 0x1060
leaq -0xa8(%rbp), %rdi
pushq $0x2
popq %rsi
callq 0x138e
pushq $0x20
popq %rbx
leaq (%rbx,%rbp), %rdi
addq $-0xa8, %rdi
callq 0x1090
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x16e9
leaq -0xe8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x1a95
testb %al, %al
je 0x1792
leaq 0x902(%rip), %rsi       # 0x2023
leaq -0xa8(%rbp), %r14
leaq -0x48(%rbp), %rdx
movq %r14, %rdi
callq 0x1060
leaq -0x88(%rbp), %r15
leaq -0xe8(%rbp), %rsi
movq %r15, %rdi
callq 0x1130
leaq -0x68(%rbp), %r15
leaq -0xc8(%rbp), %rsi
movq %r15, %rdi
callq 0x1130
pushq $0x40
popq %r14
pushq $0x2a
popq %rdi
leaq -0xa8(%rbp), %rsi
pushq $0x3
popq %rdx
callq 0x12dc
pushq $0x40
popq %rbx
leaq (%rbx,%rbp), %rdi
addq $-0xa8, %rdi
callq 0x1090
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x1776
jmp 0x17ee
leaq 0x88a(%rip), %rsi       # 0x2023
leaq -0xa8(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x1060
leaq -0x88(%rbp), %rdi
leaq 0x876(%rip), %rsi       # 0x202d
leaq -0x29(%rbp), %rdx
callq 0x1060
leaq -0xa8(%rbp), %rsi
pushq $0x2
popq %rdx
xorl %edi, %edi
callq 0x12dc
pushq $0x20
popq %rbx
leaq (%rbx,%rbp), %rdi
addq $-0xa8, %rdi
callq 0x1090
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x17d4
xorl %edi, %edi
xorl %esi, %esi
callq 0x138e
leaq -0x48(%rbp), %rdi
callq 0x13ea
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %r13
leaq -0xa8(%rbp), %r14
movq 0x27c2(%rip), %r15      # 0x3fd8
leaq 0x7e8(%rip), %r12       # 0x2005
cmpq %r13, %rbx
je 0x1851
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1130
movq %r15, %rdi
movq %r14, %rsi
callq 0x10e0
movq %rax, %rdi
movq %r12, %rsi
callq 0x10f0
movq %r14, %rdi
callq 0x1090
addq $0x20, %rbx
jmp 0x181d
movq 0x2780(%rip), %rdi      # 0x3fd8
callq 0x10a0
leaq -0x48(%rbp), %rdi
callq 0x1aa2
leaq -0xc8(%rbp), %rdi
callq 0x1090
leaq -0xe8(%rbp), %rdi
callq 0x1090
xorl %eax, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq (%r14,%rbp), %rdi
addq $-0xa8, %rdi
callq 0x1090
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x1895
jmp 0x1995
movq %rax, %rbx
pushq $0x20
popq %r14
leaq (%r14,%rbp), %rdi
addq $-0xa8, %rdi
callq 0x1090
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x18bb
jmp 0x1995
jmp 0x1929
jmp 0x1942
jmp 0x1942
movq %rax, %rbx
pushq $0x40
popq %r14
leaq (%r14,%rbp), %rdi
addq $-0xa8, %rdi
callq 0x1090
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x18e7
jmp 0x1995
movq %rax, %rbx
pushq $0x20
popq %r14
leaq (%r14,%rbp), %rdi
addq $-0xa8, %rdi
callq 0x1090
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x190d
jmp 0x1995
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x1090
jmp 0x1995
jmp 0x1942
jmp 0x1942
jmp 0x1978
jmp 0x1942
movq %rax, %rbx
jmp 0x1995
movq %rax, %rbx
addq $-0x20, %r15
movq %r15, %rdi
callq 0x1090
cmpq %r14, %r15
jne 0x194a
jmp 0x1995
movq %rax, %rbx
addq $-0x20, %r15
movq %r15, %rdi
callq 0x1090
cmpq %r14, %r15
jne 0x1960
jmp 0x1995
movq %rax, %rbx
jmp 0x19a1
movq %rax, %rbx
jmp 0x198c
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x1090
leaq -0x48(%rbp), %rdi
callq 0x1aa2
leaq -0xc8(%rbp), %rdi
callq 0x1090
leaq -0xe8(%rbp), %rdi
callq 0x1090
movq %rbx, %rdi
callq 0x1190
nop