// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x30, %edi
callq 0x20c0
movq %rax, %rbx
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xb48(%rip), %rsi       # 0x41ad
leaq 0xb48(%rip), %rdx       # 0x41b4
leaq -0x48(%rbp), %rdi
callq 0x2e46
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x25d4
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x3696
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x20d0
movq 0x393b(%rip), %r14      # 0x6fd8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2916
movl $0x30, %edi
callq 0x20c0
movq %rax, %r13
movq %rax, %rdi
callq 0x30ec
movl $0x30, %edi
callq 0x20c0
movq %rax, %r15
movq %rax, %rdi
callq 0x2c40
movl $0x30, %edi
callq 0x20c0
movq %rax, %r12
movq %rax, %rdi
callq 0x2ee4
leaq 0xac7(%rip), %rsi       # 0x41b5
movl $0x24, %edx
movq %r14, %rdi
callq 0x20e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x20b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2070
movq %rbx, %rdi
movq %r15, %rsi
callq 0x262e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2916
movq %rbx, %rdi
movq %r12, %rsi
callq 0x262e
leaq 0xa90(%rip), %rsi       # 0x41da
movl $0x3a, %edx
movq %r14, %rdi
callq 0x20e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x20b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2070
movq %rbx, %rdi
movq %r13, %rsi
callq 0x26fa
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2916
movq %rbx, %rdi
movq %r15, %rsi
callq 0x262e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2916
movq %rbx, %rdi
movq %r13, %rsi
callq 0x26fa
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2916
movq %rbx, %rdi
movq %r13, %rsi
callq 0x26fa
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2916
leaq 0xa38(%rip), %rsi       # 0x4215
movl $0x1e, %edx
movq %r14, %rdi
callq 0x20e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x20b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2638
leaq 0xa14(%rip), %rsi       # 0x4234
movl $0x23, %edx
movq %r14, %rdi
callq 0x20e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x20b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2070
movl $0x30, %edi
callq 0x20c0
movq %rax, %r13
movq %rax, %rdi
callq 0x335c
movq %rbx, %rdi
movq %r13, %rsi
callq 0x26fa
leaq 0x9dd(%rip), %rsi       # 0x4258
movl $0x31, %edx
movq %r14, %rdi
callq 0x20e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x20b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2070
movq %rbx, %rdi
movq %r12, %rsi
callq 0x262e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2916
movq %rbx, %rdi
movq %r13, %rsi
callq 0x26fa
movq %rbx, %rdi
movq %r13, %rsi
callq 0x26fa
movq %rbx, %rdi
movq %r13, %rsi
callq 0x26fa
movq %rbx, %rdi
movq %r13, %rsi
callq 0x26fa
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2916
leaq 0x987(%rip), %rsi       # 0x428a
movl $0x30, %edx
movq %r14, %rdi
callq 0x20e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x20b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2070
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
movq (%r12), %rax
movq %r12, %rdi
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x260c
movl $0x30, %esi
movq %rbx, %rdi
callq 0x20d0
movq (%r13), %rax
movq %r13, %rdi
callq *0x8(%rax)
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x398c
movq %rax, %r14
movq %r12, %rbx
jmp 0x39b1
movq %rax, %r14
movq %r15, %rbx
jmp 0x39b1
movq %rax, %r14
movq %r13, %rbx
jmp 0x39b1
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x39b1
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x20d0
jmp 0x39b1
movq %rax, %r14
movl $0x30, %esi
movq %rbx, %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x2120