// File: /workspace/github_cpp_makefile_star2_O3/Serfati[P]Heroes-of-Might-and-Magic-3/Hero.cpp
// Function: Hero::typeFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int Hero::typeFromFile(string heroName) {
    string path = "Heros/" + heroName + "/Details.txt";
    ifstream in;
    in.open(path);
    if ( ! in ) {
        cout << "HERO: Error reading from file..." << endl;
        return -1;
    }
    string cleanHeader;
    getline(in,cleanHeader,';');
    int  type;
    //Hero @param
    int bd,wz,arc,vmp,zmb;
    double _gold;
    bool _is;
    in >> _is >> bd >> wz >> arc >> vmp >> zmb >> type >> _gold;
    in.close();

    return type;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rsi, %rdx
leaq 0x1bb5(%rip), %rsi      # 0xb779
leaq -0x288(%rbp), %rbx
movq %rbx, %rdi
callq 0x9e14
leaq 0x1a7e(%rip), %rsi      # 0xb658
movq %rbx, %rdi
callq 0x3470
leaq -0x30(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9c06
movq %rdx, -0x40(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x30(%rbp)
jmp 0x9c0d
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, -0x38(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x278(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9c43
movq -0x278(%rbp), %rsi
incq %rsi
callq 0x3290
leaq -0x288(%rbp), %rdi
callq 0x32c0
leaq -0x288(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movl $0x8, %edx
callq 0x3240
movq -0x288(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x268(%rbp,%rax)
je 0x9cc9
movq 0x6340(%rip), %rbx      # 0xffc0
leaq 0x1a9f(%rip), %rsi      # 0xb726
movl $0x20, %edx
movq %rbx, %rdi
callq 0x32d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq 0x630e(%rip), %rdi      # 0xffc0
callq 0x3030
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %rax, %rdi
callq 0x31b0
jmp 0x9d7a
leaq -0x68(%rbp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq -0x288(%rbp), %rdi
leaq -0x78(%rbp), %rsi
movl $0x3b, %edx
callq 0x3450
leaq -0x288(%rbp), %rdi
leaq -0x19(%rbp), %rsi
callq 0x3230
leaq -0x54(%rbp), %rsi
movq %rax, %rdi
callq 0x3180
leaq -0x50(%rbp), %rsi
movq %rax, %rdi
callq 0x3180
leaq -0x4c(%rbp), %rsi
movq %rax, %rdi
callq 0x3180
leaq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x3180
leaq -0x44(%rbp), %rsi
movq %rax, %rdi
callq 0x3180
leaq -0x20(%rbp), %rsi
movq %rax, %rdi
callq 0x3180
leaq -0x80(%rbp), %rsi
movq %rax, %rdi
callq 0x31a0
leaq -0x288(%rbp), %rdi
callq 0x3070
movl -0x20(%rbp), %ebx
movq -0x78(%rbp), %rdi
cmpq %r15, %rdi
je 0x9d7a
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3290
leaq -0x288(%rbp), %rdi
callq 0x3080
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0x9d9b
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3290
movl %ebx, %eax
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9dce
movq %rax, %rbx
jmp 0x9df7
movq %rax, %rbx
leaq -0x278(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9e0c
movq -0x278(%rbp), %rsi
jmp 0x9e04
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r15, %rdi
je 0x9deb
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3290
jmp 0x9deb
movq %rax, %rbx
leaq -0x288(%rbp), %rdi
callq 0x3080
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0x9e0c
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3290
movq %rbx, %rdi
callq 0x3420