// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movl %esi, %ebp
movq %rdi, %r14
movq 0x48(%rdi), %rdi
movq 0x50(%r14), %rbx
testq %rbx, %rbx
je 0x1a15d
movq 0x19e71(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x1a159
incl 0x8(%rbx)
jmp 0x1a15d
lock
incl 0x8(%rbx)
callq 0x2470a
movl %eax, %r15d
testq %rbx, %rbx
je 0x1a172
movq %rbx, %rdi
callq 0xb634
cmpl %ebp, %r15d
jl 0x1a2cc
movq 0x48(%r14), %rdi
movq 0x50(%r14), %r12
testq %r12, %r12
je 0x1a1a1
movq 0x19e31(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x1a19b
incl 0x8(%r12)
jmp 0x1a1a1
lock
incl 0x8(%r12)
callq 0x24706
movq (%rax), %rax
movslq %ebp, %rcx
shlq $0x4, %rcx
movq -0x10(%rax,%rcx), %r15
movq -0x8(%rax,%rcx), %rbx
testq %rbx, %rbx
je 0x1a1d4
movq 0x19dfa(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x1a1d0
incl 0x8(%rbx)
jmp 0x1a1d4
lock
incl 0x8(%rbx)
testq %r12, %r12
je 0x1a1e1
movq %r12, %rdi
callq 0xb634
movq %rsp, %rdi
movq %r15, %rsi
callq 0xe816
leaq 0xe67f(%rip), %rsi      # 0x28872
movq %rsp, %rdi
callq 0x50a0
testl %eax, %eax
jne 0x1a23b
movq (%r15), %rax
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
callq *0x88(%rax)
movq %rsp, %rdi
leaq 0x20(%rsp), %r12
movq %r12, %rsi
callq 0x5250
movq (%r12), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x1a23b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0xe694(%rip), %rsi      # 0x288d6
movq %rsp, %rdi
callq 0x50a0
testl %eax, %eax
jne 0x1a2ed
movl 0x24(%r14), %ebp
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
cmpl %eax, %ebp
jl 0x1a2f4
movq (%r15), %rax
movq %r15, %rdi
callq *0x60(%rax)
testb %al, %al
jne 0x1a2fb
movq (%r15), %rax
movq %r15, %rdi
callq *0xd8(%rax)
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
movq %r14, %rdi
movl %eax, %esi
callq 0x17cb4
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a2b2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x51f0
testq %rbx, %rbx
je 0x1a2bf
movq %rbx, %rdi
callq 0xb634
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x4, %edi
callq 0x5100
movl $0xb, (%rax)
movq 0x19cad(%rip), %rsi     # 0x33f90
movq %rax, %rdi
xorl %edx, %edx
callq 0x5300
movl $0xc, %ebp
jmp 0x1a300
movl $0x6, %ebp
jmp 0x1a300
movl $0x1, %ebp
movl $0x4, %edi
callq 0x5100
movl %ebp, (%rax)
movq 0x19c7d(%rip), %rsi     # 0x33f90
movq %rax, %rdi
xorl %edx, %edx
callq 0x5300
jmp 0x1a333
jmp 0x1a32e
movq %rax, %r14
movq %r12, %rbx
testq %r12, %r12
jne 0x1a356
jmp 0x1a35e
movq %rax, %r14
jmp 0x1a351
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a351
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x51f0
testq %rbx, %rbx
je 0x1a35e
movq %rbx, %rdi
callq 0xb634
movq %r14, %rdi
callq 0x5320