// File: /workspace/github_cpp_makefile_star2_O2/Serfati[P]Heroes-of-Might-and-Magic-3/GameUnit.cpp
// Function: GameUnit::load(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>)
void GameUnit::load(vector<string> _heroes) {
    for (std::string i : _heroes) {
        Hero s;
        Warrior *s1;
        Thief *s2;
        Necromancer *s3;
        switch ( s.typeFromFile(i)) {
            case 0:
                s1 = new(nothrow) Warrior();
                if ( nullptr == s1 ) cout << "Error: memory could not be allocated" << endl;
                s1->load(i);
                realOrder.push_back(s1);
                break;
            case 1:
                s2 = new(nothrow) Thief();
                if ( nullptr == s2 ) cout << "Error: memory could not be allocated" << endl;
                s2->load(i);
                realOrder.push_back(s2);
                break;
            case 2:
                s3 = new(nothrow) Necromancer();
                if ( nullptr == s3 ) cout << "Error: memory could not be allocated" << endl;
                s3->load(i);
                realOrder.push_back(s3);
                break;
            default:
                cout << "Load failed!";
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, -0x38(%rbp)
movq (%rsi), %rcx
movq 0x8(%rsi), %rax
movq %rax, -0x40(%rbp)
leaq -0xe8(%rbp), %rbx
leaq -0xc8(%rbp), %r15
leaq -0xa8(%rbp), %r13
cmpq -0x40(%rbp), %rcx
je 0x3eaa
movq %rbx, %rdi
movq %rcx, -0x48(%rbp)
movq %rcx, %rsi
callq 0x32f0
leaq -0x130(%rbp), %rdi
callq 0x70e6
movq %r15, %rdi
movq %rbx, %r14
movq %rbx, %rsi
callq 0x32f0
leaq -0x130(%rbp), %rdi
movq %r15, %r12
movq %r15, %rsi
callq 0x8092
movl %eax, %ebx
movq %r12, %rdi
callq 0x3130
testl %ebx, %ebx
je 0x3d52
cmpl $0x1, %ebx
je 0x3d31
cmpl $0x2, %ebx
jne 0x3d76
pushq $0x48
popq %rdi
movq 0xa295(%rip), %rsi      # 0xdfa8
callq 0x3470
movq %rax, %rbx
testq %rax, %rax
je 0x3e37
movq %rbx, %rdi
callq 0x5978
jmp 0x3e52
pushq $0x48
popq %rdi
movq 0xa26d(%rip), %rsi      # 0xdfa8
callq 0x3470
movq %rax, %rbx
testq %rax, %rax
je 0x3d8e
movq %rbx, %rdi
callq 0x5938
jmp 0x3da9
pushq $0x48
popq %rdi
movq 0xa24c(%rip), %rsi      # 0xdfa8
callq 0x3470
movq %rax, %rbx
testq %rax, %rax
je 0x3de8
movq %rbx, %rdi
callq 0x8a8c
jmp 0x3e03
movq 0xa243(%rip), %rdi      # 0xdfc0
leaq 0x56d4(%rip), %rsi      # 0x9458
callq 0x3270
jmp 0x3e86
movq 0xa22b(%rip), %rdi      # 0xdfc0
leaq 0x5697(%rip), %rsi      # 0x9433
callq 0x3270
movq %rax, %rdi
callq 0x3150
leaq -0x88(%rbp), %rdi
movq %r14, %rsi
callq 0x32f0
movq %rbx, %rdi
leaq -0x88(%rbp), %r12
movq %r12, %rsi
callq 0x7e1e
movq %r12, %rdi
callq 0x3130
movq %rbx, -0x30(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x5dfa
jmp 0x3e86
movq 0xa1d1(%rip), %rdi      # 0xdfc0
leaq 0x563d(%rip), %rsi      # 0x9433
callq 0x3270
movq %rax, %rdi
callq 0x3150
movq %r13, %rdi
movq %r14, %rsi
callq 0x32f0
movq %rbx, %rdi
movq %r13, %r12
movq %r13, %rsi
callq 0x7e1e
movq %r12, %rdi
callq 0x3130
movq %rbx, -0x30(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x5dfa
jmp 0x3e86
movq 0xa182(%rip), %rdi      # 0xdfc0
leaq 0x55ee(%rip), %rsi      # 0x9433
callq 0x3270
movq %rax, %rdi
callq 0x3150
leaq -0x68(%rbp), %rdi
movq %r14, %rsi
callq 0x32f0
movq %rbx, %rdi
leaq -0x68(%rbp), %r12
movq %r12, %rsi
callq 0x7e1e
movq %r12, %rdi
callq 0x3130
movq %rbx, -0x30(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x5dfa
leaq -0x130(%rbp), %rdi
callq 0x5866
movq %r14, %rbx
movq %r14, %rdi
callq 0x3130
movq -0x48(%rbp), %rcx
addq $0x20, %rcx
jmp 0x3cac
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3ec0
jmp 0x3ec0
movq %rax, %r14
movq 0xa0de(%rip), %rsi      # 0xdfa8
movq %rbx, %rdi
callq 0x3190
jmp 0x3f14
jmp 0x3f11
movq %rax, %r14
leaq -0x88(%rbp), %rdi
jmp 0x3f0a
jmp 0x3f11
movq %rax, %r14
leaq -0x68(%rbp), %rdi
jmp 0x3f0a
jmp 0x3f11
movq %rax, %r14
leaq -0xa8(%rbp), %rdi
jmp 0x3f0a
movq %rax, %r14
jmp 0x3f20
movq %rax, %r14
leaq -0xc8(%rbp), %rdi
callq 0x3130
jmp 0x3f14
movq %rax, %r14
leaq -0x130(%rbp), %rdi
callq 0x5866
leaq -0xe8(%rbp), %rdi
callq 0x3130
movq %r14, %rdi
callq 0x33f0