// File: /workspace/github_cpp_makefile_star2_O1/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 0xb50(%rip), %rsi       # 0x41ad
leaq 0xb50(%rip), %rdx       # 0x41b4
leaq -0x48(%rbp), %rdi
callq 0x2e42
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x25d0
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x368e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x20d0
movq 0x3943(%rip), %r14      # 0x6fd8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2912
movl $0x30, %edi
callq 0x20c0
movq %rax, %r13
movq %rax, %rdi
callq 0x30e4
movl $0x30, %edi
callq 0x20c0
movq %rax, %r15
movq %rax, %rdi
callq 0x2c3c
movl $0x30, %edi
callq 0x20c0
movq %rax, %r12
movq %rax, %rdi
callq 0x2edc
leaq 0xacf(%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 0x262a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2912
movq %rbx, %rdi
movq %r12, %rsi
callq 0x262a
leaq 0xa98(%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 0x26f6
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2912
movq %rbx, %rdi
movq %r15, %rsi
callq 0x262a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2912
movq %rbx, %rdi
movq %r13, %rsi
callq 0x26f6
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2912
movq %rbx, %rdi
movq %r13, %rsi
callq 0x26f6
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2912
leaq 0xa40(%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 0x2634
leaq 0xa1c(%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 0x3354
movq %rbx, %rdi
movq %r13, %rsi
callq 0x26f6
leaq 0x9e5(%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 0x262a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2912
movq %rbx, %rdi
movq %r13, %rsi
callq 0x26f6
movq %rbx, %rdi
movq %r13, %rsi
callq 0x26f6
movq %rbx, %rdi
movq %r13, %rsi
callq 0x26f6
movq %rbx, %rdi
movq %r13, %rsi
callq 0x26f6
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2912
leaq 0x98f(%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 0x2608
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 0x3984
movq %rax, %r14
movq %r12, %rbx
jmp 0x39a9
movq %rax, %r14
movq %r15, %rbx
jmp 0x39a9
movq %rax, %r14
movq %r13, %rbx
jmp 0x39a9
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x39a9
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x20d0
jmp 0x39a9
movq %rax, %r14
movl $0x30, %esi
movq %rbx, %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x2120