// File: /workspace/github_cpp_makefile_star2_O3/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 0x9003(%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 0xe3db
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
leaq 0x1(%r12), %rbx
shlq $0x4, %r12
movq 0x10(%r15), %rax
movq (%rax,%r12), %rax
movq 0x8(%rax), %r13
movq 0x10(%rax), %r14
testq %r14, %r14
je 0xe1b2
movq 0x8e26(%rip), %rax      # 0x16fc8
cmpb $0x0, (%rax)
je 0xe1ad
incl 0x8(%r14)
jmp 0xe1b2
lock
incl 0x8(%r14)
testq %r13, %r13
je 0xe3a6
movq (%r13), %rax
movq %r13, %rdi
callq *0x10(%rax)
movq 0x58(%r13), %rax
shlq $0x4, %rax
movq 0x10(%r15), %rcx
movq (%rcx,%rax), %rax
movq %r13, -0x78(%rbp)
movq %r14, -0x70(%rbp)
movq %r13, %rcx
testq %r14, %r14
je 0xe203
movq 0x8ddc(%rip), %rcx      # 0x16fc8
cmpb $0x0, (%rcx)
je 0xe1fa
incl 0x8(%r14)
movq %r13, %rcx
jmp 0xe203
lock
incl 0x8(%r14)
movq -0x78(%rbp), %rcx
xorl %edx, %edx
cmpl $0x0, 0x8(%rcx)
setne %dl
shll $0x4, %edx
leaq (%rdx,%rax), %rdi
addq $0x10, %rdi
movq %rcx, -0x8(%rdi)
leaq -0x70(%rbp), %rsi
callq 0xac4a
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0xe232
callq 0x57a8
leaq 0x8f1f(%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 0xe3a6
movl $0x4, %edx
movq 0x8d6a(%rip), %rdi      # 0x16fd0
leaq 0x1dc0(%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 0x570a
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x8d33(%rip), %rdi      # 0x16fd0
callq 0x4190
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x27f7(%rip), %rsi      # 0x10aab
callq 0x4190
movq 0x30(%r13), %rsi
movq %r15, %rdi
callq 0x40e0
movq %rax, %r15
movl $0x11, %edx
movq %rax, %rdi
leaq 0x2791(%rip), %rsi      # 0x10a68
callq 0x4190
movq 0x58(%r13), %rsi
movq %r15, %rdi
callq 0x40e0
movq %rax, %r15
movl $0x6, %edx
movq %rax, %rdi
leaq 0x2767(%rip), %rsi      # 0x10a61
callq 0x4190
movl 0x38(%r13), %esi
movq %r15, %rdi
callq 0x4220
movq %rax, %r15
movl $0x14, %edx
movq %rax, %rdi
leaq 0x2716(%rip), %rsi      # 0x10a33
callq 0x4190
leaq 0x8e2f(%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 0x681a
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 0xe3a2
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x58(%rbp), %r15
testq %r14, %r14
je 0xe3b3
movq %r14, %rdi
callq 0x57a8
addq $-0x10, %r12
decq %rbx
jg 0xe186
leaq 0x8d91(%rip), %rax      # 0x17158
movq (%rax), %rax
movq 0x28(%r15), %rcx
movq 0x18(%rax), %rax
shlq $0x7, %rcx
movq -0x78(%rax,%rcx), %r12
cmpq $-0x1, %r12
je 0xe64b
movl $0x1, %r12d
movl $0x10, %ebx
movq 0x10(%r15), %rax
movq (%rax,%rbx), %rax
movq 0x18(%rax), %r13
movq 0x20(%rax), %r14
testq %r14, %r14
je 0xe41c
movq 0x8bbc(%rip), %rax      # 0x16fc8
cmpb $0x0, (%rax)
je 0xe417
incl 0x8(%r14)
jmp 0xe41c
lock
incl 0x8(%r14)
testq %r13, %r13
je 0xe610
movq (%r13), %rax
movq %r13, %rdi
callq *0x10(%rax)
movq 0x58(%r13), %rax
shlq $0x4, %rax
movq 0x10(%r15), %rcx
movq (%rcx,%rax), %rax
movq %r13, -0x68(%rbp)
movq %r14, -0x60(%rbp)
movq %r13, %rcx
testq %r14, %r14
je 0xe46d
movq 0x8b72(%rip), %rcx      # 0x16fc8
cmpb $0x0, (%rcx)
je 0xe464
incl 0x8(%r14)
movq %r13, %rcx
jmp 0xe46d
lock
incl 0x8(%r14)
movq -0x68(%rbp), %rcx
xorl %edx, %edx
cmpl $0x0, 0x8(%rcx)
setne %dl
shll $0x4, %edx
leaq (%rdx,%rax), %rdi
addq $0x10, %rdi
movq %rcx, -0x8(%rdi)
leaq -0x60(%rbp), %rsi
callq 0xac4a
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0xe49c
callq 0x57a8
leaq 0x8cb5(%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 0xe610
movl $0x5, %edx
movq 0x8b00(%rip), %rdi      # 0x16fd0
leaq 0x1b60(%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 0x570a
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x8ac9(%rip), %rdi      # 0x16fd0
callq 0x4190
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x258d(%rip), %rsi      # 0x10aab
callq 0x4190
movq 0x30(%r13), %rsi
movq %r15, %rdi
callq 0x40e0
movq %rax, %r15
movl $0x11, %edx
movq %rax, %rdi
leaq 0x2527(%rip), %rsi      # 0x10a68
callq 0x4190
movq 0x58(%r13), %rsi
movq %r15, %rdi
callq 0x40e0
movq %rax, %r15
movl $0x6, %edx
movq %rax, %rdi
leaq 0x24fd(%rip), %rsi      # 0x10a61
callq 0x4190
movl 0x38(%r13), %esi
movq %r15, %rdi
callq 0x4220
movq %rax, %r15
movl $0x14, %edx
movq %rax, %rdi
leaq 0x24ac(%rip), %rsi      # 0x10a33
callq 0x4190
leaq 0x8bc5(%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 0x681a
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 0xe60c
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0x58(%rbp), %r15
testq %r14, %r14
je 0xe61d
movq %r14, %rdi
callq 0x57a8
incq %r12
leaq 0x8b31(%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, %rbx
cmpq %rax, %r12
jbe 0xe3f0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe660
jmp 0xe660
jmp 0xe660
movq %rax, %rbx
jmp 0xe683
jmp 0xe667
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xe683
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4170
testq %r14, %r14
je 0xe690
movq %r14, %rdi
callq 0x57a8
movq %rbx, %rdi
callq 0x4230