// File: /workspace/github_cpp_makefile_star2_O2/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 $0x38, %rsp
pushq $0x30
popq %rdi
callq 0x2100
movq %rax, %rbx
movq %rax, %rdi
callq 0x2ad8
pushq $0x30
popq %rdi
callq 0x2100
movq %rax, %r14
movq %rax, %rdi
callq 0x293c
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x10(%rax)
pushq $0x30
popq %rdi
callq 0x2100
movq %rax, %r14
movq %rax, %rdi
callq 0x26c8
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x10(%rax)
pushq $0x50
popq %rdi
callq 0x2100
movq %rax, %r14
leaq 0x1315(%rip), %rsi      # 0x40b5
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x2862
leaq -0x50(%rbp), %rsi
movq %r14, %rdi
callq 0x245c
leaq -0x50(%rbp), %rdi
callq 0x2070
leaq 0x12ab(%rip), %rsi      # 0x4074
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x2862
movq (%rbx), %rax
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq *0x18(%rax)
movq %rax, %r15
leaq -0x50(%rbp), %rdi
callq 0x2070
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x18(%rax)
leaq 0x1224(%rip), %rsi      # 0x4026
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x2862
movq (%rbx), %rax
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq *0x18(%rax)
movq %rax, %r15
leaq -0x50(%rbp), %rdi
callq 0x2070
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x18(%rax)
leaq 0x1239(%rip), %rsi      # 0x4074
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x2862
movq (%rbx), %rax
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq *0x18(%rax)
movq %rax, %r12
leaq -0x50(%rbp), %rdi
callq 0x2070
movq (%r14), %rax
movq %r14, %rdi
movq %r12, %rsi
callq *0x18(%rax)
pushq $0x50
popq %rdi
callq 0x2100
movq %rax, %r15
leaq 0x123a(%rip), %rsi      # 0x40b9
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x2862
movq %rbx, -0x58(%rbp)
leaq -0x50(%rbp), %rsi
movq %r15, %rdi
callq 0x245c
leaq -0x50(%rbp), %rdi
callq 0x2070
movq 0x312c(%rip), %rbx      # 0x5fd8
leaq 0x120a(%rip), %rsi      # 0x40bd
movq %rbx, %rdi
callq 0x20f0
movq %rax, %r13
movq %r12, %rdi
callq 0x241e
movl %eax, %esi
movq %r13, %rdi
callq 0x20a0
movq %rax, %rdi
callq 0x2080
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq *0x28(%rax)
movq (%r14), %rax
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %r15, %rdx
callq *0x28(%rax)
leaq 0x11c7(%rip), %rsi      # 0x40c3
movq %rbx, %rdi
callq 0x20f0
movq %rax, %r13
movq %r12, %rdi
callq 0x241e
movl %eax, %esi
movq %r13, %rdi
callq 0x20a0
movq %rax, %rdi
callq 0x2080
movq (%r14), %rax
pushq $0x2
popq %rsi
movq %r14, %rdi
movq %r15, %rdx
callq *0x28(%rax)
movq %rbx, %rdi
leaq 0x1189(%rip), %rsi      # 0x40c3
callq 0x20f0
movq %rax, %r13
movq %r12, %rdi
callq 0x241e
movl %eax, %esi
movq %r13, %rdi
callq 0x20a0
movq %rax, %rdi
callq 0x2080
movq (%r14), %rax
pushq $0x3
popq %rsi
movq %r14, %rdi
movq %r15, %rdx
callq *0x28(%rax)
movq (%r14), %rax
pushq $-0x1
popq %rsi
movq %r14, %rdi
movq %r15, %rdx
callq *0x28(%rax)
leaq 0x114a(%rip), %rsi      # 0x40cb
movq %rbx, %r13
movq %rbx, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x2080
movq (%r14), %rax
movq %r14, %rdi
pushq $0x2
popq %rbx
movl %ebx, %esi
callq *0x20(%rax)
movq (%r14), %rax
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq *0x28(%rax)
movq %r13, %rdi
movq %r13, %rbx
leaq 0x1106(%rip), %rsi      # 0x40c3
callq 0x20f0
movq %rax, %r13
movq %r12, %rdi
callq 0x241e
movl %eax, %esi
movq %r13, %rdi
callq 0x20a0
movq %rax, %rdi
callq 0x2080
leaq 0x10f1(%rip), %rsi      # 0x40d7
movq %rbx, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x2080
movq (%r14), %rax
movq %r14, %rdi
movq %r12, %rsi
callq *0x18(%rax)
movq (%r14), %rax
movq %r14, %rdi
pushq $0x2
popq %rsi
movq %r15, %rdx
callq *0x28(%rax)
movq %rbx, %rdi
leaq 0x10a8(%rip), %rsi      # 0x40c3
callq 0x20f0
movq %rax, %r13
movq %r12, %rdi
callq 0x241e
movl %eax, %esi
movq %r13, %rdi
callq 0x20a0
movq %rax, %rdi
callq 0x2080
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq -0x58(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
leaq -0x50(%rbp), %rdi
callq 0x2070
jmp 0x307b
movq %rax, %r12
pushq $0x50
popq %rsi
movq %r15, %rdi
jmp 0x30c9
jmp 0x308b
jmp 0x3099
jmp 0x308b
jmp 0x3099
movq %rax, %r12
leaq -0x50(%rbp), %rdi
callq 0x2070
jmp 0x30ce
movq %rax, %r12
jmp 0x30ce
movq %rax, %r12
leaq -0x50(%rbp), %rdi
callq 0x2070
jmp 0x30af
movq %rax, %r12
pushq $0x50
jmp 0x30ba
jmp 0x30b5
movq %rax, %r12
pushq $0x30
popq %rsi
movq %r14, %rdi
jmp 0x30c9
movq %rax, %r12
pushq $0x30
popq %rsi
movq %rbx, %rdi
callq 0x2110
movq %r12, %rdi
callq 0x2140