LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Se6[P]CmdLineArgs/./CmdLineArgs.h
// Function: CmdLineArgs::findShortName[abi:cxx11](char)
std::vector<std::string>::iterator CmdLineArgs::findShortName(char name)
{
    if(name==' ')
        return args_.end();

    std::vector<std::string>::iterator pos;
    bool found = false;

    for(pos=args_.begin(); pos!=args_.end(); ++pos){

        if( pos->size()<2 || (*pos)[0] != '-')
            continue;

        if((*pos)[1] == '-')
            continue;

        std::string::size_type idx = pos->find(name,1);
        if( idx != std::string::npos ) {
            found = true;
            break;
        }
    }

    return found ? pos : args_.end();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x20, %sil
jne 0x3881
movq 0x8(%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %r14
movsbl %sil, %ebp
pushq $0x1
popq %r15
movq 0x8(%rbx), %rax
cmpq %rax, %r14
je 0x3876
cmpq $0x2, 0x8(%r14)
jb 0x38bd
movq (%r14), %rax
cmpb $0x2d, (%rax)
jne 0x38bd
cmpb $0x2d, 0x1(%rax)
je 0x38bd
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x3280
cmpq $-0x1, %rax
jne 0x38c3
addq $0x20, %r14
jmp 0x388c
movq %r14, %rax
jmp 0x3876
// File: /workspace/github_cpp_makefile_star2_O2/Se6[P]CmdLineArgs/./CmdLineArgs.h
// Function: CmdLineArgs::getFlag(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int CmdLineArgs::getFlag(const std::string &long_name, char short_name, const std::string &desc)
{
    addUsage(long_name,short_name,"",desc);

    int nb=0;

    // First search the long names:
    auto pos = findLongName(long_name);
    while(pos != args_.end()){
        ++nb;
        pos = args_.erase(pos);
        pos = findLongName(long_name);
    }

    // Then search the short names:
    pos = findShortName(short_name);
    while(pos != args_.end()){
        ++nb;
        if(pos->size()==2)
            pos = args_.erase(pos);
        else
            pos->erase(pos->find(short_name,1),1);
        pos = findShortName(short_name);
    }

    return nb;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r12
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x4905(%rip), %rsi      # 0x81ee
leaq 0x8(%rsp), %r13
leaq 0x7(%rsp), %rdx
movq %r13, %rdi
callq 0x53e4
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
movq %r13, %rcx
movq %r12, %r8
callq 0x39bc
leaq 0x8(%rsp), %rdi
callq 0x30e0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3780
xorl %ebp, %ebp
cmpq 0x8(%rbx), %rax
je 0x3946
incl %ebp
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5528
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3780
jmp 0x3926
movsbl %r14b, %r14d
pushq $0x1
popq %r15
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3862
cmpq 0x8(%rbx), %rax
je 0x3996
movq %rax, %r12
cmpq $0x2, 0x8(%rax)
jne 0x3976
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5528
jmp 0x3992
movq %r12, %rdi
movl %r14d, %esi
movq %r15, %rdx
callq 0x3280
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x3040
incl %ebp
jmp 0x394e
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x30e0
movq %rbx, %rdi
callq 0x3390
// File: /workspace/github_cpp_makefile_star2_O2/Se6[P]CmdLineArgs/./CmdLineArgs.h
// Function: CmdLineArgs::addUsage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void CmdLineArgs::addUsage(const std::string &long_name, char short_name, const std::string &default_val, const std::string &desc)
{
    std::string usage(4,' ');
    usage += "--" + long_name;

    if( short_name != ' ' ) {
        usage += " (-";
        usage += short_name;
        usage += ") ";
    }

    if( default_val.size() )
        usage += " (default: " + default_val + ")";

    usage_.push_back( std::pair<std::string, std::string>(usage,desc) );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %r8, %r14
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rsp, %rdi
pushq $0x4
popq %rsi
pushq $0x20
popq %rdx
callq 0x3250
leaq 0x464f(%rip), %rsi      # 0x8046
leaq 0x20(%rsp), %rdi
movq %r12, %rdx
callq 0x554c
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x33e0
leaq 0x20(%rsp), %rdi
callq 0x30e0
cmpb $0x20, %bpl
je 0x3a4b
leaq 0x4653(%rip), %rsi      # 0x807b
movq %rsp, %rdi
callq 0x33d0
movsbl %bpl, %esi
movq %rsp, %rdi
callq 0x31e0
leaq 0x4666(%rip), %rsi      # 0x80a9
movq %rsp, %rdi
callq 0x33d0
cmpq $0x0, 0x8(%r15)
je 0x3a9d
leaq 0x4653(%rip), %rsi      # 0x80ac
leaq 0x60(%rsp), %rdi
movq %r15, %rdx
callq 0x554c
leaq 0x4865(%rip), %rdx      # 0x82d2
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x552d
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x33e0
leaq 0x20(%rsp), %rdi
callq 0x30e0
leaq 0x60(%rsp), %rdi
callq 0x30e0
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
movq %r14, %rdx
callq 0x563a
addq $0x58, %rbx
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x6598
leaq 0x20(%rsp), %rdi
callq 0x5670
movq %rsp, %rdi
callq 0x30e0
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x30e0
jmp 0x3af2
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
jmp 0x3b14
jmp 0x3b1d
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5670
jmp 0x3b20
jmp 0x3b1d
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x30e0
jmp 0x3b20
jmp 0x3b1d
movq %rax, %rbx
movq %rsp, %rdi
callq 0x30e0
movq %rbx, %rdi
callq 0x3390
// File: /workspace/github_cpp_makefile_star2_O2/Se6[P]CmdLineArgs/./CmdLineArgs.h
// Function: CmdLineArgs::getUnparsedOpts[abi:cxx11]()
std::vector<std::string> CmdLineArgs::getUnparsedOpts()
{
    std::vector<std::string> unparsed;
    for( auto &arg: args_ )
        if( arg[0] == '-' )
            unparsed.push_back(arg);
    return unparsed;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq (%rsi), %r14
movq 0x8(%rsi), %r15
cmpq %r15, %r14
je 0x4814
movq (%r14), %rax
cmpb $0x2d, (%rax)
jne 0x480e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5396
addq $0x20, %r14
jmp 0x47f6
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x53c2
movq %r14, %rdi
callq 0x3390
// File: /workspace/github_cpp_makefile_star2_O2/Se6[P]CmdLineArgs/./CmdLineArgs.h
// Function: CmdLineArgs::throwIfUnparsed()
void CmdLineArgs::throwIfUnparsed()
{
    std::vector<std::string> unparsed = getUnparsedOpts();
    if( !unparsed.empty() ) {
        std::string msg("\nError: unparsed options: ");
        for( auto &arg: unparsed )
            msg += arg + " ";
        throw std::runtime_error(msg);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rsi
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x47dc
movq (%rbx), %rax
cmpq 0x8(%rbx), %rax
jne 0x4948
leaq 0x8(%rsp), %rdi
callq 0x53c2
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x3786(%rip), %rsi      # 0x80d5
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x53e4
movq 0x8(%rsp), %rbx
movq 0x10(%rsp), %r13
leaq 0x373b(%rip), %r14      # 0x80aa
leaq 0x40(%rsp), %r15
leaq 0x20(%rsp), %r12
cmpq %r13, %rbx
je 0x49a5
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x56c1
movq %r12, %rdi
movq %r15, %rsi
callq 0x33e0
movq %r15, %rdi
callq 0x30e0
addq $0x20, %rbx
jmp 0x4979
pushq $0x10
popq %rdi
callq 0x3110
movq %rax, %r14
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
movq 0x762c(%rip), %rsi      # 0xbff0
movq 0x75f5(%rip), %rdx      # 0xbfc0
movq %r14, %rdi
callq 0x3370
jmp 0x49f1
movq %rax, %rbx
movq %r14, %rdi
callq 0x3190
jmp 0x49f4
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x30e0
jmp 0x49f4
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x30e0
jmp 0x4a03
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x53c2
movq %rbx, %rdi
callq 0x3390
nop
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/City.cpp
// Function: warcraft::compBeforeFight(std::shared_ptr<warcraft::Weapon>, std::shared_ptr<warcraft::Weapon>)
bool compBeforeFight(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;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rcx
movl 0x8(%rcx), %edi
movq (%rsi), %rdx
movl 0x8(%rdx), %esi
movb $0x1, %al
cmpl %esi, %edi
jl 0x4528
xorl $0x2, %edi
xorl $0x2, %esi
orl %edi, %esi
jne 0x4526
movq 0x38(%rcx), %rcx
cmpq 0x38(%rdx), %rcx
jb 0x4528
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/City.cpp
// Function: warcraft::City::Battle()
bool City::Battle()
{
    //城市中没有对立的两武士，决斗失败
    if (!redWarrior.get() || !blueWarrior.get())
        return false;

    /****************************战前准备*******************************/
    //排列好武器
    vector<WeaponPtr> &redWeaponLib = redWarrior->getWeapons();
    if (!redWeaponLib.empty())
    std::sort(redWeaponLib.begin(), redWeaponLib.end(), compBeforeFight);
    
    vector<WeaponPtr> &blueWeaponLib = blueWarrior->getWeapons();
    if (!blueWeaponLib.empty())
    std::sort(blueWeaponLib.begin(), blueWeaponLib.end(), compBeforeFight);

    //如果双方都没有武器，则视为平局
    if (0 == redWeaponLib.size() && 0 == blueWeaponLib.size())
    {
        bothAlive();
        return true; //决斗成功
    }

    /****************************战中*******************************/
    //偶数编号城市，蓝方先攻击
    if (0 == _id % 2)
        blueWarriorAttackFirst();
    //奇数编号城市，红方先攻击
    else
        redWarriorAttackFirst();

    return true; //决斗成功
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rdi), %r14
testq %r14, %r14
je 0x45d0
movq %rdi, %rbx
movq 0x18(%rdi), %r15
testq %r15, %r15
je 0x45d0
movq 0x40(%r14), %rdi
movq 0x48(%r14), %rsi
cmpq %rsi, %rdi
je 0x4594
leaq -0x8f(%rip), %rdx       # 0x44fc
callq 0x54dc
movq 0x18(%rbx), %r15
movq 0x40(%r15), %rdi
movq 0x48(%r15), %rsi
cmpq %rsi, %rdi
je 0x45ad
leaq -0xac(%rip), %rdx       # 0x44fc
callq 0x54dc
movq 0x48(%r14), %rax
cmpq 0x40(%r14), %rax
jne 0x45c1
movq 0x48(%r15), %rax
cmpq 0x40(%r15), %rax
je 0x45de
testb $0x1, (%rbx)
jne 0x45d4
movq %rbx, %rdi
callq 0x45f4
jmp 0x45e6
xorl %eax, %eax
jmp 0x45e8
movq %rbx, %rdi
callq 0x483e
jmp 0x45e6
movq %rbx, %rdi
callq 0x4f2a
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/City.cpp
// Function: warcraft::City::judgeResult(bool&, bool&)
bool City::judgeResult(bool &redHpFlag, bool &blueHpFlag)
{
    //如果双方的HP都没有变化，则平局
    if (false == redHpFlag && false == blueHpFlag)
    {
        bothAlive();
        return true;
    }

    else if (redWarrior->getHp() <= 0 && blueWarrior->getHp() <= 0)
    {
        bothdie();
        return true;
    }
    else if (redWarrior->getHp() <= 0)
    {
        win(blueWarrior, redWarrior);
        return true;
    }
    else if (blueWarrior->getHp() <= 0)
    {
        win(redWarrior, blueWarrior);
        return true;
    }
    else
        return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r15
movb (%rdx), %al
orb (%rsi), %al
jne 0x4e3d
movq %r15, %rdi
callq 0x4f2a
jmp 0x4ef4
leaq 0x8(%r15), %r12
leaq 0x18(%r15), %r13
movq 0x8(%r15), %rax
movq 0x18(%r15), %rcx
cmpl $0x0, 0x38(%rax)
movl 0x38(%rcx), %eax
jle 0x4e61
testl %eax, %eax
jle 0x4ea8
xorl %eax, %eax
jmp 0x4ef6
testl %eax, %eax
jle 0x4eec
leaq -0x50(%rbp), %r14
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x5392
leaq -0x58(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x5392
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x4a92
leaq -0x50(%rbp), %rdi
callq 0x5302
leaq -0x60(%rbp), %rdi
jmp 0x4ee5
leaq -0x30(%rbp), %r14
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5392
leaq -0x38(%rbp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x5392
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x4a92
leaq -0x30(%rbp), %rdi
callq 0x5302
leaq -0x40(%rbp), %rdi
callq 0x5302
jmp 0x4ef4
movq %r15, %rdi
callq 0x50c6
movb $0x1, %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x40(%rbp), %rbx
jmp 0x4f0f
leaq -0x60(%rbp), %rbx
movq %rax, %r15
movq %r14, %rdi
callq 0x5302
movq %rbx, %rdi
callq 0x5302
movq %r15, %rdi
callq 0x4250
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/./Type.h
// Function: warcraft::toString[abi:cxx11](warcraft::ColorType)
inline string toString(ColorType color)
{
    switch(color)
    {
        case RED:
        return "red";
        case BLUE:
        return "blue";
        default:
        return string();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x1, %esi
je 0x505e
testl %esi, %esi
jne 0x5073
leaq 0x8ffa(%rip), %rsi      # 0xe052
leaq -0xa(%rbp), %rdx
jmp 0x5069
leaq 0x8ff1(%rip), %rsi      # 0xe056
leaq -0x9(%rbp), %rdx
movq %rbx, %rdi
callq 0x51dc
jmp 0x5083
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/GameConfig.cpp
// Function: warcraft::GameConfig::readFromStream(std::istream&)
void GameConfig::readFromStream(std::istream &is)
{
    while (is.good())
    {
        nextGroupId(); //每一次读新数据组时 Case 组数++
        InitData group;
        //读取第一行 组数
        size_t caseNum;
        is >> caseNum;

        //读取第二行 基地生命元 城市数 Lion每前进一步的降低的忠诚度  截止时间
        is >> group._initBaseHp;
        is >> group._cityNum;
        is >> group._lionReduceLoyalty;
        is >> group._deadline;

        //读取第三行 武士初始生命值 
        for (size_t i = 0; i < _initWarriorOrder.size(); i++)
            is >> group._initWarriorHp[GameConfig::getInstance()->_initWarriorOrder[i]];
        
        //读取第四行 武士初始攻击力 
        for (size_t i = 0; i < _initWarriorOrder.size(); i++)
            is >> group._initWarriorAttack[GameConfig::getInstance()->_initWarriorOrder[i]];

        _groups.push_back(std::move(group));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x60(%rbp), %r12
leaq 0x18(%rdi), %rax
movq %rax, -0x30(%rbp)
leaq -0xb0(%rbp), %r15
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%rbx,%rax)
jne 0x60b0
incq 0x101dc(%rip)           # 0x16160
andl $0x0, -0x88(%rbp)
andq $0x0, -0x80(%rbp)
leaq -0x88(%rbp), %rax
movq %rax, -0x78(%rbp)
movq %rax, -0x70(%rbp)
andq $0x0, -0x68(%rbp)
andl $0x0, -0x58(%rbp)
andq $0x0, -0x50(%rbp)
leaq -0x58(%rbp), %rax
movq %rax, -0x48(%rbp)
movq %rax, -0x40(%rbp)
andq $0x0, -0x38(%rbp)
movq %rbx, %rdi
leaq -0xb8(%rbp), %rsi
callq 0x40d0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x40d0
movq %rbx, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x40d0
movq %rbx, %rdi
leaq -0xa0(%rbp), %rsi
callq 0x40d0
movq %rbx, %rdi
leaq -0x98(%rbp), %rsi
callq 0x40d0
xorl %r15d, %r15d
xorl %r13d, %r13d
movq (%r14), %rcx
movq 0x8(%r14), %rax
movq %rax, %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %rdx, %r13
jae 0x604e
movq 0x10140(%rip), %rax     # 0x16168
movq (%rax), %rsi
addq %r15, %rsi
leaq -0x90(%rbp), %rdi
callq 0x632e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x40d0
incq %r13
addq $0x4, %r15
jmp 0x600b
xorl %r13d, %r13d
xorl %r15d, %r15d
subq %rcx, %rax
sarq $0x2, %rax
cmpq %rax, %r15
jae 0x6090
movq 0x10101(%rip), %rax     # 0x16168
movq (%rax), %rsi
addq %r13, %rsi
movq %r12, %rdi
callq 0x632e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x40d0
incq %r15
movq (%r14), %rcx
movq 0x8(%r14), %rax
addq $0x4, %r13
jmp 0x6054
movq -0x30(%rbp), %rdi
leaq -0xb0(%rbp), %r15
movq %r15, %rsi
callq 0x67ce
movq %r15, %rdi
callq 0x6380
jmp 0x5f6b
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x60c6
jmp 0x60c6
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x6380
movq %rbx, %rdi
callq 0x4250
nop
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/GameConfig.cpp
// Function: warcraft::GameConfig::readFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void GameConfig::readFromFile(const string filename)
{
    std::ifstream ifs(filename, std::ifstream::in);
    if (!ifs.good())
    {
        cout << filename << " GameConfig::readFromFile ERROR!" << endl;
        exit(-1);
    }
    readFromStream(ifs);
    ifs.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x220(%rbp), %r15
pushq $0x8
popq %rdx
movq %r15, %rdi
callq 0x4210
movq (%r15), %rax
movq -0x18(%rax), %rax
cmpl $0x0, -0x200(%rbp,%rax)
jne 0x614c
leaq -0x220(%rbp), %rsi
movq %r14, %rdi
callq 0x5f3e
leaq -0x220(%rbp), %rdi
callq 0x4040
leaq -0x220(%rbp), %rdi
callq 0x4050
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0xfe7d(%rip), %rdi      # 0x15fd0
movq %rbx, %rsi
callq 0x4150
leaq 0x7f45(%rip), %rsi      # 0xe0a7
movq %rax, %rdi
callq 0x4160
movq %rax, %rdi
callq 0x40b0
pushq $-0x1
popq %rdi
callq 0x41b0
movq %rax, %rbx
leaq -0x220(%rbp), %rdi
callq 0x4050
movq %rbx, %rdi
callq 0x4250
nop
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/GameConfig.cpp
// Function: warcraft::GameConfig::print() const
void GameConfig::print() const
{
    for (size_t i = 0; i < _groups.size(); i++)
    {
        //第一行
        cout << i + 1 << endl;
        //第二行
        cout << _groups[i]._initBaseHp << " ";
        cout << _groups[i]._cityNum << " ";
        cout << _groups[i]._lionReduceLoyalty << " ";
        cout << _groups[i]._deadline << endl;
        //第三行
        for (auto &e : _groups[i]._initWarriorHp)
            cout << e.second << " ";
        cout << endl;
        //第四行
        for (auto &e : _groups[i]._initWarriorAttack)
            cout << e.second << " ";
        cout << endl;
        cout << "---------------" << endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorl %r13d, %r13d
movq 0xfe20(%rip), %r14      # 0x15fd0
leaq 0x88ac(%rip), %r15      # 0xea63
movq %rdi, -0x30(%rbp)
movq 0x20(%rbx), %rax
subq 0x18(%rbx), %rax
sarq $0x7, %rax
cmpq %rax, %r13
jae 0x62ff
leaq 0x1(%r13), %rsi
movq %r14, %rdi
movq %rsi, -0x38(%rbp)
callq 0x40f0
movq %rax, %rdi
callq 0x40b0
movq 0x18(%rbx), %rax
shlq $0x7, %r13
movq (%rax,%r13), %rsi
movq %r14, %rdi
callq 0x40f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x4160
movq 0x18(%rbx), %rax
movq 0x8(%rax,%r13), %rsi
movq %r14, %rdi
callq 0x40f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x4160
movq 0x18(%rbx), %rax
movq 0x10(%rax,%r13), %rsi
movq %r14, %rdi
callq 0x40f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x4160
movq 0x18(%rbx), %rax
movq 0x18(%rax,%r13), %rsi
movq %r14, %rdi
callq 0x40f0
movq %rax, %rdi
callq 0x40b0
movq 0x18(%rbx), %rax
leaq (%rax,%r13), %rbx
addq $0x28, %rbx
movq 0x10(%rbx), %r12
cmpq %rbx, %r12
je 0x6292
movq 0x28(%r12), %rsi
movq %r14, %rdi
callq 0x40f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x4160
movq %r12, %rdi
callq 0x41a0
movq %rax, %r12
jmp 0x6268
movq %r14, %rdi
callq 0x40b0
movq -0x30(%rbp), %rbx
movq 0x18(%rbx), %rax
addq %rax, %r13
addq $0x58, %r13
movq 0x10(%r13), %r12
cmpq %r13, %r12
je 0x62d7
movq 0x28(%r12), %rsi
movq %r14, %rdi
callq 0x40f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x4160
movq %r12, %rdi
callq 0x41a0
movq %rax, %r12
jmp 0x62ad
movq %r14, %rdi
callq 0x40b0
movq %r14, %rdi
leaq 0x7ddf(%rip), %rsi      # 0xe0c8
callq 0x4160
movq %rax, %rdi
callq 0x40b0
movq -0x38(%rbp), %r13
jmp 0x61bb
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/./Type.h
// Function: warcraft::toString[abi:cxx11](warcraft::WarriorType)
inline string toString(WarriorType warrior)
{
    switch(warrior)
    {
        case DRAGON:
        return "dragon";
        case NINJA:
        return "ninja";
        case ICEMAN:
        return "iceman";
        case LION:
        return "lion";
        case WOLF:
        return "wolf";
        default:
        return string();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x4, %esi
ja 0x81c1
movl %esi, %eax
leaq 0x5ff9(%rip), %rcx      # 0xe160
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x6055(%rip), %rsi      # 0xe1cc
leaq -0xd(%rbp), %rdx
jmp 0x81af
leaq 0x6061(%rip), %rsi      # 0xe1e5
leaq -0x9(%rbp), %rdx
jmp 0x81af
leaq 0x6048(%rip), %rsi      # 0xe1d9
leaq -0xb(%rbp), %rdx
jmp 0x81af
leaq 0x6042(%rip), %rsi      # 0xe1e0
leaq -0xa(%rbp), %rdx
jmp 0x81af
leaq 0x6028(%rip), %rsi      # 0xe1d3
leaq -0xc(%rbp), %rdx
movq %rbx, %rdi
callq 0x51dc
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
jmp 0x81b7
nop
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/./Type.h
// Function: warcraft::toString[abi:cxx11](warcraft::WeaponType)
inline string toString(WeaponType weapon)
{
    switch(weapon)
    {
        case SWORD:
        return "sword";
        case BOMB:
        return "bomb";
        case ARROW:
        return "arrow";
        default:
        return string();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x2, %esi
je 0x8aae
cmpl $0x1, %esi
je 0x8aa1
testl %esi, %esi
jne 0x8ac3
leaq 0x578c(%rip), %rsi      # 0xe227
leaq -0xb(%rbp), %rdx
jmp 0x8ab9
leaq 0x5785(%rip), %rsi      # 0xe22d
leaq -0xa(%rbp), %rdx
jmp 0x8ab9
leaq 0x577d(%rip), %rsi      # 0xe232
leaq -0x9(%rbp), %rdx
movq %rbx, %rdi
callq 0x51dc
jmp 0x8ad3
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/TestWarcraft.cpp
// Function: test1()
void test1()
{
    //勇士生命值，攻击力赋值顺序
    vector<WarriorType> initWarriorOrder{DRAGON, NINJA, ICEMAN, LION, WOLF};
    GameConfig::getInstance()->setInitWarriorOrder(initWarriorOrder.begin(), initWarriorOrder.end());
    GameConfig::getInstance()->readFromFile("warcraft.conf");
    GameConfig::getInstance()->print();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
movups 0x3946(%rip), %xmm0     # 0xe8c8
leaq -0x70(%rbp), %rsi
movaps %xmm0, (%rsi)
movl $0x4, 0x10(%rsi)
leaq -0x50(%rbp), %rbx
pushq $0x5
popq %rdx
leaq -0x11(%rbp), %rcx
movq %rbx, %rdi
callq 0xb50a
leaq 0xb1be(%rip), %r14      # 0x16168
movq (%r14), %rdi
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
callq 0xb540
movq (%r14), %rbx
leaq 0x3919(%rip), %rsi      # 0xe8dc
leaq -0x38(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x51dc
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0x60de
leaq -0x38(%rbp), %rdi
callq 0x40a0
movq (%r14), %rdi
callq 0x6192
leaq -0x50(%rbp), %rdi
callq 0x6488
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x40a0
jmp 0xb012
jmp 0xb00f
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x6488
movq %rbx, %rdi
callq 0x4250
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/TestWarcraft.cpp
// Function: test2()
void test2()
{
    GameTime::getInstance()->showTime();
    GameTime::getInstance()->updateTime();
    cout << endl;
    GameTime::getInstance()->showTime();
    GameTime::getInstance()->updateTime();
    cout << endl;
    GameTime::getInstance()->showTime();
    GameTime::getInstance()->updateTime();
    cout << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0xb147(%rip), %r14      # 0x16178
movq (%r14), %rdi
callq 0xb572
movq (%r14), %rdi
callq 0xb5ec
movq 0xaf88(%rip), %rbx      # 0x15fd0
movq %rbx, %rdi
callq 0x40b0
movq (%r14), %rdi
callq 0xb572
movq (%r14), %rdi
callq 0xb5ec
movq %rbx, %rdi
callq 0x40b0
movq (%r14), %rdi
callq 0xb572
movq (%r14), %rdi
callq 0xb5ec
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x40b0
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/TestWarcraft.cpp
// Function: test3()
void test3()
{
    test1();
    WeaponPtr weapon(new Arrow(DRAGON));
    cout << weapon->getAttackValue() << endl;
    cout << weapon->getName() << endl;
    cout << weapon->getDurability() << endl;
    weapon->decreaseDuribility();
    cout << weapon->getDurability() << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
callq 0xaf70
pushq $0x48
popq %rdi
callq 0x4170
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
callq 0x7d4e
leaq -0x20(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xadda
movq (%rbx), %rax
movq 0x30(%rax), %rsi
movq 0xaf0a(%rip), %rdi      # 0x15fd0
callq 0x40f0
movq %rax, %rdi
callq 0x40b0
movq -0x20(%rbp), %rsi
addq $0x10, %rsi
leaq -0x40(%rbp), %rdi
callq 0x41d0
movq 0xaee5(%rip), %rdi      # 0x15fd0
leaq -0x40(%rbp), %rsi
callq 0x4150
movq %rax, %rdi
callq 0x40b0
leaq -0x40(%rbp), %rdi
callq 0x40a0
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rsi
movq 0xaebc(%rip), %rdi      # 0x15fd0
callq 0x40f0
movq %rax, %rdi
callq 0x40b0
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rsi
decq %rsi
movq %rsi, 0x38(%rax)
movq 0xae99(%rip), %rdi      # 0x15fd0
callq 0x40f0
movq %rax, %rdi
callq 0x40b0
leaq -0x18(%rbp), %rdi
callq 0x5302
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0xb176
movq %rax, %rbx
pushq $0x48
popq %rsi
movq %r14, %rdi
callq 0x4180
jmp 0xb182
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x40a0
jmp 0xb179
movq %rax, %rbx
leaq -0x18(%rbp), %rdi
callq 0x5302
movq %rbx, %rdi
callq 0x4250
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/./WarcraftWorld.h
// Function: warcraft::WarcraftWorld::~WarcraftWorld()
~WarcraftWorld()
    {
        if (_red)
            delete _red;
        if (_blue)
            delete _blue;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0xb6af
movq %r14, %rdi
callq 0xb794
movl $0xa8, %esi
movq %r14, %rdi
callq 0x4180
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0xb6cd
movq %r14, %rdi
callq 0xb794
movl $0xa8, %esi
movq %r14, %rdi
callq 0x4180
addq $0x10, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xb704
nop
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/Warrior.cpp
// Function: warcraft::Warrior::attack(std::shared_ptr<warcraft::Warrior>, std::shared_ptr<warcraft::Weapon>)
void Warrior::attack(WarriorPtr enemy, WeaponPtr weapon)
{
    switch (weapon->getType())
    {
    case SWORD:
    {
        enemy->sufferAttack(weapon->getAttackValue());
        break;
    }
    case BOMB:
    {
        enemy->sufferAttack(weapon->getAttackValue());
        if (this->getType() != NINJA)
            this->sufferAttack(weapon->getAttackValue() / 2);
        break;
    }
    case ARROW:
    {
        enemy->sufferAttack(weapon->getAttackValue());
        break;
    }
    }
    weapon->decreaseDuribility();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdx), %rax
movl 0x8(%rax), %ecx
cmpl $0x2, %ecx
je 0xbae4
cmpl $0x1, %ecx
je 0xbaf4
testl %ecx, %ecx
jne 0xbaee
movq (%rsi), %rdi
movq 0x30(%rax), %rcx
subl %ecx, 0x38(%rdi)
decq 0x38(%rax)
popq %rbp
retq
movq (%rsi), %rdx
movq 0x30(%rax), %rcx
subl %ecx, 0x38(%rdx)
cmpl $0x1, 0x3c(%rdi)
je 0xbaee
shrq %rcx
jmp 0xbaeb
nop
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/Warrior.cpp
// Function: warcraft::Warrior::getNewWeapon(std::shared_ptr<warcraft::Weapon>)
void Warrior::getNewWeapon(WeaponPtr weapon) 
{
    if (!weapon.get())
        return;
    WeaponPtr newWeapon;
    switch (weapon->getType())
    {
        case SWORD:newWeapon.reset(new Sword(_type)); break;
        case BOMB:newWeapon.reset(new Bomb(_type));break;
        case ARROW:newWeapon.reset(new Arrow(_type)); newWeapon->setDurability(weapon->getDurability()); break;
    }
    _weapons.push_back(newWeapon);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq (%rsi), %rax
testq %rax, %rax
je 0xbbd3
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
movl 0x8(%rax), %eax
testl %eax, %eax
je 0xbb98
cmpl $0x1, %eax
je 0xbb74
cmpl $0x2, %eax
jne 0xbbba
movq %rsi, %r14
pushq $0x48
popq %rdi
callq 0x4170
movq %rax, %r15
movl 0x3c(%rbx), %esi
movq %rax, %rdi
callq 0x7d4e
leaq -0x30(%rbp), %rdi
movq %r15, %rsi
callq 0x7d08
movq -0x30(%rbp), %rax
movq (%r14), %rcx
movq 0x38(%rcx), %rcx
movq %rcx, 0x38(%rax)
jmp 0xbbba
pushq $0x40
popq %rdi
callq 0x4170
movq %rax, %r14
movl 0x3c(%rbx), %esi
movq %rax, %rdi
callq 0x7bb4
leaq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x7b6e
jmp 0xbbba
pushq $0x40
popq %rdi
callq 0x4170
movq %rax, %r14
movl 0x3c(%rbx), %esi
movq %rax, %rdi
callq 0x7a18
leaq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x79d2
addq $0x40, %rbx
leaq -0x30(%rbp), %rsi
movq %rbx, %rdi
callq 0x81d4
leaq -0x28(%rbp), %rdi
callq 0x5302
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x48
popq %rsi
movq %r15, %rdi
jmp 0xbbf4
jmp 0xbbeb
movq %rax, %rbx
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4180
jmp 0xbbfe
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x5302
movq %rbx, %rdi
callq 0x4250
nop
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/warcraftWorld.cpp
// Function: warcraft::WarcraftWorld::startGame()
void WarcraftWorld::startGame()
{
    size_t deadline = GameConfig::getInstance()->getDeadline(_caseNum);
    while (GameTime::getInstance()->getTime() < deadline)
    {
        //1):武士降生
        GameTime::getInstance()->showTime();
        createAndShow(_red);
        createAndShow(_blue);
        GameTime::getInstance()->updateTime();

        //2):Lion逃跑
        GameTime::getInstance()->showTime();
        lionRun();
        GameTime::getInstance()->updateTime();

        //3):武士前进到某一城市
        GameTime::getInstance()->showTime();
        warriorMarch();
        GameTime::getInstance()->updateTime();

        //4):wolf抢敌人的武器
        GameTime::getInstance()->showTime();
        wolfStealing();
        GameTime::getInstance()->updateTime();

        //5):进行战斗并报告战斗情况
        GameTime::getInstance()->showTime();
        startFight();
        GameTime::getInstance()->updateTime();

        //6):龙开始欢呼
        GameTime::getInstance()->showTime();
        dragonCheer();
        GameTime::getInstance()->updateTime();

        //7):武士抵达敌方司令部
        GameTime::getInstance()->showTime();
        warriorArriveHeadquarters();
        GameTime::getInstance()->updateTime();

        //8):司令部被占领
        GameTime::getInstance()->showTime();
        occupyHeadquarters();
        GameTime::getInstance()->updateTime();

        //9):司令部报告生命元数量
        GameTime::getInstance()->showTime();
        headquartersReport();
        GameTime::getInstance()->updateTime();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xa544(%rip), %rax      # 0x16168
movq (%rax), %rax
movq 0x28(%rdi), %rcx
movq 0x18(%rax), %rax
shlq $0x7, %rcx
movq -0x68(%rax,%rcx), %r14
leaq 0xa539(%rip), %r15      # 0x16178
movq (%r15), %rdi
imulq $0x3c, (%rdi), %rax
addq 0x8(%rdi), %rax
cmpq %r14, %rax
jae 0xbd3c
callq 0xb572
movq (%rbx), %rsi
movq %rbx, %rdi
callq 0xbd48
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
callq 0xbd48
movq (%r15), %rdi
callq 0xb5ec
movq (%r15), %rdi
callq 0xb572
movq %rbx, %rdi
callq 0xc472
movq (%r15), %rdi
callq 0xb5ec
movq (%r15), %rdi
callq 0xb572
movq %rbx, %rdi
callq 0xc610
movq (%r15), %rdi
callq 0xb5ec
movq (%r15), %rdi
callq 0xb572
movq %rbx, %rdi
callq 0xc9d6
movq (%r15), %rdi
callq 0xb5ec
movq (%r15), %rdi
callq 0xb572
movq %rbx, %rdi
callq 0xcae8
movq (%r15), %rdi
callq 0xb5ec
movq (%r15), %rdi
callq 0xb572
movq %rbx, %rdi
callq 0xcb10
movq (%r15), %rdi
callq 0xb5ec
movq (%r15), %rdi
callq 0xb572
movq %rbx, %rdi
callq 0xcbc6
movq (%r15), %rdi
callq 0xb5ec
movq (%r15), %rdi
callq 0xb572
movq %rbx, %rdi
callq 0xcdfa
movq (%r15), %rdi
callq 0xb5ec
movq (%r15), %rdi
callq 0xb572
movq %rbx, %rdi
callq 0xcee0
movq (%r15), %rdi
callq 0xb5ec
jmp 0xbc3f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/warcraftWorld.cpp
// Function: warcraft::WarcraftWorld::lionRun()
void WarcraftWorld::lionRun()
{
    for (auto &e : _citys)
    {
        WarriorPtr redWarrior = e->getRedWarrior();
        if (redWarrior.get() && LION == redWarrior->getType() && redWarrior->getLoyalty() <= 0)
        {
            cout << " red lion " << redWarrior->getId() << " run away" << endl;
            e->detach(redWarrior);
        }

        WarriorPtr blueWarrior = e->getBlueWarrior();
        if (blueWarrior.get() && LION == blueWarrior->getType() && blueWarrior->getLoyalty() <= 0)
        {
            cout << " blue lion " << blueWarrior->getId() << " run away" << endl;
            e->detach(blueWarrior);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x10(%rdi), %rbx
movq 0x18(%rdi), %r14
leaq -0x30(%rbp), %r12
leaq -0x38(%rbp), %r13
leaq -0x48(%rbp), %r15
movq %r14, -0x50(%rbp)
cmpq %r14, %rbx
je 0xc5de
movq (%rbx), %rsi
addq $0x8, %rsi
movq %r13, %rdi
callq 0x5392
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0xc52e
cmpl $0x3, 0x3c(%rdi)
jne 0xc52e
movq (%rdi), %rax
callq *0x20(%rax)
testl %eax, %eax
jg 0xc52e
movq 0x9afd(%rip), %rdi      # 0x15fd0
leaq 0x2558(%rip), %rsi      # 0xea32
callq 0x4160
movq -0x38(%rbp), %rcx
movq 0x30(%rcx), %rsi
movq %rax, %rdi
callq 0x40f0
movq %rax, %rdi
leaq 0x2544(%rip), %rsi      # 0xea3d
callq 0x4160
movq %rax, %rdi
callq 0x40b0
movq (%rbx), %r12
leaq -0x60(%rbp), %rdi
movq %r13, %rsi
callq 0x5392
movq %r12, %rdi
leaq -0x30(%rbp), %r12
leaq -0x60(%rbp), %rsi
callq 0xd1fc
leaq -0x58(%rbp), %rdi
callq 0x5302
movq (%rbx), %rsi
addq $0x18, %rsi
movq %r15, %rdi
callq 0x5392
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xc5c4
cmpl $0x3, 0x3c(%rdi)
jne 0xc5c4
movq (%rdi), %rax
callq *0x20(%rax)
testl %eax, %eax
jg 0xc5c4
movq 0x9a73(%rip), %rdi      # 0x15fd0
leaq 0x24e3(%rip), %rsi      # 0xea47
callq 0x4160
movq -0x48(%rbp), %rcx
movq 0x30(%rcx), %rsi
movq %rax, %rdi
callq 0x40f0
movq %rax, %rdi
leaq 0x24ba(%rip), %rsi      # 0xea3d
callq 0x4160
movq %rax, %rdi
callq 0x40b0
movq (%rbx), %r12
movq %r13, %r14
leaq -0x70(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x5392
movq %r12, %rdi
leaq -0x30(%rbp), %r12
movq %r13, %rsi
movq %r14, %r13
movq -0x50(%rbp), %r14
callq 0xd1fc
leaq -0x68(%rbp), %rdi
callq 0x5302
leaq -0x40(%rbp), %rdi
callq 0x5302
movq %r12, %rdi
callq 0x5302
addq $0x10, %rbx
jmp 0xc49b
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
leaq -0x40(%rbp), %rdi
callq 0x5302
jmp 0xc5fe
movq %rax, %r15
leaq -0x30(%rbp), %rdi
callq 0x5302
movq %r15, %rdi
callq 0x4250
nop
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/warcraftWorld.cpp
// Function: warcraft::WarcraftWorld::wolfStealing()
void WarcraftWorld::wolfStealing()
{
    for (auto &e : _citys)
    {
        WarriorPtr redWarrior = e->getRedWarrior();
        WarriorPtr blueWarrior = e->getBlueWarrior();
        if (redWarrior.get() && WOLF == redWarrior->getType())
        {
            redWarrior->stealWeapons(blueWarrior);
        }
        if (blueWarrior.get() && WOLF == blueWarrior->getType())
        {
            blueWarrior->stealWeapons(redWarrior);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x10(%rdi), %rbx
movq 0x18(%rdi), %r14
leaq -0x48(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0x70(%rbp), %r13
leaq -0x60(%rbp), %r12
cmpq %r14, %rbx
je 0xcaa5
movq (%rbx), %rsi
addq $0x8, %rsi
movq %r13, %rdi
callq 0x5392
movq (%rbx), %rsi
addq $0x18, %rsi
movq %r12, %rdi
callq 0x5392
movq -0x70(%rbp), %r15
testq %r15, %r15
je 0xca58
cmpl $0x4, 0x3c(%r15)
jne 0xca58
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x5392
movq (%r15), %rax
movq %r15, %rdi
leaq -0x50(%rbp), %rsi
callq *0x28(%rax)
leaq -0x48(%rbp), %rdi
callq 0x5302
movq -0x60(%rbp), %r15
testq %r15, %r15
je 0xca8a
cmpl $0x4, 0x3c(%r15)
jne 0xca8a
movq %r13, %rsi
leaq -0x40(%rbp), %rdi
callq 0x5392
movq (%r15), %rax
movq %r15, %rdi
leaq -0x40(%rbp), %rsi
callq *0x28(%rax)
leaq -0x38(%rbp), %rdi
callq 0x5302
leaq -0x58(%rbp), %rdi
callq 0x5302
leaq -0x68(%rbp), %rdi
callq 0x5302
addq $0x10, %rbx
jmp 0xc9ff
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
leaq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0xcac4
movq %rax, %r15
movq -0x30(%rbp), %rdi
callq 0x5302
leaq -0x58(%rbp), %rdi
callq 0x5302
leaq -0x68(%rbp), %rdi
callq 0x5302
movq %r15, %rdi
callq 0x4250
nop
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/warcraftWorld.cpp
// Function: warcraft::WarcraftWorld::dragonCheer()
void WarcraftWorld::dragonCheer()
{
    for (auto &e : _citys)
    {
        WarriorPtr redWarrior = e->getRedWarrior();
        WarriorPtr blueWarrior = e->getBlueWarrior();
        if (redWarrior.get() && DRAGON == redWarrior->getType())
        {
            redWarrior->cheer();
        }
        if (blueWarrior.get() && DRAGON == blueWarrior->getType())
        {
            blueWarrior->cheer();
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x10(%rdi), %r13
movq 0x18(%rdi), %rbx
leaq -0x40(%rbp), %r14
leaq -0x38(%rbp), %r15
leaq -0x48(%rbp), %r12
cmpq %rbx, %r13
je 0xcb9b
movq (%r13), %rsi
addq $0x8, %rsi
movq %r15, %rdi
callq 0x5392
movq (%r13), %rsi
addq $0x18, %rsi
movq %r12, %rdi
callq 0x5392
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0xcb6f
cmpl $0x0, 0x3c(%rdi)
jne 0xcb6f
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xcb84
cmpl $0x0, 0x3c(%rdi)
jne 0xcb84
movq (%rdi), %rax
callq *0x18(%rax)
movq %r14, %rdi
callq 0x5302
leaq -0x30(%rbp), %rdi
callq 0x5302
addq $0x10, %r13
jmp 0xcb35
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq %r14, %rdi
callq 0x5302
leaq -0x30(%rbp), %rdi
callq 0x5302
movq %r15, %rdi
callq 0x4250
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/warcraftWorld.cpp
// Function: warcraft::WarcraftWorld::occupyHeadquarters()
void WarcraftWorld::occupyHeadquarters()
{
    //蓝方基地
    WarriorPtr redWarrior = _citys[GameConfig::getInstance()->getCityNum(_caseNum) + 1]->getRedWarrior();
    if (redWarrior.get()){
        cout << "blue headquarter was taken" << endl;
        exit(0);
    }
    //红方基地
    WarriorPtr blueWarrior = _citys[0]->getBlueWarrior();
    if (blueWarrior.get())
    {
        cout << "red headquarter was taken" << endl;
        exit(0);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x9359(%rip), %rax      # 0x16168
movq (%rax), %rax
movq 0x10(%rdi), %rcx
movq 0x28(%rdi), %rdx
movq 0x18(%rax), %rax
shlq $0x7, %rdx
movq -0x78(%rax,%rdx), %rax
shlq $0x4, %rax
movq 0x10(%rcx,%rax), %rsi
addq $0x8, %rsi
leaq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x5392
cmpq $0x0, (%r14)
jne 0xce7e
movq 0x10(%rbx), %rax
movq (%rax), %rsi
addq $0x18, %rsi
leaq -0x20(%rbp), %rbx
movq %rbx, %rdi
callq 0x5392
cmpq $0x0, (%rbx)
jne 0xce9b
leaq -0x18(%rbp), %rdi
callq 0x5302
leaq -0x28(%rbp), %rdi
callq 0x5302
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x914b(%rip), %rdi      # 0x15fd0
leaq 0x1b09(%rip), %rsi      # 0xe995
callq 0x4160
movq %rax, %rdi
callq 0x40b0
jmp 0xceb6
movq 0x912e(%rip), %rdi      # 0x15fd0
leaq 0x1b07(%rip), %rsi      # 0xe9b0
callq 0x4160
movq %rax, %rdi
callq 0x40b0
xorl %edi, %edi
callq 0x41b0
movq %rax, %rbx
leaq -0x18(%rbp), %rdi
callq 0x5302
jmp 0xcece
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x5302
movq %rbx, %rdi
callq 0x4250
nop
// File: /workspace/github_cpp_makefile_star2_O2/Worthy-Wang[P]Warcraft3-StartWar/warcraftWorld.cpp
// Function: warcraft::WarcraftWorld::headquartersReport()
void WarcraftWorld::headquartersReport()
{
    //红方基地
    cout << _red->getBaseHp() << " elememts in red headquarters" << endl;
    //蓝方基地
    cout << _blue->getBaseHp() << " elememts in blue headquarters" << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x8(%rax), %rsi
movq 0x90d8(%rip), %r14      # 0x15fd0
movq %r14, %rdi
callq 0x40f0
leaq 0x1a51(%rip), %rsi      # 0xe958
movq %rax, %rdi
callq 0x4160
movq %rax, %rdi
callq 0x40b0
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdi
callq 0x40f0
leaq 0x1a48(%rip), %rsi      # 0xe976
movq %rax, %rdi
callq 0x4160
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x40b0
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinitctl.cc
// Function: wait_service_state(int, cpbuffer<1024u>&, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool)
static int wait_service_state(int socknum, cpbuffer_t &rbuffer, handle_t handle,
        const std::string &service_name, bool do_stop, bool verbose)
{
    // Wait until service started:
    int r = rbuffer.fill_to(socknum, 2);
    while (r > 0) {
        if (rbuffer[0] >= 100) {
            unsigned pktlen = (unsigned char) rbuffer[1];
            fill_buffer_to(rbuffer, socknum, pktlen);

            if (value((cp_info)rbuffer[0]).is_in(cp_info::SERVICEEVENT, cp_info::SERVICEEVENT5)) {
                int ret = process_service_event(rbuffer, pktlen, handle, service_name, do_stop, verbose);
                if (ret >= 0) {
                    return ret;
                }
            }
            else {
                rbuffer.consume(pktlen);
            }

            r = rbuffer.fill_to(socknum, 2);
        }
        else {
            // Not an information packet?
            throw dinit_protocol_error();
        }
    }

    if (r == -1) {
        perror("dinitctl: read");
    }
    else {
        throw dinit_protocol_error();
    }

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %ebx
movl %r8d, %ebp
movq %rcx, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movq %rsi, %r14
movl %edi, %r15d
pushq $0x2
popq %rdx
movq %rsi, %rdi
movl %r15d, %esi
callq 0xb49c
movl $0x400, %r12d           # imm = 0x400
movzbl %bpl, %r13d
movzbl %bl, %ebx
testl %eax, %eax
jle 0xa25e
movl 0x400(%r14), %eax
leal -0x400(%rax), %ecx
cmpl $0x400, %eax            # imm = 0x400
cmovbl %eax, %ecx
cmpb $0x64, (%r14,%rcx)
jl 0xa281
leal 0x1(%rax), %ecx
addl $0xfffffc01, %eax       # imm = 0xFFFFFC01
cmpl %r12d, %ecx
cmovbl %ecx, %eax
movzbl (%r14,%rax), %ebp
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0xb33a
movl 0x400(%r14), %eax
leal -0x400(%rax), %ecx
cmpl %r12d, %eax
cmovbl %eax, %ecx
movb (%r14,%rcx), %al
andb $-0x2, %al
movq %r14, %rdi
movl %ebp, %esi
cmpb $0x64, %al
jne 0xa246
movl 0xc(%rsp), %edx
movq 0x10(%rsp), %rcx
movl %r13d, %r8d
movl %ebx, %r9d
callq 0xa56a
testl %eax, %eax
js 0xa24b
jmp 0xa272
callq 0xb41c
movq %r14, %rdi
movl %r15d, %esi
pushq $0x2
popq %rdx
callq 0xb49c
jmp 0xa1c2
cmpl $-0x1, %eax
jne 0xa281
leaq 0x80b9(%rip), %rdi      # 0x12323
callq 0x42a0
pushq $0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rdi
callq 0x4190
leaq 0x10870(%rip), %rsi     # 0x1ab00
movq %rax, %rdi
xorl %edx, %edx
callq 0x44f0
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinitctl.cc
// Function: print_failure_details(stopped_reason_t, unsigned short, int, int, int)
static void print_failure_details(stopped_reason_t stop_reason, uint16_t launch_stage,
        int exit_status, int exit_si_code, int exit_si_status)
{
    using std::cout;

    switch (stop_reason) {
        case stopped_reason_t::DEPFAILED:
            cout << "Reason: a dependency of the service failed to start. "
                    "Check dinit log.\n";
            break;
        case stopped_reason_t::TIMEDOUT:
            cout << "Reason: start timed out.\n";
            break;
        case stopped_reason_t::EXECFAILED:
            cout << "Reason: execution of service process failed:\n";
            cout << "        Stage: " << exec_stage_descriptions[launch_stage] << "\n";
            cout << "        Error: " << strerror(exit_status) << "\n";
            break;
        case stopped_reason_t::FAILED:
            cout << "Reason: service process terminated before ready: ";
            if (exit_si_code != 0 || exit_si_status != 0) {
                print_termination_details(exit_si_code, exit_si_status);
            }
            else {
                print_termination_details(exit_status);
            }
            cout << "\n";
            break;
        default:
            cout << "Reason unknown/unrecognised. Check dinit log.\n";
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
addl $-0x2, %edi
cmpl $0x3, %edi
ja 0xa38b
movl %ecx, %r14d
movl %edx, %ebx
leaq 0x6dbf(%rip), %rax      # 0x11078
movslq (%rax,%rdi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x10cdf(%rip), %rdi     # 0x1afa8
leaq 0x8072(%rip), %rsi      # 0x12342
jmp 0xa3b0
movl %esi, %r15d
movq 0x10cc9(%rip), %r14     # 0x1afa8
leaq 0x80bd(%rip), %rsi      # 0x123a3
movq %r14, %rdi
callq 0x42f0
leaq 0x80dc(%rip), %rsi      # 0x123d1
movq %r14, %rdi
callq 0x42f0
movzwl %r15w, %ecx
leaq 0x10938(%rip), %rdx     # 0x1ac40
movq (%rdx,%rcx,8), %rsi
movq %rax, %rdi
callq 0x42f0
leaq 0x87d5(%rip), %r15      # 0x12af0
movq %rax, %rdi
movq %r15, %rsi
callq 0x42f0
leaq 0x80b4(%rip), %rsi      # 0x123e1
movq %r14, %rdi
callq 0x42f0
movq %rax, %r14
movl %ebx, %edi
callq 0x40e0
movq %r14, %rdi
movq %rax, %rsi
callq 0x42f0
movq %rax, %rdi
movq %r15, %rsi
jmp 0xa3b0
movq 0x10c4f(%rip), %rdi     # 0x1afa8
leaq 0x8029(%rip), %rsi      # 0x12389
jmp 0xa3b0
movl %r8d, %ebp
movq 0x10c3c(%rip), %rdi     # 0x1afa8
leaq 0x807e(%rip), %rsi      # 0x123f1
callq 0x42f0
movl %ebp, %eax
orl %r14d, %eax
je 0xa39b
movl %r14d, %edi
movl %ebp, %esi
callq 0xa802
jmp 0xa3a2
movq 0x10c16(%rip), %rdi     # 0x1afa8
leaq 0x808a(%rip), %rsi      # 0x12423
jmp 0xa3b0
movl %ebx, %edi
callq 0xa863
movq 0x10bff(%rip), %rdi     # 0x1afa8
leaq 0x8740(%rip), %rsi      # 0x12af0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x42f0
// File: /workspace/github_cpp_makefile_star2_O2/davmac314[P]dinit/src/dinitctl.cc
// Function: issue_load_service(int, char const*, bool)
static int issue_load_service(int socknum, const char *service_name, bool find_only)
{
    // Build buffer;
    srvname_len_t srvname_len = strlen(service_name);
    int bufsize = 3 + srvname_len;
    
    std::unique_ptr<char[]> ubuf(new char[bufsize]);
    auto buf = ubuf.get();

    buf[0] = (char)(find_only ? cp_cmd::FINDSERVICE : cp_cmd::LOADSERVICE);
    memcpy(buf + 1, &srvname_len, sizeof(srvname_len));
    memcpy(buf + 3, service_name, srvname_len);

    write_all_x(socknum, buf, bufsize);
    
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movl %edi, %ebx
movq %rsi, %rdi
callq 0x4140
movq %rax, %r15
movzwl %r15w, %r12d
addl $0x3, %r12d
movq %r12, %rdi
callq 0x4030
movq %rax, %r13
movq %rax, (%rsp)
movb $0x2, %al
subb %bpl, %al
movb %al, (%r13)
movw %r15w, 0x1(%r13)
leaq 0x3(%r13), %rdi
movzwl %r15w, %edx
movq %r14, %rsi
callq 0x4280
movl %ebx, %edi
movq %r13, %rsi
movl %r12d, %edx
callq 0xb277
movq %rsp, %rdi
callq 0xb81a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0xb81a
movq %rbx, %rdi
callq 0x4510