// File: /workspace/github_cpp_makefile_star2_O2/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 0x4971(%rip), %rsi      # 0x952b
leaq -0x48(%rbp), %rdi
leaq -0x468(%rbp), %rdx
callq 0x38f0
xorl %r14d, %r14d
movslq 0x96c0(%rip), %rax      # 0xe294
cmpq %rax, %r14
jge 0x4bea
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x7b8e
incq %r14
jmp 0x4bcd
leaq -0x468(%rbp), %rdi
callq 0x33c0
leaq 0x446b(%rip), %rsi      # 0x9068
leaq -0x468(%rbp), %rdi
pushq $0x10
popq %rdx
callq 0x3040
leaq 0x47e2(%rip), %rsi      # 0x93f5
leaq -0x468(%rbp), %rdi
callq 0x3270
movq %rax, %rdi
callq 0x3150
movl 0x30(%rbx), %esi
leaq -0x468(%rbp), %rdi
callq 0x33e0
leaq 0x4b78(%rip), %rsi      # 0x97b5
movq %rax, %rdi
callq 0x3270
movl 0x9645(%rip), %esi      # 0xe290
movq %rax, %rdi
callq 0x33e0
leaq 0x4b5b(%rip), %rsi      # 0x97b5
movq %rax, %rdi
callq 0x3270
movl 0x962c(%rip), %esi      # 0xe294
movq %rax, %rdi
callq 0x33e0
movq %rax, %rdi
callq 0x3150
leaq -0x268(%rbp), %rdi
movq %rbx, %rsi
callq 0x560c
leaq -0x468(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x3260
leaq -0x268(%rbp), %r14
movq %r14, %rdi
callq 0x3130
xorl %r12d, %r12d
leaq -0x68(%rbp), %r15
leaq -0x48(%rbp), %r13
movslq 0x95d9(%rip), %rax      # 0xe294
cmpq %rax, %r12
jge 0x4d01
movq (%rbx), %rax
movq (%rax,%r12,8), %rsi
movq %r15, %rdi
callq 0x6c44
movq %r14, %rdi
movq %r15, %rsi
leaq 0x4ad9(%rip), %rdx      # 0x97b5
callq 0x58b3
movq %r13, %rdi
movq %r14, %rsi
callq 0x3460
movq %r14, %rdi
callq 0x3130
movq %r15, %rdi
callq 0x3130
incq %r12
jmp 0x4cb4
leaq -0x268(%rbp), %rdi
callq 0x33c0
leaq 0x4389(%rip), %rsi      # 0x909d
leaq -0x268(%rbp), %rdi
pushq $0x10
popq %rdx
callq 0x3040
leaq 0x46f5(%rip), %rsi      # 0x941f
leaq -0x268(%rbp), %rdi
callq 0x3270
movq %rax, %rdi
callq 0x3150
leaq -0x268(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3260
leaq -0x268(%rbp), %rdi
callq 0x3300
leaq -0x468(%rbp), %rdi
callq 0x3300
leaq -0x268(%rbp), %rdi
callq 0x3320
leaq -0x468(%rbp), %rdi
callq 0x3320
leaq -0x48(%rbp), %rdi
callq 0x3130
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4ddd
movq %rax, %rbx
leaq -0x268(%rbp), %rdi
jmp 0x4dd6
jmp 0x4ddd
jmp 0x4dee
movq %rax, %rbx
leaq -0x268(%rbp), %rdi
callq 0x3320
jmp 0x4de0
jmp 0x4ddd
movq %rax, %rbx
leaq -0x268(%rbp), %rdi
callq 0x3130
jmp 0x4dd2
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x3130
jmp 0x4de0
movq %rax, %rbx
leaq -0x468(%rbp), %rdi
callq 0x3320
jmp 0x4df1
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x33f0