// File: 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
subq $0x500, %rsp            # imm = 0x500
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x4b0(%rbp)
movq %rdi, %rax
movq %rax, -0x4b8(%rbp)
callq 0x8290
movq -0x4b0(%rbp), %rdi
addq $0x18, %rdi
movq %rdi, -0x4a8(%rbp)
callq 0x8290
leaq 0xe0c1(%rip), %rax      # 0x13068
movq %rax, -0x10(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x4390
jmp 0x4fb9
movq -0x10(%rbp), %rsi
leaq -0x218(%rbp), %rdi
movl $0x8, %edx
callq 0x4210
jmp 0x4fd0
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x218(%rbp,%rax), %rdi
callq 0x4180
movb %al, -0x4b9(%rbp)
jmp 0x4ff0
movb -0x4b9(%rbp), %al
testb $0x1, %al
jne 0x4ffc
jmp 0x505d
movq 0x16fbd(%rip), %rdi     # 0x1bfc0
leaq 0xe074(%rip), %rsi      # 0x1307e
callq 0x4310
movq %rax, -0x4c8(%rbp)
jmp 0x5018
movq -0x4c8(%rbp), %rdi
movq 0x16f8a(%rip), %rsi     # 0x1bfb0
callq 0x4340
jmp 0x502d
jmp 0x505d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x537a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x536e
leaq -0x248(%rbp), %rdi
movq %rdi, -0x4d0(%rbp)
callq 0x4420
movq -0x4d0(%rbp), %rsi
leaq -0x218(%rbp), %rdi
movl $0x3b, %edx
callq 0x4570
jmp 0x508a
movq -0x4b8(%rbp), %rsi
addq $0x30, %rsi
leaq -0x218(%rbp), %rdi
callq 0x41f0
movq %rax, -0x4d8(%rbp)
jmp 0x50aa
movq -0x4d8(%rbp), %rdi
leaq 0x17298(%rip), %rsi     # 0x1c350
callq 0x41f0
movq %rax, -0x4e0(%rbp)
jmp 0x50c6
movq -0x4e0(%rbp), %rdi
leaq 0x17280(%rip), %rsi     # 0x1c354
callq 0x41f0
jmp 0x50db
leaq -0x218(%rbp), %rdi
callq 0x4090
jmp 0x50e9
leaq 0xdfad(%rip), %rax      # 0x1309d
movq %rax, -0x10(%rbp)
leaq -0x450(%rbp), %rdi
callq 0x4390
jmp 0x5102
leaq -0x468(%rbp), %rdi
callq 0x82b0
movq -0x10(%rbp), %rsi
leaq -0x450(%rbp), %rdi
movl $0x8, %edx
callq 0x4210
jmp 0x5125
movq -0x450(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x450(%rbp,%rax), %rdi
callq 0x4180
movb %al, -0x4e1(%rbp)
jmp 0x5145
movb -0x4e1(%rbp), %al
testb $0x1, %al
jne 0x5151
jmp 0x51b2
movq 0x16e68(%rip), %rdi     # 0x1bfc0
leaq 0xe581(%rip), %rsi      # 0x136e0
callq 0x4310
movq %rax, -0x4f0(%rbp)
jmp 0x516d
movq -0x4f0(%rbp), %rdi
movq 0x16e35(%rip), %rsi     # 0x1bfb0
callq 0x4340
jmp 0x5182
jmp 0x51b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x5362
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x534a
leaq -0x450(%rbp), %rdi
leaq -0x248(%rbp), %rsi
movl $0x3b, %edx
callq 0x4570
jmp 0x51cc
leaq -0x488(%rbp), %rdi
callq 0x4420
leaq -0x450(%rbp), %rdi
leaq -0x488(%rbp), %rsi
callq 0x43e0
movq %rax, -0x4f8(%rbp)
jmp 0x51f4
movq -0x4f8(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x43d0
movb %al, -0x4f9(%rbp)
jmp 0x5212
movb -0x4f9(%rbp), %al
testb $0x1, %al
jne 0x521e
jmp 0x524c
leaq -0x468(%rbp), %rdi
leaq -0x488(%rbp), %rsi
callq 0x82d0
jmp 0x5233
jmp 0x51d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x533e
leaq -0x450(%rbp), %rdi
callq 0x4090
jmp 0x525a
leaq -0x4a0(%rbp), %rdi
leaq -0x468(%rbp), %rsi
callq 0x8340
jmp 0x526f
movq -0x4b8(%rbp), %rdi
leaq -0x4a0(%rbp), %rsi
callq 0x53a0
jmp 0x5284
leaq -0x4a0(%rbp), %rdi
callq 0x8430
movq -0x4b8(%rbp), %rsi
movq %rsi, %rdi
addq $0x18, %rdi
callq 0x8490
jmp 0x52a5
movq -0x4b8(%rbp), %rdi
callq 0x5970
jmp 0x52b3
movq -0x4b8(%rbp), %rax
movq %rax, %rdi
addq $0x18, %rdi
movslq 0x30(%rax), %rsi
callq 0x86e0
movq -0x4b8(%rbp), %rdi
movq (%rax), %rsi
callq 0x59c0
jmp 0x52db
leaq -0x488(%rbp), %rdi
callq 0x4200
leaq -0x468(%rbp), %rdi
callq 0x8430
leaq -0x450(%rbp), %rdi
callq 0x40c0
leaq -0x248(%rbp), %rdi
callq 0x4200
leaq -0x218(%rbp), %rdi
callq 0x40c0
addq $0x500, %rsp            # imm = 0x500
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x4a0(%rbp), %rdi
callq 0x8430
leaq -0x488(%rbp), %rdi
callq 0x4200
leaq -0x468(%rbp), %rdi
callq 0x8430
leaq -0x450(%rbp), %rdi
callq 0x40c0
leaq -0x248(%rbp), %rdi
callq 0x4200
leaq -0x218(%rbp), %rdi
callq 0x40c0
movq -0x4a8(%rbp), %rdi
callq 0x8700
movq -0x4b0(%rbp), %rdi
callq 0x8700
movq -0x220(%rbp), %rdi
callq 0x4520
nop