// File: /workspace/github_cpp_makefile_star2_O1/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 0x1b9d(%rip), %rsi      # 0xb799
leaq -0x288(%rbp), %rbx
movq %rbx, %rdi
callq 0x9e4c
leaq 0x1a66(%rip), %rsi      # 0xb678
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 0x9c3e
movq %rdx, -0x40(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x30(%rbp)
jmp 0x9c45
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 0x9c7b
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 0x9d01
movq 0x6308(%rip), %rbx      # 0xffc0
leaq 0x1a87(%rip), %rsi      # 0xb746
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 0x62d6(%rip), %rdi      # 0xffc0
callq 0x3030
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %rax, %rdi
callq 0x31b0
jmp 0x9db2
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 0x9db2
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3290
leaq -0x288(%rbp), %rdi
callq 0x3080
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0x9dd3
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 0x9e06
movq %rax, %rbx
jmp 0x9e2f
movq %rax, %rbx
leaq -0x278(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9e44
movq -0x278(%rbp), %rsi
jmp 0x9e3c
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r15, %rdi
je 0x9e23
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3290
jmp 0x9e23
movq %rax, %rbx
leaq -0x288(%rbp), %rdi
callq 0x3080
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0x9e44
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3290
movq %rbx, %rdi
callq 0x3420