// File: millanek[P]evo/process_vcf_coding_sequences.cpp
// Function: parseGetCodingSeqOptions(int, char**)
void parseGetCodingSeqOptions(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 'n': opt::bIsCoding = false; break;
            case 'p': opt::bUsePartial = true; break;
            case 'H': arg >> opt::hetTreatment; break;
            case 's': arg >> opt::sampleNameFile; break;
            case OPT_ONLY_STATS: opt::bNoStats = true; break;
            case OPT_NONDIV_THREE: arg >> opt::nonDivPrefix; break;
            case 'h':
                std::cout << CODINGSEQ_USAGE_MESSAGE;
                exit(EXIT_SUCCESS);
        }
    }
    
    if (!opt::bIsCoding && opt::bUsePartial) {
        std::cerr << "The -n and -p options are not compatible\n";
        die = true;
    }
    
    if (opt::hetTreatment != 'r' && opt::hetTreatment != 'p' && opt::hetTreatment != 'b' && opt::hetTreatment != 'i') {
        std::cerr << "The -H (--het-treatment) option can only have the values 'r', 'p', 'b', or 'i'\n";
        die = true;
    }
    
    if (argc - optind < 3) {
        std::cerr << "missing arguments\n";
        die = true;
    }
    else if (argc - optind > 3)
    {
        std::cerr << "too many arguments\n";
        die = true;
    }
    
    if (die) {
        std::cout << "\n" << CODINGSEQ_USAGE_MESSAGE;
        exit(EXIT_FAILURE);
    }
    
    // Parse the input filenames
    opt::vcfFile = argv[optind++];
    opt::genomeFile = argv[optind++];
    opt::geneFile = argv[optind++];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movq 0xe72a4(%rip), %rdx     # 0x199878
