// File: /workspace/github_cpp_makefile_star2_O3/iZhangHui[P]CppPrimer/CH06_Functions/examples/refparms.cc
// Function: main
int main() 
{
	
	string s;
	getline(cin, s); 
	size_t ctr = 0;
	auto index = find_char(s, 'o', ctr);
	cout << index << " " << ctr << endl;
	
	vector<int> ivec;
	int i;
	// read values into ivec
	while (cin >> i)
		ivec.push_back(i);

	// for each value in the list of ints
	for (auto i : {42, 33, 92}) {
		auto it = find_val(ivec.begin(), ivec.end(), i, ctr);
		if (it == ivec.end())
			cout << i << " is not in the input data" << endl;
		else
			cout << i << " was at position " 
			     << it - ivec.begin() << endl;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
leaq -0x60(%rbp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
movq 0x2ca0(%rip), %rdi      # 0x3fe0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %edx
movq 0x2c85(%rip), %rdi      # 0x3fe0
leaq -0x70(%rbp), %rsi
callq 0x1140
movq -0x68(%rbp), %rax
testq %rax, %rax
je 0x13a2
movq -0x70(%rbp), %rcx
xorl %ebx, %ebx
xorl %edx, %edx
xorl %edi, %edi
movq %rax, %rsi
leaq 0x1(%rdx), %r8
cmpq %rax, %rsi
movq %rsi, %r9
cmoveq %rdi, %r9
cmpb $0x6f, (%rcx,%rdi)
cmoveq %r8, %rbx
cmoveq %r8, %rdx
cmoveq %r9, %rsi
incq %rdi
cmpq %rdi, %rax
jne 0x137a
jmp 0x13a6
xorl %ebx, %ebx
xorl %esi, %esi
movq 0x2c23(%rip), %rdi      # 0x3fd0
callq 0x1070
movq %rax, %r14
leaq 0xc72(%rip), %rsi       # 0x202e
movl $0x1, %edx
movq %rax, %rdi
callq 0x10f0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1070
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rbx
movaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq 0x2bc9(%rip), %r14      # 0x3fe0
leaq -0x2c(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x1060
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x145a
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x144d
movl -0x2c(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x48(%rbp)
jmp 0x141b
movq %rbx, %rdi
movq %r15, %rdx
callq 0x15ec
jmp 0x141b
movabsq $0x210000002a, %rax     # imm = 0x210000002A
movq %rax, -0x7c(%rbp)
movl $0x5c, -0x74(%rbp)
xorl %r15d, %r15d
movq 0x2b57(%rip), %rbx      # 0x3fd0
leaq 0xb84(%rip), %r14       # 0x2004
movl -0x7c(%rbp,%r15), %esi
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %rax
cmpq %rax, %rcx
je 0x1511
movq %rax, %r12
movq %r12, %rdx
cmpq %rax, %r12
cmoveq %rcx, %r12
cmpl %esi, (%rcx)
cmovneq %rdx, %r12
addq $0x4, %rcx
cmpq %rax, %rcx
jne 0x1495
cmpq %rax, %r12
je 0x1511
movq %rbx, %rdi
callq 0x1120
movq %rax, %r13
movl $0x11, %edx
movq %rax, %rdi
leaq 0xb51(%rip), %rsi       # 0x201e
callq 0x10f0
subq -0x50(%rbp), %r12
sarq $0x2, %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0x10b0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %esi
movq %r12, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
jmp 0x1554
movq %rbx, %rdi
callq 0x1120
movq %rax, %r12
movl $0x19, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x10f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %esi
movq %r12, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
addq $0x4, %r15
cmpq $0xc, %r15
jne 0x1480
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x1577
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x10e0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x1590
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x10e0
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x15cf
movq %rax, %rbx
leaq -0x60(%rbp), %r14
jmp 0x15cf
jmp 0x15b3
jmp 0x15b3
movq %rax, %rbx
leaq -0x60(%rbp), %r14
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x15cf
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x10e0
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x15e4
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x10e0
movq %rbx, %rdi
callq 0x1130