// File: /workspace/github_cpp_makefile_star2_O2/t0mm4rx[P]piscine_cpp/day08/ex02/main.cpp
// Function: main
int main()
{
	MutantStack<int> mstack;
	mstack.push(5);
	mstack.push(17);
	std::cout << mstack.top() << std::endl;
	mstack.pop();
	std::cout << mstack.size() << std::endl;
	mstack.push(3);
	mstack.push(5);
	mstack.push(737);
	mstack.push(0);
	MutantStack<int>::iterator it = mstack.begin();
	MutantStack<int>::iterator ite = mstack.end();
	++it;
	--it;
	while (it != ite)
	{
		std::cout << *it << std::endl;
		++it;
	}
	MutantStack<int> s(mstack);
	std::cout << mstack.size() << "/" << s.size() << std::endl;
	while (!s.empty())
		s.pop();
	std::cout << "Size: " << s.size() << std::endl;
	for (int i = 0; i < 10; i++)
		s.push(i * 2);
	it = s.begin();
	while (it != s.end())
		std::cout << *(it++) << " - ";
	std::cout << std::endl;
	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
leaq -0xe8(%rbp), %rbx
movq %rbx, %rdi
callq 0x16aa
leaq -0x98(%rbp), %rsi
movl $0x5, (%rsi)
movq %rbx, %rdi
callq 0x193a
leaq -0x98(%rbp), %rsi
movl $0x11, (%rsi)
leaq -0xe8(%rbp), %rdi
callq 0x193a
movq -0xb8(%rbp), %rax
cmpq -0xb0(%rbp), %rax
jne 0x131d
movq -0xa0(%rbp), %rcx
movl $0x200, %eax            # imm = 0x200
addq -0x8(%rcx), %rax
movl -0x4(%rax), %esi
movq 0x3cb1(%rip), %rdi      # 0x4fd8
callq 0x1120
movq %rax, %rdi
callq 0x1060
movq %rbx, %rdi
callq 0x1bbc
movq %rbx, %rdi
callq 0x1a06
movq 0x3c8d(%rip), %rdi      # 0x4fd8
movq %rax, %rsi
callq 0x1080
movq %rax, %rdi
callq 0x1060
leaq -0x98(%rbp), %rsi
movl $0x3, (%rsi)
leaq -0xe8(%rbp), %rdi
callq 0x193a
leaq -0x98(%rbp), %rsi
movl $0x5, (%rsi)
leaq -0xe8(%rbp), %rdi
callq 0x193a
leaq -0x98(%rbp), %rsi
movl $0x2e1, (%rsi)          # imm = 0x2E1
leaq -0xe8(%rbp), %rdi
callq 0x193a
leaq -0x98(%rbp), %rsi
andl $0x0, (%rsi)
leaq -0xe8(%rbp), %rdi
callq 0x193a
movq -0xd8(%rbp), %r12
movq -0xd0(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0xc8(%rbp), %r15
movq %r15, -0x38(%rbp)
movq -0xc0(%rbp), %r14
movq %r14, -0x30(%rbp)
addq $0x4, %r12
cmpq %r15, %r12
je 0x13f4
cmpq %rax, %r12
jne 0x1419
jmp 0x13f8
addq $0x8, %r14
leaq -0x8(%r14), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%r14), %r15
movq %r15, -0x40(%rbp)
addq $0x200, %r15            # imm = 0x200
movq %r15, -0x38(%rbp)
movq %rax, %r14
movq %r15, %r12
movq -0xb8(%rbp), %r13
addq $-0x4, %r12
movq 0x3bad(%rip), %rbx      # 0x4fd8
movq %r12, -0x48(%rbp)
cmpq %r13, %r12
je 0x1476
movl (%r12), %esi
movq %rbx, %rdi
callq 0x1120
movq %rax, %rdi
callq 0x1060
addq $0x4, %r12
movq %r12, -0x48(%rbp)
cmpq %r15, %r12
jne 0x142f
leaq 0x8(%r14), %rax
movq %rax, -0x30(%rbp)
movq 0x8(%r14), %r12
movq %r12, -0x40(%rbp)
leaq 0x200(%r12), %r15
movq %r15, -0x38(%rbp)
movq %rax, %r14
jmp 0x142b
leaq -0x98(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x1c22
leaq -0xe8(%rbp), %rdi
callq 0x1a06
movq 0x3b3c(%rip), %rdi      # 0x4fd8
movq %rax, %rsi
callq 0x1080
leaq 0x1b59(%rip), %rsi      # 0x3004
movq %rax, %rdi
callq 0x10b0
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x1a06
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1080
movq %rax, %rdi
callq 0x1060
leaq -0x98(%rbp), %rbx
movq -0x68(%rbp), %rax
cmpq -0x88(%rbp), %rax
je 0x14f3
movq %rbx, %rdi
callq 0x1bbc
jmp 0x14dc
movq 0x3ade(%rip), %rdi      # 0x4fd8
leaq 0x1b05(%rip), %rsi      # 0x3006
callq 0x10b0
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x1a06
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1080
movq %rax, %rdi
callq 0x1060
xorl %r15d, %r15d
leaq -0x98(%rbp), %rbx
leaq -0x108(%rbp), %r14
cmpl $0x14, %r15d
je 0x1557
movl %r15d, -0x108(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x193a
addl $0x2, %r15d
jmp 0x1539
movq -0x88(%rbp), %rax
movups -0x80(%rbp), %xmm0
movq -0x70(%rbp), %rcx
leaq -0x48(%rbp), %rbx
movq %rax, (%rbx)
movups %xmm0, 0x8(%rbx)
movq %rcx, 0x18(%rbx)
leaq -0x108(%rbp), %r14
movq 0x3a55(%rip), %r15      # 0x4fd8
leaq 0x1a83(%rip), %r12      # 0x300d
cmpq -0x68(%rbp), %rax
je 0x15bf
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x1670
movq -0x108(%rbp), %rax
movl (%rax), %esi
movq %r15, %rdi
callq 0x1120
movq %rax, %rdi
movq %r12, %rsi
callq 0x10b0
movq -0x48(%rbp), %rax
jmp 0x158a
movq 0x3a12(%rip), %rdi      # 0x4fd8
callq 0x1060
leaq -0x98(%rbp), %rdi
callq 0x1902
leaq -0xe8(%rbp), %rdi
callq 0x1902
xorl %eax, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x161c
jmp 0x161c
jmp 0x161c
jmp 0x161c
jmp 0x161c
jmp 0x161c
jmp 0x161c
jmp 0x161c
jmp 0x160b
jmp 0x160b
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x1902
jmp 0x161f
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x1902
movq %rbx, %rdi
callq 0x1130
nop