// File: /workspace/github_cpp_makefile_star2_O3/t0mm4rx[P]piscine_cpp/day04/ex03/main.cpp
// Function: main
int main()
{
	IMateriaSource* src = new MateriaSource();
	src->learnMateria(new Ice());
	src->learnMateria(new Cure());
	ICharacter* moi = new Character("moi");
	AMateria* tmp;
	tmp = src->createMateria("ice");
	moi->equip(tmp);
	tmp = src->createMateria("cure");
	moi->equip(tmp);
	tmp = src->createMateria("ice");
	moi->equip(tmp);
	ICharacter* bob = new Character("bob");
	std::cout << "0 XP=" << tmp->getXP() << std::endl;
	moi->use(0, *bob);
	moi->use(1, *bob);
	std::cout << "3rd XP=" << tmp->getXP() << std::endl;
	moi->use(2, *bob);
	std::cout << "3rd XP=" << tmp->getXP() << std::endl;
	moi->use(3, *bob);
	moi->use(-1, *bob);
	std::cout << "Unequip 3rd" << std::endl;
	moi->unequip(2);
	moi->use(2, *bob);
	std::cout << "3rd XP=" << tmp->getXP() << std::endl;
	std::cout << "Requip 3rd" << std::endl;
	moi->equip(tmp);
	moi->use(2, *bob);
	std::cout << "3rd XP=" << tmp->getXP() << std::endl;
	delete bob;
	delete moi;
	delete src;
	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
movq %rax, %rdi
callq 0x2d00
movl $0x30, %edi
callq 0x20c0
movq %rax, %r14
movq %rax, %rdi
callq 0x2ae0
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x10(%rax)
movl $0x30, %edi
callq 0x20c0
movq %rax, %r14
movq %rax, %rdi
callq 0x2820
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x10(%rax)
movl $0x50, %edi
callq 0x20c0
movq %rax, %r14
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x10e9(%rip), %rsi      # 0x40b5
leaq 0x10e5(%rip), %rdx      # 0x40b8
leaq -0x48(%rbp), %rdi
callq 0x2a40
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x2518
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x2ffd
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x20d0
leaq -0x48(%rbp), %rdi
movq %r13, (%rdi)
leaq 0x1069(%rip), %rsi      # 0x4074
leaq 0x1065(%rip), %rdx      # 0x4077
callq 0x2a40
movq (%rbx), %rax
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq *0x18(%rax)
movq %rax, %r15
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x303c
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x20d0
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x18(%rax)
leaq -0x48(%rbp), %rdi
movq %r13, (%rdi)
leaq 0xffa(%rip), %rsi       # 0x4050
leaq 0xff7(%rip), %rdx       # 0x4054
callq 0x2a40
movq (%rbx), %rax
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq *0x18(%rax)
movq %rax, %r15
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x3087
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x20d0
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x18(%rax)
leaq -0x48(%rbp), %rdi
movq %r13, (%rdi)
leaq 0xfd3(%rip), %rsi       # 0x4074
leaq 0xfcf(%rip), %rdx       # 0x4077
callq 0x2a40
movq (%rbx), %rax
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq *0x18(%rax)
movq %rax, %r12
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x30d2
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x20d0
movq (%r14), %rax
movq %r14, %rdi
movq %r12, %rsi
callq *0x18(%rax)
movl $0x50, %edi
callq 0x20c0
movq %rax, %r15
leaq -0x48(%rbp), %rdi
movq %r13, (%rdi)
leaq 0xfc0(%rip), %rsi       # 0x40b9
leaq 0xfbc(%rip), %rdx       # 0x40bc
callq 0x2a40
leaq -0x48(%rbp), %rsi
movq %r15, %rdi
callq 0x2518
movq %rbx, -0x50(%rbp)
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x312a
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x20d0
movq 0x2ea7(%rip), %r13      # 0x5fd8
leaq 0xf85(%rip), %rsi       # 0x40bd
movl $0x5, %edx
movq %r13, %rdi
callq 0x20f0
movq %r12, %rdi
callq 0x242a
movl %eax, %esi
movq %r13, %rdi
callq 0x2060
movq %r12, %rbx
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x20b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2070
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq *0x28(%rax)
movq (%r14), %rax
movq %r14, %rdi
movl $0x1, %esi
movq %r15, %rdx
callq *0x28(%rax)
leaq 0xf19(%rip), %rsi       # 0x40c3
movl $0x7, %edx
movq %r13, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x242a
movl %eax, %esi
movq %r13, %rdi
callq 0x2060
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x20b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2070
movq (%r14), %rax
movq %r14, %rdi
movl $0x2, %esi
movq %r15, %rdx
callq *0x28(%rax)
movl $0x7, %edx
movq %r13, %rdi
leaq 0xeb0(%rip), %rsi       # 0x40c3
callq 0x20f0
movq %rbx, %rdi
callq 0x242a
movl %eax, %esi
movq %r13, %rdi
callq 0x2060
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x20b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2070
movq (%r14), %rax
movq %r14, %rdi
movl $0x3, %esi
movq %r15, %rdx
callq *0x28(%rax)
movq (%r14), %rax
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r15, %rdx
callq *0x28(%rax)
leaq 0xe4e(%rip), %rsi       # 0x40cb
movl $0xb, %edx
movq %r13, %rdi
callq 0x20f0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x20b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2070
movq (%r14), %rax
movq %r14, %rdi
movl $0x2, %esi
callq *0x20(%rax)
movq (%r14), %rax
movq %r14, %rdi
movl $0x2, %esi
movq %r15, %rdx
callq *0x28(%rax)
movl $0x7, %edx
movq %r13, %rdi
leaq 0xde3(%rip), %rsi       # 0x40c3
callq 0x20f0
movq %rbx, %rdi
callq 0x242a
movl %eax, %esi
movq %r13, %rdi
callq 0x2060
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x20b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2070
leaq 0xdaf(%rip), %rsi       # 0x40d7
movl $0xa, %edx
movq %r13, %rdi
callq 0x20f0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x20b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2070
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x18(%rax)
movq (%r14), %rax
movq %r14, %rdi
movl $0x2, %esi
movq %r15, %rdx
callq *0x28(%rax)
movl $0x7, %edx
movq %r13, %rdi
leaq 0xd3a(%rip), %rsi       # 0x40c3
callq 0x20f0
movq %rbx, %rdi
callq 0x242a
movl %eax, %esi
movq %r13, %rdi
callq 0x2060
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x20b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2070
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x3414
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x20d0
jmp 0x3414
movq %rax, %r12
movl $0x50, %esi
movq %r15, %rdi
jmp 0x347e
jmp 0x3426
jmp 0x343b
jmp 0x3426
jmp 0x343b
movq %rax, %r12
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x3483
movq -0x38(%rbp), %rsi
incq %rsi
jmp 0x347e
movq %rax, %r12
jmp 0x3483
movq %rax, %r12
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x345d
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x20d0
jmp 0x345d
movq %rax, %r12
movl $0x50, %esi
jmp 0x346e
jmp 0x3466
movq %rax, %r12
movl $0x30, %esi
movq %r14, %rdi
jmp 0x347e
movq %rax, %r12
movl $0x30, %esi
movq %rbx, %rdi
callq 0x20d0
movq %r12, %rdi
callq 0x2110