// File: /workspace/github_cpp_makefile_star2_O1/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 -0x80(%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 0x183e
leaq -0xd0(%rbp), %rsi
movl $0x5, (%rsi)
movq %rbx, %rdi
callq 0x1a2e
leaq -0xd0(%rbp), %rsi
movl $0x11, (%rsi)
leaq -0x80(%rbp), %rdi
callq 0x1a2e
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jne 0x1356
movq -0x38(%rbp), %rcx
movl $0x200, %eax            # imm = 0x200
addq -0x8(%rcx), %rax
movl -0x4(%rax), %esi
movq 0x3c78(%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 -0x50(%rbp), %rax
movq -0x48(%rbp), %rdi
cmpq %rdi, %rax
je 0x13a2
addq $-0x4, %rax
jmp 0x13d1
movl $0x200, %esi            # imm = 0x200
callq 0x10e0
movq -0x38(%rbp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, -0x38(%rbp)
movq -0x8(%rax), %rax
movq %rax, -0x48(%rbp)
leaq 0x200(%rax), %rcx
movq %rcx, -0x40(%rbp)
addq $0x1fc, %rax            # imm = 0x1FC
movq %rax, -0x50(%rbp)
movq -0x60(%rbp), %rsi
movq -0x38(%rbp), %rcx
movq %rcx, %rdx
subq -0x58(%rbp), %rdx
shrq $0x3, %rdx
cmpq $0x1, %rcx
adcq $-0x1, %rdx
shlq $0x7, %rdx
subq -0x48(%rbp), %rax
subq -0x70(%rbp), %rsi
sarq $0x2, %rax
sarq $0x2, %rsi
addq %rdx, %rsi
addq %rax, %rsi
movq 0x3bc7(%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 -0xd0(%rbp), %rsi
movl $0x3, (%rsi)
leaq -0x80(%rbp), %rdi
callq 0x1a2e
leaq -0xd0(%rbp), %rsi
movl $0x5, (%rsi)
leaq -0x80(%rbp), %rdi
callq 0x1a2e
leaq -0xd0(%rbp), %rsi
movl $0x2e1, (%rsi)          # imm = 0x2E1
leaq -0x80(%rbp), %rdi
callq 0x1a2e
leaq -0xd0(%rbp), %rsi
movl $0x0, (%rsi)
leaq -0x80(%rbp), %rdi
callq 0x1a2e
movq -0x70(%rbp), %r12
movq -0x60(%rbp), %r13
movq -0x58(%rbp), %r15
addq $0x4, %r12
cmpq %r13, %r12
je 0x14b3
movq -0x68(%rbp), %rax
jmp 0x14c6
movq 0x8(%r15), %r12
addq $0x8, %r15
leaq 0x200(%r12), %r13
movq %r12, %rax
movq -0x50(%rbp), %rbx
cmpq %rax, %r12
jne 0x14e0
movl $0x200, %r12d           # imm = 0x200
addq -0x8(%r15), %r12
addq $-0x8, %r15
movq %r12, %r13
addq $-0x4, %r12
cmpq %rbx, %r12
je 0x153e
movl (%r12), %esi
movq 0x3ae4(%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, %r12
cmpq %r13, %r12
jne 0x14e4
movq 0x8(%r15), %r12
addq $0x8, %r15
leaq 0x200(%r12), %r13
jmp 0x14e4
leaq -0xd0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x1c92
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 0x3a4a(%rip), %rdi      # 0x4fd8
callq 0x1080
movq %rax, %rbx
leaq 0x1a67(%rip), %rsi      # 0x3004
movl $0x1, %edx
movq %rax, %rdi
callq 0x10f0
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 %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 -0xa0(%rbp), %rax
cmpq -0xc0(%rbp), %rax
je 0x168d
movq -0x98(%rbp), %rdi
cmpq %rdi, %rax
je 0x1649
addq $-0x4, %rax
jmp 0x1684
movl $0x200, %esi            # imm = 0x200
callq 0x10e0
movq -0x88(%rbp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, -0x88(%rbp)
movq -0x8(%rax), %rax
movq %rax, -0x98(%rbp)
leaq 0x200(%rax), %rcx
movq %rcx, -0x90(%rbp)
addq $0x1fc, %rax            # imm = 0x1FC
movq %rax, -0xa0(%rbp)
jmp 0x162e
movq 0x3944(%rip), %rdi      # 0x4fd8
leaq 0x196b(%rip), %rsi      # 0x3006
movl $0x6, %edx
callq 0x10f0
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 0x38e1(%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 -0xd0(%rbp), %rbx
leaq -0x2c(%rbp), %r14
movl %r15d, -0x2c(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1a2e
addl $0x2, %r15d
cmpl $0x14, %r15d
jne 0x1734
movq -0xc0(%rbp), %rax
movq -0xb0(%rbp), %r12
movq -0xa8(%rbp), %r15
movq 0x386f(%rip), %rbx      # 0x4fd8
leaq 0x189d(%rip), %r14      # 0x300d
cmpq -0xa0(%rbp), %rax
je 0x17b0
leaq 0x4(%rax), %r13
cmpq %r12, %r13
jne 0x1791
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 0x1770
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %esi
movq 0x380a(%rip), %rdi      # 0x4fd8
callq 0x1030
movq %rax, %rdi
callq 0x1090
leaq -0xd0(%rbp), %rdi
callq 0x19d4
leaq -0x80(%rbp), %rdi
callq 0x19d4
xorl %eax, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1829
jmp 0x1829
jmp 0x1829
jmp 0x1829
jmp 0x1829
jmp 0x1829
jmp 0x1829
jmp 0x1829
jmp 0x1818
jmp 0x1818
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x19d4
jmp 0x182c
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x19d4
movq %rbx, %rdi
callq 0x1150
nop