// File: millanek[P]evo/process_vcf_linkGeneNames.cpp
// Function: attemptMappingUpdate(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
inline void attemptMappingUpdate(std::map<string,string>& cichlidHomologMap, const std::string& cichlidGene, const std::string& homologGene) {
    if (cichlidHomologMap.count(cichlidGene) == 0) {
        cichlidHomologMap[cichlidGene] = homologGene;
    } else {
        // Prefer zebrafish homologs as they have the best GO annotation
        if (cichlidHomologMap[cichlidGene].substr(0,6) == "ENSDAR") { return; }
        if (homologGene.substr(0,6) == "ENSDAR") { cichlidHomologMap[cichlidGene] = homologGene; }
        // Next best option is Medaka
        if (cichlidHomologMap[cichlidGene].substr(0,6) == "ENSORL") { return; }
        if (homologGene.substr(0,6) == "ENSORL") { cichlidHomologMap[cichlidGene] = homologGene; }
        // Next is stickleback:
        if (cichlidHomologMap[cichlidGene].substr(0,6) == "ENSGAC") { return; }
        if (homologGene.substr(0,6) == "ENSGAC") { cichlidHomologMap[cichlidGene] = homologGene; }
        // Tetraodon would be added only if there wasn't any other homolo before
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x58740
cmpq $0x0, %rax
jne 0xef166
movq -0x18(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x584d0
movq -0xf0(%rbp), %rsi
movq %rax, %rdi
callq 0xa060
jmp 0xef4a1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x584d0
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
leaq -0x38(%rbp), %rdi
movq %rdi, -0x100(%rbp)
movl $0x6, %ecx
callq 0xa5f0
movq -0x100(%rbp), %rdi
leaq 0x5a397(%rip), %rsi     # 0x149534
callq 0x2d770
movb %al, -0xf1(%rbp)
jmp 0xef1aa
leaq -0x38(%rbp), %rdi
callq 0xac88
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0xef1bf
jmp 0xef1de
jmp 0xef4a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xac88
jmp 0xef4aa
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
leaq -0x68(%rbp), %rdi
movq %rdi, -0x110(%rbp)
movl $0x6, %ecx
callq 0xa5f0
movq -0x110(%rbp), %rdi
leaq 0x5a32b(%rip), %rsi     # 0x149534
callq 0x2d770
movb %al, -0x101(%rbp)
jmp 0xef216
leaq -0x68(%rbp), %rdi
callq 0xac88
movb -0x101(%rbp), %al
testb $0x1, %al
jne 0xef22b
jmp 0xef26e
movq -0x18(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x584d0
movq -0x118(%rbp), %rsi
movq %rax, %rdi
callq 0xa060
jmp 0xef26e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0xac88
jmp 0xef4aa
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x584d0
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
leaq -0x88(%rbp), %rdi
movq %rdi, -0x128(%rbp)
movl $0x6, %ecx
callq 0xa5f0
movq -0x128(%rbp), %rdi
leaq 0x5a29a(%rip), %rsi     # 0x149542
callq 0x2d770
movb %al, -0x119(%rbp)
jmp 0xef2b5
leaq -0x88(%rbp), %rdi
callq 0xac88
movb -0x119(%rbp), %al
testb $0x1, %al
jne 0xef2cd
jmp 0xef2ef
jmp 0xef4a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x88(%rbp), %rdi
callq 0xac88
jmp 0xef4aa
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x138(%rbp)
movl $0x6, %ecx
callq 0xa5f0
movq -0x138(%rbp), %rdi
leaq 0x5a225(%rip), %rsi     # 0x149542
callq 0x2d770
movb %al, -0x129(%rbp)
jmp 0xef32a
leaq -0xa8(%rbp), %rdi
callq 0xac88
movb -0x129(%rbp), %al
testb $0x1, %al
jne 0xef342
jmp 0xef388
movq -0x18(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x584d0
movq -0x140(%rbp), %rsi
movq %rax, %rdi
callq 0xa060
jmp 0xef388
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0xac88
jmp 0xef4aa
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x584d0
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x150(%rbp)
movl $0x6, %ecx
callq 0xa5f0
movq -0x150(%rbp), %rdi
leaq 0x5a179(%rip), %rsi     # 0x14953b
callq 0x2d770
movb %al, -0x141(%rbp)
jmp 0xef3cf
leaq -0xc8(%rbp), %rdi
callq 0xac88
movb -0x141(%rbp), %al
testb $0x1, %al
jne 0xef3e7
jmp 0xef409
jmp 0xef4a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0xac88
jmp 0xef4aa
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
leaq -0xe8(%rbp), %rdi
movq %rdi, -0x160(%rbp)
movl $0x6, %ecx
callq 0xa5f0
movq -0x160(%rbp), %rdi
leaq 0x5a104(%rip), %rsi     # 0x14953b
callq 0x2d770
movb %al, -0x151(%rbp)
jmp 0xef444
leaq -0xe8(%rbp), %rdi
callq 0xac88
movb -0x151(%rbp), %al
testb $0x1, %al
jne 0xef45c
jmp 0xef49f
movq -0x18(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x584d0
movq -0x168(%rbp), %rsi
movq %rax, %rdi
callq 0xa060
jmp 0xef49f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0xac88
jmp 0xef4aa
jmp 0xef4a1
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0xab50
nopw %cs:(%rax,%rax)
nopl (%rax)