// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
movq %rdi, %rbx
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x6047(%rip), %rdx      # 0xb52b
leaq -0x48(%rbp), %rdi
movq %rdx, %rsi
callq 0x39b0
cmpl $0x0, 0xada5(%rip)      # 0x1029c
jle 0x5517
xorl %r14d, %r14d
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x9380
incq %r14
movslq 0xad8a(%rip), %rax      # 0x1029c
cmpq %rax, %r14
jl 0x54fc
leaq -0x468(%rbp), %rdi
callq 0x33f0
leaq 0x5b3e(%rip), %rsi      # 0xb068
leaq -0x468(%rbp), %rdi
movl $0x10, %edx
callq 0x3050
leaq 0x5eb3(%rip), %rsi      # 0xb3f5
leaq -0x468(%rbp), %r14
movl $0x29, %edx
movq %r14, %rdi
callq 0x32d0
movq -0x468(%rbp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
leaq -0x468(%rbp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movl 0x30(%rbx), %esi
leaq -0x468(%rbp), %rdi
callq 0x3410
movq %rax, %r14
leaq 0x6267(%rip), %rsi      # 0xb805
movl $0x1, %edx
movq %rax, %rdi
callq 0x32d0
movl 0xace7(%rip), %esi      # 0x10298
movq %r14, %rdi
callq 0x3410
movq %rax, %r14
leaq 0x6242(%rip), %rsi      # 0xb805
movl $0x1, %edx
movq %rax, %rdi
callq 0x32d0
movl 0xacc6(%rip), %esi      # 0x1029c
movq %r14, %rdi
callq 0x3410
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
leaq -0x268(%rbp), %rdi
movq %rbx, %rsi
callq 0x64a0
movq -0x268(%rbp), %rsi
movq -0x260(%rbp), %rdx
leaq -0x468(%rbp), %rdi
callq 0x32d0
leaq -0x258(%rbp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x5650
movq -0x258(%rbp), %rsi
incq %rsi
callq 0x3290
cmpl $0x0, 0xac45(%rip)      # 0x1029c
jle 0x572e
xorl %r15d, %r15d
leaq -0x68(%rbp), %r14
leaq -0x48(%rbp), %r12
movq (%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x7c0c
movq %r14, %rdi
leaq 0x6184(%rip), %rsi      # 0xb805
callq 0x3470
movq %r13, -0x268(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x56af
movq %rdx, -0x268(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x258(%rbp)
jmp 0x56b7
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, -0x260(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x268(%rbp), %rsi
movq -0x260(%rbp), %rdx
movq %r12, %rdi
callq 0x30c0
movq -0x268(%rbp), %rdi
cmpq %r13, %rdi
je 0x5702
movq -0x258(%rbp), %rsi
incq %rsi
callq 0x3290
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x571b
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3290
incq %r15
movslq 0xab77(%rip), %rax      # 0x1029c
cmpq %rax, %r15
jl 0x5668
leaq -0x268(%rbp), %rdi
callq 0x33f0
leaq 0x595c(%rip), %rsi      # 0xb09d
leaq -0x268(%rbp), %rdi
movl $0x10, %edx
callq 0x3050
leaq 0x5cc6(%rip), %rsi      # 0xb41f
leaq -0x268(%rbp), %rbx
movl $0x13, %edx
movq %rbx, %rdi
callq 0x32d0
movq -0x268(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
leaq -0x268(%rbp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x268(%rbp), %rdi
callq 0x32d0
leaq -0x268(%rbp), %r14
movq %r14, %rdi
callq 0x3310
leaq -0x468(%rbp), %rbx
movq %rbx, %rdi
callq 0x3310
movq 0xa7e3(%rip), %rax      # 0xffb8
movq (%rax), %r15
movq 0x18(%rax), %r12
leaq -0x260(%rbp), %rdi
movq %r15, -0x8(%rdi)
movq -0x18(%r15), %rax
movq %r12, -0x268(%rbp,%rax)
callq 0x3210
movl $0xf8, %r13d
addq %r13, %r14
movq %r14, %rdi
callq 0x30d0
leaq -0x460(%rbp), %rdi
movq %r15, -0x8(%rdi)
movq -0x18(%r15), %rax
movq %r12, -0x468(%rbp,%rax)
callq 0x3210
addq %r13, %rbx
movq %rbx, %rdi
callq 0x30d0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x5849
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x3290
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5890
movq %rax, %rbx
leaq -0x258(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x58d1
movq -0x258(%rbp), %rsi
jmp 0x58c9
jmp 0x5890
jmp 0x58df
movq %rax, %rbx
leaq -0x268(%rbp), %rdi
callq 0x3330
jmp 0x58d1
jmp 0x5890
movq %rax, %rbx
jmp 0x58d1
movq %rax, %rbx
jmp 0x58b8
movq %rax, %rbx
movq -0x268(%rbp), %rdi
cmpq %r13, %rdi
je 0x58b8
movq -0x258(%rbp), %rsi
incq %rsi
callq 0x3290
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x58d1
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3290
leaq -0x468(%rbp), %rdi
callq 0x3330
jmp 0x58e2
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x58fb
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x3290
movq %rbx, %rdi
callq 0x3420
nop