// File: /workspace/github_cpp_makefile_star2_O3/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, %ebx
movq %rdi, %r14
movq 0x48(%rdi), %rdi
movq 0x50(%r14), %r15
testq %r15, %r15
je 0x19fed
movq 0x18fe3(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x19fe8
incl 0x8(%r15)
jmp 0x19fed
lock
incl 0x8(%r15)
callq 0x243da
movl %eax, %ebp
testq %r15, %r15
je 0x1a001
movq %r15, %rdi
callq 0xb478
cmpl %ebx, %ebp
jl 0x1a15a
movq 0x48(%r14), %rdi
movq 0x50(%r14), %r12
testq %r12, %r12
je 0x1a02f
movq 0x18fa3(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x1a029
incl 0x8(%r12)
jmp 0x1a02f
lock
incl 0x8(%r12)
callq 0x243d6
movq (%rax), %rax
movslq %ebx, %rcx
shlq $0x4, %rcx
movq -0x10(%rax,%rcx), %r15
movq -0x8(%rax,%rcx), %rbx
testq %rbx, %rbx
je 0x1a062
movq 0x18f6c(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x1a05e
incl 0x8(%rbx)
jmp 0x1a062
lock
incl 0x8(%rbx)
testq %r12, %r12
je 0x1a06f
movq %r12, %rdi
callq 0xb478
movq %rsp, %rdi
movq %r15, %rsi
callq 0xe5f6
leaq 0xd7f1(%rip), %rsi      # 0x27872
movq %rsp, %rdi
callq 0x50a0
testl %eax, %eax
jne 0x1a0c9
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 0x1a0c9
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0xd806(%rip), %rsi      # 0x278d6
movq %rsp, %rdi
callq 0x50a0
testl %eax, %eax
jne 0x1a17b
movl 0x24(%r14), %ebp
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
cmpl %eax, %ebp
jl 0x1a182
movq (%r15), %rax
movq %r15, %rdi
callq *0x60(%rax)
testb %al, %al
jne 0x1a189
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 0x17b78
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a140
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x51f0
testq %rbx, %rbx
je 0x1a14d
movq %rbx, %rdi
callq 0xb478
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x4, %edi
callq 0x5100
movl $0xb, (%rax)
movq 0x18e1f(%rip), %rsi     # 0x32f90
movq %rax, %rdi
xorl %edx, %edx
callq 0x5300
movl $0xc, %ebp
jmp 0x1a18e
movl $0x6, %ebp
jmp 0x1a18e
movl $0x1, %ebp
movl $0x4, %edi
callq 0x5100
movl %ebp, (%rax)
movq 0x18def(%rip), %rsi     # 0x32f90
movq %rax, %rdi
xorl %edx, %edx
callq 0x5300
jmp 0x1a1cc
movq %rax, %r14
jmp 0x1a1ea
movq %rax, %r14
testq %r12, %r12
je 0x1a1f7
movq %r12, %rdi
jmp 0x1a1f2
movq %rax, %r14
testq %r15, %r15
je 0x1a1f7
movq %r15, %rdi
jmp 0x1a1f2
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a1ea
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x51f0
testq %rbx, %rbx
je 0x1a1f7
movq %rbx, %rdi
callq 0xb478
movq %r14, %rdi
callq 0x5320
nop