// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH13_CopyControl/examples/substr.cc
// Function: main
int main()
{
	string s1 = "a value", s2 = "another";
	auto x = position(s1, s2, "val");
	if (x == string::npos)
		cout << "not found" << endl;
	else if (x < s1.size())
		cout << "value is in first parameter" << endl;
	else
		cout << "value is in second parameter" << endl;

	auto n = (s1 + s2).find('a');
	cout << "n = " << n << endl;
	s1 + s2 = "wow!";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq -0x58(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xd20(%rip), %rsi       # 0x2004
leaq 0xd20(%rip), %rdx       # 0x200b
leaq -0x68(%rbp), %rdi
callq 0x1644
leaq -0x78(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xd08(%rip), %rsi       # 0x200c
leaq 0xd08(%rip), %rdx       # 0x2013
leaq -0x88(%rbp), %rdi
callq 0x1644
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0xcee(%rip), %rsi       # 0x2014
leaq 0xcea(%rip), %rdx       # 0x2017
leaq -0x48(%rbp), %rdi
callq 0x1644
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x126c
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x1362
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x10b0
cmpq -0x60(%rbp), %rbx
leaq 0xcb5(%rip), %rax       # 0x2022
leaq 0xcca(%rip), %rcx       # 0x203e
cmovbq %rax, %rcx
movl $0x1c, %eax
sbbq $0x0, %rax
cmpq $-0x1, %rbx
leaq 0xc8c(%rip), %rsi       # 0x2018
cmovneq %rcx, %rsi
movl $0x9, %edx
cmovneq %rax, %rdx
movq 0x2c38(%rip), %rbx      # 0x3fd8
movq %rbx, %rdi
callq 0x10c0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10a0
movsbl %al, %esi
movq 0x2c12(%rip), %rdi      # 0x3fd8
callq 0x1030
movq %rax, %rdi
callq 0x1060
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x1546
leaq -0x48(%rbp), %r14
movq %r14, %rdi
movl $0x61, %esi
xorl %edx, %edx
callq 0x10d0
movq %rax, %rbx
movq (%r14), %rdi
cmpq %r13, %rdi
je 0x1411
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x10b0
movq 0x2bc0(%rip), %rdi      # 0x3fd8
leaq 0xc3c(%rip), %rsi       # 0x205b
movl $0x4, %edx
callq 0x10c0
movq 0x2ba8(%rip), %rdi      # 0x3fd8
movq %rbx, %rsi
callq 0x1050
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1060
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x1546
leaq -0x48(%rbp), %rdi
movq 0x8(%rdi), %rdx
leaq 0xbdb(%rip), %rcx       # 0x2060
movl $0x4, %r8d
xorl %esi, %esi
callq 0x10f0
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x14a7
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x10b0
movq -0x88(%rbp), %rdi
cmpq %r12, %rdi
je 0x14bf
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x10b0
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x14d4
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x10b0
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14eb
jmp 0x150e
jmp 0x150e
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x1511
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x10b0
jmp 0x1511
jmp 0x150e
movq %rax, %rbx
jmp 0x1529
jmp 0x150e
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r12, %rdi
je 0x1529
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x10b0
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x153e
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x10b0
movq %rbx, %rdi
callq 0x1110