// File: /workspace/github_cpp_makefile_star2_O1/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 0x6039(%rip), %rdx      # 0xb545
leaq -0x48(%rbp), %rdi
movq %rdx, %rsi
callq 0x39b0
cmpl $0x0, 0xad7d(%rip)      # 0x1029c
jle 0x553f
xorl %r14d, %r14d
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x93be
incq %r14
movslq 0xad62(%rip), %rax      # 0x1029c
cmpq %rax, %r14
jl 0x5524
leaq -0x468(%rbp), %rdi
callq 0x33f0
leaq 0x5b16(%rip), %rsi      # 0xb068
leaq -0x468(%rbp), %rdi
movl $0x10, %edx
callq 0x3050
leaq 0x5e8b(%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 0x625f(%rip), %rsi      # 0xb825
movl $0x1, %edx
movq %rax, %rdi
callq 0x32d0
movl 0xacbf(%rip), %esi      # 0x10298
movq %r14, %rdi
callq 0x3410
movq %rax, %r14
leaq 0x623a(%rip), %rsi      # 0xb825
movl $0x1, %edx
movq %rax, %rdi
callq 0x32d0
movl 0xac9e(%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 0x64bc
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 0x5678
movq -0x258(%rbp), %rsi
incq %rsi
callq 0x3290
cmpl $0x0, 0xac1d(%rip)      # 0x1029c
jle 0x5756
xorl %r15d, %r15d
leaq -0x68(%rbp), %r14
leaq -0x48(%rbp), %r12
movq (%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x7c30
movq %r14, %rdi
leaq 0x617c(%rip), %rsi      # 0xb825
callq 0x3470
movq %r13, -0x268(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x56d7
movq %rdx, -0x268(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x258(%rbp)
jmp 0x56df
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 0x572a
movq -0x258(%rbp), %rsi
incq %rsi
callq 0x3290
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x5743
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3290
incq %r15
movslq 0xab4f(%rip), %rax      # 0x1029c
cmpq %rax, %r15
jl 0x5690
leaq -0x268(%rbp), %rdi
callq 0x33f0
leaq 0x5934(%rip), %rsi      # 0xb09d
leaq -0x268(%rbp), %rdi
movl $0x10, %edx
callq 0x3050
leaq 0x5c9e(%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 0xa7bb(%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 0x5871
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 0x58b8
movq %rax, %rbx
leaq -0x258(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x58f9
movq -0x258(%rbp), %rsi
jmp 0x58f1
jmp 0x58b8
jmp 0x5907
movq %rax, %rbx
leaq -0x268(%rbp), %rdi
callq 0x3330
jmp 0x58f9
jmp 0x58b8
movq %rax, %rbx
jmp 0x58f9
movq %rax, %rbx
jmp 0x58e0
movq %rax, %rbx
movq -0x268(%rbp), %rdi
cmpq %r13, %rdi
je 0x58e0
movq -0x258(%rbp), %rsi
incq %rsi
callq 0x3290
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x58f9
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3290
leaq -0x468(%rbp), %rdi
callq 0x3330
jmp 0x590a
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x5923
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x3290
movq %rbx, %rdi
callq 0x3420
nop