// File: 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
movq %rsp, %rbp
subq $0x330, %rsp            # imm = 0x330
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x210(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0x208(%rbp)
callq 0x2a670
movq -0x208(%rbp), %rdi
callq 0x12a20
movq %rax, %rsi
leaq -0x20(%rbp), %rdi
callq 0x22910
jmp 0x2e6fa
leaq -0x30(%rbp), %rdi
callq 0x12a70
movq -0x210(%rbp), %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0x2a6b0
movq -0x220(%rbp), %rdi
callq 0x12af0
movq %rax, %rdi
callq 0x3d230
movl %eax, -0x214(%rbp)
jmp 0x2e736
movl -0xc(%rbp), %eax
movl %eax, -0x224(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x12b30
movl -0x224(%rbp), %ecx
movl -0x214(%rbp), %eax
cmpl %ecx, %eax
jge 0x2e7c5
movl $0x4, %edi
callq 0x6160
movq %rax, %rdi
movl $0xb, (%rdi)
movq 0x25826(%rip), %rsi     # 0x53f98
xorl %eax, %eax
movl %eax, %edx
callq 0x6430
jmp 0x2f11f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x12a70
jmp 0x2f116
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x12b30
jmp 0x2f10d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x2f10d
leaq -0x20(%rbp), %rdi
callq 0x12980
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x2a6b0
movq -0x230(%rbp), %rdi
callq 0x12af0
movq %rax, %rdi
callq 0x3d230
movl %eax, -0x228(%rbp)
jmp 0x2e7fd
movl -0x10(%rbp), %eax
movl %eax, -0x234(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x12b30
movl -0x234(%rbp), %ecx
movl -0x228(%rbp), %eax
cmpl %ecx, %eax
jge 0x2e861
movl $0x4, %edi
callq 0x6160
movq %rax, %rdi
movl $0x3, (%rdi)
movq 0x2575f(%rip), %rsi     # 0x53f98
xorl %eax, %eax
movl %eax, %edx
callq 0x6430
jmp 0x2f11f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x12b30
jmp 0x2f10d
movq -0x210(%rbp), %rsi
leaq -0x80(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x2a6b0
movq -0x248(%rbp), %rdi
callq 0x12af0
movq %rax, %rdi
callq 0x3d220
movq %rax, -0x240(%rbp)
jmp 0x2e895
movq -0x240(%rbp), %rdi
movl -0xc(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x12c80
movq %rax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x12c10
leaq -0x80(%rbp), %rdi
callq 0x12b30
leaq -0x20(%rbp), %rdi
callq 0x12980
movq %rax, %rsi
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x258(%rbp)
callq 0x2a6b0
movq -0x258(%rbp), %rdi
callq 0x12af0
movq %rax, %rdi
callq 0x3d220
movq %rax, -0x250(%rbp)
jmp 0x2e8fa
movq -0x250(%rbp), %rdi
movl -0x10(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x12c80
movq %rax, %rsi
leaq -0x90(%rbp), %rdi
callq 0x12c10
leaq -0xa0(%rbp), %rdi
callq 0x12b30
leaq -0x70(%rbp), %rdi
callq 0x12d30
movq %rax, %rdi
movl -0x10(%rbp), %esi
decl %esi
movq (%rdi), %rax
movq 0xd0(%rax), %rax
callq *%rax
jmp 0x2e948
movq -0x210(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0x2a6b0
movq -0x268(%rbp), %rdi
callq 0x12af0
movq %rax, %rdi
callq 0x3d220
movq %rax, -0x260(%rbp)
jmp 0x2e97f
movq -0x260(%rbp), %rdi
callq 0x12b50
movq %rax, -0xa8(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x12b30
movq -0x210(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x278(%rbp)
callq 0x2a6b0
movq -0x278(%rbp), %rdi
callq 0x12af0
movq %rax, %rdi
callq 0x3d220
movq %rax, -0x270(%rbp)
jmp 0x2e9d5
movq -0x270(%rbp), %rdi
callq 0x12b80
movq %rax, -0xc0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x12bb0
movb %al, -0x279(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x12b30
movb -0x279(%rbp), %al
testb $0x1, %al
jne 0x2ea1c
jmp 0x2ec38
leaq -0xa8(%rbp), %rdi
callq 0x12bf0
movq %rax, %rdi
callq 0x12d30
movq %rax, %rdi
movq (%rdi), %rax
movq 0xc0(%rax), %rax
callq *%rax
movb %al, -0x27a(%rbp)
jmp 0x2ea47
movb -0x27a(%rbp), %al
testb $0x1, %al
jne 0x2ea56
jmp 0x2ec27
movq -0x210(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x298(%rbp)
callq 0x2a6e0
movq -0x298(%rbp), %rdi
callq 0x3ab30
movq %rax, -0x290(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x12bf0
movq %rax, %rsi
leaq -0xf0(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0x12c10
movq -0x290(%rbp), %rdi
movq -0x288(%rbp), %rsi
callq 0x26f20
jmp 0x2eaba
leaq -0xf0(%rbp), %rdi
callq 0x12d50
leaq -0xe0(%rbp), %rdi
callq 0x3a9d0
movq -0x210(%rbp), %rsi
leaq -0x100(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x2a6b0
movq -0x2b0(%rbp), %rdi
callq 0x12af0
movq %rax, -0x2a8(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x12bf0
movq %rax, %rsi
leaq -0x110(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x12c10
movq -0x2a8(%rbp), %rdi
movq -0x2a0(%rbp), %rsi
callq 0x3d2d0
jmp 0x2eb36
leaq -0x110(%rbp), %rdi
callq 0x12d50
leaq -0x100(%rbp), %rdi
callq 0x12b30
jmp 0x2ec33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x12b30
jmp 0x2f10d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x12b30
jmp 0x2f104
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x2f0f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x12b30
jmp 0x2f0f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x12b30
jmp 0x2f0f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x12d50
leaq -0xe0(%rbp), %rdi
callq 0x3a9d0
jmp 0x2f0f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x12d50
leaq -0x100(%rbp), %rdi
callq 0x12b30
jmp 0x2f0f8
leaq -0xa8(%rbp), %rdi
callq 0x12d70
jmp 0x2e99e
movq -0x210(%rbp), %rsi
leaq -0x148(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
callq 0x2a670
movq -0x2b8(%rbp), %rdi
callq 0x12a20
movq %rax, %rsi
leaq -0x138(%rbp), %rdi
callq 0x22910
jmp 0x2ec6f
leaq -0x138(%rbp), %rdi
callq 0x12980
movq %rax, %rsi
leaq -0x128(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
callq 0x2a6b0
movq -0x2c8(%rbp), %rdi
callq 0x12af0
movq %rax, %rdi
callq 0x3d220
movq %rax, -0x2c0(%rbp)
jmp 0x2ecae
movq -0x2c0(%rbp), %rdi
callq 0x12b50
movq %rax, -0x118(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x12b30
leaq -0x138(%rbp), %rdi
callq 0x12a00
leaq -0x148(%rbp), %rdi
callq 0x12a70
movq -0x210(%rbp), %rsi
leaq -0x180(%rbp), %rdi
movq %rdi, -0x2d0(%rbp)
callq 0x2a670
movq -0x2d0(%rbp), %rdi
callq 0x12a20
movq %rax, %rsi
leaq -0x170(%rbp), %rdi
callq 0x22910
jmp 0x2ed1c
leaq -0x170(%rbp), %rdi
callq 0x12980
movq %rax, %rsi
leaq -0x160(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x2a6b0
movq -0x2e0(%rbp), %rdi
callq 0x12af0
movq %rax, %rdi
callq 0x3d220
movq %rax, -0x2d8(%rbp)
jmp 0x2ed5b
movq -0x2d8(%rbp), %rdi
callq 0x12b80
movq %rax, -0x150(%rbp)
leaq -0x118(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x12bb0
movb %al, -0x2e1(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x12b30
leaq -0x170(%rbp), %rdi
callq 0x12a00
leaq -0x180(%rbp), %rdi
callq 0x12a70
movb -0x2e1(%rbp), %al
testb $0x1, %al
jne 0x2edba
jmp 0x2f0d1
leaq -0x118(%rbp), %rdi
callq 0x12bf0
movq %rax, %rdi
callq 0x12d30
movq %rax, %rdi
movq (%rdi), %rax
movq 0xc0(%rax), %rax
callq *%rax
movb %al, -0x2e2(%rbp)
jmp 0x2ede5
movb -0x2e2(%rbp), %al
testb $0x1, %al
jne 0x2edf4
jmp 0x2f0c0
movq -0x210(%rbp), %rsi
leaq -0x1b0(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
callq 0x2a670
movq -0x2f0(%rbp), %rdi
callq 0x12a20
movq %rax, %rsi
leaq -0x1a0(%rbp), %rdi
callq 0x22910
jmp 0x2ee2b
leaq -0x1a0(%rbp), %rdi
callq 0x12980
movq %rax, %rsi
leaq -0x190(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0x2a6e0
movq -0x308(%rbp), %rdi
callq 0x3ab30
movq %rax, -0x300(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x12bf0
movq %rax, %rsi
leaq -0x1c0(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0x12c10
movq -0x300(%rbp), %rdi
movq -0x2f8(%rbp), %rsi
callq 0x26f20
jmp 0x2ee97
leaq -0x1c0(%rbp), %rdi
callq 0x12d50
leaq -0x190(%rbp), %rdi
callq 0x3a9d0
leaq -0x1a0(%rbp), %rdi
callq 0x12a00
leaq -0x1b0(%rbp), %rdi
callq 0x12a70
movq -0x210(%rbp), %rsi
leaq -0x1f0(%rbp), %rdi
movq %rdi, -0x310(%rbp)
callq 0x2a670
movq -0x310(%rbp), %rdi
callq 0x12a20
movq %rax, %rsi
leaq -0x1e0(%rbp), %rdi
callq 0x22910
jmp 0x2eefe
leaq -0x1e0(%rbp), %rdi
callq 0x12980
movq %rax, %rsi
leaq -0x1d0(%rbp), %rdi
movq %rdi, -0x328(%rbp)
callq 0x2a6b0
movq -0x328(%rbp), %rdi
callq 0x12af0
movq %rax, -0x320(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x12bf0
movq %rax, %rsi
leaq -0x200(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x12c10
movq -0x320(%rbp), %rdi
movq -0x318(%rbp), %rsi
callq 0x3d2d0
jmp 0x2ef6a
leaq -0x200(%rbp), %rdi
callq 0x12d50
leaq -0x1d0(%rbp), %rdi
callq 0x12b30
leaq -0x1e0(%rbp), %rdi
callq 0x12a00
leaq -0x1f0(%rbp), %rdi
callq 0x12a70
jmp 0x2f0cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x2efd1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x12b30
leaq -0x138(%rbp), %rdi
callq 0x12a00
leaq -0x148(%rbp), %rdi
callq 0x12a70
jmp 0x2f0f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x2f014
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x12b30
leaq -0x170(%rbp), %rdi
callq 0x12a00
leaq -0x180(%rbp), %rdi
callq 0x12a70
jmp 0x2f0f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x2f063
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x12d50
leaq -0x190(%rbp), %rdi
callq 0x3a9d0
leaq -0x1a0(%rbp), %rdi
callq 0x12a00
leaq -0x1b0(%rbp), %rdi
callq 0x12a70
jmp 0x2f0f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x2f0b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x12d50
leaq -0x1d0(%rbp), %rdi
callq 0x12b30
leaq -0x1e0(%rbp), %rdi
callq 0x12a00
leaq -0x1f0(%rbp), %rdi
callq 0x12a70
jmp 0x2f0f8
leaq -0x118(%rbp), %rdi
callq 0x12d70
jmp 0x2ece5
leaq -0x90(%rbp), %rdi
callq 0x12d50
leaq -0x70(%rbp), %rdi
callq 0x12d50
leaq -0x20(%rbp), %rdi
callq 0x12a00
addq $0x330, %rsp            # imm = 0x330
popq %rbp
retq
leaq -0x90(%rbp), %rdi
callq 0x12d50
leaq -0x70(%rbp), %rdi
callq 0x12d50
leaq -0x20(%rbp), %rdi
callq 0x12a00
movq -0x38(%rbp), %rdi
callq 0x6460
nop