// File: /workspace/github_cpp_makefile_star2_O3/Worthy-Wang[P]Warcraft3-StartWar/warcraftWorld.cpp
// Function: warcraft::WarcraftWorld::init()
void WarcraftWorld::init()
{
    vector<WarriorType> initHpOrder{DRAGON, NINJA, ICEMAN, LION, WOLF}; //同时对生命值与攻击力顺序赋值
    vector<WarriorType> redCreateorder{ICEMAN, LION, WOLF, NINJA, DRAGON};
    vector<WarriorType> blueCreateorder{LION, DRAGON, NINJA, ICEMAN, WOLF};

    GameConfig::getInstance()->setInitWarriorOrder(initHpOrder.begin(), initHpOrder.end());
    GameConfig::getInstance()->readFromFile("warcraft.conf");
    GameConfig::getInstance()->print(); //进行检测

    _caseNum = GameConfig::getInstance()->currentGroupId();
    size_t baseHp = GameConfig::getInstance()->getInitBaseHp(_caseNum);
    _red = new Headquarters(RED, baseHp);
    _blue = new Headquarters(BLUE, baseHp);
    _red->setWarriorCreateOrder(redCreateorder.begin(), redCreateorder.end());
    _blue->setWarriorCreateOrder(blueCreateorder.begin(), blueCreateorder.end());

    CityPtr city(new City(0));
    _citys.push_back(city); //红方基地
    size_t i = 1;
    for (; i <= GameConfig::getInstance()->getCityNum(_caseNum); i++)
    {
        city.reset(new City(i));
        _citys.push_back(city);
    }
    city.reset(new City(i));
    _citys.push_back(city); //蓝方基地
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
movups 0x1ada(%rip), %xmm0     # 0x10978
leaq -0x80(%rbp), %rsi
movaps %xmm0, (%rsi)
movl $0x4, 0x10(%rsi)
leaq -0x98(%rbp), %rdi
leaq -0x60(%rbp), %r14
movl $0x5, %edx
movq %r14, %rcx
callq 0xca02
movups 0x1be5(%rip), %xmm0     # 0x10ab0
movaps %xmm0, (%r14)
movl $0x0, 0x10(%r14)
leaq -0x80(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x40(%rbp), %rcx
movl $0x5, %edx
callq 0xca02
movups 0x1a98(%rip), %xmm0     # 0x1098c
leaq -0x40(%rbp), %rsi
movaps %xmm0, (%rsi)
movl $0x4, 0x10(%rsi)
leaq -0x60(%rbp), %rdi
leaq -0x29(%rbp), %rcx
movl $0x5, %edx
callq 0xca02
leaq 0x823d(%rip), %r12      # 0x17158
movq (%r12), %rdi
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
callq 0xca48
movq (%r12), %r14
leaq -0xa8(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x19dc(%rip), %rsi      # 0x10924
leaq 0x19e2(%rip), %rdx      # 0x10931
leaq -0xb8(%rbp), %rdi
callq 0x8bbc
leaq -0xb8(%rbp), %rsi
movq %r14, %rdi
callq 0x6508
movq -0xb8(%rbp), %rdi
cmpq %r15, %rdi
je 0xef85
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x4170
movq (%r12), %rdi
callq 0x65cc
leaq 0x81bb(%rip), %rax      # 0x17150
movq (%rax), %rax
movq %rax, 0x28(%rbx)
movq (%r12), %rcx
movq 0x18(%rcx), %rcx
shlq $0x7, %rax
movq -0x80(%rcx,%rax), %r15
movl $0xa8, %edi
callq 0x4160
movq %rax, %r14
movl $0x0, (%rax)
movq %r15, 0x8(%rax)
xorl %eax, %eax
movq %rax, 0x10(%r14)
movl $0x1, %r13d
movq %r13, 0x18(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r14)
movq %rax, 0x30(%r14)
leaq 0x68(%r14), %rax
movq %rax, 0x38(%r14)
movq %r13, 0x40(%r14)
movups %xmm0, 0x48(%r14)
movl $0x3f800000, %ecx       # imm = 0x3F800000
movl %ecx, 0x58(%r14)
movups %xmm0, 0x60(%r14)
movq %r14, %rax
addq $0xa0, %rax
movq %rax, 0x70(%r14)
movq %r13, 0x78(%r14)
movups %xmm0, 0x80(%r14)
movl %ecx, 0x90(%r14)
movups %xmm0, 0x98(%r14)
movq %r14, (%rbx)
movl $0xa8, %edi
callq 0x4160
movl $0x1, (%rax)
movq %r15, 0x8(%rax)
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
movq %r13, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movq %rcx, 0x30(%rax)
leaq 0x68(%rax), %rcx
movq %rcx, 0x38(%rax)
movq %r13, 0x40(%rax)
movups %xmm0, 0x48(%rax)
movl $0x3f800000, %edx       # imm = 0x3F800000
movl %edx, 0x58(%rax)
movups %xmm0, 0x60(%rax)
movq %rax, %rcx
addq $0xa0, %rcx
movq %rcx, 0x70(%rax)
movq %r13, 0x78(%rax)
movups %xmm0, 0x80(%rax)
movl %edx, 0x90(%rax)
movups %xmm0, 0x98(%rax)
movq %rax, 0x8(%rbx)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq %r14, %rdi
callq 0xf2bc
movq 0x8(%rbx), %rdi
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0xf2bc
movl $0x28, %edi
callq 0x4160
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x20(%rax)
leaq -0x38(%rbp), %rdi
movq %rax, -0x8(%rdi)
movq %rax, %rsi
callq 0xf3ac
leaq 0x10(%rbx), %r14
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0xf310
movq (%r12), %rax
movq 0x28(%rbx), %rcx
movq 0x18(%rax), %rax
shlq $0x7, %rcx
cmpq $0x0, -0x78(%rax,%rcx)
je 0xf15a
leaq -0x40(%rbp), %r15
movl $0x28, %edi
callq 0x4160
movq %r13, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0xf35e
movq %r14, %rdi
movq %r15, %rsi
callq 0xf310
incq %r13
movq (%r12), %rax
movq 0x28(%rbx), %rcx
movq 0x18(%rax), %rax
shlq $0x7, %rcx
cmpq -0x78(%rax,%rcx), %r13
jbe 0xf112
movl $0x28, %edi
callq 0x4160
movq %r13, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
leaq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0xf35e
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0xf310
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0xf198
callq 0x57a8
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0xf1ad
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x4170
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0xf1c2
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x4170
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0xf1dd
movq -0x88(%rbp), %rsi
subq %rdi, %rsi
callq 0x4170
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xf228
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
cmpq %r15, %rdi
je 0xf239
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xf239
jmp 0xf223
movq %rax, %rbx
jmp 0xf24e
movq %rax, %rbx
jmp 0xf263
jmp 0xf223
jmp 0xf223
jmp 0xf228
movq %rax, %rbx
jmp 0xf239
movq %rax, %rbx
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0xf239
callq 0x57a8
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0xf24e
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x4170
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0xf263
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x4170
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0xf27e
movq -0x88(%rbp), %rsi
subq %rdi, %rsi
callq 0x4170
movq %rbx, %rdi
callq 0x4230