// File: 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
movq %rsp, %rbp
subq $0x350, %rsp            # imm = 0x350
movq %rcx, -0x238(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x230(%rbp)
leaq -0x28(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0x2a6b0
movq -0x228(%rbp), %rdi
callq 0x12af0
movq %rax, %rdi
callq 0x3d230
movl %eax, -0x21c(%rbp)
jmp 0x2dab7
movl -0xc(%rbp), %eax
movl %eax, -0x23c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x12b30
movl -0x23c(%rbp), %ecx
movl -0x21c(%rbp), %eax
cmpl %ecx, %eax
jge 0x2db16
movl $0x4, %edi
callq 0x6160
movq %rax, %rdi
movl $0xb, (%rdi)
movq 0x264a5(%rip), %rsi     # 0x53f98
xorl %eax, %eax
movl %eax, %edx
callq 0x6430
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x12b30
jmp 0x2e550
movq -0x230(%rbp), %rsi
leaq -0x58(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0x2a6b0
movq -0x250(%rbp), %rdi
callq 0x12af0
movq %rax, %rdi
callq 0x3d220
movq %rax, -0x248(%rbp)
jmp 0x2db4a
movq -0x248(%rbp), %rdi
movl -0xc(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x12c80
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
movq %rdi, -0x258(%rbp)
callq 0x12c10
leaq -0x58(%rbp), %rdi
callq 0x12b30
movq -0x258(%rbp), %rdi
callq 0x12d30
movq %rax, %rsi
leaq -0x78(%rbp), %rdi
callq 0x19c20
jmp 0x2db94
leaq 0x13c39(%rip), %rsi     # 0x417d4
leaq -0x78(%rbp), %rdi
callq 0x12920
movb %al, -0x259(%rbp)
jmp 0x2dbac
movb -0x259(%rbp), %al
testb $0x1, %al
jne 0x2dbb8
jmp 0x2dc33
leaq -0x48(%rbp), %rdi
callq 0x12d30
movq %rax, %rsi
movq (%rsi), %rax
movq 0x88(%rax), %rax
leaq -0x98(%rbp), %rdi
callq *%rax
jmp 0x2dbd9
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x6370
leaq -0x98(%rbp), %rdi
callq 0x64c8
jmp 0x2dc33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x12b30
jmp 0x2e550
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e547
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e53e
leaq 0x13be4(%rip), %rsi     # 0x4181e
leaq -0x78(%rbp), %rdi
callq 0x216a0
movb %al, -0x25a(%rbp)
jmp 0x2dc4b
movb -0x25a(%rbp), %al
testb $0x1, %al
jne 0x2dc57
jmp 0x2dc7f
movl $0x4, %edi
callq 0x6160
movq %rax, %rdi
movl $0xc, (%rdi)
movq 0x26327(%rip), %rsi     # 0x53f98
xorl %eax, %eax
movl %eax, %edx
callq 0x6430
jmp 0x2e559
movq -0x230(%rbp), %rdi
callq 0x2a620
movl %eax, -0x264(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x12d30
movq %rax, %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
callq *%rax
movl %eax, -0x260(%rbp)
jmp 0x2dcae
movl -0x264(%rbp), %eax
movl -0x260(%rbp), %ecx
cmpl %ecx, %eax
jge 0x2dce6
movl $0x4, %edi
callq 0x6160
movq %rax, %rdi
movl $0x6, (%rdi)
movq 0x262c0(%rip), %rsi     # 0x53f98
xorl %eax, %eax
movl %eax, %edx
callq 0x6430
jmp 0x2e559
leaq -0x48(%rbp), %rdi
callq 0x12d30
movq %rax, %rdi
movq (%rdi), %rax
movq 0x60(%rax), %rax
callq *%rax
movb %al, -0x265(%rbp)
jmp 0x2dd03
movb -0x265(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x2dd3b
movl $0x4, %edi
callq 0x6160
movq %rax, %rdi
movl $0x1, (%rdi)
movq 0x2626b(%rip), %rsi     # 0x53f98
xorl %eax, %eax
movl %eax, %edx
callq 0x6430
jmp 0x2e559
leaq -0x48(%rbp), %rdi
callq 0x12d30
movq -0x238(%rbp), %rsi
movq %rax, -0x278(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x26c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x6100
jmp 0x2dd69
movl -0x26c(%rbp), %esi
movq -0x278(%rbp), %rdi
movq (%rdi), %rax
movq 0xe0(%rax), %rax
leaq -0xb8(%rbp), %rdx
callq *%rax
jmp 0x2dd8b
leaq -0xb8(%rbp), %rdi
callq 0x64c8
leaq -0x48(%rbp), %rdi
callq 0x12d30
movq %rax, %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
callq *%rax
movl %eax, -0x27c(%rbp)
jmp 0x2ddb4
movl -0x27c(%rbp), %esi
movq -0x230(%rbp), %rdi
callq 0x2a7c0
jmp 0x2ddc8
movq -0x230(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x290(%rbp)
callq 0x2a6b0
movq -0x290(%rbp), %rdi
callq 0x12af0
movq %rax, %rdi
callq 0x3d220
movq %rax, -0x288(%rbp)
jmp 0x2ddff
movq -0x288(%rbp), %rdi
callq 0x12b50
movq %rax, -0xc0(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x12b30
movq -0x230(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x2a6b0
movq -0x2a0(%rbp), %rdi
callq 0x12af0
movq %rax, %rdi
callq 0x3d220
movq %rax, -0x298(%rbp)
jmp 0x2de55
movq -0x298(%rbp), %rdi
callq 0x12b80
movq %rax, -0xd8(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x12bb0
movb %al, -0x2a1(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x12b30
movb -0x2a1(%rbp), %al
testb $0x1, %al
jne 0x2de9c
jmp 0x2e08d
leaq -0xc0(%rbp), %rdi
callq 0x12bf0
movq %rax, %rdi
callq 0x12d30
movq %rax, %rdi
movq (%rdi), %rax
movq 0xc0(%rax), %rax
callq *%rax
movb %al, -0x2a2(%rbp)
jmp 0x2dec7
movb -0x2a2(%rbp), %al
testb $0x1, %al
jne 0x2ded6
jmp 0x2e07c
movq -0x230(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
movq %rdi, -0x2c0(%rbp)
callq 0x2a6e0
movq -0x2c0(%rbp), %rdi
callq 0x3ab30
movq %rax, -0x2b8(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x12bf0
movq %rax, %rsi
leaq -0x108(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x12c10
movq -0x2b8(%rbp), %rdi
movq -0x2b0(%rbp), %rsi
callq 0x26f20
jmp 0x2df3a
leaq -0x108(%rbp), %rdi
callq 0x12d50
leaq -0xf8(%rbp), %rdi
callq 0x3a9d0
movq -0x230(%rbp), %rsi
leaq -0x118(%rbp), %rdi
movq %rdi, -0x2d8(%rbp)
callq 0x2a6b0
movq -0x2d8(%rbp), %rdi
callq 0x12af0
movq %rax, -0x2d0(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x12bf0
movq %rax, %rsi
leaq -0x128(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
callq 0x12c10
movq -0x2d0(%rbp), %rdi
movq -0x2c8(%rbp), %rsi
callq 0x3d2d0
jmp 0x2dfb6
leaq -0x128(%rbp), %rdi
callq 0x12d50
leaq -0x118(%rbp), %rdi
callq 0x12b30
jmp 0x2e088
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x64c8
jmp 0x2e53e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x12b30
jmp 0x2e53e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x12b30
jmp 0x2e53e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x12d50
leaq -0xf8(%rbp), %rdi
callq 0x3a9d0
jmp 0x2e53e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x12d50
leaq -0x118(%rbp), %rdi
callq 0x12b30
jmp 0x2e53e
leaq -0xc0(%rbp), %rdi
callq 0x12d70
jmp 0x2de1e
movq -0x230(%rbp), %rsi
leaq -0x160(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x2a670
movq -0x2e0(%rbp), %rdi
callq 0x12a20
movq %rax, %rsi
leaq -0x150(%rbp), %rdi
callq 0x22910
jmp 0x2e0c4
leaq -0x150(%rbp), %rdi
callq 0x12980
movq %rax, %rsi
leaq -0x140(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
callq 0x2a6b0
movq -0x2f0(%rbp), %rdi
callq 0x12af0
movq %rax, %rdi
callq 0x3d220
movq %rax, -0x2e8(%rbp)
jmp 0x2e103
movq -0x2e8(%rbp), %rdi
callq 0x12b50
movq %rax, -0x130(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x12b30
leaq -0x150(%rbp), %rdi
callq 0x12a00
leaq -0x160(%rbp), %rdi
callq 0x12a70
movq -0x230(%rbp), %rsi
leaq -0x198(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0x2a670
movq -0x2f8(%rbp), %rdi
callq 0x12a20
movq %rax, %rsi
leaq -0x188(%rbp), %rdi
callq 0x22910
jmp 0x2e171
leaq -0x188(%rbp), %rdi
callq 0x12980
movq %rax, %rsi
leaq -0x178(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0x2a6b0
movq -0x308(%rbp), %rdi
callq 0x12af0
movq %rax, %rdi
callq 0x3d220
movq %rax, -0x300(%rbp)
jmp 0x2e1b0
movq -0x300(%rbp), %rdi
callq 0x12b80
movq %rax, -0x168(%rbp)
leaq -0x130(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x12bb0
movb %al, -0x309(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x12b30
leaq -0x188(%rbp), %rdi
callq 0x12a00
leaq -0x198(%rbp), %rdi
callq 0x12a70
movb -0x309(%rbp), %al
testb $0x1, %al
jne 0x2e20f
jmp 0x2e523
leaq -0x130(%rbp), %rdi
callq 0x12bf0
movq %rax, %rdi
callq 0x12d30
movq %rax, %rdi
movq (%rdi), %rax
movq 0xc0(%rax), %rax
callq *%rax
movb %al, -0x30a(%rbp)
jmp 0x2e23a
movb -0x30a(%rbp), %al
testb $0x1, %al
jne 0x2e249
jmp 0x2e512
movq -0x230(%rbp), %rsi
leaq -0x1c8(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x2a670
movq -0x318(%rbp), %rdi
callq 0x12a20
movq %rax, %rsi
leaq -0x1b8(%rbp), %rdi
callq 0x22910
jmp 0x2e280
leaq -0x1b8(%rbp), %rdi
callq 0x12980
movq %rax, %rsi
leaq -0x1a8(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x2a6e0
movq -0x330(%rbp), %rdi
callq 0x3ab30
movq %rax, -0x328(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x12bf0
movq %rax, %rsi
leaq -0x1d8(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x12c10
movq -0x328(%rbp), %rdi
movq -0x320(%rbp), %rsi
callq 0x26f20
jmp 0x2e2ec
leaq -0x1d8(%rbp), %rdi
callq 0x12d50
leaq -0x1a8(%rbp), %rdi
callq 0x3a9d0
leaq -0x1b8(%rbp), %rdi
callq 0x12a00
leaq -0x1c8(%rbp), %rdi
callq 0x12a70
movq -0x230(%rbp), %rsi
leaq -0x208(%rbp), %rdi
movq %rdi, -0x338(%rbp)
callq 0x2a670
movq -0x338(%rbp), %rdi
callq 0x12a20
movq %rax, %rsi
leaq -0x1f8(%rbp), %rdi
callq 0x22910
jmp 0x2e353
leaq -0x1f8(%rbp), %rdi
callq 0x12980
movq %rax, %rsi
leaq -0x1e8(%rbp), %rdi
movq %rdi, -0x350(%rbp)
callq 0x2a6b0
movq -0x350(%rbp), %rdi
callq 0x12af0
movq %rax, -0x348(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x12bf0
movq %rax, %rsi
leaq -0x218(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0x12c10
movq -0x348(%rbp), %rdi
movq -0x340(%rbp), %rsi
callq 0x3d2d0
jmp 0x2e3bf
leaq -0x218(%rbp), %rdi
callq 0x12d50
leaq -0x1e8(%rbp), %rdi
callq 0x12b30
leaq -0x1f8(%rbp), %rdi
callq 0x12a00
leaq -0x208(%rbp), %rdi
callq 0x12a70
jmp 0x2e51e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e426
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x12b30
leaq -0x150(%rbp), %rdi
callq 0x12a00
leaq -0x160(%rbp), %rdi
callq 0x12a70
jmp 0x2e53e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e469
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x12b30
leaq -0x188(%rbp), %rdi
callq 0x12a00
leaq -0x198(%rbp), %rdi
callq 0x12a70
jmp 0x2e53e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e4b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x12d50
leaq -0x1a8(%rbp), %rdi
callq 0x3a9d0
leaq -0x1b8(%rbp), %rdi
callq 0x12a00
leaq -0x1c8(%rbp), %rdi
callq 0x12a70
jmp 0x2e53e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e504
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x12d50
leaq -0x1e8(%rbp), %rdi
callq 0x12b30
leaq -0x1f8(%rbp), %rdi
callq 0x12a00
leaq -0x208(%rbp), %rdi
callq 0x12a70
jmp 0x2e53e
leaq -0x130(%rbp), %rdi
callq 0x12d70
jmp 0x2e13a
leaq -0x78(%rbp), %rdi
callq 0x64c8
leaq -0x48(%rbp), %rdi
callq 0x12d50
addq $0x350, %rsp            # imm = 0x350
popq %rbp
retq
leaq -0x78(%rbp), %rdi
callq 0x64c8
leaq -0x48(%rbp), %rdi
callq 0x12d50
movq -0x30(%rbp), %rdi
callq 0x6460
nopl (%rax)