// File: /workspace/github_cpp_makefile_star2_O1/t0mm4rx[P]piscine_cpp/day00/ex01/commands.cpp
// Function: add(Contact*, int*)
void add(Contact contacts[8], int *index)
{
	Contact			c;
	std::string	buffer;

	if (*index >= 8)
	{
		std::cout << "All 8 contacts already registed!" << std::endl << std::endl;
		return ;
	}
	std::cin.ignore();
	std::cout << std::setw(20) << "First name: ";
	std::getline(std::cin, buffer);
	c.set_first_name(buffer);
	std::cout << std::setw(20) << "Last name: ";
	std::getline(std::cin, buffer);
	c.set_last_name(buffer);
	std::cout << std::setw(20) << "Nickname: ";
	std::getline(std::cin, buffer);
	c.set_nick_name(buffer);
	std::cout << std::setw(20) << "Login: ";
	std::getline(std::cin, buffer);
	c.set_login(buffer);
	std::cout << std::setw(20) << "Postal address: ";
	std::getline(std::cin, buffer);
	c.set_postal_address(buffer);
	std::cout << std::setw(20) << "Mail: ";
	std::getline(std::cin, buffer);
	c.set_mail(buffer);
	std::cout << std::setw(20) << "Phone: ";
	std::getline(std::cin, buffer);
	c.set_phone(buffer);
	std::cout << std::setw(20) << "Birthday: ";
	std::getline(std::cin, buffer);
	c.set_birthday(buffer);
	std::cout << std::setw(20) << "Favorite meal: ";
	std::getline(std::cin, buffer);
	c.set_favorite_meal(buffer);
	std::cout << std::setw(20) << "Underwear color: ";
	std::getline(std::cin, buffer);
	c.set_underwear_color(buffer);
	std::cout << std::setw(20) << "Darkest secret: ";
	std::getline(std::cin, buffer);
	c.set_darkest_secret(buffer);
	contacts[*index] = c;
	if (*index < 8)
		(*index)++;
	std::cout << BOLD << "Contact added !" << RESET << std::endl << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x188(%rsp), %rdi
callq 0x4394
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
cmpl $0x8, (%rbx)
jl 0x303d
movq 0x3fee(%rip), %rbx      # 0x6fd0
leaq 0x221b(%rip), %rsi      # 0x5204
movl $0x20, %edx
movq %rbx, %rdi
callq 0x2120
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %esi
movq 0x3fbc(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20f0
jmp 0x38c2
movq 0x3f9c(%rip), %r12      # 0x6fe0
movq %r12, %rdi
callq 0x21f0
movq 0x3f7d(%rip), %r15      # 0x6fd0
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0x14, 0x10(%r15,%rax)
leaq 0x21bb(%rip), %rsi      # 0x5225
movl $0xc, %edx
movq %r15, %rdi
callq 0x2120
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %edx
movq 0x3f4a(%rip), %r12      # 0x6fe0
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x2200
leaq 0x178(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x168(%rsp), %rdi
callq 0x4304
leaq 0x188(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x4aae
movq 0x168(%rsp), %rdi
cmpq %rbp, %rdi
je 0x30fb
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x2100
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0x14, 0x10(%r15,%rax)
leaq 0x2120(%rip), %rsi      # 0x5232
movl $0xb, %edx
movq %r15, %rdi
callq 0x2120
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %edx
movq 0x3ea2(%rip), %r12      # 0x6fe0
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x2200
leaq 0x158(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x148(%rsp), %rdi
callq 0x4304
leaq 0x188(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x4ab4
movq 0x148(%rsp), %rdi
cmpq %rbp, %rdi
je 0x31a3
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x2100
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0x14, 0x10(%r15,%rax)
leaq 0x2084(%rip), %rsi      # 0x523e
movl $0xa, %edx
movq %r15, %rdi
callq 0x2120
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %edx
movq 0x3dfa(%rip), %r12      # 0x6fe0
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x2200
leaq 0x138(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x128(%rsp), %rdi
callq 0x4304
leaq 0x188(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0x4abe
movq 0x128(%rsp), %rdi
cmpq %rbp, %rdi
je 0x324b
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x2100
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0x14, 0x10(%r15,%rax)
leaq 0x1fe7(%rip), %rsi      # 0x5249
movl $0x7, %edx
movq %r15, %rdi
callq 0x2120
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %edx
movq 0x3d52(%rip), %r12      # 0x6fe0
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x2200
leaq 0x118(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x108(%rsp), %rdi
callq 0x4304
leaq 0x188(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x4ac8
movq 0x108(%rsp), %rdi
cmpq %rbp, %rdi
je 0x32f3
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x2100
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0x14, 0x10(%r15,%rax)
leaq 0x1f47(%rip), %rsi      # 0x5251
movl $0x10, %edx
movq %r15, %rdi
callq 0x2120
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %edx
movq 0x3caa(%rip), %r12      # 0x6fe0
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x2200
leaq 0xf8(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0xe8(%rsp), %rdi
callq 0x4304
leaq 0x188(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x4ad2
movq 0xe8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x339b
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x2100
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0x14, 0x10(%r15,%rax)
leaq 0x1eb0(%rip), %rsi      # 0x5262
movl $0x6, %edx
movq %r15, %rdi
callq 0x2120
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %edx
movq 0x3c02(%rip), %r12      # 0x6fe0
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x2200
leaq 0xd8(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0x4304
leaq 0x188(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x4adc
movq 0xc8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3443
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x2100
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0x14, 0x10(%r15,%rax)
leaq 0x1e0f(%rip), %rsi      # 0x5269
movl $0x7, %edx
movq %r15, %rdi
callq 0x2120
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %edx
movq 0x3b5a(%rip), %r12      # 0x6fe0
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x2200
leaq 0xb8(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x4304
leaq 0x188(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x4ae8
movq 0xa8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x34eb
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2100
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0x14, 0x10(%r15,%rax)
leaq 0x1d6f(%rip), %rsi      # 0x5271
movl $0xa, %edx
movq %r15, %rdi
callq 0x2120
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %edx
movq 0x3ab2(%rip), %r12      # 0x6fe0
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x2200
leaq 0x98(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x4304
leaq 0x188(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x4af4
movq 0x88(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3593
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2100
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0x14, 0x10(%r15,%rax)
leaq 0x1cd2(%rip), %rsi      # 0x527c
movl $0xf, %edx
movq %r15, %rdi
callq 0x2120
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %edx
movq 0x3a0a(%rip), %r12      # 0x6fe0
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x2200
leaq 0x78(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x4304
leaq 0x188(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x4b00
movq 0x68(%rsp), %rdi
cmpq %rbp, %rdi
je 0x362c
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2100
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0x14, 0x10(%r15,%rax)
leaq 0x1c49(%rip), %rsi      # 0x528c
movl $0x11, %edx
movq %r15, %rdi
callq 0x2120
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %edx
movq 0x3971(%rip), %r12      # 0x6fe0
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x2200
leaq 0x58(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x4304
leaq 0x188(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x4b0c
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x36c5
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2100
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0x14, 0x10(%r15,%rax)
leaq 0x1bc2(%rip), %rsi      # 0x529e
movl $0x10, %edx
movq %r15, %rdi
callq 0x2120
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %edx
movq 0x38d8(%rip), %rdi      # 0x6fe0
leaq 0x8(%rsp), %rsi
callq 0x2200
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x4304
leaq 0x188(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x4b18
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x375b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2100
movslq (%rbx), %rax
imulq $0x160, %rax, %rax      # imm = 0x160
addq %rax, %r14
leaq 0x188(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2090
leaq 0x20(%r14), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x2090
leaq 0x40(%r14), %rdi
leaq 0x1c8(%rsp), %rsi
callq 0x2090
leaq 0x60(%r14), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x2090
movl $0x80, %esi
leaq (%r14,%rsi), %rdi
addq %r15, %rsi
callq 0x2090
movl $0xa0, %esi
leaq (%r14,%rsi), %rdi
addq %r15, %rsi
callq 0x2090
movl $0xc0, %esi
leaq (%r14,%rsi), %rdi
addq %r15, %rsi
callq 0x2090
movl $0xe0, %esi
leaq (%r14,%rsi), %rdi
addq %r15, %rsi
callq 0x2090
movl $0x100, %esi            # imm = 0x100
leaq (%r14,%rsi), %rdi
addq %r15, %rsi
callq 0x2090
movl $0x120, %esi            # imm = 0x120
leaq (%r14,%rsi), %rdi
addq %r15, %rsi
callq 0x2090
movl $0x140, %eax            # imm = 0x140
addq %rax, %r14
addq %rax, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2090
movl (%rbx), %eax
cmpl $0x7, %eax
jg 0x3835
incl %eax
movl %eax, (%rbx)
movq 0x3794(%rip), %rdi      # 0x6fd0
leaq 0x1816(%rip), %rsi      # 0x5059
movl $0x4, %edx
callq 0x2120
movq 0x377c(%rip), %rdi      # 0x6fd0
leaq 0x1a54(%rip), %rsi      # 0x52af
movl $0xf, %edx
callq 0x2120
movq 0x3764(%rip), %rbx      # 0x6fd0
leaq 0x1809(%rip), %rsi      # 0x507c
movl $0x4, %edx
movq %rbx, %rdi
callq 0x2120
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %esi
movq 0x3732(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x38ec
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2100
leaq 0x188(%rsp), %rdi
callq 0x4490
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x3a4c
movq 0x38(%rsp), %rsi
jmp 0x3a3f
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3a4c
movq 0x58(%rsp), %rsi
jmp 0x3a3f
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3a4c
movq 0x78(%rsp), %rsi
jmp 0x3a3f
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3a4c
movq 0x98(%rsp), %rsi
jmp 0x3a3f
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3a4c
movq 0xb8(%rsp), %rsi
jmp 0x3a3f
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3a4c
movq 0xd8(%rsp), %rsi
jmp 0x3a3f
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3a4c
movq 0xf8(%rsp), %rsi
jmp 0x3a3f
movq %rax, %rbx
movq 0x108(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3a4c
movq 0x118(%rsp), %rsi
jmp 0x3a3f
movq %rax, %rbx
movq 0x128(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3a4c
movq 0x138(%rsp), %rsi
jmp 0x3a3f
movq %rax, %rbx
movq 0x148(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3a4c
movq 0x158(%rsp), %rsi
jmp 0x3a3f
movq %rax, %rbx
movq 0x168(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3a4c
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x2100
jmp 0x3a4c
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x3a63
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2100
leaq 0x188(%rsp), %rdi
callq 0x4490
movq %rbx, %rdi
callq 0x21d0