// File: /workspace/github_cpp_makefile_star2_O3/t0mm4rx[P]piscine_cpp/day01/ex02/main.cpp
// Function: main
int		main(void)
{
	Zombie		*tallZombies[10];
	Zombie		*smallZombies[10];
	ZombieEvent	talls;
	ZombieEvent	smalls;

	srand(time(0));
	talls.setZombieType("Tall");
	smalls.setZombieType("Small");
	std::cout << "Creating zombies." << std::endl;
	for (int i = 0; i < 10; i++)
	{
		tallZombies[i] = talls.randomChump();
		smallZombies[i] = smalls.randomChump();
	}
	std::cout << std::endl << "First fight begins." << std::endl;
	fight(tallZombies, smallZombies);
	std::cout << std::endl << "King is entering the fight." << std::endl;
	king();
	std::cout << std::endl <<  "Second fight begins." << std::endl;
	fight(tallZombies, smallZombies);
	std::cout << std::endl << "Killing zombies." << std::endl;
	for (int i = 0; i < 10; i++)
	{
		delete tallZombies[i];
		delete smallZombies[i];
	}
	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
leaq 0x70(%rsp), %r12
movq %r12, -0x10(%r12)
xorl %eax, %eax
movq %rax, -0x8(%r12)
movb %al, (%r12)
leaq 0x50(%rsp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
xorl %edi, %edi
callq 0x10b0
movl %eax, %edi
callq 0x10c0
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x14d7(%rip), %rsi      # 0x309e
leaq 0x14d4(%rip), %rdx      # 0x30a2
leaq 0x20(%rsp), %rdi
callq 0x1932
leaq 0x60(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x192c
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x1bfe
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x10f0
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1495(%rip), %rsi      # 0x30a3
leaq 0x1493(%rip), %rdx      # 0x30a8
movq %rsp, %rdi
callq 0x1932
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x192c
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x1c40
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x10f0
movq 0x3391(%rip), %rbx      # 0x4fd8
leaq 0x145b(%rip), %rsi      # 0x30a9
movl $0x11, %edx
movq %rbx, %rdi
callq 0x1100
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq 0x335f(%rip), %rbx      # 0x4fd8
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
xorl %ebp, %ebp
leaq 0x60(%rsp), %r14
leaq 0x40(%rsp), %r15
movq %r14, %rdi
callq 0x15fc
movq %rax, 0xd0(%rsp,%rbp,8)
movq %r15, %rdi
callq 0x15fc
movq %rax, 0x80(%rsp,%rbp,8)
incq %rbp
cmpq $0xa, %rbp
jne 0x1c95
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq 0x32fc(%rip), %rbx      # 0x4fd8
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
movq %rax, %r14
leaq 0x13c5(%rip), %rsi      # 0x30bb
movl $0x13, %edx
movq %rax, %rdi
callq 0x1100
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
leaq 0xd0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x19c8
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq 0x327b(%rip), %rbx      # 0x4fd8
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
movq %rax, %r14
leaq 0x1358(%rip), %rsi      # 0x30cf
movl $0x1b, %edx
movq %rax, %rdi
callq 0x1100
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
callq 0x1a4e
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq 0x320a(%rip), %rbx      # 0x4fd8
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
movq %rax, %r14
leaq 0x1303(%rip), %rsi      # 0x30eb
movl $0x14, %edx
movq %rax, %rdi
callq 0x1100
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
leaq 0xd0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x19c8
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq 0x3189(%rip), %rdi      # 0x4fd8
callq 0x1030
movq %rax, %rdi
callq 0x1070
movq %rax, %rbx
leaq 0x129a(%rip), %rsi      # 0x3100
movl $0x10, %edx
movq %rax, %rdi
callq 0x1100
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
xorl %r14d, %r14d
movq 0xd0(%rsp,%r14,8), %rbx
testq %rbx, %rbx
je 0x1ed9
movq 0x20(%rbx), %rdi
leaq 0x30(%rbx), %rax
cmpq %rax, %rdi
je 0x1ec2
movq (%rax), %rsi
incq %rsi
callq 0x10f0
movq (%rbx), %rdi
leaq 0x10(%rbx), %rax
cmpq %rax, %rdi
je 0x1ed9
movq (%rax), %rsi
incq %rsi
callq 0x10f0
movl $0x40, %esi
movq %rbx, %rdi
callq 0x10f0
movq 0x80(%rsp,%r14,8), %rbx
testq %rbx, %rbx
je 0x1f22
movq 0x20(%rbx), %rdi
leaq 0x30(%rbx), %rax
cmpq %rax, %rdi
je 0x1f0b
movq (%rax), %rsi
incq %rsi
callq 0x10f0
movq (%rbx), %rdi
leaq 0x10(%rbx), %rax
cmpq %rax, %rdi
je 0x1f22
movq (%rax), %rsi
incq %rsi
callq 0x10f0
movl $0x40, %esi
movq %rbx, %rdi
callq 0x10f0
incq %r14
cmpq $0xa, %r14
jne 0x1e9d
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x1f53
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x10f0
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x1f6a
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x10f0
xorl %eax, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x1fb6
movq 0x10(%rsp), %rsi
jmp 0x1fa5
jmp 0x1fb3
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x1fb6
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x10f0
jmp 0x1fb6
jmp 0x1fb3
jmp 0x1fb3
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x1fcd
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x10f0
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x1fe4
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x10f0
movq %rbx, %rdi
callq 0x1130