// File: /workspace/github_cpp_makefile_star2_O1/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 0x2988d(%rip), %rbx     # 0x33fd0
leaq 0x1bdf4(%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 0x29a5b(%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 0xaf62
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 0xb0dc
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 0xa851
movl $0x1004, %edx           # imm = 0x1004
movq %r15, %rdi
xorl %esi, %esi
callq 0x2110
addq $0x1004, %r15           # imm = 0x1004
movq %r15, -0x48(%rbp)
jmp 0xa85f
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xb26c
decl %r12d
jne 0xa81c
movl $0xffc00, %ebx          # imm = 0xFFC00
movabsq $-0x7fdff7fdff7fdff7, %r15 # imm = 0x8020080200802009
callq 0x2070
movslq %eax, %rcx
movq %rcx, %rax
imulq %r15
addq %rcx, %rdx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x13, %rdx
addq %rax, %rdx
imulq $0xffc00, %rdx, %rax    # imm = 0xFFC00
subq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, %rdx
shlq $0xc, %rdx
leaq (%rdx,%rcx,4), %rcx
movl $0x5, (%rax,%rcx)
decl %ebx
jne 0xa873
movq -0x50(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
testq %rdi, %rdi
je 0xa8d3
callq 0x21b0
movl $0xffc00, %r12d         # imm = 0xFFC00
movabsq $0xffc00ffc00ffc01, %r13 # imm = 0xFFC00FFC00FFC01
movq 0x29706(%rip), %rbx     # 0x33ff0
leaq 0x1bc62(%rip), %r14     # 0x26553
callq 0x2070
movslq %eax, %rsi
movq %rsi, %rax
imulq %r15
addq %rsi, %rdx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x13, %rdx
addq %rax, %rdx
imulq $0xffc00, %rdx, %rax    # imm = 0xFFC00
movq -0x48(%rbp), %rdx
subq -0x50(%rbp), %rdx
subq %rax, %rsi
sarq $0x2, %rdx
imulq %r13, %rdx
cmpq %rsi, %rdx
jbe 0xab7b
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 %r12d
jne 0xa8f1
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 0xb3c2
decl %r12d
jne 0xa983
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 0xac14
addl (%rax), %ebx
decl %r12d
jne 0xa9c7
movq 0x295e5(%rip), %rdi     # 0x33fd0
leaq 0x1bb86(%rip), %rsi     # 0x26578
movl $0x29, %edx
callq 0x2230
movq 0x295cd(%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 0xacca
leaq -0x1150(%rbp), %rbx
movq %rbx, %rdi
callq 0xaeae
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 0xb668
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 0xaaab
movb %al, (%rcx)
incq -0x1120(%rbp)
jmp 0xaab6
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb832
movb -0x29(%rbp), %al
incb %al
movb %al, -0x29(%rbp)
cmpb $0x7b, %al
jl 0xaa8a
movq -0x1140(%rbp), %r15
cmpq -0x1120(%rbp), %r15
je 0xab22
movq -0x1130(%rbp), %r13
movq -0x1128(%rbp), %r12
movq 0x294e9(%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 0xab19
movq 0x8(%r12), %r15
addq $0x8, %r12
leaq 0x200(%r15), %r13
cmpq -0x1120(%rbp), %r15
jne 0xaaeb
leaq -0x1150(%rbp), %rdi
callq 0xb7e4
leaq -0xa0(%rbp), %rdi
callq 0xaeae
leaq -0xf0(%rbp), %rdi
callq 0xaec6
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0xab54
callq 0x21b0
leaq -0x140(%rbp), %rdi
callq 0xaf14
leaq -0x70(%rbp), %rdi
callq 0xac7c
addq $0x1128, %rsp           # imm = 0x1128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ba3a(%rip), %rdi     # 0x265bc
xorl %eax, %eax
callq 0x22a0
jmp 0xabb2
jmp 0xabb2
movq %rax, %rbx
jmp 0xabcd
movq %rax, %rbx
jmp 0xabe7
jmp 0xabb2
jmp 0xab9d
jmp 0xabb2
movq %rax, %rbx
leaq -0x1150(%rbp), %rdi
callq 0xb7e4
jmp 0xabb5
jmp 0xabf8
jmp 0xabb2
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0xaeae
leaq -0xf0(%rbp), %rdi
callq 0xaec6
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0xabdb
callq 0x21b0
leaq -0x140(%rbp), %rdi
callq 0xaf14
leaq -0x70(%rbp), %rdi
callq 0xac7c
movq %rbx, %rdi
callq 0x2340
movq %rax, %rbx
cmpl $0x1, %edx
jne 0xabb5
movq %rbx, %rdi
callq 0x20c0
callq 0x2310
jmp 0xa96f
jmp 0xabb2