// File: /workspace/github_cpp_makefile_star2_O1/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 0x2ca6(%rip), %rdi      # 0x3fe0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %edx
movq 0x2c8b(%rip), %rdi      # 0x3fe0
leaq -0x70(%rbp), %rsi
callq 0x1140
movq -0x68(%rbp), %rax
testq %rax, %rax
je 0x1398
movq -0x70(%rbp), %rcx
xorl %ebx, %ebx
xorl %edx, %edx
movq %rax, %rsi
cmpq %rax, %rsi
movq %rsi, %rdi
cmoveq %rdx, %rdi
xorl %r8d, %r8d
cmpb $0x6f, (%rcx,%rdx)
cmoveq %rdi, %rsi
sete %r8b
addq %r8, %rbx
incq %rdx
cmpq %rdx, %rax
jne 0x1372
jmp 0x139d
xorl %ebx, %ebx
movq %rax, %rsi
movq 0x2c2c(%rip), %rdi      # 0x3fd0
callq 0x1070
movq %rax, %r14
leaq 0xc7b(%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 0x2bd2(%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 0x1451
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x1444
movl -0x2c(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x48(%rbp)
jmp 0x1412
movq %rbx, %rdi
movq %r15, %rdx
callq 0x15e6
jmp 0x1412
movabsq $0x210000002a, %rax     # imm = 0x210000002A
movq %rax, -0x7c(%rbp)
movl $0x5c, -0x74(%rbp)
xorl %r14d, %r14d
movq 0x2b60(%rip), %rbx      # 0x3fd0
leaq 0xba7(%rip), %r15       # 0x201e
movl -0x7c(%rbp,%r14), %esi
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rax, %r12
cmpq %rax, %rcx
je 0x14a8
movq %rax, %r12
cmpq %rax, %r12
movq %r12, %rdx
cmoveq %rcx, %rdx
cmpl %esi, (%rcx)
cmoveq %rdx, %r12
addq $0x4, %rcx
cmpq %rax, %rcx
jne 0x148f
cmpq %rax, %r12
je 0x1507
movq %rbx, %rdi
callq 0x1120
movq %rax, %r13
movl $0x11, %edx
movq %rax, %rdi
movq %r15, %rsi
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 0x154e
movq %rbx, %rdi
callq 0x1120
movq %rax, %r12
movl $0x19, %edx
movq %rax, %rdi
leaq 0xae3(%rip), %rsi       # 0x2004
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, %r14
cmpq $0xc, %r14
jne 0x1477
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x1571
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x10e0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x158a
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 0x15c9
movq %rax, %rbx
leaq -0x60(%rbp), %r14
jmp 0x15c9
jmp 0x15ad
jmp 0x15ad
movq %rax, %rbx
leaq -0x60(%rbp), %r14
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x15c9
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x10e0
movq -0x70(%rbp), %rdi
cmpq %r14, %rdi
je 0x15de
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x10e0
movq %rbx, %rdi
callq 0x1130