// File: Serfati[P]Heroes-of-Might-and-Magic-3/GameUnit.cpp
// Function: GameUnit::save()
void GameUnit::save() {
    string HeroesNames = "";
    for (int i = 0; i < ::numberOfPlayers; ++ i)
        realOrder[i]->save();
    ofstream out;
    out.open("game/Game_Details.txt");
    out << "=[ Heroes Names ]= | TURN | Round# | #OP;" << endl;
    out << currentTurn << " " << ::roundNumber << " " << ::numberOfPlayers << endl;
    out << getTurnOrder();

    for (int i = 0; i < ::numberOfPlayers; ++ i)
        HeroesNames += realOrder[i]->getName() + " ";
    ofstream out2;
    out2.open("game/Real_Order.txt");
    out2 << "=[ Heroes Names ]=;" << endl;
    out2 << HeroesNames;

    out2.close();
    out.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4f0, %rsp            # imm = 0x4F0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x4b8(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x4b0(%rbp)
callq 0x4530
movq -0x4b0(%rbp), %rdx
leaq 0xc633(%rip), %rsi      # 0x1352b
leaq -0x28(%rbp), %rdi
callq 0x4c10
jmp 0x6f03
leaq -0x29(%rbp), %rdi
callq 0x4360
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl 0x15438(%rip), %eax     # 0x1c354
jge 0x6f70
movq -0x4b8(%rbp), %rdi
movslq -0x40(%rbp), %rsi
callq 0x86e0
movq (%rax), %rdi
callq 0x10d20
jmp 0x6f38
jmp 0x6f3a
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x6f13
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x4360
jmp 0x727e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x7275
leaq -0x240(%rbp), %rdi
callq 0x44e0
jmp 0x6f7e
leaq 0xc0e3(%rip), %rsi      # 0x13068
leaq -0x240(%rbp), %rdi
movl $0x10, %edx
callq 0x4050
jmp 0x6f98
leaq 0xc456(%rip), %rsi      # 0x133f5
leaq -0x240(%rbp), %rdi
callq 0x4310
movq %rax, -0x4c0(%rbp)
jmp 0x6fb4
movq -0x4c0(%rbp), %rdi
movq 0x14fee(%rip), %rsi     # 0x1bfb0
callq 0x4340
jmp 0x6fc9
movq -0x4b8(%rbp), %rax
movl 0x30(%rax), %esi
leaq -0x240(%rbp), %rdi
callq 0x4510
movq %rax, -0x4c8(%rbp)
jmp 0x6fe8
movq -0x4c8(%rbp), %rdi
leaq 0xc7b7(%rip), %rsi      # 0x137ad
callq 0x4310
movq %rax, -0x4d0(%rbp)
jmp 0x7004
movq -0x4d0(%rbp), %rdi
movl 0x1533f(%rip), %esi     # 0x1c350
callq 0x4510
movq %rax, -0x4d8(%rbp)
jmp 0x701f
movq -0x4d8(%rbp), %rdi
leaq 0xc780(%rip), %rsi      # 0x137ad
callq 0x4310
movq %rax, -0x4e0(%rbp)
jmp 0x703b
movq -0x4e0(%rbp), %rdi
movl 0x1530c(%rip), %esi     # 0x1c354
callq 0x4510
movq %rax, -0x4e8(%rbp)
jmp 0x7056
movq -0x4e8(%rbp), %rdi
movq 0x14f4c(%rip), %rsi     # 0x1bfb0
callq 0x4340
jmp 0x706b
movq -0x4b8(%rbp), %rsi
leaq -0x260(%rbp), %rdi
callq 0x80e0
jmp 0x7080
leaq -0x240(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x42f0
jmp 0x7095
leaq -0x260(%rbp), %rdi
callq 0x4200
movl $0x0, -0x264(%rbp)
movl -0x264(%rbp), %eax
cmpl 0x1529d(%rip), %eax     # 0x1c354
jge 0x71a0
movq -0x4b8(%rbp), %rdi
movslq -0x264(%rbp), %rsi
callq 0x86e0
movq (%rax), %rsi
leaq -0x2a8(%rbp), %rdi
callq 0xf0c0
jmp 0x70e1
leaq 0xc6c5(%rip), %rdx      # 0x137ad
leaq -0x288(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x8920
jmp 0x70fd
leaq -0x28(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x43f0
jmp 0x710f
leaq -0x288(%rbp), %rdi
callq 0x4200
leaq -0x2a8(%rbp), %rdi
callq 0x4200
movl -0x264(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x264(%rbp)
jmp 0x70ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x7269
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x4200
jmp 0x7269
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x718f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x4200
leaq -0x2a8(%rbp), %rdi
callq 0x4200
jmp 0x7269
leaq -0x4a8(%rbp), %rdi
callq 0x44e0
jmp 0x71ae
leaq 0xbee8(%rip), %rsi      # 0x1309d
leaq -0x4a8(%rbp), %rdi
movl $0x10, %edx
callq 0x4050
jmp 0x71c8
leaq 0xc250(%rip), %rsi      # 0x1341f
leaq -0x4a8(%rbp), %rdi
callq 0x4310
movq %rax, -0x4f0(%rbp)
jmp 0x71e4
movq -0x4f0(%rbp), %rdi
movq 0x14dbe(%rip), %rsi     # 0x1bfb0
callq 0x4340
jmp 0x71f9
leaq -0x4a8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x42f0
jmp 0x720b
leaq -0x4a8(%rbp), %rdi
callq 0x4430
jmp 0x7219
leaq -0x240(%rbp), %rdi
callq 0x4430
jmp 0x7227
leaq -0x4a8(%rbp), %rdi
callq 0x4450
leaq -0x240(%rbp), %rdi
callq 0x4450
leaq -0x28(%rbp), %rdi
callq 0x4200
addq $0x4f0, %rsp            # imm = 0x4F0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x4a8(%rbp), %rdi
callq 0x4450
leaq -0x240(%rbp), %rdi
callq 0x4450
leaq -0x28(%rbp), %rdi
callq 0x4200
movq -0x38(%rbp), %rdi
callq 0x4520
nopw (%rax,%rax)