// File: /workspace/github_cpp_makefile_star2_O3/Serfati[P]Heroes-of-Might-and-Magic-3/Hero.cpp
// Function: Hero::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool Hero::load(string newName) {
    setName(newName);
    string path = "Heros/" + newName + "/Details.txt";
    ifstream in;
    in.open(path);
    if ( ! in ) {
        cout << "HERO: Error reading from file..." << endl;
        return 0;
    }
    string cleanHeader;
    getline(in,cleanHeader,';');

    //Hero @param
    int bd,wz,arc,vmp,zmb,_type;
    double _gold;
    bool _is,_DG,_SA;
    in >> _is >> bd >> wz >> arc >> vmp >> zmb >> _type >> _gold >> _DG >> _SA;

    army->buildArmy(bd,wz,arc,vmp,zmb);
    this->isAlive = _is;
    this->gotDG = _DG;
    this->usedSA = _SA;
    setGold(_gold);
    setType(_type);
    in.close();
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x290, %rsp            # imm = 0x290
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x98(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %r15
movq %r15, %rdi
callq 0x6930
leaq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x3160
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0x9892
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x3290
leaq 0x1ee0(%rip), %rsi      # 0xb779
leaq -0x2b0(%rbp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x9e14
leaq 0x1da6(%rip), %rsi      # 0xb658
movq %r15, %rdi
callq 0x3470
leaq -0x50(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x98de
movq %rdx, -0x60(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x50(%rbp)
jmp 0x98e7
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, -0x58(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x2a0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x991d
movq -0x2a0(%rbp), %rsi
incq %rsi
callq 0x3290
leaq -0x2b0(%rbp), %rdi
callq 0x32c0
leaq -0x2b0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x8, %edx
callq 0x3240
movq -0x2b0(%rbp), %rax
movq -0x18(%rax), %rax
movl -0x290(%rbp,%rax), %r15d
testb $0x5, %r15b
je 0x99a2
movq 0x6662(%rip), %rbx      # 0xffc0
leaq 0x1dc1(%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 0x6630(%rip), %rdi      # 0xffc0
callq 0x3030
movq %rax, %rdi
callq 0x31b0
jmp 0x9ad1
leaq -0x78(%rbp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq -0x2b0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movl $0x3b, %edx
callq 0x3450
leaq -0x2b0(%rbp), %rdi
leaq -0x23(%rbp), %rsi
callq 0x3230
leaq -0x3c(%rbp), %rsi
movq %rax, %rdi
callq 0x3180
leaq -0x38(%rbp), %rsi
movq %rax, %rdi
callq 0x3180
leaq -0x34(%rbp), %rsi
movq %rax, %rdi
callq 0x3180
leaq -0x30(%rbp), %rsi
movq %rax, %rdi
callq 0x3180
leaq -0x2c(%rbp), %rsi
movq %rax, %rdi
callq 0x3180
leaq -0x28(%rbp), %rsi
movq %rax, %rdi
callq 0x3180
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x31a0
leaq -0x22(%rbp), %rsi
movq %rax, %rdi
callq 0x3230
leaq -0x21(%rbp), %rsi
movq %rax, %rdi
callq 0x3230
movq 0x40(%rbx), %rdi
movl -0x3c(%rbp), %esi
movl -0x38(%rbp), %edx
movl -0x34(%rbp), %ecx
movl -0x30(%rbp), %r8d
movl -0x2c(%rbp), %r9d
callq 0x7760
movb -0x23(%rbp), %al
movb %al, 0x3a(%rbx)
movb -0x22(%rbp), %al
movb %al, 0x38(%rbx)
movb -0x21(%rbp), %al
movb %al, 0x39(%rbx)
movsd -0x68(%rbp), %xmm0
movsd 0x1bca(%rip), %xmm1     # 0xb650
minsd %xmm0, %xmm1
xorpd %xmm2, %xmm2
cmpltsd %xmm2, %xmm0
andnpd %xmm1, %xmm0
movlpd %xmm0, 0x30(%rbx)
movl -0x28(%rbp), %eax
cmpl $0x3, %eax
movl $0x3, %ecx
cmovbl %eax, %ecx
movl %ecx, 0x28(%rbx)
leaq -0x2b0(%rbp), %rdi
callq 0x3070
movq -0x88(%rbp), %rdi
cmpq %r12, %rdi
je 0x9ad1
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3290
leaq -0x2b0(%rbp), %rdi
callq 0x3080
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x9af2
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x3290
testb $0x5, %r15b
sete %al
addq $0x290, %rsp            # imm = 0x290
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9b49
movq %rax, %rbx
jmp 0x9b70
movq %rax, %rbx
leaq -0x2a0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9b85
movq -0x2a0(%rbp), %rsi
jmp 0x9b7d
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0x9b85
movq -0x98(%rbp), %rsi
jmp 0x9b7d
movq %rax, %rbx
jmp 0x9b64
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r12, %rdi
je 0x9b64
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3290
leaq -0x2b0(%rbp), %rdi
callq 0x3080
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x9b85
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x3290
movq %rbx, %rdi
callq 0x3420
nop