// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
pushq $0x30
popq %rdi
callq 0x20e0
movq %rax, %rbx
leaq 0x10da(%rip), %rsi      # 0x41ad
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x2a92
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x24e8
leaq -0x50(%rbp), %rdi
callq 0x2060
movq 0x3edc(%rip), %rdi      # 0x6fd8
movq %rbx, %rsi
callq 0x2706
pushq $0x30
popq %rdi
callq 0x20e0
movq %rax, %r12
movq %rax, %rdi
callq 0x2ce8
pushq $0x30
popq %rdi
callq 0x20e0
movq %rax, %r14
movq %rax, %rdi
callq 0x2918
pushq $0x30
popq %rdi
callq 0x20e0
movq %rax, %r15
movq %rax, %rdi
callq 0x2b6c
movq 0x3e94(%rip), %r13      # 0x6fd8
leaq 0x106a(%rip), %rsi      # 0x41b5
movq %r13, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2070
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2514
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2706
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2514
leaq 0x1057(%rip), %rsi      # 0x41da
movq %r13, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2070
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2598
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2706
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2514
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2706
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2598
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2706
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2598
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2706
leaq 0x1023(%rip), %rsi      # 0x4215
movq %r13, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x251e
leaq 0x1023(%rip), %rsi      # 0x4234
movq %r13, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2070
pushq $0x30
popq %rdi
callq 0x20e0
movq %rax, %r12
movq %rax, %rdi
callq 0x2ea8
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2598
movq 0x3d92(%rip), %r13      # 0x6fd8
leaq 0x100b(%rip), %rsi      # 0x4258
movq %r13, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2070
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2514
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2706
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2598
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2598
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2598
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2598
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2706
leaq 0xfd9(%rip), %rsi       # 0x428a
movq %r13, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2070
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x250a
pushq $0x30
popq %rsi
movq %rbx, %rdi
callq 0x20f0
movq (%r12), %rax
movq %r12, %rdi
callq *0x8(%rax)
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3313
movq %rax, %r13
movq %r15, %rbx
jmp 0x332c
movq %rax, %r13
movq %r14, %rbx
jmp 0x332c
movq %rax, %r13
movq %r12, %rbx
jmp 0x332c
movq %rax, %r13
leaq -0x50(%rbp), %rdi
callq 0x2060
jmp 0x332c
movq %rax, %r13
pushq $0x30
popq %rsi
movq %rbx, %rdi
callq 0x20f0
movq %r13, %rdi
callq 0x2140