// File: BohangZhang[P]Sorcery-C-Project/player.cc
// Function: Player::use(int)
void Player::use(int i) {
    if (getSlot()->getSize() < i) throw 11; // Number; The Minion doesn't exist
    shared_ptr<Minion> m = getSlot()->getSlot()[i - 1];
    string minion_type = m->getType();
    if (minion_type == "Enchantment") {
        minion_type = m->getOriginType();
    }
    if (minion_type != "Act_Minion") throw 12; // Number; Wrong command, the minion doesn't have an ability to use
    if (getMagic() < m->getAbilityCost()) throw 6; // Number; You don't have enough Magic
    if (m->getSilent() == 1) throw 1; // The Ac Minion has been silented
    m->use();
    subMagic(m->getAbilityCost());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0xa8(%rbp)
leaq -0x20(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x2a6b0
movq -0xa0(%rbp), %rdi
callq 0x12af0
movq %rax, %rdi
callq 0x3d230
movl %eax, -0x94(%rbp)
jmp 0x2d759
movl -0xc(%rbp), %eax
movl %eax, -0xac(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x12b30
movl -0xac(%rbp), %ecx
movl -0x94(%rbp), %eax
cmpl %ecx, %eax
jge 0x2d7b8
movl $0x4, %edi
callq 0x6160
movq %rax, %rdi
movl $0xb, (%rdi)
movq 0x26803(%rip), %rsi     # 0x53f98
xorl %eax, %eax
movl %eax, %edx
callq 0x6430
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x12b30
jmp 0x2da55
movq -0xa8(%rbp), %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x2a6b0
movq -0xc0(%rbp), %rdi
callq 0x12af0
movq %rax, %rdi
callq 0x3d220
movq %rax, -0xb8(%rbp)
jmp 0x2d7ec
movq -0xb8(%rbp), %rdi
movl -0xc(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x12c80
movq %rax, %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x12c10
leaq -0x50(%rbp), %rdi
callq 0x12b30
movq -0xc8(%rbp), %rdi
callq 0x12d30
movq %rax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x19c20
jmp 0x2d836
leaq 0x13f97(%rip), %rsi     # 0x417d4
leaq -0x70(%rbp), %rdi
callq 0x12920
movb %al, -0xc9(%rbp)
jmp 0x2d84e
movb -0xc9(%rbp), %al
testb $0x1, %al
jne 0x2d85d
jmp 0x2d8e1
leaq -0x40(%rbp), %rdi
callq 0x12d30
movq %rax, %rsi
movq (%rsi), %rax
movq 0x88(%rax), %rax
leaq -0x90(%rbp), %rdi
callq *%rax
jmp 0x2d87e
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x6370
leaq -0x90(%rbp), %rdi
callq 0x64c8
jmp 0x2d8e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x12b30
jmp 0x2da55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x2da4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x64c8
jmp 0x2da4c
leaq 0x13f36(%rip), %rsi     # 0x4181e
leaq -0x70(%rbp), %rdi
callq 0x216a0
movb %al, -0xca(%rbp)
jmp 0x2d8f9
movb -0xca(%rbp), %al
testb $0x1, %al
jne 0x2d905
jmp 0x2d92d
movl $0x4, %edi
callq 0x6160
movq %rax, %rdi
movl $0xc, (%rdi)
movq 0x26679(%rip), %rsi     # 0x53f98
xorl %eax, %eax
movl %eax, %edx
callq 0x6430
jmp 0x2da5e
movq -0xa8(%rbp), %rdi
callq 0x2a620
movl %eax, -0xd4(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x12d30
movq %rax, %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
callq *%rax
movl %eax, -0xd0(%rbp)
jmp 0x2d95c
movl -0xd4(%rbp), %eax
movl -0xd0(%rbp), %ecx
cmpl %ecx, %eax
jge 0x2d994
movl $0x4, %edi
callq 0x6160
movq %rax, %rdi
movl $0x6, (%rdi)
movq 0x26612(%rip), %rsi     # 0x53f98
xorl %eax, %eax
movl %eax, %edx
callq 0x6430
jmp 0x2da5e
leaq -0x40(%rbp), %rdi
callq 0x12d30
movq %rax, %rdi
movq (%rdi), %rax
movq 0x60(%rax), %rax
callq *%rax
movb %al, -0xd5(%rbp)
jmp 0x2d9b1
movb -0xd5(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x2d9e6
movl $0x4, %edi
callq 0x6160
movq %rax, %rdi
movl $0x1, (%rdi)
movq 0x265bd(%rip), %rsi     # 0x53f98
xorl %eax, %eax
movl %eax, %edx
callq 0x6430
jmp 0x2da5e
leaq -0x40(%rbp), %rdi
callq 0x12d30
movq %rax, %rdi
movq (%rdi), %rax
movq 0xd8(%rax), %rax
callq *%rax
jmp 0x2da00
leaq -0x40(%rbp), %rdi
callq 0x12d30
movq %rax, %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
callq *%rax
movl %eax, -0xdc(%rbp)
jmp 0x2da1d
movl -0xdc(%rbp), %esi
movq -0xa8(%rbp), %rdi
callq 0x2a7c0
jmp 0x2da31
leaq -0x70(%rbp), %rdi
callq 0x64c8
leaq -0x40(%rbp), %rdi
callq 0x12d50
addq $0xe0, %rsp
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x12d50
movq -0x28(%rbp), %rdi
callq 0x6460
nop