// File: FabienBounoir[P]JustePrix-CLI/meilleurScore.cpp
// Function: MeilleurScore::sauvegarderScore(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void MeilleurScore::sauvegarderScore(int nbCoups, string nom)
{
    string ligneFichierScore;
    ofstream fichierScore(this->getFichierDifficulte().c_str());
    
    stringstream stringNbCoups;
    stringNbCoups << nbCoups;

    string creationScore = stringNbCoups.str() + " " + nom;
    this->donneeFichier.push_back(make_pair(nbCoups, creationScore));
    sort(donneeFichier.begin(), donneeFichier.end());

    for(unsigned int i=0;i < donneeFichier.size(); i++)
    {
        fichierScore << donneeFichier[i].second << endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4c0, %rsp            # imm = 0x4C0
movq %rdx, -0x4a0(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x498(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3340
movq -0x498(%rbp), %rsi
leaq -0x258(%rbp), %rdi
callq 0x7ce0
jmp 0x8256
leaq -0x258(%rbp), %rdi
callq 0x30d0
movq %rax, %rsi
leaq -0x238(%rbp), %rdi
movl $0x10, %edx
callq 0x32a0
jmp 0x8278
leaq -0x258(%rbp), %rdi
callq 0x3130
leaq -0x3f0(%rbp), %rdi
callq 0x3160
jmp 0x8292
leaq -0x3e0(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x33d0
jmp 0x82a3
leaq -0x450(%rbp), %rdi
leaq -0x3f0(%rbp), %rsi
callq 0x3230
jmp 0x82b8
leaq 0x1e17(%rip), %rdx      # 0xa0d6
leaq -0x430(%rbp), %rdi
leaq -0x450(%rbp), %rsi
callq 0x8600
jmp 0x82d4
movq -0x4a0(%rbp), %rdx
leaq -0x410(%rbp), %rdi
leaq -0x430(%rbp), %rsi
callq 0x85b0
jmp 0x82f0
leaq -0x430(%rbp), %rdi
callq 0x3130
leaq -0x450(%rbp), %rdi
callq 0x3130
movq -0x498(%rbp), %rax
movq %rax, -0x4a8(%rbp)
leaq -0x478(%rbp), %rdi
leaq -0xc(%rbp), %rsi
leaq -0x410(%rbp), %rdx
callq 0x5f10
jmp 0x832f
movq -0x4a8(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0x5ee0
jmp 0x8344
leaq -0x478(%rbp), %rdi
callq 0x4920
movq -0x498(%rbp), %rdi
callq 0x6950
movq -0x498(%rbp), %rdi
movq %rax, -0x480(%rbp)
callq 0x6740
movq %rax, -0x488(%rbp)
movq -0x480(%rbp), %rdi
movq -0x488(%rbp), %rsi
callq 0x8650
jmp 0x838b
movl $0x0, -0x48c(%rbp)
movq -0x498(%rbp), %rdi
movl -0x48c(%rbp), %eax
movq %rax, -0x4b0(%rbp)
callq 0x5b80
movq %rax, %rcx
movq -0x4b0(%rbp), %rax
cmpq %rcx, %rax
jae 0x84f8
movq -0x498(%rbp), %rdi
movl -0x48c(%rbp), %eax
movl %eax, %esi
callq 0x5b60
movq %rax, %rsi
addq $0x8, %rsi
leaq -0x238(%rbp), %rdi
callq 0x3200
movq %rax, -0x4b8(%rbp)
jmp 0x83f1
movq -0x4b8(%rbp), %rdi
movq 0x6bb9(%rip), %rsi      # 0xefb8
callq 0x3270
jmp 0x8406
jmp 0x8408
movl -0x48c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48c(%rbp)
jmp 0x8395
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x260(%rbp)
movl %eax, -0x264(%rbp)
jmp 0x8552
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x260(%rbp)
movl %eax, -0x264(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x3130
jmp 0x8552
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x260(%rbp)
movl %eax, -0x264(%rbp)
jmp 0x8546
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x260(%rbp)
movl %eax, -0x264(%rbp)
jmp 0x853a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x260(%rbp)
movl %eax, -0x264(%rbp)
jmp 0x84b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x260(%rbp)
movl %eax, -0x264(%rbp)
leaq -0x430(%rbp), %rdi
callq 0x3130
leaq -0x450(%rbp), %rdi
callq 0x3130
jmp 0x853a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x260(%rbp)
movl %eax, -0x264(%rbp)
jmp 0x852e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x260(%rbp)
movl %eax, -0x264(%rbp)
leaq -0x478(%rbp), %rdi
callq 0x4920
jmp 0x852e
leaq -0x410(%rbp), %rdi
callq 0x3130
leaq -0x3f0(%rbp), %rdi
callq 0x3190
leaq -0x238(%rbp), %rdi
callq 0x3360
leaq -0x38(%rbp), %rdi
callq 0x3130
addq $0x4c0, %rsp            # imm = 0x4C0
popq %rbp
retq
leaq -0x410(%rbp), %rdi
callq 0x3130
leaq -0x3f0(%rbp), %rdi
callq 0x3190
leaq -0x238(%rbp), %rdi
callq 0x3360
leaq -0x38(%rbp), %rdi
callq 0x3130
movq -0x260(%rbp), %rdi
callq 0x33e0
nopw (%rax,%rax)