// File: /workspace/github_cpp_makefile_star2_O1/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 0x75dc(%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 0x3af8
movq 0xc507(%rip), %r15      # 0xffc0
leaq 0x75be(%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 0xc4d5(%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 0xc761(%rip), %rsi      # 0x10298
movq %rax, %rdi
callq 0x3180
leaq 0xc756(%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 0x7521(%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 0x3be8
movq 0xc417(%rip), %r15      # 0xffc0
leaq 0x7b98(%rip), %rsi      # 0xb748
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 0xc3e5(%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 0x3c49
movq %r13, %rdi
movq %r12, %rsi
callq 0x6618
jmp 0x3c23
leaq -0x2b0(%rbp), %rdi
callq 0x3070
leaq -0xa8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x6664
leaq -0xa8(%rbp), %rsi
movq %rbx, %rdi
callq 0x3dbe
leaq -0xa8(%rbp), %rdi
callq 0x66f8
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x6762
movq %rbx, %rdi
callq 0x4246
movslq 0x30(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x42c0
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x3cc0
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x3290
leaq -0x70(%rbp), %rdi
callq 0x66f8
leaq -0x2b0(%rbp), %rdi
callq 0x3080
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3cee
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 0x66f8
jmp 0x3d38
jmp 0x3d30
movq %rax, %r15
jmp 0x3d8a
movq %rax, %r15
jmp 0x3d7e
jmp 0x3d35
movq %rax, %r15
jmp 0x3d50
movq %rax, %r15
jmp 0x3d65
movq %rax, %r15
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x3d50
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x3290
leaq -0x70(%rbp), %rdi
callq 0x66f8
leaq -0x2b0(%rbp), %rdi
callq 0x3080
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3d7e
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 0x3da2
movq 0x28(%rbx), %rsi
subq %rdi, %rsi
callq 0x3290
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3db6
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x3290
movq %r15, %rdi
callq 0x3420