// File: /workspace/github_cpp_makefile_star2_O1/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 0x14cf(%rip), %rsi      # 0x309e
leaq 0x14cc(%rip), %rdx      # 0x30a2
leaq 0x20(%rsp), %rdi
callq 0x1940
leaq 0x60(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x193a
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x1c06
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x10f0
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x148d(%rip), %rsi      # 0x30a3
leaq 0x148b(%rip), %rdx      # 0x30a8
movq %rsp, %rdi
callq 0x1940
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x193a
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x1c48
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x10f0
movq 0x3389(%rip), %rbx      # 0x4fd8
leaq 0x1453(%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 0x3357(%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 0x15f8
movq %rax, 0xd0(%rsp,%rbp,8)
movq %r15, %rdi
callq 0x15f8
movq %rax, 0x80(%rsp,%rbp,8)
incq %rbp
cmpq $0xa, %rbp
jne 0x1c9d
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq 0x32f4(%rip), %rbx      # 0x4fd8
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
movq %rax, %r14
leaq 0x13bd(%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 0x19d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq 0x3273(%rip), %rbx      # 0x4fd8
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
movq %rax, %r14
leaq 0x1350(%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 0x1a56
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq 0x3202(%rip), %rbx      # 0x4fd8
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
movq %rax, %r14
leaq 0x12fb(%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 0x19d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq 0x3181(%rip), %rdi      # 0x4fd8
callq 0x1030
movq %rax, %rdi
callq 0x1070
movq %rax, %rbx
leaq 0x1292(%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 0x1eee
movq 0x20(%rbx), %rdi
leaq 0x30(%rbx), %rax
cmpq %rax, %rdi
je 0x1eca
movq (%rax), %rsi
incq %rsi
callq 0x10f0
movq (%rbx), %rdi
leaq 0x10(%rbx), %rax
cmpq %rax, %rdi
je 0x1ee1
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 0x1f37
movq 0x20(%rbx), %rdi
leaq 0x30(%rbx), %rax
cmpq %rax, %rdi
je 0x1f13
movq (%rax), %rsi
incq %rsi
callq 0x10f0
movq (%rbx), %rdi
leaq 0x10(%rbx), %rax
cmpq %rax, %rdi
je 0x1f2a
movq (%rax), %rsi
incq %rsi
callq 0x10f0
movl $0x40, %esi
movq %rbx, %rdi
callq 0x10f0
incq %r14
cmpq $0xa, %r14
jne 0x1ea5
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x1f5b
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x10f0
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x1f72
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 0x1fbe
movq 0x10(%rsp), %rsi
jmp 0x1fad
jmp 0x1fbb
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x1fbe
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x10f0
jmp 0x1fbe
jmp 0x1fbb
jmp 0x1fbb
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x1fd5
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x10f0
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x1fec
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x10f0
movq %rbx, %rdi
callq 0x1130