// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
xorl %edi, %edi
callq 0x10d0
movl %eax, %edi
callq 0x10e0
leaq 0x7cc(%rip), %rsi       # 0x209e
leaq 0x70(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x16a0
leaq 0x30(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x169a
leaq 0x70(%rsp), %rdi
callq 0x1060
leaq 0x7a2(%rip), %rsi       # 0x20a3
leaq 0x50(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x16a0
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x169a
leaq 0x50(%rsp), %rdi
callq 0x1060
movq 0x26a8(%rip), %rdi      # 0x3fd8
leaq 0x772(%rip), %rsi       # 0x20a9
callq 0x10f0
movq %rax, %rdi
callq 0x1070
xorl %r15d, %r15d
leaq 0x30(%rsp), %rbx
leaq 0x10(%rsp), %r14
cmpq $0xa, %r15
je 0x197c
movq %rbx, %rdi
callq 0x1474
movq %rax, 0xe0(%rsp,%r15,8)
movq %r14, %rdi
callq 0x1474
movq %rax, 0x90(%rsp,%r15,8)
incq %r15
jmp 0x1951
movq 0x2655(%rip), %rdi      # 0x3fd8
callq 0x1070
leaq 0x72c(%rip), %rsi       # 0x20bb
movq %rax, %rdi
callq 0x10f0
movq %rax, %rdi
callq 0x1070
leaq 0xe0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x1780
movq 0x261d(%rip), %rdi      # 0x3fd8
callq 0x1070
leaq 0x708(%rip), %rsi       # 0x20cf
movq %rax, %rdi
callq 0x10f0
movq %rax, %rdi
callq 0x1070
callq 0x17de
movq 0x25f5(%rip), %rdi      # 0x3fd8
callq 0x1070
leaq 0x6fc(%rip), %rsi       # 0x20eb
movq %rax, %rdi
callq 0x10f0
movq %rax, %rdi
callq 0x1070
leaq 0xe0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x1780
movq 0x25bd(%rip), %rdi      # 0x3fd8
callq 0x1070
leaq 0x6d9(%rip), %rsi       # 0x2100
movq %rax, %rdi
callq 0x10f0
movq %rax, %rdi
callq 0x1070
xorl %r15d, %r15d
pushq $0x40
popq %rbx
cmpq $0xa, %r15
je 0x1a88
movq 0xe0(%rsp,%r15,8), %r14
testq %r14, %r14
je 0x1a58
movq %r14, %rdi
callq 0x1aea
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1110
movq 0x90(%rsp,%r15,8), %r14
testq %r14, %r14
je 0x1a78
movq %r14, %rdi
callq 0x1aea
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1110
incq %r15
jmp 0x1a3d
leaq 0x10(%rsp), %rdi
callq 0x1060
leaq 0x30(%rsp), %rdi
callq 0x1060
xorl %eax, %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
jmp 0x1abf
jmp 0x1aca
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x1060
jmp 0x1acd
jmp 0x1aca
jmp 0x1aca
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1060
leaq 0x30(%rsp), %rdi
callq 0x1060
movq %rbx, %rdi
callq 0x1140
nop