// File: /workspace/github_cpp_makefile_star2_O3/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), %r12
testq %r12, %r12
je 0x1a241
movq 0x18d91(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x1a23b
incl 0x8(%r12)
jmp 0x1a241
lock
incl 0x8(%r12)
callq 0x243da
movl %eax, %r13d
testq %r12, %r12
je 0x1a256
movq %r12, %rdi
callq 0xb478
cmpl %ebx, %r13d
jl 0x1a845
movq 0x48(%r14), %rdi
movq 0x50(%r14), %r13
testq %r13, %r13
je 0x1a283
movq 0x18d4d(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x1a27e
incl 0x8(%r13)
jmp 0x1a283
lock
incl 0x8(%r13)
callq 0x243d6
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 0x1a2c5
movq 0x18d13(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x1a2bc
movq 0x8(%rsp), %rax
incl 0x8(%rax)
jmp 0x1a2c5
movq 0x8(%rsp), %rax
lock
incl 0x8(%rax)
testq %r13, %r13
je 0x1a2d2
movq %r13, %rdi
callq 0xb478
leaq 0x78(%rsp), %rdi
movq %r12, %rsi
callq 0xe5f6
leaq 0xd58c(%rip), %rsi      # 0x27872
leaq 0x78(%rsp), %rdi
callq 0x50a0
testl %eax, %eax
jne 0x1a332
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 0x1a332
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x51f0
leaq 0xd59d(%rip), %rsi      # 0x278d6
leaq 0x78(%rsp), %rdi
callq 0x50a0
testl %eax, %eax
jne 0x1a866
movl 0x24(%r14), %ebx
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
cmpl %eax, %ebx
jl 0x1a86d
movq (%r12), %rax
movq %r12, %rdi
callq *0x60(%rax)
testb %al, %al
jne 0x1a874
leaq 0xa8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %rdi
callq 0xb4e8
movq (%r12), %rax
leaq 0x98(%rsp), %rdx
movq %r12, %rdi
movl %ebp, %esi
callq *0xe0(%rax)
movq 0x98(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1a3ca
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x51f0
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
movq %r14, %rdi
movl %eax, %esi
callq 0x17b78
movq 0x48(%r14), %rdi
movq 0x50(%r14), %rbx
testq %rbx, %rbx
je 0x1a400
movq 0x18bce(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x1a3fc
incl 0x8(%rbx)
jmp 0x1a400
lock
incl 0x8(%rbx)
callq 0x243d6
movq (%rax), %r15
testq %rbx, %rbx
je 0x1a415
movq %rbx, %rdi
callq 0xb478
leaq 0x58(%rsp), %rbp
movq 0x18b9f(%rip), %r12     # 0x32fc0
movq 0x48(%r14), %rdi
movq 0x50(%r14), %rbx
testq %rbx, %rbx
je 0x1a43e
cmpb $0x0, (%r12)
je 0x1a43a
incl 0x8(%rbx)
jmp 0x1a43e
lock
incl 0x8(%rbx)
callq 0x243d6
movq 0x8(%rax), %r13
testq %rbx, %rbx
je 0x1a454
movq %rbx, %rdi
callq 0xb478
cmpq %r13, %r15
je 0x1a557
movq (%r15), %rdi
movq (%rdi), %rax
callq *0xc0(%rax)
testb %al, %al
je 0x1a54e
movq 0x58(%r14), %rdi
movq 0x60(%r14), %r13
testq %r13, %r13
je 0x1a490
cmpb $0x0, (%r12)
je 0x1a48b
incl 0x8(%r13)
jmp 0x1a490
lock
incl 0x8(%r13)
movq (%r15), %rax
movq %rax, 0x68(%rsp)
movq 0x8(%r15), %rax
movq %rax, 0x70(%rsp)
testq %rax, %rax
je 0x1a4b6
cmpb $0x0, (%r12)
je 0x1a4b2
incl 0x8(%rax)
jmp 0x1a4b6
lock
incl 0x8(%rax)
leaq 0x68(%rsp), %rsi
callq 0x15b74
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1a4cf
callq 0xb478
testq %r13, %r13
je 0x1a4dc
movq %r13, %rdi
callq 0xb478
movq 0x48(%r14), %rdi
movq 0x50(%r14), %r13
testq %r13, %r13
je 0x1a4fb
cmpb $0x0, (%r12)
je 0x1a4f6
incl 0x8(%r13)
jmp 0x1a4fb
lock
incl 0x8(%r13)
movq (%r15), %rax
movq %rax, 0x58(%rsp)
movq 0x8(%r15), %rax
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x1a521
cmpb $0x0, (%r12)
je 0x1a51d
incl 0x8(%rax)
jmp 0x1a521
lock
incl 0x8(%rax)
movq %rbp, %rsi
callq 0x2441a
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1a538
callq 0xb478
testq %r13, %r13
je 0x1a421
movq %r13, %rdi
callq 0xb478
jmp 0x1a421
addq $0x10, %r15
jmp 0x1a421
movq 0x88(%r14), %rsi
movq 0x90(%r14), %r15
testq %r15, %r15
je 0x1a57c
cmpb $0x0, (%r12)
je 0x1a577
incl 0x8(%r15)
jmp 0x1a57c
lock
incl 0x8(%r15)
leaq 0x10(%rsp), %rdi
callq 0x11e3e
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rdi
movq 0x50(%rax), %rbx
testq %rbx, %rbx
je 0x1a5a8
cmpb $0x0, (%r12)
je 0x1a5a4
incl 0x8(%rbx)
jmp 0x1a5a8
lock
incl 0x8(%rbx)
callq 0x243d6
movq (%rax), %r13
testq %rbx, %rbx
je 0x1a5bd
movq %rbx, %rdi
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a5cc
callq 0xb478
testq %r15, %r15
je 0x1a5d9
movq %r15, %rdi
callq 0xb478
leaq 0x10(%rsp), %r15
movq 0x88(%r14), %rsi
movq 0x90(%r14), %rax
testq %rax, %rax
je 0x1a601
cmpb $0x0, (%r12)
je 0x1a5fd
incl 0x8(%rax)
jmp 0x1a601
lock
incl 0x8(%rax)
movq %rax, 0x30(%rsp)
movq %r15, %rdi
callq 0x11e3e
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rdi
movq 0x50(%rax), %rbx
testq %rbx, %rbx
je 0x1a630
cmpb $0x0, (%r12)
je 0x1a62c
incl 0x8(%rbx)
jmp 0x1a630
lock
incl 0x8(%rbx)
callq 0x243d6
movq 0x8(%rax), %rbp
testq %rbx, %rbx
je 0x1a646
movq %rbx, %rdi
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a655
callq 0xb478
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1a664
callq 0xb478
cmpq %rbp, %r13
je 0x1a800
movq (%r13), %rdi
movq (%rdi), %rax
callq *0xc0(%rax)
testb %al, %al
je 0x1a7f7
movq 0x88(%r14), %rsi
movq 0x90(%r14), %rbp
testq %rbp, %rbp
je 0x1a6a5
cmpb $0x0, (%r12)
je 0x1a6a1
incl 0x8(%rbp)
jmp 0x1a6a5
lock
incl 0x8(%rbp)
movq %r15, %rdi
callq 0x11e3e
movq 0x10(%rsp), %rax
movq 0x58(%rax), %rdi
movq 0x60(%rax), %rbx
testq %rbx, %rbx
je 0x1a6cf
cmpb $0x0, (%r12)
je 0x1a6cb
incl 0x8(%rbx)
jmp 0x1a6cf
lock
incl 0x8(%rbx)
movq (%r13), %rax
movq %rax, 0x48(%rsp)
movq 0x8(%r13), %rax
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0x1a6f6
cmpb $0x0, (%r12)
je 0x1a6f2
incl 0x8(%rax)
jmp 0x1a6f6
lock
incl 0x8(%rax)
leaq 0x48(%rsp), %rsi
callq 0x15b74
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1a70f
callq 0xb478
testq %rbx, %rbx
je 0x1a71c
movq %rbx, %rdi
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a72b
callq 0xb478
testq %rbp, %rbp
je 0x1a738
movq %rbp, %rdi
callq 0xb478
movq 0x88(%r14), %rsi
movq 0x90(%r14), %rbp
testq %rbp, %rbp
je 0x1a75b
cmpb $0x0, (%r12)
je 0x1a757
incl 0x8(%rbp)
jmp 0x1a75b
lock
incl 0x8(%rbp)
movq %r15, %rdi
callq 0x11e3e
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rdi
movq 0x50(%rax), %rbx
testq %rbx, %rbx
je 0x1a785
cmpb $0x0, (%r12)
je 0x1a781
incl 0x8(%rbx)
jmp 0x1a785
lock
incl 0x8(%rbx)
movq (%r13), %rax
movq %rax, 0x38(%rsp)
movq 0x8(%r13), %rax
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x1a7ac
cmpb $0x0, (%r12)
je 0x1a7a8
incl 0x8(%rax)
jmp 0x1a7ac
lock
incl 0x8(%rax)
leaq 0x38(%rsp), %rsi
callq 0x2441a
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1a7c5
callq 0xb478
testq %rbx, %rbx
je 0x1a7d2
movq %rbx, %rdi
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a7e1
callq 0xb478
testq %rbp, %rbp
je 0x1a5de
movq %rbp, %rdi
callq 0xb478
jmp 0x1a5de
addq $0x10, %r13
jmp 0x1a5de
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
movq 0x8(%rsp), %rbx
je 0x1a826
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x51f0
testq %rbx, %rbx
je 0x1a833
movq %rbx, %rdi
callq 0xb478
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 0x18734(%rip), %rsi     # 0x32f90
movq %rax, %rdi
xorl %edx, %edx
callq 0x5300
movl $0xc, %ebx
jmp 0x1a879
movl $0x6, %ebx
jmp 0x1a879
movl $0x1, %ebx
movl $0x4, %edi
callq 0x5100
movl %ebx, (%rax)
movq 0x18704(%rip), %rsi     # 0x32f90
movq %rax, %rdi
xorl %edx, %edx
callq 0x5300
jmp 0x1a9a6
movq %rax, %r14
testq %rbx, %rbx
je 0x1a8ab
movq %rbx, %rdi
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a8bf
callq 0xb478
jmp 0x1a8bf
movq %rax, %r14
testq %r15, %r15
je 0x1a9ee
movq %r15, %rdi
jmp 0x1a9e9
jmp 0x1a9de
movq %rax, %r14
movq 0x98(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1a9ee
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x51f0
jmp 0x1a9ee
movq %rax, %r14
movq 0x8(%rsp), %rbx
jmp 0x1aa14
movq %rax, %r14
testq %r13, %r13
je 0x1aa21
movq %r13, %rdi
jmp 0x1aa1c
movq %rax, %r14
testq %r12, %r12
je 0x1aa21
movq %r12, %rdi
jmp 0x1aa1c
jmp 0x1a9a6
movq %rax, %r14
movq 0x40(%rsp), %rdi
jmp 0x1a949
jmp 0x1a971
movq %rax, %r14
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1a953
callq 0xb478
testq %rbx, %rbx
je 0x1a960
movq %rbx, %rdi
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a974
callq 0xb478
jmp 0x1a974
movq %rax, %r14
testq %rbp, %rbp
je 0x1a9ee
movq %rbp, %rdi
jmp 0x1a9e9
movq %rax, %r14
movq 0x60(%rsp), %rdi
jmp 0x1a990
movq %rax, %r14
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1a99a
callq 0xb478
testq %r13, %r13
je 0x1a9ee
movq %r13, %rdi
jmp 0x1a9e9
jmp 0x1a9a6
movq %rax, %r14
jmp 0x1a9ee
movq %rax, %r14
jmp 0x1a9cf
movq %rax, %r14
testq %rbx, %rbx
je 0x1a9c0
movq %rbx, %rdi
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a9cf
callq 0xb478
cmpq $0x0, 0x30(%rsp)
je 0x1a9ee
movq 0x30(%rsp), %rdi
jmp 0x1a9e9
movq %rax, %r14
testq %rbx, %rbx
je 0x1a9ee
movq %rbx, %rdi
callq 0xb478
movq 0x8(%rsp), %rbx
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1aa14
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x51f0
testq %rbx, %rbx
je 0x1aa21
movq %rbx, %rdi
callq 0xb478
movq %r14, %rdi
callq 0x5320
nop