// File: /workspace/github_cpp_makefile_star2_O2/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 $0x1178, %rsp           # imm = 0x1178
movq 0x28085(%rip), %rdi     # 0x31fb8
leaq 0x175d6(%rip), %rsi     # 0x21510
callq 0x31d0
movq %rax, %rdi
callq 0x30e0
leaq 0x2828a(%rip), %rax     # 0x321d8
movl (%rax), %edi
callq 0x31c0
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
andq $0x0, -0x70(%rbp)
movaps %xmm0, -0x60(%rbp)
andq $0x0, -0x50(%rbp)
leaq -0x170(%rbp), %rdi
callq 0xa2ca
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
andq $0x0, -0x30(%rbp)
leaq -0x120(%rbp), %rdi
callq 0xa2ea
leaq -0xc8(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movl $0xffc00, %r15d         # imm = 0xFFC00
leaq -0x1198(%rbp), %rbx
leaq -0x40(%rbp), %r14
subl $0x1, %r15d
jb 0x9fdd
movl $0x1004, %edx           # imm = 0x1004
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3110
movq %r14, %rdi
movq %rbx, %rsi
callq 0xab64
jmp 0x9fbb
movl $0xffc00, %ebx          # imm = 0xFFC00
movl $0xffc00, %r14d         # imm = 0xFFC00
subl $0x1, %r14d
jb 0xa00d
callq 0x3070
cltd
idivl %ebx
movslq %edx, %rax
movq -0x40(%rbp), %rcx
imulq $0x1004, %rax, %rax     # imm = 0x1004
movl $0x5, (%rcx,%rax)
jmp 0x9fe8
leaq -0x40(%rbp), %rbx
movq (%rbx), %rax
leaq -0x1198(%rbp), %rdi
movq %rax, (%rdi)
movups 0x8(%rbx), %xmm0
movups %xmm0, 0x8(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
callq 0xa952
movl $0xffc00, %r12d         # imm = 0xFFC00
movq 0x27fad(%rip), %r14     # 0x31ff0
leaq 0x174db(%rip), %r15     # 0x21525
movl $0xffc00, %r13d         # imm = 0xFFC00
subl $0x1, %r13d
jb 0xa0ad
callq 0x3070
cltd
idivl %r12d
movslq %edx, %rsi
movq %rbx, %rdi
callq 0xa30a
movq %r14, %rdi
movq %r15, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30e0
jmp 0xa050
movq %rax, %rbx
jmp 0xa29b
movq %rax, %rbx
jmp 0xa2b0
jmp 0xa280
movq %rax, %rbx
cmpl $0x1, %edx
jne 0xa283
movq %rbx, %rdi
callq 0x30b0
callq 0x3300
movl $0xffc00, %r12d         # imm = 0xFFC00
leaq -0xd0(%rbp), %rbx
leaq -0x1198(%rbp), %r14
subl $0x1, %r12d
jb 0xa0f2
callq 0x3070
movl %eax, %r15d
callq 0x3070
shlq $0x20, %rax
movl %r15d, %ecx
orq %rax, %rcx
movq %rcx, -0x1198(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xad0a
jmp 0xa0c1
xorl %ebx, %ebx
movl $0x2710, %r12d          # imm = 0x2710
leaq -0xd0(%rbp), %r14
leaq -0x1198(%rbp), %r15
subl $0x1, %r12d
jb 0xa128
callq 0x3070
movl %eax, -0x1198(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0xa32c
addl (%rax), %ebx
jmp 0xa108
movq 0x27e89(%rip), %rdi     # 0x31fb8
leaq 0x17414(%rip), %rsi     # 0x2154a
callq 0x31d0
movq %rax, %rdi
movl %ebx, %esi
callq 0x3320
movq %rax, %rdi
callq 0x30e0
leaq -0x1198(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0xa3e4
leaq -0x1198(%rbp), %rdi
callq 0xa648
leaq -0x1198(%rbp), %rdi
callq 0xb000
movb $0x61, %al
leaq -0x1198(%rbp), %rbx
leaq -0xa0(%rbp), %r14
movb %al, -0xa0(%rbp)
cmpb $0x7b, %al
jge 0xa1a7
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb25c
movb -0xa0(%rbp), %al
incb %al
jmp 0xa188
movq -0x1188(%rbp), %rax
movq -0x1180(%rbp), %rcx
leaq -0xa0(%rbp), %rbx
movq %rax, (%rbx)
movq %rcx, 0x8(%rbx)
movups -0x1178(%rbp), %xmm0
movups %xmm0, 0x10(%rbx)
movq 0x27de3(%rip), %r14     # 0x31fb8
leaq -0x190(%rbp), %r15
cmpq -0x1168(%rbp), %rax
je 0xa206
movsbl (%rax), %esi
movq %r14, %rdi
callq 0x3210
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0xa37e
movq -0xa0(%rbp), %rax
jmp 0xa1dc
leaq -0x1198(%rbp), %rdi
callq 0xb22c
leaq -0xd0(%rbp), %rdi
callq 0xa648
leaq -0x120(%rbp), %rdi
callq 0xa660
leaq -0x40(%rbp), %rdi
callq 0xa952
leaq -0x170(%rbp), %rdi
callq 0xa6b6
leaq -0x60(%rbp), %rdi
callq 0xa746
leaq -0x80(%rbp), %rdi
callq 0xa3b8
addq $0x1178, %rsp           # imm = 0x1178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa280
jmp 0xa280
jmp 0xa280
jmp 0xa280
jmp 0xa26d
movq %rax, %rbx
leaq -0x1198(%rbp), %rdi
callq 0xb22c
jmp 0xa283
jmp 0xa280
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0xa648
leaq -0x120(%rbp), %rdi
callq 0xa660
leaq -0x40(%rbp), %rdi
callq 0xa952
leaq -0x170(%rbp), %rdi
callq 0xa6b6
leaq -0x60(%rbp), %rdi
callq 0xa746
leaq -0x80(%rbp), %rdi
callq 0xa3b8
movq %rbx, %rdi
callq 0x3330