// File: /workspace/github_cpp_makefile_star2_O1/t0mm4rx[P]piscine_cpp/day00/ex01/commands.cpp
// Function: print_contacts(Contact*, int*)
void print_contacts(Contact contacts[8], int *index)
{
	if (*index == 0)
	{
		std::cout << "No contacts yet !" << std::endl << std::endl;
		return ;
	}
	std::cout << " ___________________________________________" << std::endl;
	std::cout << "|" << std::setw(10) << std::left << "index";
	std::cout << "|" << std::setw(10) << std::left << "first name";
	std::cout << "|" << std::setw(10) << std::left << "last name";
	std::cout << "|" << std::setw(10) << std::left << "login" << "|" << std::endl;
	std::cout << " ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾" << std::endl;
	for (int i = 0; i < *index; i++)
	{
		std::cout << "|" << std::setw(10) << std::left << i << "|";
		std::cout << std::setw(10) << std::left << truncate(contacts[i].get_first_name()) << "|";
		std::cout << std::setw(10) << std::left << truncate(contacts[i].get_last_name()) << "|";
		std::cout << std::setw(10) << std::left << truncate(contacts[i].get_login()) << "|";
		std::cout << std::endl;
		std::cout << " ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾" << std::endl;
	}
	std::cout << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
cmpl $0x0, (%rsi)
je 0x41bf
movq %rsi, %r12
movq %rdi, %r15
movq 0x3283(%rip), %rbx      # 0x6fd0
leaq 0x157d(%rip), %rsi      # 0x52d1
movl $0x2c, %edx
movq %rbx, %rdi
callq 0x2120
movq (%rbx), %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
leaq 0x1348(%rip), %r14      # 0x50d7
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2120
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movl $0xa, %r13d
movq %r13, 0x10(%rbx,%rcx)
movq -0x18(%rax), %rax
movl $0xffffff4f, %ebp       # imm = 0xFFFFFF4F
movl 0x18(%rbx,%rax), %ecx
andl %ebp, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x1530(%rip), %rsi      # 0x52fe
movl $0x5, %edx
movq %rbx, %rdi
callq 0x2120
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2120
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movq %r13, 0x10(%rbx,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl %ebp, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x14f5(%rip), %rsi      # 0x5304
movl $0xa, %edx
movq %rbx, %rdi
callq 0x2120
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2120
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movq %r13, 0x10(%rbx,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl %ebp, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x14bf(%rip), %rsi      # 0x530f
movl $0x9, %edx
movq %rbx, %rdi
callq 0x2120
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2120
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movq %r13, 0x10(%rbx,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl %ebp, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x1488(%rip), %rsi      # 0x5319
movl $0x5, %edx
movq %rbx, %rdi
callq 0x2120
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2120
movq (%rbx), %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
leaq 0x1443(%rip), %rsi      # 0x531f
movl $0x82, %edx
movq %rbx, %rdi
callq 0x2120
movq (%rbx), %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
cmpl $0x0, (%r12)
jle 0x4204
movq %r12, 0x20(%rsp)
xorl %r12d, %r12d
movq 0x30a6(%rip), %rbx      # 0x6fd0
leaq 0x11a6(%rip), %r13      # 0x50d7
movl $0x1, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2120
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
movl $0xa, %ebp
movq %rbp, 0x10(%rbx,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%rbx,%rax)
movq %rbx, %rdi
movl %r12d, %esi
callq 0x21c0
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2120
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movq %rbp, 0x10(%rbx,%rcx)
movl $0xffffff4f, %ebp       # imm = 0xFFFFFF4F
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl %ebp, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x68(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x4b24
movq %rsp, %rdi
movq %r14, %rsi
callq 0x2afc
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x2120
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2120
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3ffc
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2100
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x4018
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2100
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movq $0xa, 0x10(%rbx,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl %ebp, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x48(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x4b46
movq %rsp, %rdi
movq %r14, %rsi
callq 0x2afc
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x2120
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2120
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4090
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2100
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x40ac
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2100
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movq $0xa, 0x10(%rbx,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl %ebp, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x4b6a
movq %rsp, %rdi
movq %r14, %rsi
callq 0x2afc
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x2120
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2120
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4124
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2100
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4140
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2100
movq (%rbx), %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
movl $0x82, %edx
movq %rbx, %rdi
leaq 0x11a9(%rip), %rsi      # 0x531f
callq 0x2120
movq (%rbx), %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
incq %r12
movq 0x20(%rsp), %rax
movslq (%rax), %rax
addq $0x160, %r15            # imm = 0x160
cmpq %rax, %r12
jl 0x3f31
jmp 0x4204
movq 0x2e0a(%rip), %rbx      # 0x6fd0
leaq 0x10f2(%rip), %rsi      # 0x52bf
movl $0x11, %edx
movq %rbx, %rdi
callq 0x2120
movq (%rbx), %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 %rax, %rbx
movq (%rbx), %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
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x426d
movq %rax, %rbx
jmp 0x42a1
movq %rax, %rbx
jmp 0x42d5
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x426d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2100
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x42f1
movq 0x78(%rsp), %rsi
jmp 0x42e9
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x42a1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2100
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x42f1
movq 0x58(%rsp), %rsi
jmp 0x42e9
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x42d5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2100
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x42f1
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2100
movq %rbx, %rdi
callq 0x21d0