leaq 0xe53c5(%rip), %rcx     # 0x1979a0
xorl %eax, %eax
movl %eax, %r8d
callq 0xaa40
movb %al, -0x12(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0xb281b
movq 0xe6995(%rip), %rax     # 0x198f90
cmpq $0x0, (%rax)
je 0xb2614
movq 0xe6988(%rip), %rax     # 0x198f90
movq (%rax), %rax
movq %rax, -0x1d8(%rbp)
jmp 0xb2624
leaq 0x838c4(%rip), %rax     # 0x135edf
movq %rax, -0x1d8(%rbp)
jmp 0xb2624
movq -0x1d8(%rbp), %rax
movq %rax, -0x1e8(%rbp)
leaq -0x1b9(%rbp), %rdi
movq %rdi, -0x1e0(%rbp)
callq 0xab60
movq -0x1e8(%rbp), %rsi
movq -0x1e0(%rbp), %rdx
leaq -0x1b8(%rbp), %rdi
callq 0x2d6c0
jmp 0xb2661
leaq -0x198(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
movl $0x8, %edx
callq 0xaaa0
jmp 0xb267b
leaq -0x1b8(%rbp), %rdi
callq 0xac88
leaq -0x1b9(%rbp), %rdi
callq 0xa640
movsbl -0x12(%rbp), %eax
movl %eax, -0x1ec(%rbp)
testl %eax, %eax
je 0xb27ce
jmp 0xb26a7
movl -0x1ec(%rbp), %eax
subl $0x1, %eax
je 0xb27d7
jmp 0xb26b8
movl -0x1ec(%rbp), %eax
subl $0x3f, %eax
je 0xb275c
jmp 0xb26c9
movl -0x1ec(%rbp), %eax
subl $0x48, %eax
je 0xb277d
jmp 0xb26da
movl -0x1ec(%rbp), %eax
subl $0x68, %eax
je 0xb27ee
jmp 0xb26eb
movl -0x1ec(%rbp), %eax
subl $0x6e, %eax
je 0xb2765
jmp 0xb26f8
movl -0x1ec(%rbp), %eax
subl $0x70, %eax
je 0xb2771
jmp 0xb2705
movl -0x1ec(%rbp), %eax
subl $0x73, %eax
je 0xb27b7
jmp 0xb280a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
jmp 0xb274b
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 0xb29a4
movb $0x1, -0x11(%rbp)
jmp 0xb280a
movb $0x0, 0xe7104(%rip)     # 0x199870
jmp 0xb280a
movb $0x1, 0xe8398(%rip)     # 0x19ab10
jmp 0xb280a
leaq 0xe70ed(%rip), %rsi     # 0x199871
leaq -0x198(%rbp), %rdi
callq 0xa7c0
jmp 0xb2792
jmp 0xb280a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
leaq -0x198(%rbp), %rdi
callq 0xa290
jmp 0xb29a4
leaq 0xe8332(%rip), %rsi     # 0x19aaf0
leaq -0x198(%rbp), %rdi
callq 0xa750
jmp 0xb27cc
jmp 0xb280a
movb $0x1, 0xe833c(%rip)     # 0x19ab11
jmp 0xb280a
leaq 0xe82f2(%rip), %rsi     # 0x19aad0
leaq -0x198(%rbp), %rdi
callq 0xa750
jmp 0xb27ec
jmp 0xb280a
movq 0xe708b(%rip), %rsi     # 0x199880
movq 0xe67bc(%rip), %rdi     # 0x198fb8
callq 0xa5c0
jmp 0xb2803
xorl %edi, %edi
callq 0xa700
leaq -0x198(%rbp), %rdi
callq 0xa290
jmp 0xb25c6
testb $0x1, 0xe704e(%rip)     # 0x199870
jne 0xb2844
testb $0x1, 0xe82e5(%rip)     # 0x19ab10
je 0xb2844
movq 0xe67bc(%rip), %rdi     # 0x198ff0
leaq 0x8e8b0(%rip), %rsi     # 0x1410eb
callq 0xa5c0
movb $0x1, -0x11(%rbp)
movsbl 0xe7026(%rip), %eax     # 0x199871
cmpl $0x72, %eax
je 0xb288b
movsbl 0xe701a(%rip), %eax     # 0x199871
cmpl $0x70, %eax
je 0xb288b
movsbl 0xe700e(%rip), %eax     # 0x199871
cmpl $0x62, %eax
je 0xb288b
movsbl 0xe7002(%rip), %eax     # 0x199871
cmpl $0x69, %eax
je 0xb288b
movq 0xe6775(%rip), %rdi     # 0x198ff0
leaq 0x8d510(%rip), %rsi     # 0x13fd92
callq 0xa5c0
movb $0x1, -0x11(%rbp)
movl -0x4(%rbp), %eax
movq 0xe672b(%rip), %rcx     # 0x198fc0
subl (%rcx), %eax
cmpl $0x3, %eax
jge 0xb28b5
movq 0xe674d(%rip), %rdi     # 0x198ff0
leaq 0x7fb80(%rip), %rsi     # 0x13242a
callq 0xa5c0
movb $0x1, -0x11(%rbp)
jmp 0xb28df
movl -0x4(%rbp), %eax
movq 0xe6701(%rip), %rcx     # 0x198fc0
subl (%rcx), %eax
cmpl $0x3, %eax
jle 0xb28dd
movq 0xe6723(%rip), %rdi     # 0x198ff0
leaq 0x7fb69(%rip), %rsi     # 0x13243d
callq 0xa5c0
movb $0x1, -0x11(%rbp)
jmp 0xb28df
testb $0x1, -0x11(%rbp)
je 0xb2911
movq 0xe66cc(%rip), %rdi     # 0x198fb8
leaq 0x7cf9a(%rip), %rsi     # 0x12f88d
callq 0xa5c0
movq %rax, %rdi
movq 0xe6f7e(%rip), %rsi     # 0x199880
callq 0xa5c0
movl $0x1, %edi
callq 0xa700
movq -0x10(%rbp), %rax
movq 0xe66a4(%rip), %rcx     # 0x198fc0
movl (%rcx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movq 0xe6696(%rip), %rdx     # 0x198fc0
movl %esi, (%rdx)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xe8136(%rip), %rdi     # 0x19aa70
callq 0xa810
movq -0x10(%rbp), %rax
movq 0xe6676(%rip), %rcx     # 0x198fc0
movl (%rcx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movq 0xe6668(%rip), %rdx     # 0x198fc0
movl %esi, (%rdx)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xe8128(%rip), %rdi     # 0x19aa90
callq 0xa810
movq -0x10(%rbp), %rax
movq 0xe6648(%rip), %rcx     # 0x198fc0
movl (%rcx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movq 0xe663a(%rip), %rdx     # 0x198fc0
movl %esi, (%rdx)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xe811a(%rip), %rdi     # 0x19aab0
callq 0xa810
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
movq -0x1c8(%rbp), %rdi
callq 0xab50