// File: /workspace/github_cpp_makefile_star2_O3/BohangZhang[P]Sorcery-C-Project/player.cc
// Function: Player::play(int)
void Player::play(int i) { // call Game notify()
    if (getHand()->getHand().size() < i) throw 7; // Number; The card doesn't exist
    else {
        shared_ptr<Card> c = getHand()->getHand()[i - 1];
        if (getMagic() < c->getCost()) throw 6; // Number; You don't have enough Magic
        string card_type = c->getType();
        if (card_type == "Enchantment") throw 8; // Number; Wrong command
        else if (card_type == "Spell") {
            c->action();
            getHand()->pop(i);
        } else if (card_type == "Ritual") {
            ritual = dynamic_pointer_cast<Ritual>(c);
            game->notifyRitual("REnter", ritual);
            getHand()->pop(i);
        } else {
            if (isSlotFull()) {
                throw 2;
            } else {
                shared_ptr<Minion> m = dynamic_pointer_cast<Minion>(c);
                getSlot()->push(m);
                getHand()->pop(i);
                game->notify("Enter", m);
            }
        }
        subMagic(c->getCost());
        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 $0xf8, %rsp
movl %esi, %ebp
movq %rdi, %r14
movq 0x38(%rdi), %rdi
movq 0x40(%r14), %rbx
testq %rbx, %rbx
je 0x17ce6
movq 0x1b2e8(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x17ce2
incl 0x8(%rbx)
jmp 0x17ce6
lock
incl 0x8(%rbx)
callq 0x15f86
movq 0x8(%rax), %r15
subq (%rax), %r15
sarq $0x4, %r15
movslq %ebp, %r12
testq %rbx, %rbx
je 0x17d06
movq %rbx, %rdi
callq 0xb478
cmpq %r12, %r15
jb 0x185a2
movq 0x38(%r14), %rdi
movq 0x40(%r14), %rbx
testq %rbx, %rbx
je 0x17d31
movq 0x1b29d(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x17d2d
incl 0x8(%rbx)
jmp 0x17d31
lock
incl 0x8(%rbx)
callq 0x15f86
movq (%rax), %rax
shlq $0x4, %r12
movq -0x10(%rax,%r12), %r15
movq -0x8(%rax,%r12), %r13
testq %r13, %r13
je 0x17d63
movq 0x1b26d(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x17d5e
incl 0x8(%r13)
jmp 0x17d63
lock
incl 0x8(%r13)
testq %rbx, %rbx
je 0x17d70
movq %rbx, %rdi
callq 0xb478
movl 0x24(%r14), %ebx
movq %r15, %rdi
callq 0xe63e
cmpl %eax, %ebx
jl 0x185c3
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
callq 0xe5f6
leaq 0xfad7(%rip), %rsi      # 0x27872
leaq 0x98(%rsp), %rdi
callq 0x50a0
testl %eax, %eax
movq %r13, 0x8(%rsp)
je 0x185e4
leaq 0xeb2c(%rip), %rsi      # 0x268e8
leaq 0x98(%rsp), %rdi
callq 0x50a0
testl %eax, %eax
je 0x17e4b
leaq 0xeb0d(%rip), %rsi      # 0x268e1
leaq 0x98(%rsp), %rdi
callq 0x50a0
testl %eax, %eax
je 0x17e74
movq 0x48(%r14), %rdi
callq 0x243e6
testb %al, %al
jne 0x185eb
testq %r13, %r13
sete %bl
leaq 0x1a2a9(%rip), %rsi     # 0x320b0
leaq 0x1ab8a(%rip), %rdx     # 0x32998
xorl %r12d, %r12d
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x5220
movq %rax, %r13
testq %rax, %rax
sete %al
orb %bl, %al
jne 0x17eda
movq 0x1b18d(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x17ecf
movq 0x8(%rsp), %r12
incl 0x8(%r12)
jmp 0x17eda
movq (%r15), %rax
movq %r15, %rdi
callq *0x40(%rax)
movq 0x38(%r14), %rdi
movq 0x40(%r14), %r12
testq %r12, %r12
je 0x17ec3
movq 0x1b158(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x17ebd
incl 0x8(%r12)
jmp 0x17ec3
testq %r13, %r13
sete %r12b
leaq 0x1a22e(%rip), %rsi     # 0x320b0
leaq 0x1ad27(%rip), %rdx     # 0x32bb0
xorl %ebx, %ebx
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x5220
testq %rax, %rax
sete %cl
orb %r12b, %cl
jne 0x18033
movq 0x1b115(%rip), %rcx     # 0x32fc0
cmpb $0x0, (%rcx)
je 0x1802b
incl 0x8(%r13)
jmp 0x18030
lock
incl 0x8(%r12)
movl %ebp, %esi
callq 0x15fb8
jmp 0x1811e
movq 0x8(%rsp), %r12
lock
incl 0x8(%r12)
movq 0x48(%r14), %rdi
movq 0x50(%r14), %rbx
testq %rbx, %rbx
je 0x17efc
movq 0x1b0d2(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x17ef8
incl 0x8(%rbx)
jmp 0x17efc
lock
incl 0x8(%rbx)
movq %r13, 0x78(%rsp)
movq %r12, 0x80(%rsp)
testq %r12, %r12
je 0x17f27
movq 0x1b0ab(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x17f21
incl 0x8(%r12)
jmp 0x17f27
lock
incl 0x8(%r12)
leaq 0x78(%rsp), %rsi
callq 0x24414
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x17f43
callq 0xb478
testq %rbx, %rbx
je 0x17f50
movq %rbx, %rdi
callq 0xb478
movq 0x38(%r14), %rdi
movq 0x40(%r14), %rbx
testq %rbx, %rbx
je 0x17f72
movq 0x1b05c(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x17f6e
incl 0x8(%rbx)
jmp 0x17f72
lock
incl 0x8(%rbx)
movl %ebp, %esi
callq 0x15fb8
testq %rbx, %rbx
je 0x17f86
movq %rbx, %rdi
callq 0xb478
movq 0x88(%r14), %rbx
leaq 0xc8(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0xfac2(%rip), %rsi      # 0x27a62
leaq 0xfac0(%rip), %rdx      # 0x27a67
leaq 0xb8(%rsp), %rdi
callq 0xb57e
movq %r13, 0x68(%rsp)
movq %r12, 0x70(%rsp)
testq %r12, %r12
movq 0x8(%rsp), %r13
je 0x17fe1
movq 0x1aff1(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x17fdb
incl 0x8(%r12)
jmp 0x17fe1
lock
incl 0x8(%r12)
leaq 0xb8(%rsp), %rsi
leaq 0x68(%rsp), %rdx
movq %rbx, %rdi
callq 0x120a0
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x18005
callq 0xb478
movq 0xb8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1811e
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x51f0
jmp 0x1811e
lock
incl 0x8(%r13)
movq %r13, %rbx
movq %rax, 0x68(%r14)
movq 0x70(%r14), %rdi
movq %rbx, 0x70(%r14)
testq %rdi, %rdi
je 0x18049
callq 0xb478
movq 0x88(%r14), %rbx
leaq 0xe8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xfa0b(%rip), %rsi      # 0x27a6f
leaq 0xfa0a(%rip), %rdx      # 0x27a75
leaq 0xd8(%rsp), %rdi
callq 0xb57e
movq 0x68(%r14), %rax
movq %rax, 0x88(%rsp)
movq 0x70(%r14), %rax
movq %rax, 0x90(%rsp)
testq %rax, %rax
je 0x180aa
movq 0x1af24(%rip), %rcx     # 0x32fc0
cmpb $0x0, (%rcx)
je 0x180a6
incl 0x8(%rax)
jmp 0x180aa
lock
incl 0x8(%rax)
leaq 0xd8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
movq %rbx, %rdi
callq 0x155e8
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x180d4
callq 0xb478
movq 0xd8(%rsp), %rdi
cmpq %r12, %rdi
je 0x180f1
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x38(%r14), %rdi
movq 0x40(%r14), %r12
testq %r12, %r12
je 0x18117
movq 0x1aebb(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x18111
incl 0x8(%r12)
jmp 0x18117
lock
incl 0x8(%r12)
movl %ebp, %esi
callq 0x15fb8
testq %r12, %r12
je 0x1812b
movq %r12, %rdi
callq 0xb478
movq %r15, %rdi
callq 0xe63e
movq %r14, %rdi
movl %eax, %esi
callq 0x17b78
movq 0x48(%r14), %rdi
movq 0x50(%r14), %rbx
testq %rbx, %rbx
je 0x1815f
movq 0x1ae6f(%rip), %rax     # 0x32fc0
cmpb $0x0, (%rax)
je 0x1815b
incl 0x8(%rbx)
jmp 0x1815f
lock
incl 0x8(%rbx)
callq 0x243d6
movq (%rax), %rbp
testq %rbx, %rbx
je 0x18174
movq %rbx, %rdi
callq 0xb478
leaq 0x48(%rsp), %r12
movq 0x1ae40(%rip), %r13     # 0x32fc0
movq 0x48(%r14), %rdi
movq 0x50(%r14), %rbx
testq %rbx, %rbx
je 0x1819d
cmpb $0x0, (%r13)
je 0x18199
incl 0x8(%rbx)
jmp 0x1819d
lock
incl 0x8(%rbx)
callq 0x243d6
movq 0x8(%rax), %r15
testq %rbx, %rbx
je 0x181b3
movq %rbx, %rdi
callq 0xb478
cmpq %r15, %rbp
je 0x182b5
movq (%rbp), %rdi
movq (%rdi), %rax
callq *0xc0(%rax)
testb %al, %al
je 0x182ac
movq 0x58(%r14), %rdi
movq 0x60(%r14), %rbx
testq %rbx, %rbx
je 0x181ee
cmpb $0x0, (%r13)
je 0x181ea
incl 0x8(%rbx)
jmp 0x181ee
lock
incl 0x8(%rbx)
movq (%rbp), %rax
movq %rax, 0x58(%rsp)
movq 0x8(%rbp), %rax
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x18215
cmpb $0x0, (%r13)
je 0x18211
incl 0x8(%rax)
jmp 0x18215
lock
incl 0x8(%rax)
leaq 0x58(%rsp), %rsi
callq 0x15b74
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1822e
callq 0xb478
testq %rbx, %rbx
je 0x1823b
movq %rbx, %rdi
callq 0xb478
movq 0x48(%r14), %rdi
movq 0x50(%r14), %rbx
testq %rbx, %rbx
je 0x18258
cmpb $0x0, (%r13)
je 0x18254
incl 0x8(%rbx)
jmp 0x18258
lock
incl 0x8(%rbx)
movq (%rbp), %rax
movq %rax, 0x48(%rsp)
movq 0x8(%rbp), %rax
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0x1827f
cmpb $0x0, (%r13)
je 0x1827b
incl 0x8(%rax)
jmp 0x1827f
lock
incl 0x8(%rax)
movq %r12, %rsi
callq 0x2441a
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x18296
callq 0xb478
testq %rbx, %rbx
je 0x18180
movq %rbx, %rdi
callq 0xb478
jmp 0x18180
addq $0x10, %rbp
jmp 0x18180
movq 0x88(%r14), %rsi
movq 0x90(%r14), %r15
testq %r15, %r15
je 0x182da
cmpb $0x0, (%r13)
je 0x182d5
incl 0x8(%r15)
jmp 0x182da
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 0x18306
cmpb $0x0, (%r13)
je 0x18302
incl 0x8(%rbx)
jmp 0x18306
lock
incl 0x8(%rbx)
callq 0x243d6
movq (%rax), %r12
testq %rbx, %rbx
je 0x1831b
movq %rbx, %rdi
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1832a
callq 0xb478
testq %r15, %r15
je 0x18337
movq %r15, %rdi
callq 0xb478
leaq 0x10(%rsp), %r15
movq 0x88(%r14), %rsi
movq 0x90(%r14), %rax
testq %rax, %rax
je 0x1835f
cmpb $0x0, (%r13)
je 0x1835b
incl 0x8(%rax)
jmp 0x1835f
lock
incl 0x8(%rax)
movq %rax, 0x20(%rsp)
movq %r15, %rdi
callq 0x11e3e
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rdi
movq 0x50(%rax), %rbx
testq %rbx, %rbx
je 0x1838e
cmpb $0x0, (%r13)
je 0x1838a
incl 0x8(%rbx)
jmp 0x1838e
lock
incl 0x8(%rbx)
callq 0x243d6
movq 0x8(%rax), %rbp
testq %rbx, %rbx
je 0x183a4
movq %rbx, %rdi
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x183b3
callq 0xb478
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x183c2
callq 0xb478
cmpq %rbp, %r12
je 0x18560
movq (%r12), %rdi
movq (%rdi), %rax
callq *0xc0(%rax)
testb %al, %al
je 0x18557
movq 0x88(%r14), %rsi
movq 0x90(%r14), %rbp
testq %rbp, %rbp
je 0x18403
cmpb $0x0, (%r13)
je 0x183ff
incl 0x8(%rbp)
jmp 0x18403
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 0x1842d
cmpb $0x0, (%r13)
je 0x18429
incl 0x8(%rbx)
jmp 0x1842d
lock
incl 0x8(%rbx)
movq (%r12), %rax
movq %rax, 0x38(%rsp)
movq 0x8(%r12), %rax
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x18455
cmpb $0x0, (%r13)
je 0x18451
incl 0x8(%rax)
jmp 0x18455
lock
incl 0x8(%rax)
leaq 0x38(%rsp), %rsi
callq 0x15b74
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1846e
callq 0xb478
testq %rbx, %rbx
je 0x1847b
movq %rbx, %rdi
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1848a
callq 0xb478
testq %rbp, %rbp
je 0x18497
movq %rbp, %rdi
callq 0xb478
movq 0x88(%r14), %rsi
movq 0x90(%r14), %rbp
testq %rbp, %rbp
je 0x184ba
cmpb $0x0, (%r13)
je 0x184b6
incl 0x8(%rbp)
jmp 0x184ba
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 0x184e4
cmpb $0x0, (%r13)
je 0x184e0
incl 0x8(%rbx)
jmp 0x184e4
lock
incl 0x8(%rbx)
movq (%r12), %rax
movq %rax, 0x28(%rsp)
movq 0x8(%r12), %rax
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x1850c
cmpb $0x0, (%r13)
je 0x18508
incl 0x8(%rax)
jmp 0x1850c
lock
incl 0x8(%rax)
leaq 0x28(%rsp), %rsi
callq 0x2441a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x18525
callq 0xb478
testq %rbx, %rbx
je 0x18532
movq %rbx, %rdi
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x18541
callq 0xb478
testq %rbp, %rbp
je 0x1833c
movq %rbp, %rdi
callq 0xb478
jmp 0x1833c
addq $0x10, %r12
jmp 0x1833c
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x18581
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18590
callq 0xb478
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x4, %edi
callq 0x5100
movl $0x7, (%rax)
movq 0x1a9d7(%rip), %rsi     # 0x32f90
movq %rax, %rdi
xorl %edx, %edx
callq 0x5300
movl $0x4, %edi
callq 0x5100
movl $0x6, (%rax)
movq 0x1a9b6(%rip), %rsi     # 0x32f90
movq %rax, %rdi
xorl %edx, %edx
callq 0x5300
movl $0x8, %ebx
jmp 0x185f0
movl $0x2, %ebx
movl $0x4, %edi
callq 0x5100
movl %ebx, (%rax)
movq 0x1a98d(%rip), %rsi     # 0x32f90
movq %rax, %rdi
xorl %edx, %edx
movq 0x8(%rsp), %r13
callq 0x5300
jmp 0x18687
movq %rax, %r14
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x18629
callq 0xb478
movq 0xd8(%rsp), %rdi
cmpq %r12, %rdi
je 0x187d7
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x51f0
jmp 0x187d7
jmp 0x1871e
jmp 0x18687
movq %rax, %r14
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x18668
callq 0xb478
movq 0xb8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x186b3
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x51f0
jmp 0x186b3
movq %rax, %r14
jmp 0x186b3
movq %rax, %r14
jmp 0x186a6
movq %rax, %r14
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x186a6
callq 0xb478
testq %rbx, %rbx
je 0x186b3
movq %rbx, %rdi
callq 0xb478
testq %r12, %r12
je 0x187d7
movq %r12, %rdi
jmp 0x187d2
movq %rax, %r14
testq %rbx, %rbx
je 0x186d4
movq %rbx, %rdi
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x186e8
callq 0xb478
jmp 0x186e8
movq %rax, %r14
testq %r15, %r15
je 0x187d7
movq %r15, %rdi
jmp 0x187d2
jmp 0x187c7
jmp 0x18716
jmp 0x18702
movq %rax, %r14
testq %rbx, %rbx
je 0x1880a
movq %rbx, %rdi
jmp 0x18805
movq %rax, %r14
jmp 0x187fd
movq %rax, %r14
jmp 0x187dc
movq %rax, %r14
movq 0x30(%rsp), %rdi
jmp 0x1873a
jmp 0x18762
movq %rax, %r14
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x18744
callq 0xb478
testq %rbx, %rbx
je 0x18751
movq %rbx, %rdi
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x18765
callq 0xb478
jmp 0x18765
movq %rax, %r14
testq %rbp, %rbp
je 0x187d7
movq %rbp, %rdi
jmp 0x187d2
movq %rax, %r14
movq 0x50(%rsp), %rdi
jmp 0x18781
movq %rax, %r14
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x187ca
callq 0xb478
jmp 0x187ca
jmp 0x1878f
movq %rax, %r14
jmp 0x187d7
movq %rax, %r14
jmp 0x187b8
movq %rax, %r14
testq %rbx, %rbx
je 0x187a9
movq %rbx, %rdi
callq 0xb478
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x187b8
callq 0xb478
cmpq $0x0, 0x20(%rsp)
je 0x187d7
movq 0x20(%rsp), %rdi
jmp 0x187d2
movq %rax, %r14
testq %rbx, %rbx
je 0x187d7
movq %rbx, %rdi
callq 0xb478
movq 0x8(%rsp), %r13
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x187fd
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x51f0
testq %r13, %r13
je 0x1880a
movq %r13, %rdi
callq 0xb478
movq %r14, %rdi
callq 0x5320