// File: 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
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movl $0x0, -0x4(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x37b0
leaq -0xf0(%rbp), %rdi
callq 0x37b0
xorl %eax, %eax
movl %eax, %edi
callq 0x2120
movl %eax, %edi
callq 0x2130
leaq -0x111(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x2230
movq -0x160(%rbp), %rdx
leaq 0xd53(%rip), %rsi       # 0x409e
leaq -0x110(%rbp), %rdi
callq 0x2da0
jmp 0x3359
leaq -0xd0(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x2d80
jmp 0x336e
leaq -0x110(%rbp), %rdi
callq 0x20b0
leaq -0x111(%rbp), %rdi
callq 0x2190
leaq -0x149(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x2230
movq -0x168(%rbp), %rdx
leaq 0xcfc(%rip), %rsi       # 0x40a3
leaq -0x148(%rbp), %rdi
callq 0x2da0
jmp 0x33b5
leaq -0xf0(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x2d80
jmp 0x33ca
leaq -0x148(%rbp), %rdi
callq 0x20b0
leaq -0x149(%rbp), %rdi
callq 0x2190
movq 0x2bef(%rip), %rdi      # 0x5fd8
leaq 0xcb9(%rip), %rsi       # 0x40a9
callq 0x2140
movq %rax, -0x170(%rbp)
jmp 0x33fe
movq -0x170(%rbp), %rdi
movq 0x2bbc(%rip), %rsi      # 0x5fc8
callq 0x2170
jmp 0x3413
movl $0x0, -0x150(%rbp)
cmpl $0xa, -0x150(%rbp)
jge 0x352b
leaq -0xd0(%rbp), %rdi
callq 0x2670
movq %rax, -0x178(%rbp)
jmp 0x343f
movq -0x178(%rbp), %rcx
movslq -0x150(%rbp), %rax
movq %rcx, -0x60(%rbp,%rax,8)
leaq -0xf0(%rbp), %rdi
callq 0x2670
movq %rax, -0x180(%rbp)
jmp 0x3467
movq -0x180(%rbp), %rcx
movslq -0x150(%rbp), %rax
movq %rcx, -0xb0(%rbp,%rax,8)
movl -0x150(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x150(%rbp)
jmp 0x341d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x34c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x20b0
leaq -0x111(%rbp), %rdi
callq 0x2190
jmp 0x3751
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x3503
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x20b0
leaq -0x149(%rbp), %rdi
callq 0x2190
jmp 0x3751
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x3751
movq 0x2aa6(%rip), %rdi      # 0x5fd8
movq 0x2a8f(%rip), %rsi      # 0x5fc8
callq 0x2170
movq %rax, -0x188(%rbp)
jmp 0x3547
movq -0x188(%rbp), %rdi
leaq 0xb66(%rip), %rsi       # 0x40bb
callq 0x2140
movq %rax, -0x190(%rbp)
jmp 0x3563
movq -0x190(%rbp), %rdi
movq 0x2a57(%rip), %rsi      # 0x5fc8
callq 0x2170
jmp 0x3578
leaq -0x60(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x3120
jmp 0x358a
movq 0x2a47(%rip), %rdi      # 0x5fd8
movq 0x2a30(%rip), %rsi      # 0x5fc8
callq 0x2170
movq %rax, -0x198(%rbp)
jmp 0x35a6
movq -0x198(%rbp), %rdi
leaq 0xb1b(%rip), %rsi       # 0x40cf
callq 0x2140
movq %rax, -0x1a0(%rbp)
jmp 0x35c2
movq -0x1a0(%rbp), %rdi
movq 0x29f8(%rip), %rsi      # 0x5fc8
callq 0x2170
jmp 0x35d7
callq 0x31b0
jmp 0x35de
movq 0x29f3(%rip), %rdi      # 0x5fd8
movq 0x29dc(%rip), %rsi      # 0x5fc8
callq 0x2170
movq %rax, -0x1a8(%rbp)
jmp 0x35fa
movq -0x1a8(%rbp), %rdi
leaq 0xae3(%rip), %rsi       # 0x40eb
callq 0x2140
movq %rax, -0x1b0(%rbp)
jmp 0x3616
movq -0x1b0(%rbp), %rdi
movq 0x29a4(%rip), %rsi      # 0x5fc8
callq 0x2170
jmp 0x362b
leaq -0x60(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x3120
jmp 0x363d
movq 0x2994(%rip), %rdi      # 0x5fd8
movq 0x297d(%rip), %rsi      # 0x5fc8
callq 0x2170
movq %rax, -0x1b8(%rbp)
jmp 0x3659
movq -0x1b8(%rbp), %rdi
leaq 0xa99(%rip), %rsi       # 0x4100
callq 0x2140
movq %rax, -0x1c0(%rbp)
jmp 0x3675
movq -0x1c0(%rbp), %rdi
movq 0x2945(%rip), %rsi      # 0x5fc8
callq 0x2170
jmp 0x368a
movl $0x0, -0x154(%rbp)
cmpl $0xa, -0x154(%rbp)
jge 0x3726
movslq -0x154(%rbp), %rax
movq -0x60(%rbp,%rax,8), %rax
movq %rax, -0x1c8(%rbp)
cmpq $0x0, %rax
je 0x36d7
movq -0x1c8(%rbp), %rdi
callq 0x3780
movq -0x1c8(%rbp), %rdi
movl $0x40, %esi
callq 0x2160
movslq -0x154(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rax
movq %rax, -0x1d0(%rbp)
cmpq $0x0, %rax
je 0x3710
movq -0x1d0(%rbp), %rdi
callq 0x3780
movq -0x1d0(%rbp), %rdi
movl $0x40, %esi
callq 0x2160
jmp 0x3712
movl -0x154(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x154(%rbp)
jmp 0x3694
movl $0x0, -0x4(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x37d0
leaq -0xd0(%rbp), %rdi
callq 0x37d0
movl -0x4(%rbp), %eax
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
leaq -0xf0(%rbp), %rdi
callq 0x37d0
leaq -0xd0(%rbp), %rdi
callq 0x37d0
movq -0x120(%rbp), %rdi
callq 0x2220
nopw %cs:(%rax,%rax)
nop