// File: Worthy-Wang[P]Warcraft3-StartWar/./Warrior.h
// Function: warcraft::Wolf::stealWeapons(std::shared_ptr<warcraft::Warrior>)
void stealWeapons(WarriorPtr enemy) override
    {
        if (!enemy.get())
            return;
        vector<WeaponPtr> &enemyWeapons = enemy->getWeapons();
        if (WOLF == enemy->getType() || 0 == enemyWeapons.size())
            return;
        //抢敌人编号最小的武器
        std::sort(enemyWeapons.begin(), enemyWeapons.end(), [](WeaponPtr lhs, WeaponPtr rhs) {
            if (lhs->getType() < rhs->getType())
                return true;
            else if (lhs->getType() == ARROW && lhs->getType() == rhs->getType() && lhs->getDurability() > rhs->getDurability())
                return true;
            else
                return false;
        });
        WeaponType type = enemyWeapons[0]->getType();
        size_t cnt = 0;
        for (auto &e : enemyWeapons)
        {
            if (type != e->getType() || _weapons.size() > MAX_WEAPON_SIZE)
                break;
            getNewWeapon(e);
            cnt++;
        }
        cout << toString(_color) << " wolf " << _id << " took " << cnt << " " << toString(type) << " from " << toString(enemy->getColor()) << " " << toString(enemy->getType()) << " " << enemy->getId() << endl;
        auto it = std::remove_if(enemyWeapons.begin(), enemyWeapons.end(), [&](WeaponPtr weapon) { return type == weapon->getType(); });
        enemyWeapons.erase(it, enemyWeapons.end());
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rsi, -0x150(%rbp)
movq %rdi, %rax
movq -0x150(%rbp), %rdi
movq %rdi, -0x148(%rbp)
movq %rax, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x140(%rbp)
callq 0x5d90
cmpq $0x0, %rax
jne 0xfb46
jmp 0xffb3
movq -0x148(%rbp), %rdi
callq 0x5db0
movq %rax, %rdi
callq 0x5dd0
movq -0x148(%rbp), %rdi
movq %rax, -0x18(%rbp)
callq 0x5db0
movq %rax, %rdi
callq 0xebc0
movl %eax, %ecx
movl $0x4, %eax
cmpl %ecx, %eax
je 0xfb90
movq -0x18(%rbp), %rdi
callq 0x5ee0
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0xfb95
jmp 0xffb3
movq -0x18(%rbp), %rdi
callq 0x5e80
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5eb0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x10030
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6690
movq %rax, %rdi
callq 0x5d30
movq %rax, %rdi
callq 0x5d50
movl %eax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x5e80
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0x5eb0
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x6330
testb $0x1, %al
jne 0xfc1c
jmp 0xfccd
leaq -0x48(%rbp), %rdi
callq 0x6370
movq %rax, -0x58(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x154(%rbp)
movq -0x58(%rbp), %rdi
callq 0x5d30
movq %rax, %rdi
callq 0x5d50
movl %eax, %ecx
movl -0x154(%rbp), %eax
cmpl %ecx, %eax
jne 0xfc65
movq -0x140(%rbp), %rdi
addq $0x40, %rdi
callq 0x5ee0
cmpq $0xa, %rax
jbe 0xfc67
jmp 0xfccd
movq -0x58(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x6390
movq -0x140(%rbp), %rdi
movq -0x160(%rbp), %rsi
callq 0x193d0
jmp 0xfc90
leaq -0x68(%rbp), %rdi
callq 0x63c0
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x63e0
jmp 0xfc06
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x63c0
jmp 0x10022
movq -0x140(%rbp), %rax
movl 0x8(%rax), %esi
leaq -0x98(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x60f0
movq -0x170(%rbp), %rsi
movq 0x1d2d8(%rip), %rdi     # 0x2cfd0
callq 0x4170
movq %rax, -0x168(%rbp)
jmp 0xfd06
movq -0x168(%rbp), %rdi
leaq 0xe4fe(%rip), %rsi      # 0x1e212
callq 0x4180
movq %rax, -0x178(%rbp)
jmp 0xfd22
movq -0x178(%rbp), %rdi
movq -0x140(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x4060
movq %rax, -0x180(%rbp)
jmp 0xfd42
movq -0x180(%rbp), %rdi
leaq 0xe4c9(%rip), %rsi      # 0x1e219
callq 0x4180
movq %rax, -0x188(%rbp)
jmp 0xfd5e
movq -0x188(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x4060
movq %rax, -0x190(%rbp)
jmp 0xfd77
movq -0x190(%rbp), %rdi
leaq 0xecf6(%rip), %rsi      # 0x1ea7b
callq 0x4180
movq %rax, -0x198(%rbp)
jmp 0xfd93
movl -0x30(%rbp), %esi
leaq -0xb8(%rbp), %rdi
callq 0x10070
jmp 0xfda4
movq -0x198(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x4170
movq %rax, -0x1a0(%rbp)
jmp 0xfdc0
movq -0x1a0(%rbp), %rdi
leaq 0xe452(%rip), %rsi      # 0x1e220
callq 0x4180
movq %rax, -0x1a8(%rbp)
jmp 0xfddc
movq -0x148(%rbp), %rdi
callq 0x5db0
movq %rax, %rdi
callq 0x61d0
movl %eax, %esi
leaq -0xd8(%rbp), %rdi
callq 0x60f0
jmp 0xfe00
movq -0x1a8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x4170
movq %rax, -0x1b0(%rbp)
jmp 0xfe1c
movq -0x1b0(%rbp), %rdi
leaq 0xec51(%rip), %rsi      # 0x1ea7b
callq 0x4180
movq %rax, -0x1b8(%rbp)
jmp 0xfe38
movq -0x148(%rbp), %rdi
callq 0x5db0
movq %rax, %rdi
callq 0xebc0
movl %eax, %esi
leaq -0xf8(%rbp), %rdi
callq 0xe9f0
jmp 0xfe5c
movq -0x1b8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x4170
movq %rax, -0x1c0(%rbp)
jmp 0xfe78
movq -0x1c0(%rbp), %rdi
leaq 0xebf5(%rip), %rsi      # 0x1ea7b
callq 0x4180
movq %rax, -0x1c8(%rbp)
jmp 0xfe94
movq -0x148(%rbp), %rdi
callq 0x5db0
movq %rax, %rdi
callq 0x6220
movq -0x1c8(%rbp), %rdi
movq %rax, %rsi
callq 0x4060
movq %rax, -0x1d0(%rbp)
jmp 0xfec0
movq -0x1d0(%rbp), %rdi
movq 0x1d0ea(%rip), %rsi     # 0x2cfb8
callq 0x41c0
jmp 0xfed5
leaq -0xf8(%rbp), %rdi
callq 0x40f0
leaq -0xd8(%rbp), %rdi
callq 0x40f0
leaq -0xb8(%rbp), %rdi
callq 0x40f0
leaq -0x98(%rbp), %rdi
callq 0x40f0
movq -0x18(%rbp), %rdi
callq 0x5e80
movq %rax, -0x108(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5eb0
movq %rax, -0x110(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x108(%rbp), %rdi
movq -0x110(%rbp), %rsi
movq -0x118(%rbp), %rdx
callq 0x101b0
movq %rax, -0x100(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x1d8(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x62f0
movq -0x18(%rbp), %rdi
callq 0x5eb0
movq %rax, -0x130(%rbp)
leaq -0x128(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x62f0
movq -0x1d8(%rbp), %rdi
movq -0x120(%rbp), %rsi
movq -0x128(%rbp), %rdx
callq 0x6260
movq %rax, -0x138(%rbp)
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x10016
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x1000a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0xfffe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x40f0
leaq -0xd8(%rbp), %rdi
callq 0x40f0
leaq -0xb8(%rbp), %rdi
callq 0x40f0
leaq -0x98(%rbp), %rdi
callq 0x40f0
movq -0x70(%rbp), %rdi
callq 0x4300
nopl (%rax,%rax)