// File: millanek[P]evo/process_vcf_linkGeneNames.cpp
// Function: linkGNOptions(int, char**)
void linkGNOptions(int argc, char** argv) {
    bool die = false;
    for (char c; (c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1;)
    {
        std::istringstream arg(optarg != NULL ? optarg : "");
        switch (c)
        {
            case '?': die = true; break;
            case 'o': arg >> opt::out; break;
            case 's': arg >> opt::species; break;
            case OPT_V1: arg >> opt::v1orthologousClustersFile; break;
            case OPT_V2: arg >> opt::v2orthologsFile; break;
            case OPT_NtoN: opt::NtoN = true; break;
            case OPT_SEP_BY_COPY: arg >> opt::sepByCopyNumberPrefix; break;
            case 'h':
                std::cout << LINKGN_USAGE_MESSAGE;
                exit(EXIT_SUCCESS);
        }
    }
    
    if (opt::v1orthologousClustersFile == "" && opt::v2orthologsFile == "") {
        std::cerr << "either --v1 or --v2 ortholog assigment must be supplied\n";
        die = true;
    }
    
    if (argc - optind < 1) {
        std::cerr << "missing arguments\n";
        die = true;
    }
    else if (argc - optind > 2)
    {
        std::cerr << "too many arguments\n";
        die = true;
    }
    
    if (opt::out != "") opt::out = "_" + opt::out;
    
    if (die) {
        std::cout << "\n" << LINKGN_USAGE_MESSAGE;
        exit(EXIT_FAILURE);
    }
    
    // Parse the input filenames
    opt::gpFile = argv[optind++];
    if (argc - optind >= 1) {
        opt::ensGeneFile = argv[optind++];
    }
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movq 0xaad34(%rip), %rdx     # 0x199978
leaq 0xa9575(%rip), %rcx     # 0x1981c0
xorl %eax, %eax
movl %eax, %r8d
callq 0xaa40
movb %al, -0x12(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0xeeea4
movq 0xaa325(%rip), %rax     # 0x198f90
cmpq $0x0, (%rax)
je 0xeec84
movq 0xaa318(%rip), %rax     # 0x198f90
movq (%rax), %rax
movq %rax, -0x1f8(%rbp)
jmp 0xeec94
leaq 0x47254(%rip), %rax     # 0x135edf
movq %rax, -0x1f8(%rbp)
jmp 0xeec94
movq -0x1f8(%rbp), %rax
movq %rax, -0x208(%rbp)
leaq -0x1b9(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0xab60
movq -0x208(%rbp), %rsi
movq -0x200(%rbp), %rdx
leaq -0x1b8(%rbp), %rdi
callq 0x2d6c0
jmp 0xeecd1
leaq -0x198(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
movl $0x8, %edx
callq 0xaaa0
jmp 0xeeceb
leaq -0x1b8(%rbp), %rdi
callq 0xac88
leaq -0x1b9(%rbp), %rdi
callq 0xa640
movsbl -0x12(%rbp), %eax
movl %eax, -0x20c(%rbp)
testl %eax, %eax
je 0xeee29
jmp 0xeed17
movl -0x20c(%rbp), %eax
subl $0x1, %eax
je 0xeee40
jmp 0xeed28
movl -0x20c(%rbp), %eax
subl $0x2, %eax
je 0xeee57
jmp 0xeed39
movl -0x20c(%rbp), %eax
subl $0x3, %eax
je 0xeee60
jmp 0xeed4a
movl -0x20c(%rbp), %eax
subl $0x3f, %eax
je 0xeedcc
jmp 0xeed57
movl -0x20c(%rbp), %eax
subl $0x68, %eax
je 0xeee77
jmp 0xeed68
movl -0x20c(%rbp), %eax
subl $0x6f, %eax
je 0xeedd5
jmp 0xeed75
movl -0x20c(%rbp), %eax
subl $0x73, %eax
je 0xeee12
jmp 0xeee93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
jmp 0xeedbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0xac88
leaq -0x1b9(%rbp), %rdi
callq 0xa640
jmp 0xef03b
movb $0x1, -0x11(%rbp)
jmp 0xeee93
leaq 0xac334(%rip), %rsi     # 0x19b110
leaq -0x198(%rbp), %rdi
callq 0xa750
jmp 0xeedea
jmp 0xeee93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
leaq -0x198(%rbp), %rdi
callq 0xa290
jmp 0xef03b
leaq 0xac337(%rip), %rsi     # 0x19b150
leaq -0x198(%rbp), %rdi
callq 0xa750
jmp 0xeee27
jmp 0xeee93
leaq 0xac280(%rip), %rsi     # 0x19b0b0
leaq -0x198(%rbp), %rdi
callq 0xa750
jmp 0xeee3e
jmp 0xeee93
leaq 0xac2e9(%rip), %rsi     # 0x19b130
leaq -0x198(%rbp), %rdi
callq 0xa750
jmp 0xeee55
jmp 0xeee93
movb $0x1, 0xac332(%rip)     # 0x19b190
jmp 0xeee93
leaq 0xac309(%rip), %rsi     # 0x19b170
leaq -0x198(%rbp), %rdi
callq 0xa750
jmp 0xeee75
jmp 0xeee93
movq 0xaab02(%rip), %rsi     # 0x199980
movq 0xaa133(%rip), %rdi     # 0x198fb8
callq 0xa5c0
jmp 0xeee8c
xorl %edi, %edi
callq 0xa700
leaq -0x198(%rbp), %rdi
callq 0xa290
jmp 0xeec36
leaq 0xac205(%rip), %rdi     # 0x19b0b0
leaq 0x4702d(%rip), %rsi     # 0x135edf
callq 0x2d770
testb $0x1, %al
jne 0xeeebd
jmp 0xeeeed
leaq 0xac26c(%rip), %rdi     # 0x19b130
leaq 0x47014(%rip), %rsi     # 0x135edf
callq 0x2d770
testb $0x1, %al
jne 0xeeed6
jmp 0xeeeed
movq 0xaa113(%rip), %rdi     # 0x198ff0
leaq 0x5a7c1(%rip), %rsi     # 0x1496a5
callq 0xa5c0
movb $0x1, -0x11(%rbp)
movl -0x4(%rbp), %eax
movq 0xaa0c9(%rip), %rcx     # 0x198fc0
subl (%rcx), %eax
cmpl $0x1, %eax
jge 0xeef17
movq 0xaa0eb(%rip), %rdi     # 0x198ff0
leaq 0x4351e(%rip), %rsi     # 0x13242a
callq 0xa5c0
movb $0x1, -0x11(%rbp)
jmp 0xeef41
movl -0x4(%rbp), %eax
movq 0xaa09f(%rip), %rcx     # 0x198fc0
subl (%rcx), %eax
cmpl $0x2, %eax
jle 0xeef3f
movq 0xaa0c1(%rip), %rdi     # 0x198ff0
leaq 0x43507(%rip), %rsi     # 0x13243d
callq 0xa5c0
movb $0x1, -0x11(%rbp)
jmp 0xeef41
leaq 0xac1c8(%rip), %rdi     # 0x19b110
leaq 0x46f90(%rip), %rsi     # 0x135edf
callq 0x50eb0
testb $0x1, %al
jne 0xeef5a
jmp 0xeef93
leaq -0x1f0(%rbp), %rdi
leaq 0x50e28(%rip), %rsi     # 0x13fd90
leaq 0xac1a1(%rip), %rdx     # 0x19b110
callq 0xba820
leaq 0xac195(%rip), %rdi     # 0x19b110
leaq -0x1f0(%rbp), %rsi
callq 0xa710
leaq -0x1f0(%rbp), %rdi
callq 0xac88
testb $0x1, -0x11(%rbp)
je 0xeefc5
movq 0xaa018(%rip), %rdi     # 0x198fb8
leaq 0x408e6(%rip), %rsi     # 0x12f88d
callq 0xa5c0
movq %rax, %rdi
movq 0xaa9ca(%rip), %rsi     # 0x199980
callq 0xa5c0
movl $0x1, %edi
callq 0xa700
movq -0x10(%rbp), %rax
movq 0xa9ff0(%rip), %rcx     # 0x198fc0
movl (%rcx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movq 0xa9fe2(%rip), %rdx     # 0x198fc0
movl %esi, (%rdx)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xac0a2(%rip), %rdi     # 0x19b090
callq 0xa810
movl -0x4(%rbp), %eax
movq 0xa9fc3(%rip), %rcx     # 0x198fc0
subl (%rcx), %eax
cmpl $0x1, %eax
jl 0xef032
movq -0x10(%rbp), %rax
movq 0xa9fb1(%rip), %rcx     # 0x198fc0
movl (%rcx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movq 0xa9fa3(%rip), %rdx     # 0x198fc0
movl %esi, (%rdx)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xac0a3(%rip), %rdi     # 0x19b0d0
callq 0xa810
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
movq -0x1c8(%rbp), %rdi
callq 0xab50
nopw (%rax,%rax)