// File: /workspace/github_cpp_makefile_star2_O2/BohangZhang[P]Sorcery-C-Project/player.cc
// Function: Player::attack(int, int)
void Player::attack(int i, int j) {
    shared_ptr<Player> nonCurrent = getGame()->getNoncurrent();
    if (getSlot()->getSize() < i) throw 11; // Number; The Minion doesn't exist
    if (nonCurrent->getSlot()->getSize() < j) throw 3; // Number; The opponent doesn't exist  
    shared_ptr<Minion> m1 = getSlot()->getSlot()[i - 1];
    shared_ptr<Minion> m2 = nonCurrent->getSlot()->getSlot()[j - 1];
    m1->attackMinion(j - 1);
    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
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x88(%rdi), %rsi
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movq %rsi, 0x50(%rsp)
callq 0x8f1c
movq (%r15), %rsi
leaq 0x68(%rsp), %rdi
callq 0xe57c
leaq 0x40(%rsp), %rdi
callq 0x8ea0
leaq 0x48(%rbx), %rsi
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movq %rsi, 0x48(%rsp)
callq 0x1a802
movq (%r12), %rdi
callq 0x1b2e6
movl %eax, %r12d
leaq 0x40(%rsp), %rdi
callq 0x8ea0
cmpl %r14d, %r12d
jl 0x147cb
movq 0x68(%rsp), %rsi
addq $0x48, %rsi
leaq 0x38(%rsp), %r12
movq %r12, %rdi
callq 0x1a802
movq (%r12), %rdi
callq 0x1b2e6
movl %eax, %r12d
leaq 0x40(%rsp), %rdi
callq 0x8ea0
cmpl %ebp, %r12d
jl 0x147cf
leaq 0x58(%rsp), %r12
movq %r12, %rdi
movq 0x48(%rsp), %rsi
callq 0x1a802
movq (%r12), %rdi
callq 0x1b2e2
movq (%rax), %rax
movslq %r14d, %rcx
shlq $0x4, %rcx
leaq (%rax,%rcx), %rsi
addq $-0x10, %rsi
leaq 0x38(%rsp), %rdi
callq 0x8f30
leaq 0x60(%rsp), %rdi
callq 0x8ea0
movq 0x68(%rsp), %rsi
addq $0x48, %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x1a802
movq (%r14), %rdi
callq 0x1b2e2
movslq %ebp, %rcx
decl %ebp
shlq $0x4, %rcx
movq (%rax), %rax
leaq (%rcx,%rax), %rsi
addq $-0x10, %rsi
leaq 0x58(%rsp), %rdi
callq 0x8f30
leaq 0x10(%rsp), %rdi
callq 0x8ea0
movq 0x38(%rsp), %rdi
movq (%rdi), %rax
movl %ebp, %esi
callq *0xd0(%rax)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq 0x48(%rsp), %rsi
callq 0x1a802
movq (%r14), %rdi
callq 0x1b2e2
movq (%rax), %r12
leaq 0x10(%rsp), %rdi
callq 0x8ea0
addq $0x58, %rbx
movq %rbx, %r15
leaq 0x8(%rsp), %r14
leaq 0xa8(%rsp), %rbp
leaq 0x98(%rsp), %r13
movq %r14, %rdi
movq 0x48(%rsp), %rsi
callq 0x1a802
movq 0x8(%rsp), %rdi
callq 0x1b2e2
movq 0x8(%rax), %rbx
leaq 0x10(%rsp), %rdi
callq 0x8ea0
cmpq %rbx, %r12
je 0x145bc
movq (%r12), %rdi
movq (%rdi), %rax
callq *0xc0(%rax)
testb %al, %al
je 0x145b3
movq %r14, %rdi
movq %r15, %rsi
callq 0x1a816
movq 0x8(%rsp), %rbx
movq %rbp, %rdi
movq %r12, %rsi
callq 0x8f30
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x10b26
leaq 0xb0(%rsp), %rdi
callq 0x8ea0
leaq 0x10(%rsp), %rdi
callq 0x8ea0
movq %r14, %rdi
movq 0x48(%rsp), %rsi
callq 0x1a802
movq 0x8(%rsp), %rbx
movq %r13, %rdi
movq %r12, %rsi
callq 0x8f30
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1b326
leaq 0xa0(%rsp), %rdi
callq 0x8ea0
leaq 0x10(%rsp), %rdi
callq 0x8ea0
jmp 0x144ef
addq $0x10, %r12
jmp 0x144ef
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq 0x50(%rsp), %rsi
callq 0x8f1c
movq (%r14), %rsi
leaq 0x18(%rsp), %rdi
callq 0xe57c
movq 0x18(%rsp), %rsi
addq $0x48, %rsi
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x1a802
movq (%rbx), %rdi
callq 0x1b2e2
movq (%rax), %r13
leaq 0x10(%rsp), %rdi
callq 0x8ea0
leaq 0x20(%rsp), %rdi
callq 0x8ea0
leaq 0x30(%rsp), %rdi
callq 0x8ea0
leaq 0x28(%rsp), %r14
leaq 0x18(%rsp), %r15
leaq 0x8(%rsp), %rbp
movq %r14, %rdi
movq 0x50(%rsp), %rsi
callq 0x8f1c
movq 0x28(%rsp), %rsi
movq %r15, %rdi
callq 0xe57c
movq 0x18(%rsp), %rsi
addq $0x48, %rsi
movq %rbp, %rdi
callq 0x1a802
movq 0x8(%rsp), %rdi
callq 0x1b2e2
movq 0x8(%rax), %rbx
leaq 0x10(%rsp), %rdi
callq 0x8ea0
leaq 0x20(%rsp), %rdi
callq 0x8ea0
leaq 0x30(%rsp), %rdi
callq 0x8ea0
cmpq %rbx, %r13
je 0x1479b
movq (%r13), %rdi
movq (%rdi), %rax
callq *0xc0(%rax)
testb %al, %al
je 0x14792
movq %r14, %rdi
movq 0x50(%rsp), %rsi
callq 0x8f1c
movq 0x28(%rsp), %rsi
movq %r15, %rdi
callq 0xe57c
movq 0x18(%rsp), %rsi
addq $0x58, %rsi
movq %rbp, %rdi
callq 0x1a816
movq 0x8(%rsp), %rbx
leaq 0x88(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x8f30
movq %rbx, %rdi
movq %r12, %rsi
callq 0x10b26
leaq 0x90(%rsp), %rdi
callq 0x8ea0
leaq 0x10(%rsp), %rdi
callq 0x8ea0
leaq 0x20(%rsp), %rdi
callq 0x8ea0
leaq 0x30(%rsp), %rdi
callq 0x8ea0
movq %r14, %rdi
movq 0x50(%rsp), %rsi
callq 0x8f1c
movq 0x28(%rsp), %rsi
movq %r15, %rdi
callq 0xe57c
movq 0x18(%rsp), %rsi
addq $0x48, %rsi
movq %rbp, %rdi
callq 0x1a802
movq 0x8(%rsp), %rbx
leaq 0x78(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x8f30
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1b326
leaq 0x80(%rsp), %rdi
callq 0x8ea0
leaq 0x10(%rsp), %rdi
callq 0x8ea0
leaq 0x20(%rsp), %rdi
callq 0x8ea0
leaq 0x30(%rsp), %rdi
callq 0x8ea0
jmp 0x14629
addq $0x10, %r13
jmp 0x14629
leaq 0x60(%rsp), %rdi
callq 0x8ea0
leaq 0x40(%rsp), %rdi
callq 0x8ea0
leaq 0x70(%rsp), %rdi
callq 0x8ea0
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0xb
jmp 0x147d1
pushq $0x3
popq %rbx
pushq $0x4
popq %rdi
callq 0x5120
movl %ebx, (%rax)
movq 0x167bd(%rip), %rsi     # 0x2afa0
movq %rax, %rdi
xorl %edx, %edx
callq 0x5310
jmp 0x14885
jmp 0x14880
jmp 0x148a3
jmp 0x1487b
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x148b5
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
jmp 0x148bf
jmp 0x1481a
movq %rax, %rbx
jmp 0x148ba
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
jmp 0x148c9
movq %rax, %rbx
jmp 0x148c4
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
jmp 0x14851
jmp 0x14880
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x8ea0
jmp 0x14888
jmp 0x14880
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
jmp 0x14872
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x8ea0
jmp 0x148a6
jmp 0x1487b
movq %rax, %rbx
jmp 0x148b0
movq %rax, %rbx
jmp 0x1489c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x8ea0
leaq 0x20(%rsp), %rdi
callq 0x8ea0
leaq 0x30(%rsp), %rdi
jmp 0x148ab
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x8ea0
leaq 0x60(%rsp), %rdi
callq 0x8ea0
leaq 0x40(%rsp), %rdi
callq 0x8ea0
leaq 0x70(%rsp), %rdi
callq 0x8ea0
movq %rbx, %rdi
callq 0x5330