// File: 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
subq $0x360, %rsp            # imm = 0x360
movq %rsi, -0x2f8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x2f0(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0x2e8(%rbp)
callq 0x4150
movq -0x2f0(%rbp), %rdi
movq -0x2e8(%rbp), %rsi
callq 0xf060
jmp 0x1122a
leaq -0x38(%rbp), %rdi
callq 0x4200
movq -0x2f8(%rbp), %rdx
leaq 0x24f0(%rip), %rsi      # 0x13731
leaq -0x88(%rbp), %rdi
movq %rdi, -0x300(%rbp)
callq 0x11990
movq -0x300(%rbp), %rsi
leaq 0x23ae(%rip), %rdx      # 0x13610
leaq -0x68(%rbp), %rdi
callq 0x8920
jmp 0x1126d
leaq -0x88(%rbp), %rdi
callq 0x4200
leaq -0x290(%rbp), %rdi
callq 0x4390
jmp 0x11287
leaq -0x290(%rbp), %rdi
leaq -0x68(%rbp), %rsi
movl $0x8, %edx
callq 0x42c0
jmp 0x1129e
movq -0x290(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x290(%rbp,%rax), %rdi
callq 0x4180
movb %al, -0x301(%rbp)
jmp 0x112be
movb -0x301(%rbp), %al
testb $0x1, %al
jne 0x112cd
jmp 0x1136a
movq 0xacec(%rip), %rdi      # 0x1bfc0
leaq 0x2403(%rip), %rsi      # 0x136de
callq 0x4310
movq %rax, -0x310(%rbp)
jmp 0x112e9
movq -0x310(%rbp), %rdi
movq 0xacb9(%rip), %rsi      # 0x1bfb0
callq 0x4340
jmp 0x112fe
movb $0x0, -0x1(%rbp)
movl $0x1, -0x294(%rbp)
jmp 0x11569
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x4200
jmp 0x115a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x4200
jmp 0x115a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x11598
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1158c
leaq -0x2b8(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x4420
movq -0x318(%rbp), %rsi
leaq -0x290(%rbp), %rdi
movl $0x3b, %edx
callq 0x4570
jmp 0x11397
leaq -0x290(%rbp), %rdi
leaq -0x2d9(%rbp), %rsi
callq 0x42d0
movq %rax, -0x320(%rbp)
jmp 0x113b3
movq -0x320(%rbp), %rdi
leaq -0x2bc(%rbp), %rsi
callq 0x41f0
movq %rax, -0x328(%rbp)
jmp 0x113cf
movq -0x328(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x41f0
movq %rax, -0x330(%rbp)
jmp 0x113eb
movq -0x330(%rbp), %rdi
leaq -0x2c4(%rbp), %rsi
callq 0x41f0
movq %rax, -0x338(%rbp)
jmp 0x11407
movq -0x338(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x41f0
movq %rax, -0x340(%rbp)
jmp 0x11423
movq -0x340(%rbp), %rdi
leaq -0x2cc(%rbp), %rsi
callq 0x41f0
movq %rax, -0x348(%rbp)
jmp 0x1143f
movq -0x348(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x41f0
movq %rax, -0x350(%rbp)
jmp 0x1145b
movq -0x350(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0x4290
movq %rax, -0x358(%rbp)
jmp 0x11477
movq -0x358(%rbp), %rdi
leaq -0x2da(%rbp), %rsi
callq 0x42d0
movq %rax, -0x360(%rbp)
jmp 0x11493
movq -0x360(%rbp), %rdi
leaq -0x2db(%rbp), %rsi
callq 0x42d0
jmp 0x114a8
movq -0x2f0(%rbp), %rax
movq 0x40(%rax), %rdi
movl -0x2bc(%rbp), %esi
movl -0x2c0(%rbp), %edx
movl -0x2c4(%rbp), %ecx
movl -0x2c8(%rbp), %r8d
movl -0x2cc(%rbp), %r9d
callq 0xc650
jmp 0x114da
movq -0x2f0(%rbp), %rdi
movb -0x2d9(%rbp), %al
andb $0x1, %al
movb %al, 0x3a(%rdi)
movb -0x2da(%rbp), %al
andb $0x1, %al
movb %al, 0x38(%rdi)
movb -0x2db(%rbp), %al
andb $0x1, %al
movb %al, 0x39(%rdi)
movsd -0x2d8(%rbp), %xmm0
callq 0xf8a0
jmp 0x11511
movq -0x2f0(%rbp), %rdi
movl -0x2d0(%rbp), %esi
callq 0xf830
jmp 0x11525
leaq -0x290(%rbp), %rdi
callq 0x4090
jmp 0x11533
movb $0x1, -0x1(%rbp)
movl $0x1, -0x294(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0x4200
jmp 0x11569
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0x4200
jmp 0x1158c
leaq -0x290(%rbp), %rdi
callq 0x40c0
leaq -0x68(%rbp), %rdi
callq 0x4200
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x360, %rsp            # imm = 0x360
popq %rbp
retq
leaq -0x290(%rbp), %rdi
callq 0x40c0
leaq -0x68(%rbp), %rdi
callq 0x4200
movq -0x40(%rbp), %rdi
callq 0x4520
nopw (%rax,%rax)