// File: /workspace/github_cpp_makefile_star2_O2/BohangZhang[P]Sorcery-C-Project/player.cc
// Function: Player::use(int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Player::use(int i, int p, string t) {
    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
    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(p,t);
    subMagic(m->getAbilityCost());
    for (auto it = this->getSlot()->getSlot().begin(); it != this->getSlot()->getSlot().end(); ) {
        if ((*it)->ifDead()) {
            this->getGraveyard()->pushfirst((*it));
            this->getSlot()->pop((*it));
        } else {
            ++it;
        }
    }
    for (auto it = this->getGame()->getNoncurrent()->getSlot()->getSlot().begin(); 
        it != this->getGame()->getNoncurrent()->getSlot()->getSlot().end(); ) {
        if ((*it)->ifDead()) {
            this->getGame()->getNoncurrent()->getGraveyard()->pushfirst((*it));
            this->getGame()->getNoncurrent()->getSlot()->pop((*it));
        } else {
            ++it;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rcx, %r15
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, 0x48(%rsp)
leaq 0x48(%rdi), %rsi
leaq 0x68(%rsp), %r12
movq %r12, %rdi
movq %rsi, 0x50(%rsp)
callq 0x1a802
movq (%r12), %rdi
callq 0x1b2e6
movl %eax, %r12d
leaq 0x70(%rsp), %rdi
callq 0x8ea0
cmpl %ebx, %r12d
jl 0x1416e
leaq 0x68(%rsp), %r12
movq %r12, %rdi
movq 0x50(%rsp), %rsi
callq 0x1a802
movq (%r12), %rdi
callq 0x1b2e2
movq (%rax), %rax
movslq %ebx, %rcx
shlq $0x4, %rcx
leaq (%rax,%rcx), %rsi
addq $-0x10, %rsi
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x8f30
leaq 0x70(%rsp), %rdi
callq 0x8ea0
movq (%rbx), %rsi
leaq 0x68(%rsp), %rdi
callq 0xb3f4
leaq 0xaa5c(%rip), %rsi      # 0x1e7d4
leaq 0x68(%rsp), %rdi
callq 0x8dc3
testb %al, %al
je 0x13db3
movq 0x58(%rsp), %rsi
movq (%rsi), %rax
leaq 0x18(%rsp), %rdi
callq *0x88(%rax)
leaq 0x68(%rsp), %rdi
leaq 0x18(%rsp), %rbx
movq %rbx, %rsi
callq 0x5250
movq %rbx, %rdi
callq 0x5378
leaq 0xaa64(%rip), %rsi      # 0x1e81e
leaq 0x68(%rsp), %rdi
callq 0xe0a3
testb %al, %al
jne 0x1418d
movq 0x48(%rsp), %rax
movl 0x24(%rax), %ebx
movq 0x58(%rsp), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
cmpl %eax, %ebx
jl 0x14191
movq 0x58(%rsp), %rdi
movq (%rdi), %rax
callq *0x60(%rax)
testb %al, %al
jne 0x14195
movq 0x58(%rsp), %rbx
leaq 0xc8(%rsp), %rdi
movq %r15, %rsi
callq 0x5290
movq (%rbx), %rax
leaq 0xc8(%rsp), %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq *0xe0(%rax)
leaq 0xc8(%rsp), %rdi
callq 0x5378
movq 0x58(%rsp), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq 0x48(%rsp), %rdi
movl %eax, %esi
callq 0x121d0
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq 0x50(%rsp), %rsi
callq 0x1a802
movq (%rbx), %rdi
callq 0x1b2e2
movq (%rax), %r12
leaq 0x20(%rsp), %rdi
callq 0x8ea0
movq 0x48(%rsp), %rax
leaq 0x58(%rax), %r15
leaq 0x18(%rsp), %rbp
leaq 0xb8(%rsp), %r13
leaq 0xa8(%rsp), %rbx
movq %rbp, %rdi
movq 0x50(%rsp), %rsi
callq 0x1a802
movq 0x18(%rsp), %rdi
callq 0x1b2e2
movq 0x8(%rax), %r14
leaq 0x20(%rsp), %rdi
callq 0x8ea0
cmpq %r14, %r12
je 0x13f5b
movq (%r12), %rdi
movq (%rdi), %rax
callq *0xc0(%rax)
testb %al, %al
je 0x13f52
movq %rbp, %rdi
movq %r15, %rsi
callq 0x1a816
movq 0x18(%rsp), %r14
movq %r13, %rdi
movq %r12, %rsi
callq 0x8f30
movq %r14, %rdi
movq %r13, %rsi
callq 0x10b26
leaq 0xc0(%rsp), %rdi
callq 0x8ea0
leaq 0x20(%rsp), %rdi
callq 0x8ea0
movq %rbp, %rdi
movq 0x50(%rsp), %rsi
callq 0x1a802
movq 0x18(%rsp), %r14
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8f30
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1b326
leaq 0xb0(%rsp), %rdi
callq 0x8ea0
leaq 0x20(%rsp), %rdi
callq 0x8ea0
jmp 0x13e8e
addq $0x10, %r12
jmp 0x13e8e
movq 0x48(%rsp), %rsi
addq $0x88, %rsi
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
movq %rsi, %r12
callq 0x8f1c
movq (%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0xe57c
movq 0x8(%rsp), %rsi
addq $0x48, %rsi
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x1a802
movq (%rbx), %rdi
callq 0x1b2e2
movq (%rax), %r13
leaq 0x20(%rsp), %rdi
callq 0x8ea0
leaq 0x10(%rsp), %rdi
callq 0x8ea0
leaq 0x40(%rsp), %rdi
callq 0x8ea0
leaq 0x38(%rsp), %r14
leaq 0x18(%rsp), %rbp
movq %r14, %rdi
movq %r12, %rsi
callq 0x8f1c
movq 0x38(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0xe57c
movq 0x8(%rsp), %rsi
addq $0x48, %rsi
movq %rbp, %rdi
callq 0x1a802
movq 0x18(%rsp), %rdi
callq 0x1b2e2
movq 0x8(%rax), %rbx
leaq 0x20(%rsp), %rdi
callq 0x8ea0
leaq 0x10(%rsp), %rdi
callq 0x8ea0
leaq 0x40(%rsp), %rdi
callq 0x8ea0
cmpq %rbx, %r13
je 0x14148
movq (%r13), %rdi
movq (%rdi), %rax
callq *0xc0(%rax)
testb %al, %al
je 0x1413f
movq %r14, %r15
movq %r14, %rdi
movq %r12, %rsi
callq 0x8f1c
movq 0x38(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0xe57c
movq 0x8(%rsp), %rsi
addq $0x58, %rsi
movq %rbp, %rdi
callq 0x1a816
movq 0x18(%rsp), %rbx
leaq 0x98(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x8f30
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10b26
leaq 0xa0(%rsp), %rdi
callq 0x8ea0
leaq 0x20(%rsp), %rdi
callq 0x8ea0
leaq 0x10(%rsp), %rdi
callq 0x8ea0
leaq 0x40(%rsp), %rdi
callq 0x8ea0
movq %r15, %r14
movq %r15, %rdi
movq %r12, %rsi
callq 0x8f1c
movq 0x38(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0xe57c
movq 0x8(%rsp), %rsi
addq $0x48, %rsi
movq %rbp, %rdi
callq 0x1a802
movq 0x18(%rsp), %rbx
leaq 0x88(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x8f30
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1b326
leaq 0x90(%rsp), %rdi
callq 0x8ea0
leaq 0x20(%rsp), %rdi
callq 0x8ea0
leaq 0x10(%rsp), %rdi
callq 0x8ea0
leaq 0x40(%rsp), %rdi
callq 0x8ea0
jmp 0x13fcd
addq $0x10, %r13
jmp 0x13fcd
leaq 0x68(%rsp), %rdi
callq 0x5378
leaq 0x60(%rsp), %rdi
callq 0x8ea0
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x4
popq %rdi
callq 0x5120
movl $0xb, (%rax)
movq 0x16e1d(%rip), %rsi     # 0x2afa0
movq %rax, %rdi
xorl %edx, %edx
callq 0x5310
pushq $0xc
jmp 0x14197
pushq $0x6
jmp 0x14197
pushq $0x1
popq %rbx
pushq $0x4
popq %rdi
callq 0x5120
movl %ebx, (%rax)
movq 0x16df7(%rip), %rsi     # 0x2afa0
movq %rax, %rdi
xorl %edx, %edx
callq 0x5310
jmp 0x14233
jmp 0x1423d
jmp 0x14238
jmp 0x1425b
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x5378
jmp 0x14268
movq %rax, %rbx
jmp 0x14272
jmp 0x141e0
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
jmp 0x14277
jmp 0x14233
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
jmp 0x14209
jmp 0x14238
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x8ea0
jmp 0x14240
jmp 0x14238
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
jmp 0x1422a
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x8ea0
jmp 0x1425e
jmp 0x14233
movq %rax, %rbx
jmp 0x14268
movq %rax, %rbx
jmp 0x14254
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x8ea0
leaq 0x10(%rsp), %rdi
callq 0x8ea0
leaq 0x40(%rsp), %rdi
jmp 0x14263
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x8ea0
leaq 0x68(%rsp), %rdi
callq 0x5378
leaq 0x60(%rsp), %rdi
callq 0x8ea0
movq %rbx, %rdi
callq 0x5330