// File: 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
subq $0x100, %rsp            # imm = 0x100
movl $0x0, -0x4(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x1740
movl $0x0, -0x24(%rbp)
cmpl $0x14, -0x24(%rbp)
jge 0x12ed
movl -0x24(%rbp), %eax
addl %eax, %eax
movl %eax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1760
jmp 0x12cf
jmp 0x12d1
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x12b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x171c
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
callq 0x1790
movl %eax, -0x84(%rbp)
jmp 0x1303
movl -0x84(%rbp), %esi
movq 0x5cb8(%rip), %rdi      # 0x6fc8
callq 0x1130
movq %rax, -0x90(%rbp)
jmp 0x131e
movq -0x90(%rbp), %rdi
movq 0x5c84(%rip), %rsi      # 0x6fb0
callq 0x10e0
jmp 0x1333
jmp 0x1398
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x171c
movq -0x30(%rbp), %rdi
callq 0x1060
movq %rax, -0x40(%rbp)
movq 0x5c63(%rip), %rdi      # 0x6fc8
leaq 0x2ca8(%rip), %rsi      # 0x4014
callq 0x10b0
movq %rax, -0x98(%rbp)
jmp 0x137a
movq -0x98(%rbp), %rdi
movq 0x5c28(%rip), %rsi      # 0x6fb0
callq 0x10e0
jmp 0x138f
callq 0x1110
jmp 0x1396
jmp 0x1398
leaq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x1790
movl %eax, -0x9c(%rbp)
jmp 0x13ae
movl -0x9c(%rbp), %esi
movq 0x5c0d(%rip), %rdi      # 0x6fc8
callq 0x1130
movq %rax, -0xa8(%rbp)
jmp 0x13c9
movq -0xa8(%rbp), %rdi
movq 0x5bd9(%rip), %rsi      # 0x6fb0
callq 0x10e0
jmp 0x13de
jmp 0x145b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x1110
jmp 0x13f3
jmp 0x171c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x171c
movq -0x30(%rbp), %rdi
callq 0x1060
movq %rax, -0x48(%rbp)
movq 0x5ba0(%rip), %rdi      # 0x6fc8
leaq 0x2bf3(%rip), %rsi      # 0x4022
callq 0x10b0
movq %rax, -0xb0(%rbp)
jmp 0x143d
movq -0xb0(%rbp), %rdi
movq 0x5b65(%rip), %rsi      # 0x6fb0
callq 0x10e0
jmp 0x1452
callq 0x1110
jmp 0x1459
jmp 0x145b
leaq -0x20(%rbp), %rdi
movl $0x26, %esi
callq 0x1790
movl %eax, -0xb4(%rbp)
jmp 0x1471
movl -0xb4(%rbp), %esi
movq 0x5b4a(%rip), %rdi      # 0x6fc8
callq 0x1130
movq %rax, -0xc0(%rbp)
jmp 0x148c
movq -0xc0(%rbp), %rdi
movq 0x5b16(%rip), %rsi      # 0x6fb0
callq 0x10e0
jmp 0x14a1
jmp 0x151e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x1110
jmp 0x14b6
jmp 0x171c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x171c
movq -0x30(%rbp), %rdi
callq 0x1060
movq %rax, -0x50(%rbp)
movq 0x5add(%rip), %rdi      # 0x6fc8
leaq 0x2b3e(%rip), %rsi      # 0x4030
callq 0x10b0
movq %rax, -0xc8(%rbp)
jmp 0x1500
movq -0xc8(%rbp), %rdi
movq 0x5aa2(%rip), %rsi      # 0x6fb0
callq 0x10e0
jmp 0x1515
callq 0x1110
jmp 0x151c
jmp 0x151e
leaq -0x68(%rbp), %rdi
callq 0x1850
movl $0xfffffffb, -0x6c(%rbp) # imm = 0xFFFFFFFB
cmpl $0x5, -0x6c(%rbp)
jg 0x1579
leaq -0x68(%rbp), %rdi
leaq -0x6c(%rbp), %rsi
callq 0x1870
jmp 0x1543
jmp 0x1545
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x152e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x1110
jmp 0x1563
jmp 0x171c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x1713
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
callq 0x18b0
movl %eax, -0xcc(%rbp)
jmp 0x158c
movl -0xcc(%rbp), %esi
movq 0x5a2f(%rip), %rdi      # 0x6fc8
callq 0x1130
movq %rax, -0xd8(%rbp)
jmp 0x15a7
movq -0xd8(%rbp), %rdi
movq 0x59fb(%rip), %rsi      # 0x6fb0
callq 0x10e0
jmp 0x15bc
jmp 0x1621
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1713
movq -0x30(%rbp), %rdi
callq 0x1060
movq %rax, -0x78(%rbp)
movq 0x59da(%rip), %rdi      # 0x6fc8
leaq 0x2a4a(%rip), %rsi      # 0x403f
callq 0x10b0
movq %rax, -0xe0(%rbp)
jmp 0x1603
movq -0xe0(%rbp), %rdi
movq 0x599f(%rip), %rsi      # 0x6fb0
callq 0x10e0
jmp 0x1618
callq 0x1110
jmp 0x161f
jmp 0x1621
leaq -0x68(%rbp), %rdi
movl $0xfffffff9, %esi       # imm = 0xFFFFFFF9
callq 0x18b0
movl %eax, -0xe4(%rbp)
jmp 0x1637
movl -0xe4(%rbp), %esi
movq 0x5984(%rip), %rdi      # 0x6fc8
callq 0x1130
movq %rax, -0xf0(%rbp)
jmp 0x1652
movq -0xf0(%rbp), %rdi
movq 0x5950(%rip), %rsi      # 0x6fb0
callq 0x10e0
jmp 0x1667
jmp 0x16e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x1110
jmp 0x167c
jmp 0x1713
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1713
movq -0x30(%rbp), %rdi
callq 0x1060
movq %rax, -0x80(%rbp)
movq 0x591b(%rip), %rdi      # 0x6fc8
leaq 0x2999(%rip), %rsi      # 0x404d
callq 0x10b0
movq %rax, -0xf8(%rbp)
jmp 0x16c2
movq -0xf8(%rbp), %rdi
movq 0x58e0(%rip), %rsi      # 0x6fb0
callq 0x10e0
jmp 0x16d7
callq 0x1110
jmp 0x16de
jmp 0x16e0
leaq -0x68(%rbp), %rdi
callq 0x1960
leaq -0x20(%rbp), %rdi
callq 0x1980
movl -0x4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x1110
jmp 0x1711
jmp 0x1713
leaq -0x68(%rbp), %rdi
callq 0x1960
leaq -0x20(%rbp), %rdi
callq 0x1980
movq -0x30(%rbp), %rdi
callq 0x1140
movq %rax, %rdi
callq 0x1840
nopw %cs:(%rax,%rax)