// File: /workspace/github_cpp_makefile_star2_O1/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 0x2d04
movl $0x30, %edi
callq 0x20c0
movq %rax, %r14
movq %rax, %rdi
callq 0x2ae4
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x10(%rax)
movl $0x30, %edi
callq 0x20c0
movq %rax, %r14
movq %rax, %rdi
callq 0x2828
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 0x10d5(%rip), %rsi      # 0x40b5
leaq 0x10d1(%rip), %rdx      # 0x40b8
leaq -0x48(%rbp), %rdi
callq 0x2a48
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x2514
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x3011
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x20d0
leaq -0x48(%rbp), %rdi
movq %r13, (%rdi)
leaq 0x1055(%rip), %rsi      # 0x4074
leaq 0x1051(%rip), %rdx      # 0x4077
callq 0x2a48
movq (%rbx), %rax
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq *0x18(%rax)
movq %rax, %r15
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x3050
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 0xfe6(%rip), %rsi       # 0x4050
leaq 0xfe3(%rip), %rdx       # 0x4054
callq 0x2a48
movq (%rbx), %rax
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq *0x18(%rax)
movq %rax, %r15
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x309b
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 0xfbf(%rip), %rsi       # 0x4074
leaq 0xfbb(%rip), %rdx       # 0x4077
callq 0x2a48
movq (%rbx), %rax
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq *0x18(%rax)
movq %rax, %r12
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x30e6
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 0xfac(%rip), %rsi       # 0x40b9
leaq 0xfa8(%rip), %rdx       # 0x40bc
callq 0x2a48
leaq -0x48(%rbp), %rsi
movq %r15, %rdi
callq 0x2514
movq %rbx, -0x50(%rbp)
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x313e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x20d0
movq 0x2e93(%rip), %r13      # 0x5fd8
leaq 0xf71(%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 0xf05(%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 0xe9c(%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 0xe3a(%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 0xdcf(%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 0xd9b(%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 0xd26(%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 0x3428
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x20d0
jmp 0x3428
movq %rax, %r12
movl $0x50, %esi
movq %r15, %rdi
jmp 0x3492
jmp 0x343a
jmp 0x344f
jmp 0x343a
jmp 0x344f
movq %rax, %r12
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x3497
movq -0x38(%rbp), %rsi
incq %rsi
jmp 0x3492
movq %rax, %r12
jmp 0x3497
movq %rax, %r12
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x3471
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x20d0
jmp 0x3471
movq %rax, %r12
movl $0x50, %esi
jmp 0x3482
jmp 0x347a
movq %rax, %r12
movl $0x30, %esi
movq %r14, %rdi
jmp 0x3492
movq %rax, %r12
movl $0x30, %esi
movq %rbx, %rdi
callq 0x20d0
movq %r12, %rdi
callq 0x2110