// File: t0mm4rx[P]piscine_cpp/day04/ex01/main.cpp
// Function: main
int main(void)
{
	Character* player = new Character("Micheal");
	std::cout << *player;
	Enemy* scorpion = new RadScorpion();
	AWeapon* pr = new PlasmaRifle();
	AWeapon* pf = new PowerFist();
	std::cout << "-- Player is choosing a weapon... --" << std::endl;
	player->equip(pr);
	std::cout << *player;
	player->equip(pf);
	std::cout << "-- Player is starting the assault against the scorpion! --" << std::endl;
	player->attack(scorpion);
	std::cout << *player;
	player->equip(pr);
	std::cout << *player;
	player->attack(scorpion);
	std::cout << *player;
	player->attack(scorpion);
	std::cout << *player;
	std::cout << "-- Player is now resting... --" << std::endl;
	player->recoverAP();
	std::cout << "-- Oh no! A mutant has appeared! --" << std::endl;
	Enemy* mutant = new SuperMutant();
	player->attack(mutant);
	std::cout << "-- The player weapon broke, he grabes another! --" << std::endl;
	player->equip(pf);
	std::cout << *player;
	player->attack(mutant);
	player->attack(mutant);
	player->attack(mutant);
	player->attack(mutant);
	std::cout << *player;
	std::cout << "-- The player has no energy left, he escapes. --" << std::endl;

	delete pr;
	delete pf;
	delete player;
	delete mutant;
	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movl $0x0, -0x4(%rbp)
movl $0x30, %edi
callq 0x2110
movq %rax, -0x78(%rbp)
movb $0x1, -0x45(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x2200
movq -0x70(%rbp), %rdx
leaq 0x15e1(%rip), %rsi      # 0x51ad
leaq -0x30(%rbp), %rdi
callq 0x3080
jmp 0x3bd7
movq -0x78(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x26f0
jmp 0x3be6
movb $0x0, -0x45(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2090
leaq -0x31(%rbp), %rdi
callq 0x2150
movq -0x78(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rsi
movq 0x43c9(%rip), %rdi      # 0x7fd8
callq 0x2aa0
movl $0x30, %edi
callq 0x2110
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x80(%rbp)
callq 0x3620
jmp 0x3c2f
movq -0x80(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x30, %edi
callq 0x2110
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x88(%rbp)
callq 0x2e30
jmp 0x3c55
movq -0x88(%rbp), %rax
movq %rax, -0x58(%rbp)
movl $0x30, %edi
callq 0x2110
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x90(%rbp)
callq 0x33d0
jmp 0x3c7e
movq -0x90(%rbp), %rax
movq %rax, -0x60(%rbp)
movq 0x4348(%rip), %rdi      # 0x7fd8
movq %rdi, -0xa8(%rbp)
leaq 0x1517(%rip), %rsi      # 0x51b5
callq 0x2100
movq %rax, %rdi
movq 0x431b(%rip), %rsi      # 0x7fc8
movq %rsi, -0xa0(%rbp)
callq 0x2130
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x2750
movq -0xa8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2aa0
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x2750
movq -0xa8(%rbp), %rdi
leaq 0x14e9(%rip), %rsi      # 0x51da
callq 0x2100
movq -0xa0(%rbp), %rsi
movq %rax, %rdi
callq 0x2130
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x2830
movq -0xa8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2aa0
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x2750
movq -0xa8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2aa0
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x2830
movq -0xa8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2aa0
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x2830
movq -0xa8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2aa0
movq -0xa8(%rbp), %rdi
leaq 0x148e(%rip), %rsi      # 0x5215
callq 0x2100
movq -0xa0(%rbp), %rsi
movq %rax, %rdi
callq 0x2130
movq -0x10(%rbp), %rdi
callq 0x2770
movq -0xa8(%rbp), %rdi
leaq 0x1482(%rip), %rsi      # 0x5234
callq 0x2100
movq -0xa0(%rbp), %rsi
movq %rax, %rdi
callq 0x2130
movl $0x30, %edi
callq 0x2110
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x98(%rbp)
callq 0x3890
jmp 0x3de4
movq -0x98(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x2830
movq 0x41d5(%rip), %rdi      # 0x7fd8
leaq 0x144e(%rip), %rsi      # 0x5258
callq 0x2100
movq %rax, %rdi
movq 0x41af(%rip), %rsi      # 0x7fc8
callq 0x2130
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x2750
movq -0x10(%rbp), %rsi
movq 0x41a2(%rip), %rdi      # 0x7fd8
callq 0x2aa0
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x2830
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x2830
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x2830
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x2830
movq -0x10(%rbp), %rsi
movq 0x415e(%rip), %rdi      # 0x7fd8
callq 0x2aa0
movq 0x4152(%rip), %rdi      # 0x7fd8
leaq 0x13fd(%rip), %rsi      # 0x528a
callq 0x2100
movq %rax, %rdi
movq 0x412c(%rip), %rsi      # 0x7fc8
callq 0x2130
movq -0x58(%rbp), %rax
movq %rax, -0xb0(%rbp)
cmpq $0x0, %rax
je 0x3ebf
movq -0xb0(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq -0x60(%rbp), %rax
movq %rax, -0xb8(%rbp)
cmpq $0x0, %rax
je 0x3edd
movq -0xb8(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
cmpq $0x0, %rax
je 0x3f0b
movq -0xc0(%rbp), %rdi
callq 0x2730
movq -0xc0(%rbp), %rdi
movl $0x30, %esi
callq 0x2120
movq -0x68(%rbp), %rax
movq %rax, -0xc8(%rbp)
cmpq $0x0, %rax
je 0x3f29
movq -0xc8(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
xorl %eax, %eax
addq $0xd0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3f57
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2090
leaq -0x31(%rbp), %rdi
callq 0x2150
testb $0x1, -0x45(%rbp)
jne 0x3f68
jmp 0x3f76
movq -0x78(%rbp), %rdi
movl $0x30, %esi
callq 0x2120
jmp 0x3fef
movq -0x80(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x30, %esi
callq 0x2120
jmp 0x3fef
movq -0x88(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x30, %esi
callq 0x2120
jmp 0x3fef
movq -0x90(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x30, %esi
callq 0x2120
jmp 0x3fef
movq -0x98(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x30, %esi
callq 0x2120
movq -0x40(%rbp), %rdi
callq 0x21f0