// File: /workspace/github_cpp_makefile_star2_O2/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 $0x98, %rsp
movq %rdi, (%rsp)
movq %rsi, 0x8(%rsp)
cmpl $0x0, (%rsi)
je 0x348c
movq 0x2e6b(%rip), %r15      # 0x5fc8
leaq 0x116d(%rip), %rsi      # 0x42d1
movq %r15, %rdi
callq 0x20e0
movq %rax, %rdi
callq 0x2090
leaq 0xf5c(%rip), %r12       # 0x40d7
movq %r15, %rdi
movq %r12, %rsi
callq 0x20e0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
pushq $0xa
popq %rbx
movq %rbx, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
movl $0xffffff4f, %ebp       # imm = 0xFFFFFF4F
movl 0x18(%rax,%rcx), %edx
andl %ebp, %edx
orl $0x20, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x114c(%rip), %rsi      # 0x42fe
movq %rax, %rdi
callq 0x20e0
movq %r15, %rdi
movq %r12, %rsi
callq 0x20e0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq %rbx, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl %ebp, %edx
orl $0x20, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x111b(%rip), %rsi      # 0x4304
movq %rax, %rdi
callq 0x20e0
movq %r15, %rdi
movq %r12, %rsi
callq 0x20e0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq %rbx, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl %ebp, %edx
orl $0x20, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x10ef(%rip), %rsi      # 0x430f
movq %rax, %rdi
callq 0x20e0
movq %r15, %rdi
movq %r12, %rsi
callq 0x20e0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq %rbx, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl %ebp, %edx
orl $0x20, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x10c2(%rip), %rsi      # 0x4319
movq %rax, %rdi
callq 0x20e0
movq %rax, %rdi
movq %r12, %rsi
callq 0x20e0
movq %rax, %rdi
callq 0x2090
leaq 0x10a6(%rip), %rsi      # 0x431f
movq %r15, %rdi
callq 0x20e0
movq %rax, %rdi
callq 0x2090
xorl %r14d, %r14d
leaq 0x18(%rsp), %r13
leaq 0x78(%rsp), %rbp
movq 0x8(%rsp), %rax
movslq (%rax), %rax
cmpq %rax, %r14
jge 0x346e
movq %r15, %rdi
movq %r12, %rsi
callq 0x20e0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
pushq $0xa
popq %rbx
movl $0xffffff4f, %edi       # imm = 0xFFFFFF4F
movq %rbx, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl %edi, %edx
orl $0x20, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movq %r14, 0x10(%rsp)
movl %r14d, %esi
callq 0x21a0
movq %rax, %rdi
movq %r12, %r14
movq %r12, %rsi
callq 0x20e0
movq (%r15), %rax
movq -0x18(%rax), %rcx
movq %rbx, 0x10(%r15,%rcx)
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r15,%rax)
leaq 0x58(%rsp), %r12
movq %r12, %rdi
movq (%rsp), %rsi
callq 0x3bf4
movq %r13, %rdi
movq %r12, %rsi
callq 0x2778
movq %r15, %rdi
movq %r13, %rbx
movq %r13, %rsi
callq 0x20d0
movq %r14, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x20e0
movq %rbx, %r13
movq %rbx, %rdi
callq 0x2080
leaq 0x58(%rsp), %rdi
callq 0x2080
movq (%r15), %rax
movq -0x18(%rax), %rcx
movq $0xa, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r15,%rax)
leaq 0x38(%rsp), %r14
movq %r14, %rdi
movq (%rsp), %rsi
callq 0x3c02
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2778
movq %r15, %rdi
movq %r13, %rsi
callq 0x20d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x20e0
movq %rbx, %rdi
callq 0x2080
leaq 0x38(%rsp), %rdi
callq 0x2080
movq (%r15), %rax
movq -0x18(%rax), %rcx
movq $0xa, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
movq %rbx, %r13
orl $0x20, %ecx
movl %ecx, 0x18(%r15,%rax)
movq %rbp, %rdi
movq (%rsp), %rsi
callq 0x3c14
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2778
movq %r15, %rdi
movq %r13, %rsi
callq 0x20d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x20e0
movq %r13, %rdi
callq 0x2080
movq %rbp, %rdi
callq 0x2080
movq %r15, %rdi
callq 0x2090
movq %r15, %rdi
leaq 0xed3(%rip), %rsi       # 0x431f
callq 0x20e0
movq %rax, %rdi
callq 0x2090
movq 0x10(%rsp), %r14
incq %r14
addq $0x160, (%rsp)          # imm = 0x160
jmp 0x3296
movq 0x2b53(%rip), %rdi      # 0x5fc8
callq 0x2090
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2b35(%rip), %rdi      # 0x5fc8
leaq 0xe25(%rip), %rsi       # 0x42bf
callq 0x20e0
movq %rax, %rdi
callq 0x2090
movq %rax, %rdi
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2090
movq %rax, %rbx
jmp 0x34f0
movq %rax, %rbx
jmp 0x34dc
movq %rax, %rbx
jmp 0x3504
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x2080
leaq 0x38(%rsp), %rdi
jmp 0x3509
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x2080
leaq 0x58(%rsp), %rdi
jmp 0x3509
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x2080
leaq 0x78(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x21b0