// File: /workspace/github_cpp_makefile_star2_O3/Serfati[P]Heroes-of-Might-and-Magic-3/GameUnit.cpp
// Function: GameUnit::GameUnit()
GameUnit::GameUnit() {
    // First Level
    const char *path = "game/Game_Details.txt";
    ifstream in;
    in.open(path);
    if ( ! in )
        cout << "GD: Error reading from file..." << endl;
    string cleanHeader;
    getline(in,cleanHeader,';');
    in >> GameUnit::currentTurn >> ::roundNumber >> ::numberOfPlayers;
    in.close();

    // Second Level
    path = "game/Real_Order.txt";
    ifstream ina;
    vector<string> HeroesNames;
    ina.open(path);
    if ( ! ina )
        cout << "RO: Error reading from file..." << endl;
    getline(ina,cleanHeader,';');
    string word;
    while ( ina >> word )
        HeroesNames.push_back(word);
    ina.close();
    load(HeroesNames);
    turnOrder = realOrder;
    shuffle();
    mainMenu(turnOrder[currentTurn]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x498, %rsp            # imm = 0x498
movq %rdi, %rbx
leaq 0x18(%rdi), %rax
movq %rax, -0x30(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
leaq -0x4b8(%rbp), %rdi
callq 0x32c0
leaq 0x75d8(%rip), %rsi      # 0xb068
leaq -0x4b8(%rbp), %rdi
movl $0x8, %edx
callq 0x3190
movq -0x4b8(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x498(%rbp,%rax)
je 0x3afc
movq 0xc503(%rip), %r15      # 0xffc0
leaq 0x75ba(%rip), %rsi      # 0xb07e
movl $0x1e, %edx
movq %r15, %rdi
callq 0x32d0
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq 0xc4d1(%rip), %rdi      # 0xffc0
callq 0x3030
movq %rax, %rdi
callq 0x31b0
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x4b8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x3b, %edx
callq 0x3450
leaq 0x30(%rbx), %rsi
leaq -0x4b8(%rbp), %rdi
callq 0x3180
leaq 0xc75d(%rip), %rsi      # 0x10298
movq %rax, %rdi
callq 0x3180
leaq 0xc752(%rip), %rsi      # 0x1029c
movq %rax, %rdi
callq 0x3180
leaq -0x4b8(%rbp), %rdi
callq 0x3070
leaq -0x2b0(%rbp), %rdi
callq 0x32c0
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
movq $0x0, -0x60(%rbp)
leaq 0x751d(%rip), %rsi      # 0xb09d
leaq -0x2b0(%rbp), %rdi
movl $0x8, %edx
callq 0x3190
movq -0x2b0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x290(%rbp,%rax)
je 0x3bec
movq 0xc413(%rip), %r15      # 0xffc0
leaq 0x7b74(%rip), %rsi      # 0xb728
movl $0x1e, %edx
movq %r15, %rdi
callq 0x32d0
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq 0xc3e1(%rip), %rdi      # 0xffc0
callq 0x3030
movq %rax, %rdi
callq 0x31b0
leaq -0x2b0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x3b, %edx
callq 0x3450
leaq -0x80(%rbp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
leaq -0x2b0(%rbp), %r15
leaq -0x90(%rbp), %r12
leaq -0x70(%rbp), %r13
movq %r15, %rdi
movq %r12, %rsi
callq 0x3300
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3c4d
movq %r13, %rdi
movq %r12, %rsi
callq 0x65fc
jmp 0x3c27
leaq -0x2b0(%rbp), %rdi
callq 0x3070
leaq -0xa8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x6648
leaq -0xa8(%rbp), %rsi
movq %rbx, %rdi
callq 0x3dc2
leaq -0xa8(%rbp), %rdi
callq 0x66dc
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x674a
movq %rbx, %rdi
callq 0x4234
movslq 0x30(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x42ae
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x3cc4
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x3290
leaq -0x70(%rbp), %rdi
callq 0x66dc
leaq -0x2b0(%rbp), %rdi
callq 0x3080
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3cf2
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x3290
leaq -0x4b8(%rbp), %rdi
callq 0x3080
addq $0x498, %rsp            # imm = 0x498
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
leaq -0xa8(%rbp), %rdi
callq 0x66dc
jmp 0x3d3c
jmp 0x3d34
movq %rax, %r15
jmp 0x3d8e
movq %rax, %r15
jmp 0x3d82
jmp 0x3d39
movq %rax, %r15
jmp 0x3d54
movq %rax, %r15
jmp 0x3d69
movq %rax, %r15
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x3d54
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x3290
leaq -0x70(%rbp), %rdi
callq 0x66dc
leaq -0x2b0(%rbp), %rdi
callq 0x3080
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3d82
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x3290
leaq -0x4b8(%rbp), %rdi
callq 0x3080
movq -0x30(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x3da6
movq 0x28(%rbx), %rsi
subq %rdi, %rsi
callq 0x3290
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3dba
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x3290
movq %r15, %rdi
callq 0x3420