// File: /workspace/github_cpp_makefile_star2_O1/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 $0xb8, %rsp
movq %rcx, %r15
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r14
movq 0x48(%rdi), %rdi
movq 0x50(%r14), %r13
testq %r13, %r13
je 0x1a3a5
movq 0x19c2b(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x1a3a0
incl 0x8(%r13)
jmp 0x1a3a5
lock
incl 0x8(%r13)
callq 0x2470a
movl %eax, %r12d
testq %r13, %r13
je 0x1a3ba
movq %r13, %rdi
callq 0xb634
cmpl %ebx, %r12d
jl 0x1a9a6
movq 0x48(%r14), %rdi
movq 0x50(%r14), %r13
testq %r13, %r13
je 0x1a3e7
movq 0x19be9(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x1a3e2
incl 0x8(%r13)
jmp 0x1a3e7
lock
incl 0x8(%r13)
callq 0x24706
movq (%rax), %rax
movslq %ebx, %rcx
shlq $0x4, %rcx
movq -0x10(%rax,%rcx), %r12
movq -0x8(%rax,%rcx), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x1a429
movq 0x19baf(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x1a420
movq 0x8(%rsp), %rax
incl 0x8(%rax)
jmp 0x1a429
movq 0x8(%rsp), %rax
lock
incl 0x8(%rax)
testq %r13, %r13
je 0x1a436
movq %r13, %rdi
callq 0xb634
leaq 0x78(%rsp), %rdi
movq %r12, %rsi
callq 0xe816
leaq 0xe428(%rip), %rsi      # 0x28872
leaq 0x78(%rsp), %rdi
callq 0x50a0
testl %eax, %eax
jne 0x1a496
movq (%r12), %rax
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq *0x88(%rax)
leaq 0x78(%rsp), %rdi
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x5250
movq (%rbx), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1a496
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0xe439(%rip), %rsi      # 0x288d6
leaq 0x78(%rsp), %rdi
callq 0x50a0
testl %eax, %eax
jne 0x1a9c7
movl 0x24(%r14), %ebx
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
cmpl %eax, %ebx
jl 0x1a9ce
movq (%r12), %rax
movq %r12, %rdi
callq *0x60(%rax)
testb %al, %al
jne 0x1a9d5
leaq 0xa8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %rdi
callq 0xb6a4
movq (%r12), %rax
leaq 0x98(%rsp), %rdx
movq %r12, %rdi
movl %ebp, %esi
callq *0xe0(%rax)
movq 0x98(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1a52e
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x51f0
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
movq %r14, %rdi
movl %eax, %esi
callq 0x17cb4
movq 0x48(%r14), %rdi
movq 0x50(%r14), %rbx
testq %rbx, %rbx
je 0x1a564
movq 0x19a6a(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x1a560
incl 0x8(%rbx)
jmp 0x1a564
lock
incl 0x8(%rbx)
callq 0x24706
movq (%rax), %r15
testq %rbx, %rbx
je 0x1a579
movq %rbx, %rdi
callq 0xb634
leaq 0x58(%rsp), %rbp
movq 0x19a3b(%rip), %r12     # 0x33fc0
movq 0x48(%r14), %rdi
movq 0x50(%r14), %rbx
testq %rbx, %rbx
je 0x1a5a2
cmpb $0x0, (%r12)
je 0x1a59e
incl 0x8(%rbx)
jmp 0x1a5a2
lock
incl 0x8(%rbx)
callq 0x24706
movq 0x8(%rax), %r13
testq %rbx, %rbx
je 0x1a5b8
movq %rbx, %rdi
callq 0xb634
cmpq %r13, %r15
je 0x1a6bb
movq (%r15), %rdi
movq (%rdi), %rax
callq *0xc0(%rax)
testb %al, %al
je 0x1a6b2
movq 0x58(%r14), %rdi
movq 0x60(%r14), %r13
testq %r13, %r13
je 0x1a5f4
cmpb $0x0, (%r12)
je 0x1a5ef
incl 0x8(%r13)
jmp 0x1a5f4
lock
incl 0x8(%r13)
movq (%r15), %rax
movq %rax, 0x68(%rsp)
movq 0x8(%r15), %rax
movq %rax, 0x70(%rsp)
testq %rax, %rax
je 0x1a61a
cmpb $0x0, (%r12)
je 0x1a616
incl 0x8(%rax)
jmp 0x1a61a
lock
incl 0x8(%rax)
leaq 0x68(%rsp), %rsi
callq 0x15c44
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1a633
callq 0xb634
testq %r13, %r13
je 0x1a640
movq %r13, %rdi
callq 0xb634
movq 0x48(%r14), %rdi
movq 0x50(%r14), %r13
testq %r13, %r13
je 0x1a65f
cmpb $0x0, (%r12)
je 0x1a65a
incl 0x8(%r13)
jmp 0x1a65f
lock
incl 0x8(%r13)
movq (%r15), %rax
movq %rax, 0x58(%rsp)
movq 0x8(%r15), %rax
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x1a685
cmpb $0x0, (%r12)
je 0x1a681
incl 0x8(%rax)
jmp 0x1a685
lock
incl 0x8(%rax)
movq %rbp, %rsi
callq 0x2474a
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1a69c
callq 0xb634
testq %r13, %r13
je 0x1a585
movq %r13, %rdi
callq 0xb634
jmp 0x1a585
addq $0x10, %r15
jmp 0x1a585
movq 0x88(%r14), %rsi
movq 0x90(%r14), %r15
testq %r15, %r15
je 0x1a6e0
cmpb $0x0, (%r12)
je 0x1a6db
incl 0x8(%r15)
jmp 0x1a6e0
lock
incl 0x8(%r15)
leaq 0x10(%rsp), %rdi
callq 0x1206a
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rdi
movq 0x50(%rax), %rbx
testq %rbx, %rbx
je 0x1a70c
cmpb $0x0, (%r12)
je 0x1a708
incl 0x8(%rbx)
jmp 0x1a70c
lock
incl 0x8(%rbx)
callq 0x24706
movq (%rax), %r13
testq %rbx, %rbx
je 0x1a721
movq %rbx, %rdi
callq 0xb634
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a730
callq 0xb634
testq %r15, %r15
je 0x1a73d
movq %r15, %rdi
callq 0xb634
leaq 0x10(%rsp), %r15
movq 0x88(%r14), %rsi
movq 0x90(%r14), %rax
testq %rax, %rax
je 0x1a765
cmpb $0x0, (%r12)
je 0x1a761
incl 0x8(%rax)
jmp 0x1a765
lock
incl 0x8(%rax)
movq %rax, 0x30(%rsp)
movq %r15, %rdi
callq 0x1206a
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rdi
movq 0x50(%rax), %rbx
testq %rbx, %rbx
je 0x1a794
cmpb $0x0, (%r12)
je 0x1a790
incl 0x8(%rbx)
jmp 0x1a794
lock
incl 0x8(%rbx)
callq 0x24706
movq 0x8(%rax), %rbp
testq %rbx, %rbx
je 0x1a7aa
movq %rbx, %rdi
callq 0xb634
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a7b9
callq 0xb634
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1a7c8
callq 0xb634
cmpq %rbp, %r13
je 0x1a964
movq (%r13), %rdi
movq (%rdi), %rax
callq *0xc0(%rax)
testb %al, %al
je 0x1a95b
movq 0x88(%r14), %rsi
movq 0x90(%r14), %rbp
testq %rbp, %rbp
je 0x1a809
cmpb $0x0, (%r12)
je 0x1a805
incl 0x8(%rbp)
jmp 0x1a809
lock
incl 0x8(%rbp)
movq %r15, %rdi
callq 0x1206a
movq 0x10(%rsp), %rax
movq 0x58(%rax), %rdi
movq 0x60(%rax), %rbx
testq %rbx, %rbx
je 0x1a833
cmpb $0x0, (%r12)
je 0x1a82f
incl 0x8(%rbx)
jmp 0x1a833
lock
incl 0x8(%rbx)
movq (%r13), %rax
movq %rax, 0x48(%rsp)
movq 0x8(%r13), %rax
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0x1a85a
cmpb $0x0, (%r12)
je 0x1a856
incl 0x8(%rax)
jmp 0x1a85a
lock
incl 0x8(%rax)
leaq 0x48(%rsp), %rsi
callq 0x15c44
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1a873
callq 0xb634
testq %rbx, %rbx
je 0x1a880
movq %rbx, %rdi
callq 0xb634
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a88f
callq 0xb634
testq %rbp, %rbp
je 0x1a89c
movq %rbp, %rdi
callq 0xb634
movq 0x88(%r14), %rsi
movq 0x90(%r14), %rbp
testq %rbp, %rbp
je 0x1a8bf
cmpb $0x0, (%r12)
je 0x1a8bb
incl 0x8(%rbp)
jmp 0x1a8bf
lock
incl 0x8(%rbp)
movq %r15, %rdi
callq 0x1206a
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rdi
movq 0x50(%rax), %rbx
testq %rbx, %rbx
je 0x1a8e9
cmpb $0x0, (%r12)
je 0x1a8e5
incl 0x8(%rbx)
jmp 0x1a8e9
lock
incl 0x8(%rbx)
movq (%r13), %rax
movq %rax, 0x38(%rsp)
movq 0x8(%r13), %rax
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x1a910
cmpb $0x0, (%r12)
je 0x1a90c
incl 0x8(%rax)
jmp 0x1a910
lock
incl 0x8(%rax)
leaq 0x38(%rsp), %rsi
callq 0x2474a
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1a929
callq 0xb634
testq %rbx, %rbx
je 0x1a936
movq %rbx, %rdi
callq 0xb634
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a945
callq 0xb634
testq %rbp, %rbp
je 0x1a742
movq %rbp, %rdi
callq 0xb634
jmp 0x1a742
addq $0x10, %r13
jmp 0x1a742
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a985
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1a994
callq 0xb634
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x4, %edi
callq 0x5100
movl $0xb, (%rax)
movq 0x195d3(%rip), %rsi     # 0x33f90
movq %rax, %rdi
xorl %edx, %edx
callq 0x5300
movl $0xc, %ebx
jmp 0x1a9da
movl $0x6, %ebx
jmp 0x1a9da
movl $0x1, %ebx
movl $0x4, %edi
callq 0x5100
movl %ebx, (%rax)
movq 0x195a3(%rip), %rsi     # 0x33f90
movq %rax, %rdi
xorl %edx, %edx
callq 0x5300
jmp 0x1aae9
movq %rax, %r14
testq %rbx, %rbx
je 0x1aa0c
movq %rbx, %rdi
callq 0xb634
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1aa20
callq 0xb634
jmp 0x1aa20
movq %rax, %r14
testq %r15, %r15
je 0x1ab31
movq %r15, %rdi
jmp 0x1ab2c
jmp 0x1ab21
movq %rax, %r14
movq 0x98(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1ab31
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x51f0
jmp 0x1ab31
movq %rax, %r14
movq 0x8(%rsp), %r13
jmp 0x1ab57
jmp 0x1aa6e
movq %rax, %r14
jmp 0x1ab57
jmp 0x1aae9
movq %rax, %r14
movq 0x40(%rsp), %rdi
jmp 0x1aa8c
jmp 0x1aab4
movq %rax, %r14
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1aa96
callq 0xb634
testq %rbx, %rbx
je 0x1aaa3
movq %rbx, %rdi
callq 0xb634
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1aab7
callq 0xb634
jmp 0x1aab7
movq %rax, %r14
testq %rbp, %rbp
je 0x1ab31
movq %rbp, %rdi
jmp 0x1ab2c
movq %rax, %r14
movq 0x60(%rsp), %rdi
jmp 0x1aad3
movq %rax, %r14
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1aadd
callq 0xb634
testq %r13, %r13
je 0x1ab31
movq %r13, %rdi
jmp 0x1ab2c
jmp 0x1aae9
movq %rax, %r14
jmp 0x1ab31
movq %rax, %r14
jmp 0x1ab12
movq %rax, %r14
testq %rbx, %rbx
je 0x1ab03
movq %rbx, %rdi
callq 0xb634
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1ab12
callq 0xb634
cmpq $0x0, 0x30(%rsp)
je 0x1ab31
movq 0x30(%rsp), %rdi
jmp 0x1ab2c
movq %rax, %r14
testq %rbx, %rbx
je 0x1ab31
movq %rbx, %rdi
callq 0xb634
movq 0x8(%rsp), %r13
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1ab57
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x51f0
testq %r13, %r13
je 0x1ab64
movq %r13, %rdi
callq 0xb634
movq %r14, %rdi
callq 0x5320