// File: soccin[P]BIC-RNAseq/tools/MergeFusion/Merger.cpp
// Function: Merger::loadHugoFile(char const*)
void Merger::loadHugoFile(const char* filename)
{
    int approved_symbol_index = 1;
    int approved_status_index = 3;
    int previous_symbol_index = 5;
    int synonyms_index = 7;
    int locus_index = 9;
    int accesion_index = 14;
    int refseq_id_index = 21;
    int vega_id_index = 25;
    
    // int entrez_id_ncbi_index = 28;
    // in omim_id_ncbi_index = 29;
    int refseq_id_ncbi_index = 30;
    //int uniprot_id_ncbi_index = 31;
    int ensembl_id_index = 32;
    int uscs_id_index = 33;
    ifstream input_fs(filename);
    if(!input_fs)
    {
        cerr << "Error: fail to open Hugo file: " << filename << endl;
        exit(1);
    }
    string line;
    getline(input_fs, line);
    while(getline(input_fs, line))
    {
        vector<string> parsed_item;
        split(line, '\t', parsed_item);
        if(parsed_item[approved_status_index] != "Approved")
            continue;
        string chr_key = locusToChr(parsed_item[locus_index]);
        if(parsed_item.size() >= 2)
            loadHugoWorker(chr_key, parsed_item[approved_symbol_index], parsed_item[approved_symbol_index]);
        if(parsed_item.size() >= 6)
            loadHugoWorker(chr_key, parsed_item[previous_symbol_index], parsed_item[approved_symbol_index]);
        if(parsed_item.size() >= 8)
            loadHugoWorker(chr_key, parsed_item[synonyms_index], parsed_item[approved_symbol_index]);
        if(parsed_item.size() >= 15)
            loadHugoWorker(chr_key, parsed_item[accesion_index], parsed_item[approved_symbol_index]);
        if(parsed_item.size() >= 22)
            loadHugoWorker(chr_key, parsed_item[refseq_id_index], parsed_item[approved_symbol_index]);
        if(parsed_item.size() >= 26)
            loadHugoWorker(chr_key, parsed_item[vega_id_index], parsed_item[approved_symbol_index]);
        if(parsed_item.size() >= 31)
            loadHugoWorker(chr_key, parsed_item[refseq_id_ncbi_index], parsed_item[approved_symbol_index]);
        if(parsed_item.size() >= 33)
            loadHugoWorker(chr_key, parsed_item[ensembl_id_index], parsed_item[approved_symbol_index]);
        if(parsed_item.size() >= 34)
            loadHugoWorker(chr_key, parsed_item[uscs_id_index], parsed_item[approved_symbol_index]);
    }
    input_fs.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3b0, %rsp            # imm = 0x3B0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2e8(%rbp)
movl $0x1, -0x14(%rbp)
movl $0x3, -0x18(%rbp)
movl $0x5, -0x1c(%rbp)
movl $0x7, -0x20(%rbp)
movl $0x9, -0x24(%rbp)
movl $0xe, -0x28(%rbp)
movl $0x15, -0x2c(%rbp)
movl $0x19, -0x30(%rbp)
movl $0x1e, -0x34(%rbp)
movl $0x20, -0x38(%rbp)
movl $0x21, -0x3c(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x248(%rbp), %rdi
movl $0x8, %edx
callq 0x34a0
movq -0x248(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x248(%rbp,%rax), %rdi
callq 0x3160
movb %al, -0x2d9(%rbp)
jmp 0x65f0
movb -0x2d9(%rbp), %al
testb $0x1, %al
jne 0x65fc
jmp 0x6667
movq 0x179ed(%rip), %rdi     # 0x1dff0
leaq 0xefd9(%rip), %rsi      # 0x155e3
callq 0x3270
movq %rax, -0x2f0(%rbp)
jmp 0x6618
movq -0x2f0(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3270
movq %rax, -0x2f8(%rbp)
jmp 0x6631
movq -0x2f8(%rbp), %rdi
movq 0x17961(%rip), %rsi     # 0x1dfa0
callq 0x32c0
jmp 0x6646
movl $0x1, %edi
callq 0x3320
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
jmp 0x6bf6
leaq -0x278(%rbp), %rdi
movq %rdi, -0x300(%rbp)
callq 0x3380
movq -0x300(%rbp), %rsi
leaq -0x248(%rbp), %rdi
callq 0x3080
jmp 0x668f
jmp 0x6691
leaq -0x248(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x3080
movq %rax, -0x308(%rbp)
jmp 0x66ad
movq -0x308(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3350
movb %al, -0x309(%rbp)
jmp 0x66cb
movb -0x309(%rbp), %al
testb $0x1, %al
jne 0x66da
jmp 0x6bbb
leaq -0x290(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x7190
movq -0x318(%rbp), %rdx
leaq -0x278(%rbp), %rdi
movl $0x9, %esi
xorl %ecx, %ecx
callq 0x135a0
jmp 0x6709
movslq -0x18(%rbp), %rsi
leaq -0x290(%rbp), %rdi
callq 0x71b0
movq %rax, %rdi
leaq 0xeee0(%rip), %rsi      # 0x15603
callq 0x4750
movb %al, -0x319(%rbp)
jmp 0x6730
movb -0x319(%rbp), %al
testb $0x1, %al
jne 0x673c
jmp 0x6779
movl $0x2, -0x294(%rbp)
jmp 0x6b8b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
jmp 0x6bea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
jmp 0x6bad
movslq -0x24(%rbp), %rsi
leaq -0x290(%rbp), %rdi
callq 0x71b0
movq %rax, %rsi
leaq -0x2d8(%rbp), %rdi
callq 0x3130
jmp 0x679a
movq -0x2e8(%rbp), %rsi
leaq -0x2b8(%rbp), %rdi
leaq -0x2d8(%rbp), %rdx
callq 0x5ec0
jmp 0x67b6
leaq -0x2d8(%rbp), %rdi
callq 0x3508
leaq -0x290(%rbp), %rdi
callq 0x7340
cmpq $0x2, %rax
jb 0x686d
movslq -0x14(%rbp), %rsi
leaq -0x290(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x71b0
movq -0x330(%rbp), %rdi
movq %rax, -0x328(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x71b0
movq -0x2e8(%rbp), %rdi
movq -0x328(%rbp), %rdx
movq %rax, %rcx
leaq -0x2b8(%rbp), %rsi
callq 0x6120
jmp 0x6825
jmp 0x686d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x3508
jmp 0x6bad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0x3508
jmp 0x6bad
leaq -0x290(%rbp), %rdi
callq 0x7340
cmpq $0x6, %rax
jb 0x68ce
movslq -0x1c(%rbp), %rsi
leaq -0x290(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0x71b0
movq -0x340(%rbp), %rdi
movq %rax, -0x338(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x71b0
movq -0x2e8(%rbp), %rdi
movq -0x338(%rbp), %rdx
movq %rax, %rcx
leaq -0x2b8(%rbp), %rsi
callq 0x6120
jmp 0x68cc
jmp 0x68ce
leaq -0x290(%rbp), %rdi
callq 0x7340
cmpq $0x8, %rax
jb 0x692f
movslq -0x20(%rbp), %rsi
leaq -0x290(%rbp), %rdi
movq %rdi, -0x350(%rbp)
callq 0x71b0
movq -0x350(%rbp), %rdi
movq %rax, -0x348(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x71b0
movq -0x2e8(%rbp), %rdi
movq -0x348(%rbp), %rdx
movq %rax, %rcx
leaq -0x2b8(%rbp), %rsi
callq 0x6120
jmp 0x692d
jmp 0x692f
leaq -0x290(%rbp), %rdi
callq 0x7340
cmpq $0xf, %rax
jb 0x6990
movslq -0x28(%rbp), %rsi
leaq -0x290(%rbp), %rdi
movq %rdi, -0x360(%rbp)
callq 0x71b0
movq -0x360(%rbp), %rdi
movq %rax, -0x358(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x71b0
movq -0x2e8(%rbp), %rdi
movq -0x358(%rbp), %rdx
movq %rax, %rcx
leaq -0x2b8(%rbp), %rsi
callq 0x6120
jmp 0x698e
jmp 0x6990
leaq -0x290(%rbp), %rdi
callq 0x7340
cmpq $0x16, %rax
jb 0x69f1
movslq -0x2c(%rbp), %rsi
leaq -0x290(%rbp), %rdi
movq %rdi, -0x370(%rbp)
callq 0x71b0
movq -0x370(%rbp), %rdi
movq %rax, -0x368(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x71b0
movq -0x2e8(%rbp), %rdi
movq -0x368(%rbp), %rdx
movq %rax, %rcx
leaq -0x2b8(%rbp), %rsi
callq 0x6120
jmp 0x69ef
jmp 0x69f1
leaq -0x290(%rbp), %rdi
callq 0x7340
cmpq $0x1a, %rax
jb 0x6a52
movslq -0x30(%rbp), %rsi
leaq -0x290(%rbp), %rdi
movq %rdi, -0x380(%rbp)
callq 0x71b0
movq -0x380(%rbp), %rdi
movq %rax, -0x378(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x71b0
movq -0x2e8(%rbp), %rdi
movq -0x378(%rbp), %rdx
movq %rax, %rcx
leaq -0x2b8(%rbp), %rsi
callq 0x6120
jmp 0x6a50
jmp 0x6a52
leaq -0x290(%rbp), %rdi
callq 0x7340
cmpq $0x1f, %rax
jb 0x6ab3
movslq -0x34(%rbp), %rsi
leaq -0x290(%rbp), %rdi
movq %rdi, -0x390(%rbp)
callq 0x71b0
movq -0x390(%rbp), %rdi
movq %rax, -0x388(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x71b0
movq -0x2e8(%rbp), %rdi
movq -0x388(%rbp), %rdx
movq %rax, %rcx
leaq -0x2b8(%rbp), %rsi
callq 0x6120
jmp 0x6ab1
jmp 0x6ab3
leaq -0x290(%rbp), %rdi
callq 0x7340
cmpq $0x21, %rax
jb 0x6b14
movslq -0x38(%rbp), %rsi
leaq -0x290(%rbp), %rdi
movq %rdi, -0x3a0(%rbp)
callq 0x71b0
movq -0x3a0(%rbp), %rdi
movq %rax, -0x398(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x71b0
movq -0x2e8(%rbp), %rdi
movq -0x398(%rbp), %rdx
movq %rax, %rcx
leaq -0x2b8(%rbp), %rsi
callq 0x6120
jmp 0x6b12
jmp 0x6b14
leaq -0x290(%rbp), %rdi
callq 0x7340
cmpq $0x22, %rax
jb 0x6b75
movslq -0x3c(%rbp), %rsi
leaq -0x290(%rbp), %rdi
movq %rdi, -0x3b0(%rbp)
callq 0x71b0
movq -0x3b0(%rbp), %rdi
movq %rax, -0x3a8(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x71b0
movq -0x2e8(%rbp), %rdi
movq -0x3a8(%rbp), %rdx
movq %rax, %rcx
leaq -0x2b8(%rbp), %rsi
callq 0x6120
jmp 0x6b73
jmp 0x6b75
leaq -0x2b8(%rbp), %rdi
callq 0x3508
movl $0x0, -0x294(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x72e0
movl -0x294(%rbp), %eax
testl %eax, %eax
je 0x6ba8
jmp 0x6ba3
jmp 0x6691
jmp 0x6691
leaq -0x290(%rbp), %rdi
callq 0x72e0
jmp 0x6bea
leaq -0x248(%rbp), %rdi
callq 0x3090
jmp 0x6bc9
leaq -0x278(%rbp), %rdi
callq 0x3508
leaq -0x248(%rbp), %rdi
callq 0x30c0
addq $0x3b0, %rsp            # imm = 0x3B0
popq %rbp
retq
leaq -0x278(%rbp), %rdi
callq 0x3508
leaq -0x248(%rbp), %rdi
callq 0x30c0
movq -0x250(%rbp), %rdi
callq 0x3470
nop