// File: /workspace/github_cpp_makefile_star2_O1/Worthy-Wang[P]Warcraft3-StartWar/warcraftWorld.cpp
// Function: warcraft::WarcraftWorld::warriorMarch()
void WarcraftWorld::warriorMarch()
{
    //让基地中，城市中的武士依次前进
    /***************************红武士*************************************/
    for (int i = GameConfig::getInstance()->getCityNum(_caseNum); i >= 0; i--)
    {
        WarriorPtr redWarrior = _citys[i]->getRedWarrior();
        //如果还活着，则前往下一个城市，如果是到达司令部，则在后面的事件中输出
        if (redWarrior.get())
        {
            redWarrior->march();
            _citys[redWarrior->getCityId()]->attach(redWarrior);
            //没有走到司令部，则输出事件
            if (redWarrior->getCityId() != (GameConfig::getInstance()->getCityNum(_caseNum) + 1))
                cout << "red " << redWarrior->getName() << " " << redWarrior->getId() << " marched to city " << redWarrior->getCityId() << " with " << redWarrior->getHp() << " elements and force " << GameConfig::getInstance()->getInitWarriorAttack(_caseNum, redWarrior->getType()) << endl;
        }
    }

    /***************************蓝武士*************************************/
    for (size_t i = 1; i <= GameConfig::getInstance()->getCityNum(_caseNum) + 1; i++)
    {
        WarriorPtr blueWarrior = _citys[i]->getBlueWarrior();
        //如果还活着，则前往下一个城市，如果是到达司令部，则在后面的事件中输出
        if (blueWarrior.get())
        {
            blueWarrior->march();
            _citys[blueWarrior->getCityId()]->attach(blueWarrior);
            //没有走到司令部，则输出事件
            if (blueWarrior->getCityId() != (GameConfig::getInstance()->getCityNum(_caseNum) + 1))
                cout << "blue " << blueWarrior->getName() << " " << blueWarrior->getId() << " marched to city " << blueWarrior->getCityId() << " with " << blueWarrior->getHp() << " elements and force " << GameConfig::getInstance()->getInitWarriorAttack(_caseNum, blueWarrior->getType()) << endl;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %r15
leaq 0x8f87(%rip), %rax      # 0x17158
movq (%rax), %rax
movq 0x28(%rdi), %rcx
movq 0x18(%rax), %rax
shlq $0x7, %rcx
movq -0x78(%rax,%rcx), %r12
testl %r12d, %r12d
movq %rdi, -0x58(%rbp)
js 0xe416
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
leaq 0x1(%r12), %r14
shlq $0x4, %r12
movq 0x10(%r15), %rax
movq (%rax,%r12), %rax
movq 0x8(%rax), %r13
movq 0x10(%rax), %rbx
testq %rbx, %rbx
je 0xe22c
movq 0x8daa(%rip), %rax      # 0x16fc8
cmpb $0x0, (%rax)
je 0xe228
incl 0x8(%rbx)
jmp 0xe22c
lock
incl 0x8(%rbx)
testq %r13, %r13
je 0xe3fc
movq (%r13), %rax
movq %r13, %rdi
callq *0x10(%rax)
movq 0x58(%r13), %rax
shlq $0x4, %rax
movq 0x10(%r15), %rcx
movq (%rcx,%rax), %rdi
movq %r13, -0x78(%rbp)
movq %rbx, -0x70(%rbp)
testq %rbx, %rbx
je 0xe271
movq 0x8d65(%rip), %rax      # 0x16fc8
cmpb $0x0, (%rax)
je 0xe26d
incl 0x8(%rbx)
jmp 0xe271
lock
incl 0x8(%rbx)
leaq -0x78(%rbp), %rsi
callq 0xcbea
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0xe288
callq 0x57ba
leaq 0x8ec9(%rip), %rax      # 0x17158
movq (%rax), %rax
movq 0x28(%r15), %rcx
movq 0x18(%rax), %rax
shlq $0x7, %rcx
movq -0x78(%rax,%rcx), %rax
incq %rax
cmpq %rax, 0x58(%r13)
je 0xe3fc
movl $0x4, %edx
movq 0x8d14(%rip), %rdi      # 0x16fd0
leaq 0x1d6a(%rip), %rsi      # 0x1002d
callq 0x4190
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x5720
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x8cdd(%rip), %rdi      # 0x16fd0
callq 0x4190
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x27a1(%rip), %rsi      # 0x10aab
callq 0x4190
movq 0x30(%r13), %rsi
movq %r15, %rdi
callq 0x40e0
movq %rax, %r15
movl $0x11, %edx
movq %rax, %rdi
leaq 0x273b(%rip), %rsi      # 0x10a68
callq 0x4190
movq 0x58(%r13), %rsi
movq %r15, %rdi
callq 0x40e0
movq %rax, %r15
movl $0x6, %edx
movq %rax, %rdi
leaq 0x2711(%rip), %rsi      # 0x10a61
callq 0x4190
movl 0x38(%r13), %esi
movq %r15, %rdi
callq 0x4220
movq %rax, %r15
movl $0x14, %edx
movq %rax, %rdi
leaq 0x26c0(%rip), %rsi      # 0x10a33
callq 0x4190
leaq 0x8dd9(%rip), %rax      # 0x17158
movq (%rax), %rax
movq -0x58(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl 0x3c(%r13), %edx
movl %edx, -0x2c(%rbp)
movq 0x18(%rax), %rax
shlq $0x7, %rcx
leaq (%rax,%rcx), %rdi
addq $-0x30, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x6838
movq (%rax), %rsi
movq %r15, %rdi
callq 0x40e0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r15, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40f0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xe3f8
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x58(%rbp), %r15
testq %rbx, %rbx
je 0xe409
movq %rbx, %rdi
callq 0x57ba
addq $-0x10, %r12
decq %r14
jg 0xe202
leaq 0x8d3b(%rip), %rax      # 0x17158
movq (%rax), %rax
movq 0x28(%r15), %rcx
movq 0x18(%rax), %rax
shlq $0x7, %rcx
cmpq $-0x1, -0x78(%rax,%rcx)
je 0xe679
movl $0x1, %r12d
movl $0x10, %r14d
movq 0x10(%r15), %rax
movq (%rax,%r14), %rax
movq 0x18(%rax), %r13
movq 0x20(%rax), %rbx
testq %rbx, %rbx
je 0xe46e
movq 0x8b68(%rip), %rax      # 0x16fc8
cmpb $0x0, (%rax)
je 0xe46a
incl 0x8(%rbx)
jmp 0xe46e
lock
incl 0x8(%rbx)
testq %r13, %r13
je 0xe63e
movq (%r13), %rax
movq %r13, %rdi
callq *0x10(%rax)
movq 0x58(%r13), %rax
shlq $0x4, %rax
movq 0x10(%r15), %rcx
movq (%rcx,%rax), %rdi
movq %r13, -0x68(%rbp)
movq %rbx, -0x60(%rbp)
testq %rbx, %rbx
je 0xe4b3
movq 0x8b23(%rip), %rax      # 0x16fc8
cmpb $0x0, (%rax)
je 0xe4af
incl 0x8(%rbx)
jmp 0xe4b3
lock
incl 0x8(%rbx)
leaq -0x68(%rbp), %rsi
callq 0xcbea
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0xe4ca
callq 0x57ba
leaq 0x8c87(%rip), %rax      # 0x17158
movq (%rax), %rax
movq 0x28(%r15), %rcx
movq 0x18(%rax), %rax
shlq $0x7, %rcx
movq -0x78(%rax,%rcx), %rax
incq %rax
cmpq %rax, 0x58(%r13)
je 0xe63e
movl $0x5, %edx
movq 0x8ad2(%rip), %rdi      # 0x16fd0
leaq 0x1b32(%rip), %rsi      # 0x10037
callq 0x4190
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x5720
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x8a9b(%rip), %rdi      # 0x16fd0
callq 0x4190
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x255f(%rip), %rsi      # 0x10aab
callq 0x4190
movq 0x30(%r13), %rsi
movq %r15, %rdi
callq 0x40e0
movq %rax, %r15
movl $0x11, %edx
movq %rax, %rdi
leaq 0x24f9(%rip), %rsi      # 0x10a68
callq 0x4190
movq 0x58(%r13), %rsi
movq %r15, %rdi
callq 0x40e0
movq %rax, %r15
movl $0x6, %edx
movq %rax, %rdi
leaq 0x24cf(%rip), %rsi      # 0x10a61
callq 0x4190
movl 0x38(%r13), %esi
movq %r15, %rdi
callq 0x4220
movq %rax, %r15
movl $0x14, %edx
movq %rax, %rdi
leaq 0x247e(%rip), %rsi      # 0x10a33
callq 0x4190
leaq 0x8b97(%rip), %rax      # 0x17158
movq (%rax), %rax
movq -0x58(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl 0x3c(%r13), %edx
movl %edx, -0x2c(%rbp)
movq 0x18(%rax), %rax
shlq $0x7, %rcx
leaq (%rax,%rcx), %rdi
addq $-0x30, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x6838
movq (%rax), %rsi
movq %r15, %rdi
callq 0x40e0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r15, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40f0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xe63a
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x58(%rbp), %r15
testq %rbx, %rbx
je 0xe64b
movq %rbx, %rdi
callq 0x57ba
incq %r12
leaq 0x8b03(%rip), %rax      # 0x17158
movq (%rax), %rax
movq 0x28(%r15), %rcx
movq 0x18(%rax), %rax
shlq $0x7, %rcx
movq -0x78(%rax,%rcx), %rax
incq %rax
addq $0x10, %r14
cmpq %rax, %r12
jbe 0xe444
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe6aa
jmp 0xe6aa
movq %rax, %r14
movq -0x70(%rbp), %rdi
jmp 0xe69c
movq %rax, %r14
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0xe6cd
callq 0x57ba
jmp 0xe6cd
jmp 0xe6aa
movq %rax, %r14
jmp 0xe6cd
jmp 0xe6b1
movq %rax, %r14
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xe6cd
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4170
testq %rbx, %rbx
je 0xe6da
movq %rbx, %rdi
callq 0x57ba
movq %r14, %rdi
callq 0x4230