// File: soccin[P]BIC-RNAseq/tools/MergeFusion/main.cpp
// Function: parseOption(int, char**)
void parseOption(int argc, char* argv[])
{
    if(argc == 1)
        printUsage();
    int next_option;
    int option_index = 0;
    do
    {
        next_option = getopt_long(argc, const_cast<char**>(argv), "C:D:F:H:S:M:o:s:g:", long_options, &option_index);
        switch(next_option)
        {
            case 'C':
                input_files.push_back(make_pair(optarg, CHIMERASCAN));
                break;
            case 'D':
                input_files.push_back(make_pair(optarg, DEFUSE));
                break;
            case 'F':
                input_files.push_back(make_pair(optarg, FUSIONCATCHER));
                break;
            case 'H':
                input_files.push_back(make_pair(optarg, FUSIONHUNTER));
                break;
            case 'S':
                input_files.push_back(make_pair(optarg, STAR));
                break;
            case 'M':
                input_files.push_back(make_pair(optarg, MAPSPLICE));
                break;
            case 'o':
                output_file = optarg;
                break;
            case 's':
                sorting_criteria = optarg;
                if(sorting_criteria != "CALLER" && sorting_criteria != "GENOMIC" && sorting_criteria != "GENE" && sorting_criteria != "BREAKPOINT_COVERAGE")
                    printUsage("[ERROR]: invalid value for --sort");
                break;
            /*case 'c':
                if(strcmp(optarg, "0")  == 0)
                    normalize_chrom = false;
                else if(strcmp(optarg, "1")  == 0)
                    normalize_chrom = true;
                else
                    printUsage("[ERROR]: invalid value for --normalize_chrom");
                break;*/
            case 'g':
                hugo_data_file = optarg;
                normalize_gene = true;
                break;
            case -1:
                break; //parsed all options
            default:
                printUsage(string("[ERROR]: Argument error: ") + argv[optind - 1]);
        }
    } while(next_option != -1);
    if(input_files.size() == 0)
        printUsage("[ERROR]: Please specify at least one input file");
    if(output_file.empty())
        printUsage("[ERROR]: Please specify output file");
    #ifdef _DEBUG
    cout << "[DEBUG]: Parsing options complete." << endl;
    #endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x350, %rsp            # imm = 0x350
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x1, -0x4(%rbp)
jne 0x3b41
leaq -0x31(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0x3480
movq -0x2f8(%rbp), %rdx
leaq 0x11b27(%rip), %rsi     # 0x1560d
leaq -0x30(%rbp), %rdi
callq 0x4520
jmp 0x3af1
leaq -0x30(%rbp), %rdi
callq 0x38b0
jmp 0x3afc
leaq -0x30(%rbp), %rdi
callq 0x3508
leaq -0x31(%rbp), %rdi
callq 0x32e0
jmp 0x3b41
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3b33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3508
leaq -0x31(%rbp), %rdi
callq 0x32e0
jmp 0x4367
movl $0x0, -0x4c(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x11887(%rip), %rdx     # 0x153dd
leaq 0x1a743(%rip), %rcx     # 0x1e2a0
leaq -0x4c(%rbp), %r8
callq 0x3420
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x2fc(%rbp)
subl $-0x1, %eax
je 0x4129
jmp 0x3b7d
movl -0x2fc(%rbp), %eax
subl $0x43, %eax
je 0x3c19
jmp 0x3b8e
movl -0x2fc(%rbp), %eax
subl $0x44, %eax
je 0x3cae
jmp 0x3b9f
movl -0x2fc(%rbp), %eax
subl $0x46, %eax
je 0x3d4f
jmp 0x3bb0
movl -0x2fc(%rbp), %eax
subl $0x48, %eax
je 0x3df0
jmp 0x3bc1
movl -0x2fc(%rbp), %eax
subl $0x4d, %eax
je 0x3f32
jmp 0x3bd2
movl -0x2fc(%rbp), %eax
subl $0x53, %eax
je 0x3e91
jmp 0x3be3
movl -0x2fc(%rbp), %eax
subl $0x67, %eax
je 0x4107
jmp 0x3bf4
movl -0x2fc(%rbp), %eax
subl $0x6f, %eax
je 0x3fd3
jmp 0x3c05
movl -0x2fc(%rbp), %eax
subl $0x73, %eax
je 0x3fee
jmp 0x412e
movl $0x0, -0x8c(%rbp)
movq 0x1a37e(%rip), %rdi     # 0x1dfa8
leaq -0x8c(%rbp), %rsi
callq 0x4680
movl %edx, -0x98(%rbp)
movq %rax, -0xa0(%rbp)
movl -0x98(%rbp), %eax
movl %eax, -0x80(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x78(%rbp), %rdi
movq %rdi, -0x308(%rbp)
leaq -0x88(%rbp), %rsi
callq 0x46b0
movq -0x308(%rbp), %rsi
leaq 0x1a7d1(%rip), %rdi     # 0x1e450
callq 0x4650
jmp 0x3c86
leaq -0x78(%rbp), %rdi
callq 0x4730
jmp 0x41ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x4730
jmp 0x4367
movl $0x1, -0xdc(%rbp)
movq 0x1a2e9(%rip), %rdi     # 0x1dfa8
leaq -0xdc(%rbp), %rsi
callq 0x4680
movl %edx, -0xe8(%rbp)
movq %rax, -0xf0(%rbp)
movl -0xe8(%rbp), %eax
movl %eax, -0xd0(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x310(%rbp)
leaq -0xd8(%rbp), %rsi
callq 0x46b0
movq -0x310(%rbp), %rsi
leaq 0x1a736(%rip), %rdi     # 0x1e450
callq 0x4650
jmp 0x3d21
leaq -0xc8(%rbp), %rdi
callq 0x4730
jmp 0x41ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x4730
jmp 0x4367
movl $0x2, -0x12c(%rbp)
movq 0x1a248(%rip), %rdi     # 0x1dfa8
leaq -0x12c(%rbp), %rsi
callq 0x4680
movl %edx, -0x138(%rbp)
movq %rax, -0x140(%rbp)
movl -0x138(%rbp), %eax
movl %eax, -0x120(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x118(%rbp), %rdi
movq %rdi, -0x318(%rbp)
leaq -0x128(%rbp), %rsi
callq 0x46b0
movq -0x318(%rbp), %rsi
leaq 0x1a695(%rip), %rdi     # 0x1e450
callq 0x4650
jmp 0x3dc2
leaq -0x118(%rbp), %rdi
callq 0x4730
jmp 0x41ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x4730
jmp 0x4367
movl $0x3, -0x17c(%rbp)
movq 0x1a1a7(%rip), %rdi     # 0x1dfa8
leaq -0x17c(%rbp), %rsi
callq 0x4680
movl %edx, -0x188(%rbp)
movq %rax, -0x190(%rbp)
movl -0x188(%rbp), %eax
movl %eax, -0x170(%rbp)
movq -0x190(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq -0x168(%rbp), %rdi
movq %rdi, -0x320(%rbp)
leaq -0x178(%rbp), %rsi
callq 0x46b0
movq -0x320(%rbp), %rsi
leaq 0x1a5f4(%rip), %rdi     # 0x1e450
callq 0x4650
jmp 0x3e63
leaq -0x168(%rbp), %rdi
callq 0x4730
jmp 0x41ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x4730
jmp 0x4367
movl $0x5, -0x1cc(%rbp)
movq 0x1a106(%rip), %rdi     # 0x1dfa8
leaq -0x1cc(%rbp), %rsi
callq 0x4680
movl %edx, -0x1d8(%rbp)
movq %rax, -0x1e0(%rbp)
movl -0x1d8(%rbp), %eax
movl %eax, -0x1c0(%rbp)
movq -0x1e0(%rbp), %rax
movq %rax, -0x1c8(%rbp)
leaq -0x1b8(%rbp), %rdi
movq %rdi, -0x328(%rbp)
leaq -0x1c8(%rbp), %rsi
callq 0x46b0
movq -0x328(%rbp), %rsi
leaq 0x1a553(%rip), %rdi     # 0x1e450
callq 0x4650
jmp 0x3f04
leaq -0x1b8(%rbp), %rdi
callq 0x4730
jmp 0x41ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x4730
jmp 0x4367
movl $0x4, -0x21c(%rbp)
movq 0x1a065(%rip), %rdi     # 0x1dfa8
leaq -0x21c(%rbp), %rsi
callq 0x4680
movl %edx, -0x228(%rbp)
movq %rax, -0x230(%rbp)
movl -0x228(%rbp), %eax
movl %eax, -0x210(%rbp)
movq -0x230(%rbp), %rax
movq %rax, -0x218(%rbp)
leaq -0x208(%rbp), %rdi
movq %rdi, -0x330(%rbp)
leaq -0x218(%rbp), %rsi
callq 0x46b0
movq -0x330(%rbp), %rsi
leaq 0x1a4b2(%rip), %rdi     # 0x1e450
callq 0x4650
jmp 0x3fa5
leaq -0x208(%rbp), %rdi
callq 0x4730
jmp 0x41ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x4730
jmp 0x4367
movq 0x19fce(%rip), %rax     # 0x1dfa8
movq (%rax), %rsi
leaq 0x1a484(%rip), %rdi     # 0x1e468
callq 0x3370
jmp 0x41ba
movq 0x19fb3(%rip), %rax     # 0x1dfa8
movq (%rax), %rsi
leaq 0x1a489(%rip), %rdi     # 0x1e488
callq 0x3370
leaq 0x1a47d(%rip), %rdi     # 0x1e488
leaq 0x113de(%rip), %rsi     # 0x153f0
callq 0x4750
testb $0x1, %al
jne 0x4020
jmp 0x4102
leaq 0x1a461(%rip), %rdi     # 0x1e488
leaq 0x10fe8(%rip), %rsi     # 0x15016
callq 0x4750
testb $0x1, %al
jne 0x403c
jmp 0x4102
leaq 0x1a445(%rip), %rdi     # 0x1e488
leaq 0x113ad(%rip), %rsi     # 0x153f7
callq 0x4750
testb $0x1, %al
jne 0x4058
jmp 0x4102
leaq 0x1a429(%rip), %rdi     # 0x1e488
leaq 0x11396(%rip), %rsi     # 0x153fc
callq 0x4750
testb $0x1, %al
jne 0x4074
jmp 0x4102
leaq -0x251(%rbp), %rdi
movq %rdi, -0x338(%rbp)
callq 0x3480
movq -0x338(%rbp), %rdx
leaq 0x1137b(%rip), %rsi     # 0x15410
leaq -0x250(%rbp), %rdi
callq 0x4520
jmp 0x40a3
leaq -0x250(%rbp), %rdi
callq 0x38b0
jmp 0x40b1
leaq -0x250(%rbp), %rdi
callq 0x3508
leaq -0x251(%rbp), %rdi
callq 0x32e0
jmp 0x4102
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x40f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x3508
leaq -0x251(%rbp), %rdi
callq 0x32e0
jmp 0x4367
jmp 0x41ba
movq 0x19e9a(%rip), %rax     # 0x1dfa8
movq (%rax), %rsi
leaq 0x1a398(%rip), %rdi     # 0x1e4b0
callq 0x3370
movb $0x1, 0x1a384(%rip)     # 0x1e4a8
jmp 0x41ba
jmp 0x41ba
leaq -0x299(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0x3480
movq -0x340(%rbp), %rdx
leaq 0x112e3(%rip), %rsi     # 0x15432
leaq -0x298(%rbp), %rdi
callq 0x4520
jmp 0x415d
movq -0x10(%rbp), %rax
movq 0x19e60(%rip), %rcx     # 0x1dfc8
movl (%rcx), %ecx
decl %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
leaq -0x278(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x4780
jmp 0x4188
leaq -0x278(%rbp), %rdi
callq 0x38b0
jmp 0x4196
leaq -0x278(%rbp), %rdi
callq 0x3508
leaq -0x298(%rbp), %rdi
callq 0x3508
leaq -0x299(%rbp), %rdi
callq 0x32e0
jmp 0x41bc
cmpl $-0x1, -0x48(%rbp)
jne 0x3b48
leaq 0x1a283(%rip), %rdi     # 0x1e450
callq 0x47d0
cmpq $0x0, %rax
jne 0x42be
leaq -0x2c1(%rbp), %rdi
movq %rdi, -0x348(%rbp)
callq 0x3480
movq -0x348(%rbp), %rdx
leaq 0x1124f(%rip), %rsi     # 0x1544c
leaq -0x2c0(%rbp), %rdi
callq 0x4520
jmp 0x420b
leaq -0x2c0(%rbp), %rdi
callq 0x38b0
jmp 0x4219
leaq -0x2c0(%rbp), %rdi
callq 0x3508
leaq -0x2c1(%rbp), %rdi
callq 0x32e0
jmp 0x42be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x4276
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x426a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x3508
leaq -0x298(%rbp), %rdi
callq 0x3508
leaq -0x299(%rbp), %rdi
callq 0x32e0
jmp 0x4367
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x42ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0x3508
leaq -0x2c1(%rbp), %rdi
callq 0x32e0
jmp 0x4367
leaq 0x1a1a3(%rip), %rdi     # 0x1e468
callq 0x3440
testb $0x1, %al
jne 0x42d3
jmp 0x435e
leaq -0x2e9(%rbp), %rdi
movq %rdi, -0x350(%rbp)
callq 0x3480
movq -0x350(%rbp), %rdx
leaq 0x11188(%rip), %rsi     # 0x1547c
leaq -0x2e8(%rbp), %rdi
callq 0x4520
jmp 0x4302
leaq -0x2e8(%rbp), %rdi
callq 0x38b0
jmp 0x4310
leaq -0x2e8(%rbp), %rdi
callq 0x3508
leaq -0x2e9(%rbp), %rdi
callq 0x32e0
jmp 0x435e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x4350
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x3508
leaq -0x2e9(%rbp), %rdi
callq 0x32e0
jmp 0x4367
addq $0x350, %rsp            # imm = 0x350
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3470