// File: /workspace/github_cpp_makefile_star2_O3/DimitriDaSilva[P]42_ft_containers/tester/containers/map/test_map_modifiers.cpp
// Function: test_map_modifiers_insert_cplusplus()
void
test_map_modifiers_insert_cplusplus()
{
	ft::map<char, int> mymap;

	// first insert function version (single parameter):
	mymap.insert(ft::pair<char, int>('a', 100) );
	mymap.insert(ft::pair<char, int>('z', 200) );

	ft::pair<ft::map<char, int>::iterator, bool> ret;

	ret = mymap.insert(ft::pair<char, int>('z', 500));
	if (ret.second == false)
	{
		std::cout << "element 'z' already existed";
		std::cout << " with a value of " << ret.first->second << std::endl;
	}

	// second insert function version (with hint position):
	ft::map<char, int>::iterator it = mymap.begin();
	mymap.insert(it, ft::pair<char, int>('b', 300));  // max efficiency inserting
	mymap.insert(it, ft::pair<char, int>('c', 400));  // no max efficiency inserting

	// third insert function version (range insertion):
	ft::map<char, int> anothermap;
	anothermap.insert(mymap.begin(), mymap.find('c'));

	print_map_info(mymap);
	print_map_info(anothermap);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
leaq -0x38(%rbp), %rbx
movl $0x0, (%rbx)
xorl %eax, %eax
movq %rax, 0x8(%rbx)
movq %rbx, 0x10(%rbx)
movq %rbx, 0x18(%rbx)
movq %rax, 0x20(%rbx)
leaq -0x70(%rbp), %rsi
movb $0x61, (%rsi)
movl $0x64, 0x4(%rsi)
leaq -0x40(%rbp), %rdi
callq 0x13126
leaq -0x70(%rbp), %rsi
movb $0x7a, (%rsi)
movl $0xc8, 0x4(%rsi)
leaq -0x40(%rbp), %rdi
callq 0x13126
leaq -0x70(%rbp), %rsi
movb $0x7a, (%rsi)
movl $0x1f4, 0x4(%rsi)       # imm = 0x1F4
leaq -0x40(%rbp), %rdi
callq 0x13126
testb %dl, %dl
jne 0x1127b
movq %rax, %r14
movq 0x22db8(%rip), %rdi     # 0x33fd0
leaq 0x155d5(%rip), %rsi     # 0x267f4
movl $0x1b, %edx
callq 0x2230
movq 0x22da0(%rip), %rdi     # 0x33fd0
leaq 0x155d9(%rip), %rsi     # 0x26810
movl $0x11, %edx
callq 0x2230
movl 0x24(%r14), %esi
movq 0x22d84(%rip), %rdi     # 0x33fd0
callq 0x2330
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
leaq -0x40(%rbp), %rdi
movq 0x18(%rdi), %r14
leaq -0x70(%rbp), %rdx
movb $0x62, (%rdx)
movl $0x12c, 0x4(%rdx)       # imm = 0x12C
movq %r14, %rsi
callq 0x131c0
leaq -0x70(%rbp), %rdx
movb $0x63, (%rdx)
movl $0x190, 0x4(%rdx)       # imm = 0x190
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x131c0
leaq -0x68(%rbp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %r8
movq -0x28(%rbp), %rsi
testq %r8, %r8
je 0x1131a
movq %rbx, %rdx
movq %rdx, %rax
movq %r8, %rcx
movb 0x20(%r8), %dil
xorl %r8d, %r8d
cmpb $0x63, %dil
setl %r8b
movq %rcx, %rdx
cmovlq %rax, %rdx
movq 0x10(%rcx,%r8,8), %r8
testq %r8, %r8
jne 0x112df
cmpq %rbx, %rdx
je 0x1131a
cmpb $0x63, %dil
cmovlq %rax, %rcx
cmpb $0x64, 0x20(%rcx)
cmovlq %rdx, %rbx
leaq -0x70(%rbp), %rdi
movq %rbx, %rdx
callq 0x1325a
leaq -0x40(%rbp), %rdi
callq 0xcdf9
leaq -0x70(%rbp), %rdi
callq 0xcdf9
leaq -0x70(%rbp), %rdi
callq 0xcfe2
leaq -0x40(%rbp), %rdi
callq 0xcfe2
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x1135f
jmp 0x1136d
jmp 0x1136d
jmp 0x1136d
jmp 0x1136d
jmp 0x1136d
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0xcfe2
jmp 0x11370
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0xcfe2
movq %rbx, %rdi
callq 0x2340