// File: /workspace/github_cpp_makefile_star2_O3/DimitriDaSilva[P]42_ft_containers/tester/containers/test_subject.cpp
// Function: test_subject()
void
test_subject()
{
	std::cout << "*** test_subject ***" << std::endl;

	srand(g_seed);

	ft::vector<std::string> vector_str;
	ft::vector<int> vector_int;
	ft::stack<int> stack_int;
	ft::vector<Buffer> vector_buffer;
	ft::stack<Buffer, std::deque<Buffer> > stack_deq_buffer;
	ft::map<int, int> map_int;

	for (int i = 0; i < COUNT; i++)
	{
		vector_buffer.push_back(Buffer());
	}

	for (int i = 0; i < COUNT; i++)
	{
		int const idx = rand() % COUNT;
		vector_buffer[idx].idx = 5;
	}
	ft::vector<Buffer>().swap(vector_buffer);

	try
	{
		for (int i = 0; i < COUNT; i++)
		{
			int const idx = rand() % COUNT;
			vector_buffer.at(idx);
			std::cerr << "Error: THIS VECTOR SHOULD BE EMPTY!!" <<std::endl;
		}
	}
	catch (std::exception const& e)
	{
		//NORMAL ! :P
	}

	for (int i = 0; i < COUNT; ++i)
	{
		map_int.insert(ft::make_pair(rand(), rand()));
	}

	int sum = 0;
	for (int i = 0; i < 10000; i++)
	{
		int access = rand();
		sum += map_int[access];
	}
	std::cout << "should be constant with the same g_seed: " << sum << std::endl;

	{
		ft::map<int, int> copy = map_int;
	}

	MutantStack<char> iterable_stack;
	for (char letter = 'a'; letter <= 'z'; letter++)
		iterable_stack.push(letter);
	for (MutantStack<char>::iterator it = iterable_stack.begin(); it != iterable_stack.end(); it++)
	{
		std::cout << *it;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1128, %rsp           # imm = 0x1128
movq 0x29821(%rip), %rbx     # 0x33fd0
leaq 0x1bd88(%rip), %rsi     # 0x2653e
movl $0x14, %edx
movq %rbx, %rdi
callq 0x2230
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
leaq 0x299ef(%rip), %rax     # 0x341e0
movl (%rax), %edi
callq 0x21d0
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
movq $0x0, -0x60(%rbp)
leaq -0x140(%rbp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0xafdc
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
leaq -0xf0(%rbp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0xb156
leaq -0x98(%rbp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movl $0xffc00, %r12d         # imm = 0xFFC00
leaq -0x1150(%rbp), %rbx
leaq -0x50(%rbp), %r14
movl $0x1004, %edx           # imm = 0x1004
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2110
movq -0x48(%rbp), %r15
cmpq -0x40(%rbp), %r15
je 0xa8bd
movl $0x1004, %edx           # imm = 0x1004
movq %r15, %rdi
xorl %esi, %esi
callq 0x2110
addq $0x1004, %r15           # imm = 0x1004
movq %r15, -0x48(%rbp)
jmp 0xa8cb
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xb2e6
decl %r12d
jne 0xa888
movl $0xffc00, %ebx          # imm = 0xFFC00
callq 0x2070
cltq
imulq $-0x7fdff7fd, %rax, %rcx # imm = 0x80200803
shrq $0x20, %rcx
addl %eax, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x13, %ecx
addl %edx, %ecx
imull $0xffc00, %ecx, %ecx    # imm = 0xFFC00
subl %ecx, %eax
cltq
movq -0x50(%rbp), %rdi
movq %rax, %rcx
shlq $0xc, %rcx
leaq (%rcx,%rax,4), %rax
movl $0x5, (%rdi,%rax)
decl %ebx
jne 0xa8d5
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
callq 0x21b0
movl $0xffc00, %r15d         # imm = 0xFFC00
movabsq $0xffc00ffc00ffc01, %r12 # imm = 0xFFC00FFC00FFC01
movq 0x296ae(%rip), %rbx     # 0x33ff0
leaq 0x1bc0a(%rip), %r14     # 0x26553
callq 0x2070
cltq
imulq $-0x7fdff7fd, %rax, %rcx # imm = 0x80200803
shrq $0x20, %rcx
addl %eax, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x13, %ecx
addl %edx, %ecx
imull $0xffc00, %ecx, %ecx    # imm = 0xFFC00
subl %ecx, %eax
movq -0x48(%rbp), %rdx
subq -0x50(%rbp), %rdx
movslq %eax, %rsi
sarq $0x2, %rdx
imulq %r12, %rdx
cmpq %rsi, %rdx
jbe 0xabd3
movl $0x24, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2230
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
decl %r15d
jne 0xa949
movl $0xffc00, %r12d         # imm = 0xFFC00
leaq -0xa0(%rbp), %rbx
leaq -0x1150(%rbp), %r14
callq 0x2070
movl %eax, %r15d
callq 0x2070
shlq $0x20, %rax
movl %r15d, %ecx
orq %rax, %rcx
movq %rcx, -0x1150(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb43c
decl %r12d
jne 0xa9db
xorl %ebx, %ebx
movl $0x2710, %r12d          # imm = 0x2710
leaq -0xa0(%rbp), %r14
leaq -0x1150(%rbp), %r15
callq 0x2070
movl %eax, -0x1150(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0xac6c
addl (%rax), %ebx
decl %r12d
jne 0xaa1f
movq 0x2958d(%rip), %rdi     # 0x33fd0
leaq 0x1bb2e(%rip), %rsi     # 0x26578
movl $0x29, %edx
callq 0x2230
movq 0x29575(%rip), %rdi     # 0x33fd0
movl %ebx, %esi
callq 0x2330
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
leaq -0x1150(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xad2c
leaq -0x1150(%rbp), %rbx
movq %rbx, %rdi
callq 0xaf10
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rbx)
movaps %xmm0, 0x30(%rbx)
movaps %xmm0, 0x20(%rbx)
movaps %xmm0, 0x10(%rbx)
movaps %xmm0, (%rbx)
leaq -0x1150(%rbp), %rdi
xorl %esi, %esi
callq 0xb6d6
leaq -0x29(%rbp), %rbx
movb $0x61, (%rbx)
movb $0x61, %al
leaq -0x1150(%rbp), %r14
movq -0x1120(%rbp), %rcx
movq -0x1110(%rbp), %rdx
decq %rdx
cmpq %rdx, %rcx
je 0xab03
movb %al, (%rcx)
incq -0x1120(%rbp)
jmp 0xab0e
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb8ac
movb -0x29(%rbp), %al
incb %al
movb %al, -0x29(%rbp)
cmpb $0x7b, %al
jl 0xaae2
movq -0x1140(%rbp), %r15
cmpq -0x1120(%rbp), %r15
je 0xab7a
movq -0x1130(%rbp), %r13
movq -0x1128(%rbp), %r12
movq 0x29491(%rip), %rbx     # 0x33fd0
leaq -0x29(%rbp), %r14
movb (%r15), %al
movb %al, -0x29(%rbp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2230
incq %r15
cmpq %r13, %r15
jne 0xab71
movq 0x8(%r12), %r15
addq $0x8, %r12
leaq 0x200(%r15), %r13
cmpq -0x1120(%rbp), %r15
jne 0xab43
leaq -0x1150(%rbp), %rdi
callq 0xb852
leaq -0xa0(%rbp), %rdi
callq 0xaf10
leaq -0xf0(%rbp), %rdi
callq 0xaf28
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0xabac
callq 0x21b0
leaq -0x140(%rbp), %rdi
callq 0xaf82
leaq -0x70(%rbp), %rdi
callq 0xacd4
addq $0x1128, %rsp           # imm = 0x1128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1b9e2(%rip), %rdi     # 0x265bc
xorl %eax, %eax
callq 0x22a0
jmp 0xac0a
jmp 0xac0a
movq %rax, %rbx
jmp 0xac25
movq %rax, %rbx
jmp 0xac3f
jmp 0xac0a
jmp 0xabf5
jmp 0xac0a
movq %rax, %rbx
leaq -0x1150(%rbp), %rdi
callq 0xb852
jmp 0xac0d
jmp 0xac50
jmp 0xac0a
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0xaf10
leaq -0xf0(%rbp), %rdi
callq 0xaf28
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0xac33
callq 0x21b0
leaq -0x140(%rbp), %rdi
callq 0xaf82
leaq -0x70(%rbp), %rdi
callq 0xacd4
movq %rbx, %rdi
callq 0x2340
movq %rax, %rbx
cmpl $0x1, %edx
jne 0xac0d
movq %rbx, %rdi
callq 0x20c0
callq 0x2310
jmp 0xa9c7
jmp 0xac0a