// File: 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
subq $0x320, %rsp            # imm = 0x320
movq %rsi, %rdx
movq %rdi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq 0x2134(%rip), %rsi      # 0x13731
leaq -0x58(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
callq 0x11990
movq -0x2c8(%rbp), %rsi
leaq 0x1ff5(%rip), %rdx      # 0x13610
leaq -0x38(%rbp), %rdi
callq 0x8920
jmp 0x11626
leaq -0x58(%rbp), %rdi
callq 0x4200
leaq -0x270(%rbp), %rdi
callq 0x4390
jmp 0x1163d
leaq -0x270(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movl $0x8, %edx
callq 0x42c0
jmp 0x11654
movq -0x270(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x270(%rbp,%rax), %rdi
callq 0x4180
movb %al, -0x2c9(%rbp)
jmp 0x11674
movb -0x2c9(%rbp), %al
testb $0x1, %al
jne 0x11683
jmp 0x11706
movq 0xa936(%rip), %rdi      # 0x1bfc0
leaq 0x204d(%rip), %rsi      # 0x136de
callq 0x4310
movq %rax, -0x2d8(%rbp)
jmp 0x1169f
movq -0x2d8(%rbp), %rdi
movq 0xa903(%rip), %rsi      # 0x1bfb0
callq 0x4340
jmp 0x116b4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x274(%rbp)
jmp 0x11855
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x4200
jmp 0x1188b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x11882
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x11876
leaq -0x298(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x4420
movq -0x2e0(%rbp), %rsi
leaq -0x270(%rbp), %rdi
movl $0x3b, %edx
callq 0x4570
jmp 0x11733
leaq -0x270(%rbp), %rdi
leaq -0x2b9(%rbp), %rsi
callq 0x42d0
movq %rax, -0x2e8(%rbp)
jmp 0x1174f
movq -0x2e8(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x41f0
movq %rax, -0x2f0(%rbp)
jmp 0x1176b
movq -0x2f0(%rbp), %rdi
leaq -0x2a4(%rbp), %rsi
callq 0x41f0
movq %rax, -0x2f8(%rbp)
jmp 0x11787
movq -0x2f8(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x41f0
movq %rax, -0x300(%rbp)
jmp 0x117a3
movq -0x300(%rbp), %rdi
leaq -0x2ac(%rbp), %rsi
callq 0x41f0
movq %rax, -0x308(%rbp)
jmp 0x117bf
movq -0x308(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x41f0
movq %rax, -0x310(%rbp)
jmp 0x117db
movq -0x310(%rbp), %rdi
leaq -0x29c(%rbp), %rsi
callq 0x41f0
movq %rax, -0x318(%rbp)
jmp 0x117f7
movq -0x318(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
callq 0x4290
jmp 0x1180c
leaq -0x270(%rbp), %rdi
callq 0x4090
jmp 0x1181a
movl -0x29c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x274(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x4200
jmp 0x11855
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x4200
jmp 0x11876
leaq -0x270(%rbp), %rdi
callq 0x40c0
leaq -0x38(%rbp), %rdi
callq 0x4200
movl -0x4(%rbp), %eax
addq $0x320, %rsp            # imm = 0x320
popq %rbp
retq
leaq -0x270(%rbp), %rdi
callq 0x40c0
leaq -0x38(%rbp), %rdi
callq 0x4200
movq -0x60(%rbp), %rdi
callq 0x4520
nopw %cs:(%rax,%rax)
nop