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

	// insert some values:
	mymap['a'] = 10;
	mymap['b'] = 20;
	mymap['c'] = 30;
	mymap['d'] = 40;
	mymap['e'] = 50;
	mymap['f'] = 60;

	it = mymap.find('b');
	mymap.erase (it);                   // erasing by iterator

	mymap.erase ('c');                  // erasing by key

	it = mymap.find ('e');
	mymap.erase(it, mymap.end());    // erasing by range

	// show content:
	for (it = mymap.begin(); it != mymap.end(); ++it)
		std::cout << it->first << " => " << it->second << '\n';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
leaq -0x30(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x1bf70
leaq -0x38(%rbp), %rdi
callq 0x1bf90
movq -0xd0(%rbp), %rdi
movb $0x61, -0x39(%rbp)
leaq -0x39(%rbp), %rsi
callq 0x1c3f0
movq %rax, -0xc8(%rbp)
jmp 0x29831
movq -0xc8(%rbp), %rax
movl $0xa, (%rax)
movb $0x62, -0x4d(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x4d(%rbp), %rsi
callq 0x1c3f0
movq %rax, -0xd8(%rbp)
jmp 0x29858
movq -0xd8(%rbp), %rax
movl $0x14, (%rax)
movb $0x63, -0x4e(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x4e(%rbp), %rsi
callq 0x1c3f0
movq %rax, -0xe0(%rbp)
jmp 0x2987f
movq -0xe0(%rbp), %rax
movl $0x1e, (%rax)
movb $0x64, -0x4f(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x4f(%rbp), %rsi
callq 0x1c3f0
movq %rax, -0xe8(%rbp)
jmp 0x298a6
movq -0xe8(%rbp), %rax
movl $0x28, (%rax)
movb $0x65, -0x50(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x1c3f0
movq %rax, -0xf0(%rbp)
jmp 0x298cd
movq -0xf0(%rbp), %rax
movl $0x32, (%rax)
movb $0x66, -0x51(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x51(%rbp), %rsi
callq 0x1c3f0
movq %rax, -0xf8(%rbp)
jmp 0x298f4
movq -0xf8(%rbp), %rax
movl $0x3c, (%rax)
movb $0x62, -0x61(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x61(%rbp), %rsi
callq 0x1c190
movq %rax, -0x100(%rbp)
jmp 0x2991b
movq -0x100(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x1c1f0
movq %rax, -0x108(%rbp)
jmp 0x2994c
movq -0x108(%rbp), %rax
movq %rax, -0x78(%rbp)
movb $0x63, -0x79(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x79(%rbp), %rsi
callq 0x2b390
jmp 0x2996a
movb $0x65, -0x89(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x89(%rbp), %rsi
callq 0x1c190
movq %rax, -0x110(%rbp)
jmp 0x2998a
movq -0x110(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x1c350
leaq -0x30(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x1c1c0
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x1c350
movq -0x120(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0xa0(%rbp), %rdx
callq 0x1c4d0
movq %rax, -0x118(%rbp)
jmp 0x29a00
movq -0x118(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2b200
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x1c1c0
movq %rax, -0xc0(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x1c160
testb $0x1, %al
jne 0x29a52
jmp 0x29aea
leaq -0x38(%rbp), %rdi
callq 0x1c330
movsbl (%rax), %esi
movq 0x51553(%rip), %rdi     # 0x7afb8
callq 0x3250
movq %rax, -0x128(%rbp)
jmp 0x29a73
movq -0x128(%rbp), %rdi
leaq 0x2dd81(%rip), %rsi     # 0x57802
callq 0x31e0
movq %rax, -0x130(%rbp)
jmp 0x29a8f
leaq -0x38(%rbp), %rdi
callq 0x1c330
movq -0x130(%rbp), %rdi
movl 0x4(%rax), %esi
callq 0x3350
movq %rax, -0x138(%rbp)
jmp 0x29ab0
movq -0x138(%rbp), %rdi
movl $0xa, %esi
callq 0x3250
jmp 0x29ac3
jmp 0x29ac5
leaq -0x38(%rbp), %rdi
callq 0x1d530
jmp 0x29a29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x1c230
jmp 0x29afc
leaq -0x30(%rbp), %rdi
callq 0x1c230
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x3360
nopw %cs:(%rax,%rax)