// File: /workspace/github_cpp_makefile_star2_O1/Worthy-Wang[P]Warcraft3-StartWar/Headquarters.cpp
// Function: warcraft::Headquarters::createWarrior(warcraft::WarriorType)
WarriorPtr Headquarters::createWarrior(WarriorType type)
{
    size_t hp = GameConfig::getInstance()->getInitWarriorHp(GameConfig::getInstance()->currentGroupId(), type);
    _baseHp -= hp;
    WarriorPtr warrior;
    WarriorViewPtr warriorView;
    WeaponPtr weapon;
    WeaponViewPtr weaponView;
    switch (type)
    {
    case DRAGON:
    {
        warrior.reset(new Dragon(getColor(), getWarriorId(), hp, getBaseHp()));
        warriorView.reset(new DragonView(warrior));
        weapon = createWeapon(getWarriorId() % 3, DRAGON);
        warrior->setWeapon(weapon);
        break;
    }
    case NINJA:
    {
        warrior.reset(new Ninja(getColor(), getWarriorId(), hp, getBaseHp()));
        warriorView.reset(new NinjaView(warrior));
        weapon = createWeapon(getWarriorId() % 3, NINJA);
        WeaponPtr weapon2 = createWeapon((getWarriorId() + 1) % 3, NINJA);
        warrior->setWeapon(weapon);
        warrior->setWeapon(weapon2);
        break;
    }
    case ICEMAN:
    {
        warrior.reset(new Iceman(getColor(), getWarriorId(), hp, getBaseHp()));
        warriorView.reset(new IcemanView(warrior));
        weapon = createWeapon(getWarriorId() % 3, ICEMAN);
        warrior->setWeapon(weapon);
        break;
    }
    case LION:
    {
        warrior.reset(new Lion(getColor(), getWarriorId(), hp, getBaseHp()));
        warriorView.reset(new LionView(warrior));
        weapon = createWeapon(getWarriorId() % 3, LION);
        warrior->setWeapon(weapon);
        break;
    }
    case WOLF:
    {
        warrior.reset(new Wolf(getColor(), getWarriorId(), hp, getBaseHp()));
        warriorView.reset(new WolfView(warrior));
        break;
    }
    default:
        cout << "Warrior Type ERROR!" << endl;
        break;
    }

    _warriorViews[warrior] = warriorView;

    return warrior;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %edx, %ebx
movq %rsi, %r12
movq %rdi, %r14
leaq 0x1024d(%rip), %rax     # 0x17158
movq (%rax), %rax
leaq 0x1023b(%rip), %rcx     # 0x17150
movq (%rcx), %rcx
leaq -0x60(%rbp), %r15
movl %edx, (%r15)
movq 0x18(%rax), %rax
shlq $0x7, %rcx
leaq (%rax,%rcx), %rdi
addq $-0x60, %rdi
movq %r15, %rsi
callq 0x6838
movq (%rax), %rax
movq 0x8(%r12), %r13
subq %rax, %r13
movq %r12, -0x48(%rbp)
movq %r13, 0x8(%r12)
xorpd %xmm0, %xmm0
movq %r14, -0x30(%rbp)
movupd %xmm0, (%r14)
movapd %xmm0, (%r15)
cmpl $0x4, %ebx
ja 0x7277
movq %rax, %r12
movl %ebx, %eax
leaq 0x919e(%rip), %rcx      # 0x10110
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %r15d, %r15d
movl $0x60, %edi
callq 0x4160
movq -0x48(%rbp), %r14
movq %rax, %rbx
movl (%r14), %esi
movq %r13, %xmm1
punpckldq 0x9151(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x9159(%rip), %xmm1     # 0x10100
movq 0x18(%r14), %rdx
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %rax, %rdi
movl %r12d, %ecx
callq 0x7b82
xorl %r15d, %r15d
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x7b34
xorl %r15d, %r15d
movl $0x18, %edi
callq 0x4160
movq %rax, %r12
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movq %rax, -0x100(%rbp)
movq 0x8(%rcx), %rax
movq %rax, -0xf8(%rbp)
testq %rax, %rax
je 0x7472
movq 0xffbe(%rip), %rcx      # 0x16fc8
cmpb $0x0, (%rcx)
je 0x746e
incl 0x8(%rax)
jmp 0x7472
xorl %r15d, %r15d
movl $0x60, %edi
callq 0x4160
movq -0x48(%rbp), %r14
movq %rax, %rbx
movl (%r14), %esi
movq %r13, %xmm1
punpckldq 0x90b1(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x90b9(%rip), %xmm1     # 0x10100
movq 0x18(%r14), %rdx
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %rax, %rdi
movl %r12d, %ecx
callq 0x82b2
xorl %r15d, %r15d
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x8264
xorl %r15d, %r15d
movl $0x18, %edi
callq 0x4160
movq %rax, %rbx
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movq %rax, -0x70(%rbp)
movq 0x8(%rcx), %rax
movq %rax, -0x68(%rbp)
testq %rax, %rax
je 0x72d6
movq 0xff24(%rip), %rcx      # 0x16fc8
cmpb $0x0, (%rcx)
je 0x72d2
incl 0x8(%rax)
jmp 0x72d6
xorl %r15d, %r15d
movl $0x60, %edi
callq 0x4160
movq -0x48(%rbp), %r14
movq %rax, %rbx
movl (%r14), %esi
movq %r13, %xmm1
punpckldq 0x9017(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x901f(%rip), %xmm1     # 0x10100
movq 0x18(%r14), %rdx
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %rax, %rdi
movl %r12d, %ecx
callq 0x7f12
xorl %r15d, %r15d
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x7ec4
xorl %r15d, %r15d
movl $0x18, %edi
callq 0x4160
movq %rax, %rbx
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movq %rax, -0xb0(%rbp)
movq 0x8(%rcx), %rax
movq %rax, -0xa8(%rbp)
testq %rax, %rax
je 0x7308
movq 0xfe84(%rip), %rcx      # 0x16fc8
cmpb $0x0, (%rcx)
je 0x7304
incl 0x8(%rax)
jmp 0x7308
xorl %r15d, %r15d
movl $0x68, %edi
callq 0x4160
movq -0x48(%rbp), %r14
movq %rax, %rbx
movl (%r14), %esi
movq 0x18(%r14), %rdx
movq %rax, %rdi
movl %r12d, %ecx
movq %r13, %r8
callq 0x80dc
xorl %r15d, %r15d
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x808e
xorl %r15d, %r15d
movl $0x18, %edi
callq 0x4160
movq %rax, %rbx
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movq %rax, -0x90(%rbp)
movq 0x8(%rcx), %rax
movq %rax, -0x88(%rbp)
testq %rax, %rax
je 0x73c0
movq 0xfe02(%rip), %rcx      # 0x16fc8
cmpb $0x0, (%rcx)
je 0x73bc
incl 0x8(%rax)
jmp 0x73c0
xorl %r15d, %r15d
movl $0x60, %edi
callq 0x4160
movq -0x48(%rbp), %r14
movq %rax, %rbx
movl (%r14), %esi
movq %r13, %xmm1
punpckldq 0x8ef5(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x8efd(%rip), %xmm1     # 0x10100
movq 0x18(%r14), %rdx
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %rax, %rdi
movl %r12d, %ecx
callq 0x7d48
xorl %r15d, %r15d
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x7cfa
xorl %r15d, %r15d
movl $0x18, %edi
callq 0x4160
movq %rax, %rbx
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movq %rax, -0xe0(%rbp)
movq 0x8(%rcx), %rax
movq %rax, -0xd8(%rbp)
testq %rax, %rax
je 0x752b
movq 0xfd62(%rip), %rcx      # 0x16fc8
cmpb $0x0, (%rcx)
je 0x7527
incl 0x8(%rax)
jmp 0x752b
xorl %r15d, %r15d
movq 0xfd4f(%rip), %rbx      # 0x16fd0
leaq 0x8f40(%rip), %rsi      # 0x101c8
movl $0x13, %edx
movq %rbx, %rdi
callq 0x4190
movq -0x48(%rbp), %r14
movq (%rbx), %rax
addq -0x18(%rax), %rbx
xorl %r15d, %r15d
movq %rbx, %rdi
movl $0xa, %esi
callq 0x4150
xorl %r15d, %r15d
movsbl %al, %esi
movq 0xfd13(%rip), %rdi      # 0x16fd0
callq 0x4030
xorl %r15d, %r15d
movq %rax, %rdi
callq 0x40f0
jmp 0x76ea
lock
incl 0x8(%rax)
leaq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x83b0
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
callq 0x8362
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x72fc
callq 0x57ba
xorl %r15d, %r15d
jmp 0x76ea
lock
incl 0x8(%rax)
leaq -0xb0(%rbp), %rsi
movq %rbx, %rdi
callq 0x8010
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
callq 0x7fc2
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0x7334
callq 0x57ba
movq 0x18(%r14), %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
movq %rcx, %rax
mulq %rdx
shrq %rdx
leaq (%rdx,%rdx,2), %rax
subq %rax, %rcx
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
movq %rcx, %rdx
movl $0x2, %ecx
callq 0x7860
movq -0x40(%rbp), %rbx
movq -0x38(%rbp), %r15
xorpd %xmm0, %xmm0
movapd %xmm0, -0x40(%rbp)
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x7385
callq 0x57ba
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq %rbx, -0xa0(%rbp)
movq %r15, -0x98(%rbp)
testq %r15, %r15
je 0x7606
movq 0xfc1e(%rip), %rax      # 0x16fc8
cmpb $0x0, (%rax)
je 0x7601
incl 0x8(%r15)
jmp 0x7606
lock
incl 0x8(%rax)
leaq -0x90(%rbp), %rsi
movq %rbx, %rdi
callq 0x81e6
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
callq 0x8198
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x73ec
callq 0x57ba
movq 0x18(%r14), %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
movq %rcx, %rax
mulq %rdx
shrq %rdx
leaq (%rdx,%rdx,2), %rax
subq %rax, %rcx
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
movq %rcx, %rdx
movl $0x3, %ecx
callq 0x7860
movq -0x40(%rbp), %rbx
movq -0x38(%rbp), %r15
xorpd %xmm0, %xmm0
movapd %xmm0, -0x40(%rbp)
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x743d
callq 0x57ba
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq %rbx, -0x80(%rbp)
movq %r15, -0x78(%rbp)
testq %r15, %r15
je 0x7627
movq 0xfb6c(%rip), %rax      # 0x16fc8
cmpb $0x0, (%rax)
je 0x7622
incl 0x8(%r15)
jmp 0x7627
lock
incl 0x8(%rax)
movb $0x1, %bl
leaq -0x100(%rbp), %rsi
movq %r12, %rdi
callq 0x7c7c
xorl %ebx, %ebx
leaq -0x60(%rbp), %rdi
movq %r12, %rsi
callq 0x7c2e
movq -0xf8(%rbp), %rdi
testq %rdi, %rdi
je 0x74a2
callq 0x57ba
movq 0x18(%r14), %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
movq %rcx, %rax
mulq %rdx
shrq %rdx
leaq (%rdx,%rdx,2), %rax
subq %rax, %rcx
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
movq %rcx, %rdx
xorl %ecx, %ecx
callq 0x7860
movq -0x40(%rbp), %rbx
movq -0x38(%rbp), %r15
xorpd %xmm0, %xmm0
movapd %xmm0, -0x40(%rbp)
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x74f0
callq 0x57ba
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq %rbx, -0xf0(%rbp)
movq %r15, -0xe8(%rbp)
testq %r15, %r15
je 0x7642
movq 0xfab3(%rip), %rax      # 0x16fc8
cmpb $0x0, (%rax)
je 0x763d
incl 0x8(%r15)
jmp 0x7642
lock
incl 0x8(%rax)
leaq -0xe0(%rbp), %rsi
movq %rbx, %rdi
callq 0x7e46
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
callq 0x7df8
movq -0xd8(%rbp), %rdi
testq %rdi, %rdi
je 0x7557
callq 0x57ba
movq 0x18(%r14), %rcx
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
movq %rcx, %rax
mulq %r12
shrq %rdx
leaq (%rdx,%rdx,2), %rax
subq %rax, %rcx
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
movq %rcx, %rdx
movl $0x1, %ecx
callq 0x7860
movq -0x40(%rbp), %rbx
movq -0x38(%rbp), %r15
xorpd %xmm0, %xmm0
movapd %xmm0, -0x40(%rbp)
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x75a8
callq 0x57ba
movq 0x18(%r14), %rcx
leaq 0x1(%rcx), %rax
mulq %r12
shrq %rdx
leaq (%rdx,%rdx,2), %rax
negq %rax
leaq (%rcx,%rax), %rdx
incq %rdx
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
movl $0x1, %ecx
callq 0x7860
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq %rbx, -0xd0(%rbp)
movq %r15, -0xc8(%rbp)
testq %r15, %r15
je 0x7663
movq 0xf9d2(%rip), %rax      # 0x16fc8
cmpb $0x0, (%rax)
je 0x765e
incl 0x8(%r15)
jmp 0x7663
lock
incl 0x8(%r15)
addq $0x40, %rdi
leaq -0xa0(%rbp), %rsi
callq 0x8fd2
movq -0x98(%rbp), %rdi
jmp 0x76e0
lock
incl 0x8(%r15)
addq $0x40, %rdi
leaq -0x80(%rbp), %rsi
callq 0x8fd2
movq -0x78(%rbp), %rdi
jmp 0x76e0
lock
incl 0x8(%r15)
addq $0x40, %rdi
leaq -0xf0(%rbp), %rsi
callq 0x8fd2
movq -0xe8(%rbp), %rdi
jmp 0x76e0
lock
incl 0x8(%r15)
addq $0x40, %rdi
leaq -0xd0(%rbp), %rsi
callq 0x8fd2
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x7684
callq 0x57ba
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0xc0(%rbp)
movq %rax, -0xb8(%rbp)
testq %rax, %rax
je 0x76bb
movq 0xf91b(%rip), %rcx      # 0x16fc8
cmpb $0x0, (%rcx)
je 0x76b7
incl 0x8(%rax)
jmp 0x76bb
lock
incl 0x8(%rax)
addq $0x40, %rdi
leaq -0xc0(%rbp), %rsi
callq 0x8fd2
movq -0xb8(%rbp), %rdi
testq %rdi, %rdi
je 0x76dc
callq 0x57ba
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x76ea
callq 0x57ba
addq $0x38, %r14
movq %r14, %rdi
movq -0x30(%rbp), %rsi
callq 0xaf00
leaq -0x58(%rbp), %rsi
movq -0x8(%rsi), %rcx
movq %rcx, (%rax)
addq $0x8, %rax
movq %rax, %rdi
callq 0xac46
testq %r15, %r15
je 0x771e
movq %r15, %rdi
callq 0x57ba
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x772c
callq 0x57ba
movq -0x30(%rbp), %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0xb8(%rbp), %rdi
jmp 0x7758
movq %rax, %r14
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x7762
callq 0x57ba
movq -0x38(%rbp), %rdi
jmp 0x778e
movq %rax, %r14
movq -0xe8(%rbp), %rdi
jmp 0x778e
jmp 0x7828
jmp 0x77a5
movq %rax, %r14
movq -0x78(%rbp), %rdi
jmp 0x778e
movq %rax, %r14
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x782b
callq 0x57ba
jmp 0x782b
jmp 0x77a5
jmp 0x77a5
movq %rax, %r14
jmp 0x7801
movq %rax, %r14
movq -0xd8(%rbp), %rdi
jmp 0x77d5
movq %rax, %r14
movq -0x88(%rbp), %rdi
jmp 0x77d5
movq %rax, %r14
movq -0xa8(%rbp), %rdi
jmp 0x77d5
movq %rax, %r14
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x7801
callq 0x57ba
jmp 0x7801
jmp 0x77f1
movq %rax, %r14
movl $0x68, %esi
jmp 0x77f9
jmp 0x77f1
jmp 0x77f1
movq %rax, %r14
movl $0x60, %esi
movq %rbx, %rdi
callq 0x4170
xorl %r15d, %r15d
jmp 0x782b
movq %rax, %r14
movq -0xf8(%rbp), %rdi
testq %rdi, %rdi
je 0x781a
callq 0x57ba
testb %bl, %bl
je 0x7801
movl $0x18, %esi
movq %r12, %rdi
jmp 0x77fc
movq %rax, %r14
testq %r15, %r15
je 0x7838
movq %r15, %rdi
callq 0x57ba
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x7846
callq 0x57ba
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x7858
callq 0x57ba
movq %r14, %rdi
callq 0x4230