// File: nachogoro[P]wordcrack-herminia/src/main.cpp
// Function: resultFound(std::map<Word, int, std::less<Word>, std::allocator<std::pair<Word const, int>>>&, Word&)
void resultFound(std::map<Word, int>& results, Word& word)
{
    auto wordInMap = results.begin();
    for (wordInMap = results.begin(); wordInMap != results.end(); ++wordInMap)
    {
        if (wordInMap->first.currentWord() == word.currentWord())
            break;
    }

    if ((wordInMap == results.end()) || (wordInMap->second < word.score())) {
        if (wordInMap != results.end()) {
            // Make sure we delete the entry so that the new one gets inserted
            results.erase(wordInMap);
        }
        results.insert(std::make_pair(word, word.score()));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x198(%rbp)
movq %rsi, -0x190(%rbp)
callq 0x31c0
movq -0x198(%rbp), %rdi
movq -0x190(%rbp), %rsi
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x11220
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x11220
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x11290
movq %rax, -0x28(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x11250
testb $0x1, %al
jne 0xf3c9
jmp 0xf44a
leaq -0x18(%rbp), %rdi
callq 0x112c0
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x5490
movq -0x10(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x5490
jmp 0xf3ed
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xbd50
movb %al, -0x199(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x3150
leaq -0x48(%rbp), %rdi
callq 0x3150
movb -0x199(%rbp), %al
testb $0x1, %al
jne 0xf41e
jmp 0xf43a
jmp 0xf44a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x3150
jmp 0xf5aa
jmp 0xf43c
leaq -0x18(%rbp), %rdi
callq 0x112f0
jmp 0xf3a6
movq -0x8(%rbp), %rdi
callq 0x11290
movq %rax, -0x80(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x11330
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x19a(%rbp)
jne 0xf4a4
leaq -0x18(%rbp), %rdi
callq 0x112c0
movl 0xd0(%rax), %eax
movl %eax, -0x1a0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3ea0
movl %eax, %ecx
movl -0x1a0(%rbp), %eax
cmpl %ecx, %eax
setl %al
movb %al, -0x19a(%rbp)
movb -0x19a(%rbp), %al
testb $0x1, %al
jne 0xf4b3
jmp 0xf5a1
movq -0x8(%rbp), %rdi
callq 0x11290
movq %rax, -0x88(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x11250
testb $0x1, %al
jne 0xf4d9
jmp 0xf4fb
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rsi
callq 0x11370
movq %rax, -0x98(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0x3ea0
movq -0x1c8(%rbp), %rsi
movl %eax, -0x174(%rbp)
leaq -0x170(%rbp), %rdi
movq %rdi, -0x1b8(%rbp)
leaq -0x174(%rbp), %rdx
callq 0x11420
movq -0x1c0(%rbp), %rdi
movq -0x1b8(%rbp), %rsi
callq 0x113c0
movb %dl, -0x1a9(%rbp)
movq %rax, -0x1a8(%rbp)
jmp 0xf55f
movb -0x1a9(%rbp), %al
movq -0x1a8(%rbp), %rcx
movq %rcx, -0x188(%rbp)
movb %al, -0x180(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x11470
jmp 0xf5a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x11470
jmp 0xf5aa
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
movq -0x70(%rbp), %rdi
callq 0x33f0
nopw %cs:(%rax,%rax)