// File: soccin[P]BIC-RNAseq/tools/MergeFusion/StandardFusion.cpp
// Function: StandardFusion::normalize_gene_name_worker(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::map<std::pair<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::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, 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, int>>>, std::less<std::pair<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::allocator<std::pair<std::pair<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::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, 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, int>>>>>>&)
void StandardFusion::normalize_gene_name_worker(string& chrom_name, string& gene_name, map<pair<string, string>, map<string, int> >& hugo_map)
{
    map<string, int> hugo_names;
    vector<string> parsed_item;
    split(gene_name, ',', parsed_item, true);
    for(size_t i = 0 ; i < parsed_item.size(); i++)
    {
        string ori_sub_gene_name = parsed_item[i];
        string sub_gene_name = parsed_item[i];
        removeSpace(sub_gene_name);
        transform(sub_gene_name.begin(), sub_gene_name.end(),sub_gene_name.begin(), ::toupper);
        pair<string, string> combined_key = make_pair(chrom_name, sub_gene_name);
        string new_hugo_name;
        if(hugo_map.find(combined_key) != hugo_map.end() && hugo_map[combined_key].size() == 1)
        {
            new_hugo_name = hugo_map[combined_key].begin()->first;
        }
        else
        {
            new_hugo_name = ori_sub_gene_name;
        }
        if(hugo_names.find(new_hugo_name) == hugo_names.end())
            hugo_names.insert(make_pair(new_hugo_name, 1));
        else
            hugo_names[new_hugo_name]++;
    }
    string final_name;
    for(map<string, int>::iterator it = hugo_names.begin(); it != hugo_names.end(); it ++)
    {
        if(!final_name.empty())
            final_name.append(",");
        final_name.append(it->first);
    }
    gene_name = final_name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x74b0
leaq -0x68(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x7190
movq -0x1e8(%rbp), %rdx
movq -0x18(%rbp), %rdi
movl $0x2c, %esi
movl $0x1, %ecx
callq 0x135a0
jmp 0x12480
movq $0x0, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x1f0(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x7340
movq %rax, %rcx
movq -0x1f0(%rbp), %rax
cmpq %rcx, %rax
jae 0x1284f
movq -0x80(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x71b0
movq %rax, %rsi
leaq -0xa0(%rbp), %rdi
callq 0x3130
jmp 0x124cd
movq -0x80(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x71b0
movq %rax, %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3130
jmp 0x124eb
leaq -0xc0(%rbp), %rdi
callq 0x13510
jmp 0x124f9
leaq -0xc0(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0x3240
movq -0x200(%rbp), %rdi
movq %rax, -0xc8(%rbp)
callq 0x31a0
movq -0x200(%rbp), %rdi
movq %rax, -0xd0(%rbp)
callq 0x3240
movq %rax, -0xd8(%rbp)
movq -0xc8(%rbp), %rdi
movq -0xd0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movq 0xba83(%rip), %rcx      # 0x1dfd8
callq 0x7360
movq %rax, -0x1f8(%rbp)
jmp 0x12563
movq -0x1f8(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x120(%rbp), %rdi
leaq -0xc0(%rbp), %rdx
callq 0x73e0
jmp 0x1258a
leaq -0x140(%rbp), %rdi
callq 0x3380
movq -0x20(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x7450
movq %rax, -0x208(%rbp)
jmp 0x125af
movq -0x208(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x20(%rbp), %rdi
callq 0x7480
movq %rax, -0x150(%rbp)
leaq -0x148(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x7910
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x209(%rbp)
jne 0x125f1
jmp 0x12623
movq -0x20(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x75a0
movq %rax, -0x218(%rbp)
jmp 0x1260a
movq -0x218(%rbp), %rdi
callq 0x7960
cmpq $0x1, %rax
sete %al
movb %al, -0x209(%rbp)
movb -0x209(%rbp), %al
testb $0x1, %al
jne 0x12632
jmp 0x126c1
movq -0x20(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x75a0
movq %rax, -0x220(%rbp)
jmp 0x1264b
movq -0x220(%rbp), %rdi
callq 0x13310
movq %rax, -0x158(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x13340
movq %rax, %rsi
leaq -0x140(%rbp), %rdi
callq 0x3040
jmp 0x1267b
jmp 0x126d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x12947
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x1283e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x12832
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x1281a
leaq -0x140(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3040
jmp 0x126d6
jmp 0x126d8
leaq -0x50(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x76b0
movq %rax, -0x228(%rbp)
jmp 0x126f1
movq -0x228(%rbp), %rax
movq %rax, -0x160(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x76e0
movq %rax, -0x168(%rbp)
leaq -0x160(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x7680
testb $0x1, %al
jne 0x1272b
jmp 0x127b2
movl $0x1, -0x194(%rbp)
leaq -0x190(%rbp), %rdi
leaq -0x140(%rbp), %rsi
leaq -0x194(%rbp), %rdx
callq 0x7750
jmp 0x12751
leaq -0x50(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x7710
movb %dl, -0x231(%rbp)
movq %rax, -0x230(%rbp)
jmp 0x12770
movb -0x231(%rbp), %al
movq -0x230(%rbp), %rcx
movq %rcx, -0x1a8(%rbp)
movb %al, -0x1a0(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x7790
jmp 0x127d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x7790
jmp 0x1281a
leaq -0x50(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x77b0
movq %rax, -0x240(%rbp)
jmp 0x127cb
movq -0x240(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
leaq -0x140(%rbp), %rdi
callq 0x3508
leaq -0x120(%rbp), %rdi
callq 0x7890
leaq -0xc0(%rbp), %rdi
callq 0x3508
leaq -0xa0(%rbp), %rdi
callq 0x3508
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x12488
leaq -0x140(%rbp), %rdi
callq 0x3508
leaq -0x120(%rbp), %rdi
callq 0x7890
leaq -0xc0(%rbp), %rdi
callq 0x3508
leaq -0xa0(%rbp), %rdi
callq 0x3508
jmp 0x12947
leaq -0x1c8(%rbp), %rdi
callq 0x3380
leaq -0x50(%rbp), %rdi
callq 0x13310
movq %rax, -0x1d0(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x76e0
movq %rax, -0x1d8(%rbp)
leaq -0x1d0(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x13360
testb $0x1, %al
jne 0x12894
jmp 0x1290e
leaq -0x1c8(%rbp), %rdi
callq 0x3440
testb $0x1, %al
jne 0x128d5
leaq 0x339d(%rip), %rsi      # 0x15c48
leaq -0x1c8(%rbp), %rdi
callq 0x34c0
jmp 0x128b9
jmp 0x128d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x3508
jmp 0x12947
leaq -0x1d0(%rbp), %rdi
callq 0x13340
movq %rax, %rsi
leaq -0x1c8(%rbp), %rdi
callq 0x34d0
jmp 0x128f2
jmp 0x128f4
leaq -0x1d0(%rbp), %rdi
xorl %esi, %esi
callq 0x13390
movq %rax, -0x1e0(%rbp)
jmp 0x1286b
movq -0x18(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x3040
jmp 0x12920
leaq -0x1c8(%rbp), %rdi
callq 0x3508
leaq -0x68(%rbp), %rdi
callq 0x72e0
leaq -0x50(%rbp), %rdi
callq 0x7580
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
leaq -0x68(%rbp), %rdi
callq 0x72e0
leaq -0x50(%rbp), %rdi
callq 0x7580
movq -0x70(%rbp), %rdi
callq 0x3470
nopw %cs:(%rax,%rax)