// File: /workspace/github_cpp_makefile_star2_O1/BohangZhang[P]Sorcery-C-Project/player.cc
// Function: Player::testing_play(int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Player::testing_play(int i, int p, string t) {
    if (getHand()->getHand().size() < i) throw 7; // Number; The card doesn't exist
    else {
        shared_ptr<Card> c = getHand()->getHand()[i - 1];
        string card_type = c->getType();
        if (card_type == "Spell") { 
            c->action(p,t);
            getHand()->pop(i);
        } else if (card_type == "Enchantment") {
            if (t == "r") throw 9; // Number; Wrong command, Enchantment can't be played on Ritual
            
            shared_ptr<Player> targetplayer {nullptr};
            if (p == 1) {targetplayer = getGame()->get1();} 
            else {targetplayer = getGame()->get2();}   
    
            int j;
            istringstream ss{t};
            ss >> j;
            shared_ptr<Minion> m = targetplayer->getSlot()->getSlot()[j - 1];
            shared_ptr<Minion> h = dynamic_pointer_cast<Minion>(c);
            h->setOrigin(m);
            targetplayer->getSlot()->getSlot()[j - 1] = h;
            getHand()->pop(i);
        } else throw 10; // Number; Wrong command, this card can't be played to a target
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rcx, %r13
movl %edx, %r15d
movl %esi, %ebx
movq %rdi, %r14
movq 0x38(%rdi), %rdi
movq 0x40(%r14), %rbp
testq %rbp, %rbp
je 0x19b3e
movq 0x1a490(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x19b3a
incl 0x8(%rbp)
jmp 0x19b3e
lock
incl 0x8(%rbp)
callq 0x16056
movq 0x8(%rax), %r12
subq (%rax), %r12
sarq $0x4, %r12
movl %ebx, 0x18(%rsp)
movslq %ebx, %rbx
testq %rbp, %rbp
je 0x19b62
movq %rbp, %rdi
callq 0xb634
cmpq %rbx, %r12
jb 0x19fb6
movq 0x38(%r14), %rdi
movq 0x40(%r14), %rbp
testq %rbp, %rbp
je 0x19b8d
movq 0x1a441(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x19b89
incl 0x8(%rbp)
jmp 0x19b8d
lock
incl 0x8(%rbp)
callq 0x16056
movq (%rax), %rax
shlq $0x4, %rbx
movq -0x10(%rax,%rbx), %r12
movq -0x8(%rax,%rbx), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x19bcc
movq 0x1a40c(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x19bc3
movq 0x8(%rsp), %rax
incl 0x8(%rax)
jmp 0x19bcc
movq 0x8(%rsp), %rax
lock
incl 0x8(%rax)
testq %rbp, %rbp
je 0x19bd9
movq %rbp, %rdi
callq 0xb634
leaq 0x60(%rsp), %rdi
movq %r12, %rsi
callq 0xe816
leaq 0xdcfb(%rip), %rsi      # 0x278e8
leaq 0x60(%rsp), %rdi
callq 0x50a0
testl %eax, %eax
movq 0x8(%rsp), %rbp
je 0x19c69
leaq 0xec6b(%rip), %rsi      # 0x28872
leaq 0x60(%rsp), %rdi
callq 0x50a0
testl %eax, %eax
jne 0x19fd7
leaq 0xdc72(%rip), %rsi      # 0x27892
movq %r13, %rdi
callq 0x50a0
testl %eax, %eax
je 0x19fde
cmpl $0x1, %r15d
jne 0x19cd2
movq 0x88(%r14), %rsi
movq 0x90(%r14), %rbp
testq %rbp, %rbp
je 0x19d08
movq 0x1a368(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x19d04
incl 0x8(%rbp)
jmp 0x19d08
leaq 0x50(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0xb6a4
movq (%r12), %rax
leaq 0x40(%rsp), %rdx
movq %r12, %rdi
movl %r15d, %esi
callq *0x48(%rax)
movq 0x40(%rsp), %rdi
cmpq %rbx, %rdi
je 0x19cb0
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0x38(%r14), %rdi
movq 0x40(%r14), %rbx
testq %rbx, %rbx
movl 0x18(%rsp), %esi
je 0x19cfa
movq 0x1a2f8(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x19cf6
incl 0x8(%rbx)
jmp 0x19cfa
movq 0x88(%r14), %rsi
movq 0x90(%r14), %rbp
testq %rbp, %rbp
je 0x19d1b
movq 0x1a2d4(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x19d17
incl 0x8(%rbp)
jmp 0x19d1b
lock
incl 0x8(%rbx)
callq 0x16088
jmp 0x19f6f
lock
incl 0x8(%rbp)
leaq 0x80(%rsp), %rdi
callq 0x12096
jmp 0x19d28
lock
incl 0x8(%rbp)
leaq 0x80(%rsp), %rdi
callq 0x120c2
movq 0x80(%rsp), %r15
movq 0x88(%rsp), %rax
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x19d5a
callq 0xb634
testq %rbp, %rbp
je 0x19d67
movq %rbp, %rdi
callq 0xb634
leaq 0x80(%rsp), %rdi
movq %r13, %rsi
movl $0x8, %edx
callq 0x52e0
leaq 0x80(%rsp), %rdi
leaq 0x1c(%rsp), %rsi
callq 0x5130
movq 0x48(%r15), %rdi
movq 0x50(%r15), %rbp
testq %rbp, %rbp
je 0x19db0
movq 0x1a21e(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x19dac
incl 0x8(%rbp)
jmp 0x19db0
lock
incl 0x8(%rbp)
callq 0x24706
movslq 0x1c(%rsp), %rcx
movq (%rax), %rax
shlq $0x4, %rcx
movq -0x10(%rax,%rcx), %rbx
movq -0x8(%rax,%rcx), %r13
testq %r13, %r13
je 0x19de7
movq 0x1a1e9(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x19de2
incl 0x8(%r13)
jmp 0x19de7
lock
incl 0x8(%r13)
testq %rbp, %rbp
je 0x19df4
movq %rbp, %rdi
callq 0xb634
leaq 0x192b5(%rip), %rsi     # 0x330b0
leaq 0x19b96(%rip), %rdx     # 0x33998
movq %r12, %rdi
xorl %ecx, %ecx
callq 0x5220
testq %rax, %rax
je 0x19e36
movq %rax, 0x20(%rsp)
movq 0x8(%rsp), %rbp
movq %rbp, 0x28(%rsp)
testq %rbp, %rbp
je 0x19e49
movq 0x1a194(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x19e45
incl 0x8(%rbp)
jmp 0x19e49
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x8(%rsp), %rbp
jmp 0x19e49
lock
incl 0x8(%rbp)
movq 0x20(%rsp), %rdi
movq %rbx, 0x30(%rsp)
movq %r13, 0x38(%rsp)
testq %r13, %r13
movl 0x18(%rsp), %ebx
je 0x19e78
movq 0x1a158(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x19e73
incl 0x8(%r13)
jmp 0x19e78
lock
incl 0x8(%r13)
movq (%rdi), %rax
leaq 0x30(%rsp), %rsi
callq *0xf8(%rax)
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x19e95
callq 0xb634
movq 0x48(%r15), %rdi
movq 0x50(%r15), %r12
testq %r12, %r12
je 0x19ebb
movq 0x1a117(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x19eb5
incl 0x8(%r12)
jmp 0x19ebb
lock
incl 0x8(%r12)
callq 0x24706
movslq 0x1c(%rsp), %rcx
movq (%rax), %rax
shlq $0x4, %rcx
leaq 0x28(%rsp), %rsi
movq -0x8(%rsi), %rdx
leaq (%rax,%rcx), %rdi
addq $-0x8, %rdi
movq %rdx, -0x8(%rdi)
callq 0xe8da
testq %r12, %r12
je 0x19ef3
movq %r12, %rdi
callq 0xb634
movq 0x38(%r14), %rdi
movq 0x40(%r14), %r12
testq %r12, %r12
je 0x19f19
movq 0x1a0b9(%rip), %rax     # 0x33fc0
cmpb $0x0, (%rax)
je 0x19f13
incl 0x8(%r12)
jmp 0x19f19
lock
incl 0x8(%r12)
movl %ebx, %esi
callq 0x16088
testq %r12, %r12
je 0x19f2d
movq %r12, %rdi
callq 0xb634
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x19f3c
callq 0xb634
testq %r13, %r13
movq 0x10(%rsp), %rbx
je 0x19f4e
movq %r13, %rdi
callq 0xb634
movq 0x1a05b(%rip), %rsi     # 0x33fb0
leaq 0x80(%rsp), %rdi
callq 0x5280
leaq 0xf8(%rsp), %rdi
callq 0x50b0
testq %rbx, %rbx
je 0x19f7c
movq %rbx, %rdi
callq 0xb634
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x19f97
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x51f0
testq %rbp, %rbp
je 0x19fa4
movq %rbp, %rdi
callq 0xb634
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x4, %edi
callq 0x5100
movl $0x7, (%rax)
movq 0x19fc3(%rip), %rsi     # 0x33f90
movq %rax, %rdi
xorl %edx, %edx
callq 0x5300
movl $0xa, %ebx
jmp 0x19fe3
movl $0x9, %ebx
movl $0x4, %edi
callq 0x5100
movl %ebx, (%rax)
movq 0x19f9a(%rip), %rsi     # 0x33f90
movq %rax, %rdi
xorl %edx, %edx
callq 0x5300
jmp 0x1a002
movq %rax, %r14
testq %rbp, %rbp
je 0x1a012
movq %rbp, %rdi
callq 0xb634
movq $0x0, 0x10(%rsp)
jmp 0x1a0c2
movq %rax, %r14
testq %rbx, %rbx
je 0x1a0f4
movq %rbx, %rdi
jmp 0x1a0cf
movq %rax, %r14
movq 0x40(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1a0f4
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x51f0
jmp 0x1a0f4
jmp 0x1a059
movq %rax, %r14
jmp 0x1a066
movq %rax, %r14
movq 0x38(%rsp), %r12
testq %r12, %r12
je 0x1a073
movq %r12, %rdi
callq 0xb634
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x1a082
callq 0xb634
testq %r13, %r13
je 0x1a0a1
movq %r13, %rdi
jmp 0x1a097
movq %rax, %r14
testq %rbp, %rbp
je 0x1a0a1
movq %rbp, %rdi
callq 0xb634
jmp 0x1a0a1
movq %rax, %r14
movq 0x19f08(%rip), %rsi     # 0x33fb0
leaq 0x80(%rsp), %rdi
callq 0x5280
leaq 0xf8(%rsp), %rdi
callq 0x50b0
cmpq $0x0, 0x10(%rsp)
je 0x1a0f4
movq 0x10(%rsp), %rdi
callq 0xb634
jmp 0x1a0f4
movq %rax, %r14
jmp 0x1a0c2
movq %rax, %r14
jmp 0x1a10f
jmp 0x1a0e2
movq %rax, %r14
movq %rbp, 0x8(%rsp)
testq %rbp, %rbp
jne 0x1a117
jmp 0x1a121
movq %rax, %r14
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a10f
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x51f0
cmpq $0x0, 0x8(%rsp)
je 0x1a121
movq 0x8(%rsp), %rdi
callq 0xb634
movq %r14, %rdi
callq 0x5320
nop