// File: /workspace/github_cpp_makefile_star2_O3/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 $0xa8, %rsp
xorps %xmm0, %xmm0
leaq -0xd0(%rbp), %rbx
movaps %xmm0, 0x40(%rbx)
movaps %xmm0, 0x30(%rbx)
movaps %xmm0, 0x20(%rbx)
movaps %xmm0, 0x10(%rbx)
movaps %xmm0, (%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1834
leaq -0x80(%rbp), %rsi
movl $0x5, (%rsi)
movq %rbx, %rdi
callq 0x1a30
leaq -0x80(%rbp), %rsi
movl $0x11, (%rsi)
leaq -0xd0(%rbp), %rdi
callq 0x1a30
movq -0xa0(%rbp), %rax
cmpq -0x98(%rbp), %rax
jne 0x135f
movq -0x88(%rbp), %rcx
movl $0x200, %eax            # imm = 0x200
addq -0x8(%rcx), %rax
movl -0x4(%rax), %esi
movq 0x3c6f(%rip), %rdi      # 0x4fd8
callq 0x1140
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 0x1090
movq -0xa0(%rbp), %rax
movq -0x98(%rbp), %rdi
cmpq %rdi, %rax
je 0x13b8
addq $-0x4, %rax
movq -0x88(%rbp), %rcx
jmp 0x13f4
movl $0x200, %esi            # imm = 0x200
callq 0x10e0
movq -0x88(%rbp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, -0x88(%rbp)
movq -0x8(%rax), %rdi
movq %rdi, -0x98(%rbp)
leaq 0x200(%rdi), %rax
movq %rax, -0x90(%rbp)
leaq 0x1fc(%rdi), %rax
movq %rax, -0xa0(%rbp)
movq %rcx, %rdx
subq -0xa8(%rbp), %rdx
shrq $0x3, %rdx
cmpq $0x1, %rcx
adcq $-0x1, %rdx
shlq $0x7, %rdx
subq %rdi, %rax
movq -0xb0(%rbp), %rsi
subq -0xc0(%rbp), %rsi
sarq $0x2, %rax
sarq $0x2, %rsi
addq %rax, %rsi
addq %rdx, %rsi
movq 0x3b9d(%rip), %rdi      # 0x4fd8
callq 0x1080
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 0x1090
leaq -0x80(%rbp), %rsi
movl $0x3, (%rsi)
leaq -0xd0(%rbp), %rdi
callq 0x1a30
leaq -0x80(%rbp), %rsi
movl $0x5, (%rsi)
leaq -0xd0(%rbp), %rdi
callq 0x1a30
leaq -0x80(%rbp), %rsi
movl $0x2e1, (%rsi)          # imm = 0x2E1
leaq -0xd0(%rbp), %rdi
callq 0x1a30
leaq -0x80(%rbp), %rsi
movl $0x0, (%rsi)
leaq -0xd0(%rbp), %rdi
callq 0x1a30
movq -0xc0(%rbp), %r13
movq -0xb0(%rbp), %rbx
movq -0xa8(%rbp), %r15
movq -0xa0(%rbp), %r12
addq $0x4, %r13
cmpq %rbx, %r13
je 0x14f2
cmpq -0xb8(%rbp), %r13
jne 0x1506
jmp 0x14f6
addq $0x8, %r15
movl $0x200, %ebx            # imm = 0x200
addq -0x8(%r15), %rbx
addq $-0x8, %r15
movq %rbx, %r13
addq $-0x4, %r13
cmpq %r12, %r13
je 0x1563
movl (%r13), %esi
movq 0x3abe(%rip), %rdi      # 0x4fd8
callq 0x1140
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
addq $0x4, %r13
cmpq %rbx, %r13
jne 0x150a
movq 0x8(%r15), %r13
addq $0x8, %r15
leaq 0x200(%r13), %rbx
jmp 0x150a
leaq -0x80(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x1c94
movq -0x88(%rbp), %rax
movq %rax, %rcx
subq -0xa8(%rbp), %rcx
shrq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
shlq $0x7, %rcx
movq -0xb0(%rbp), %rsi
movq -0xa0(%rbp), %rax
subq -0x98(%rbp), %rax
subq -0xc0(%rbp), %rsi
sarq $0x2, %rax
sarq $0x2, %rsi
addq %rax, %rsi
addq %rcx, %rsi
movq 0x3a13(%rip), %rdi      # 0x4fd8
callq 0x1080
movq %rax, %rbx
leaq 0x1a30(%rip), %rsi      # 0x3004
movl $0x1, %edx
movq %rax, %rdi
callq 0x10f0
movq -0x38(%rbp), %rax
movq %rax, %rcx
subq -0x58(%rbp), %rcx
shrq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
shlq $0x7, %rcx
movq -0x60(%rbp), %rsi
movq -0x50(%rbp), %rax
subq -0x48(%rbp), %rax
subq -0x70(%rbp), %rsi
sarq $0x2, %rax
sarq $0x2, %rsi
addq %rax, %rsi
addq %rcx, %rsi
movq %rbx, %rdi
callq 0x1080
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 0x1090
movq -0x70(%rbp), %rax
movq -0x50(%rbp), %rcx
cmpq %rax, %rcx
je 0x16a5
movq -0x48(%rbp), %rdi
cmpq %rdi, %rcx
je 0x1668
addq $-0x4, %rcx
jmp 0x169c
movl $0x200, %esi            # imm = 0x200
callq 0x10e0
movq -0x70(%rbp), %rax
movq -0x38(%rbp), %rcx
leaq -0x8(%rcx), %rdx
movq %rdx, -0x38(%rbp)
movq -0x8(%rcx), %rdi
movq %rdi, -0x48(%rbp)
leaq 0x200(%rdi), %rcx
movq %rcx, -0x40(%rbp)
leaq 0x1fc(%rdi), %rcx
movq %rcx, -0x50(%rbp)
cmpq %rax, %rcx
jne 0x165d
movq 0x392c(%rip), %rdi      # 0x4fd8
leaq 0x1953(%rip), %rsi      # 0x3006
movl $0x6, %edx
callq 0x10f0
movq -0x38(%rbp), %rax
movq %rax, %rcx
subq -0x58(%rbp), %rcx
shrq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
shlq $0x7, %rcx
movq -0x60(%rbp), %rsi
movq -0x50(%rbp), %rax
subq -0x48(%rbp), %rax
subq -0x70(%rbp), %rsi
sarq $0x2, %rax
sarq $0x2, %rsi
addq %rax, %rsi
addq %rcx, %rsi
movq 0x38db(%rip), %rdi      # 0x4fd8
callq 0x1080
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 0x1090
xorl %r15d, %r15d
leaq -0x80(%rbp), %rbx
leaq -0x2c(%rbp), %r14
movl %r15d, -0x2c(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1a30
addl $0x2, %r15d
cmpl $0x14, %r15d
jne 0x1737
movq -0x70(%rbp), %rax
movq -0x60(%rbp), %r12
movq -0x58(%rbp), %r15
movq 0x3875(%rip), %rbx      # 0x4fd8
leaq 0x18a3(%rip), %r14      # 0x300d
cmpq -0x50(%rbp), %rax
je 0x17a7
leaq 0x4(%rax), %r13
cmpq %r12, %r13
jne 0x1788
movq 0x8(%r15), %r13
addq $0x8, %r15
leaq 0x200(%r13), %r12
movl (%rax), %esi
movq %rbx, %rdi
callq 0x1140
movl $0x3, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x10f0
movq %r13, %rax
jmp 0x176a
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %esi
movq 0x3813(%rip), %rdi      # 0x4fd8
callq 0x1030
movq %rax, %rdi
callq 0x1090
leaq -0x80(%rbp), %rdi
callq 0x19ca
leaq -0xd0(%rbp), %rdi
callq 0x19ca
xorl %eax, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x181d
jmp 0x181d
jmp 0x181d
jmp 0x181d
jmp 0x181d
jmp 0x181d
jmp 0x181d
jmp 0x181d
jmp 0x180f
jmp 0x180f
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x19ca
jmp 0x1820
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x19ca
movq %rbx, %rdi
callq 0x1150