// File: /workspace/github_cpp_makefile_star2_O1/t0mm4rx[P]piscine_cpp/day08/ex00/main.cpp
// Function: main
int main()
{
	std::vector<int> list;
	for (int i = 0; i < 20; i++)
		list.push_back(i * 2);
	try
	{
		std::cout << easyfind(list, 4) << std::endl;
	}
	catch (std::exception &e)
	{
		std::cout << "Cannot find 4" << std::endl;
	}
	try
	{
		std::cout << easyfind(list, 1) << std::endl;
	}
	catch (std::exception &e)
	{
		std::cout << "Cannot find 1" << std::endl;
	}
	try
	{
		std::cout << easyfind(list, 38) << std::endl;
	}
	catch (std::exception &e)
	{
		std::cout << "Cannot find 38" << std::endl;
	}
	std::list<int> list2;
	for (int i = -5; i <= 5; i++)
		list2.push_back(i);
	try
	{
		std::cout << easyfind(list2, 0) << std::endl;
	}
	catch (std::exception &e)
	{
		std::cout << "Cannot find 0" << std::endl;
	}
	try
	{
		std::cout << easyfind(list2, -7) << std::endl;
	}
	catch (std::exception &e)
	{
		std::cout << "Cannot find -7" << std::endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
xorps %xmm0, %xmm0
leaq -0x30(%rbp), %r14
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
xorl %r15d, %r15d
leaq -0x48(%rbp), %rbx
movl %r15d, -0x48(%rbp)
movq -0x28(%rbp), %rsi
cmpq -0x20(%rbp), %rsi
je 0x130e
movl %r15d, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x28(%rbp)
jmp 0x1319
movq %r14, %rdi
movq %rbx, %rdx
callq 0x178e
addl $0x2, %r15d
cmpl $0x28, %r15d
jne 0x12f3
leaq -0x30(%rbp), %rdi
movl $0x4, %esi
callq 0x16d9
movq 0x2c90(%rip), %rdi      # 0x3fc8
movl %eax, %esi
callq 0x1160
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10b0
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x16d9
movq 0x2c4a(%rip), %rdi      # 0x3fc8
movl %eax, %esi
callq 0x1160
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10b0
leaq -0x30(%rbp), %rdi
movl $0x26, %esi
callq 0x16d9
movq 0x2c04(%rip), %rdi      # 0x3fc8
movl %eax, %esi
callq 0x1160
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10b0
movq %rbx, -0x40(%rbp)
movq %rbx, -0x48(%rbp)
movq $0x0, -0x38(%rbp)
movl $0xfffffffb, %r14d      # imm = 0xFFFFFFFB
movl $0x18, %edi
callq 0x10f0
movl %r14d, 0x10(%rax)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1040
incq -0x38(%rbp)
incl %r14d
cmpl $0x6, %r14d
jne 0x140b
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
callq 0x173f
movq 0x2b85(%rip), %rdi      # 0x3fc8
movl %eax, %esi
callq 0x1160
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10b0
leaq -0x48(%rbp), %r15
movq %r15, %rdi
movl $0xfffffff9, %esi       # imm = 0xFFFFFFF9
callq 0x173f
movq 0x2b3c(%rip), %rdi      # 0x3fc8
movl %eax, %esi
callq 0x1160
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10b0
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x14db
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x1100
movq %rbx, %rdi
cmpq %r15, %rbx
jne 0x14c6
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x14f0
movq -0x20(%rbp), %rsi
subq %rdi, %rsi
callq 0x1100
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
cmpl $0x1, %edx
jne 0x169e
movq %r14, %rdi
callq 0x1070
movq 0x2ab0(%rip), %rdi      # 0x3fc8
leaq 0xb1e(%rip), %rsi       # 0x203d
movl $0xe, %edx
callq 0x1110
movq 0x2a98(%rip), %rdi      # 0x3fc8
callq 0x1080
callq 0x1140
jmp 0x14bd
jmp 0x169b
movq %rax, %r14
callq 0x1140
jmp 0x169e
movq %rax, %r14
cmpl $0x1, %edx
jne 0x169e
movq %r14, %rdi
callq 0x1070
movq 0x2a5f(%rip), %rdi      # 0x3fc8
leaq 0xabf(%rip), %rsi       # 0x202f
movl $0xd, %edx
callq 0x1110
movq 0x2a47(%rip), %rdi      # 0x3fc8
callq 0x1080
callq 0x1140
jmp 0x1474
jmp 0x169b
movq %rax, %r14
callq 0x1140
jmp 0x169e
movq %rax, %r14
cmpl $0x1, %edx
jne 0x16bc
movq %r14, %rdi
callq 0x1070
movq 0x2a0b(%rip), %rdi      # 0x3fc8
leaq 0xa5c(%rip), %rsi       # 0x2020
movl $0xe, %edx
callq 0x1110
movq 0x29f3(%rip), %rdi      # 0x3fc8
callq 0x1080
callq 0x1140
jmp 0x13f5
jmp 0x1696
movq %rax, %r14
callq 0x1140
jmp 0x16bc
movq %rax, %r14
cmpl $0x1, %edx
jne 0x16bc
movq %r14, %rdi
callq 0x1070
movq 0x29b7(%rip), %rdi      # 0x3fc8
leaq 0x9fa(%rip), %rsi       # 0x2012
movl $0xd, %edx
callq 0x1110
movq 0x299f(%rip), %rdi      # 0x3fc8
callq 0x1080
callq 0x1140
jmp 0x13af
jmp 0x1696
movq %rax, %r14
callq 0x1140
jmp 0x16bc
movq %rax, %r14
cmpl $0x1, %edx
jne 0x16bc
movq %r14, %rdi
callq 0x1070
movq 0x296d(%rip), %rdi      # 0x3fc8
leaq 0x9a2(%rip), %rsi       # 0x2004
movl $0xd, %edx
callq 0x1110
movq 0x2955(%rip), %rdi      # 0x3fc8
callq 0x1080
callq 0x1140
jmp 0x1369
jmp 0x1696
movq %rax, %r14
callq 0x1140
jmp 0x16bc
movq %rax, %rdi
callq 0x1731
movq %rax, %r14
jmp 0x16bc
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %rbx, %rdi
je 0x16bc
movq (%rdi), %r15
movl $0x18, %esi
callq 0x1100
movq %r15, %rdi
cmpq %rbx, %r15
jne 0x16a7
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x16d1
movq -0x20(%rbp), %rsi
subq %rdi, %rsi
callq 0x1100
movq %r14, %rdi
callq 0x1170