// File: millanek[P]evo/evo_abba_baba.cpp
// Function: parseAbbaBabaOptions(int, char**)
void parseAbbaBabaOptions(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 's': arg >> opt::sampleNameFile; break;
            case 'f': opt::bFrequency = true; opt::jackKniveWindowSize = JACKKNIVE_WINDOW_SIZE_FREQUENCY; break;
            case 'w': arg >> opt::windowSize; break;
            case 'n': arg >> opt::runName; break;
            case OPT_AA_EQ_O: opt::bAaEqO = true; break;
            case OPT_NO_AA_O: opt::bNoAaO = true; break;
            case 'h':
                std::cout << ABBA_USAGE_MESSAGE;
                exit(EXIT_SUCCESS);
        }
    }
    
    if (opt::runName == "") {
        if (opt::bFrequency) { opt::runName = "frequency"; }
        if (!opt::bFrequency) { opt::runName = "sequence"; }
    }
    if (argc - optind < 2) {
        std::cerr << "missing arguments\n";
        die = true;
    }
    else if (argc - optind > 2)
    {
        std::cerr << "too many arguments\n";
        die = true;
    }
    
    if (die) {
        std::cout << "\n" << ABBA_USAGE_MESSAGE;
        exit(EXIT_FAILURE);
    }
    
    // Parse the input filenames
    opt::vcfFile = argv[optind++];
    opt::setsFile = 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 0x148e54(%rip), %rdx    # 0x1996c8
leaq 0x145f15(%rip), %rcx    # 0x196790
xorl %eax, %eax
movl %eax, %r8d
callq 0xaa40
movb %al, -0x12(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0x50ac6
movq 0x1486f5(%rip), %rax    # 0x198f90
cmpq $0x0, (%rax)
je 0x508b4
movq 0x1486e8(%rip), %rax    # 0x198f90
movq (%rax), %rax
movq %rax, -0x1d8(%rbp)
jmp 0x508c4
leaq 0xe5624(%rip), %rax     # 0x135edf
movq %rax, -0x1d8(%rbp)
jmp 0x508c4
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 0x50901
leaq -0x198(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
movl $0x8, %edx
callq 0xaaa0
jmp 0x5091b
leaq -0x1b8(%rbp), %rdi
callq 0xac88
leaq -0x1b9(%rbp), %rdi
callq 0xa640
movsbl -0x12(%rbp), %eax
movl %eax, -0x1ec(%rbp)
testl %eax, %eax
je 0x50a87
jmp 0x50947
movl -0x1ec(%rbp), %eax
subl $0x1, %eax
je 0x50a90
jmp 0x50958
movl -0x1ec(%rbp), %eax
subl $0x3f, %eax
je 0x50a00
jmp 0x50969
movl -0x1ec(%rbp), %eax
subl $0x66, %eax
je 0x50a46
jmp 0x5097a
movl -0x1ec(%rbp), %eax
subl $0x68, %eax
je 0x50a99
jmp 0x5098b
movl -0x1ec(%rbp), %eax
subl $0x6e, %eax
je 0x50a70
jmp 0x5099c
movl -0x1ec(%rbp), %eax
subl $0x73, %eax
je 0x50a09
jmp 0x509a9
movl -0x1ec(%rbp), %eax
subl $0x77, %eax
je 0x50a59
jmp 0x50ab5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
jmp 0x509ef
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 0x50c04
movb $0x1, -0x11(%rbp)
jmp 0x50ab5
leaq 0x1493f0(%rip), %rsi    # 0x199e00
leaq -0x198(%rbp), %rdi
callq 0xa750
jmp 0x50a1e
jmp 0x50ab5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
leaq -0x198(%rbp), %rdi
callq 0xa290
jmp 0x50c04
movb $0x1, 0x149420(%rip)    # 0x199e6d
movl $0x1388, 0x148c69(%rip) # imm = 0x1388
jmp 0x50ab5
leaq 0x148c64(%rip), %rsi    # 0x1996c4
leaq -0x198(%rbp), %rdi
callq 0xa370
jmp 0x50a6e
jmp 0x50ab5
leaq 0x1493a9(%rip), %rsi    # 0x199e20
leaq -0x198(%rbp), %rdi
callq 0xa750
jmp 0x50a85
jmp 0x50ab5
movb $0x1, 0x1493de(%rip)    # 0x199e6c
jmp 0x50ab5
movb $0x1, 0x1493d7(%rip)    # 0x199e6e
jmp 0x50ab5
movq 0x148c30(%rip), %rsi    # 0x1996d0
movq 0x148511(%rip), %rdi    # 0x198fb8
callq 0xa5c0
jmp 0x50aae
xorl %edi, %edi
callq 0xa700
leaq -0x198(%rbp), %rdi
callq 0xa290
jmp 0x50866
leaq 0x149353(%rip), %rdi    # 0x199e20
leaq 0xe540b(%rip), %rsi     # 0x135edf
callq 0x2d770
testb $0x1, %al
jne 0x50adf
jmp 0x50b19
testb $0x1, 0x149387(%rip)    # 0x199e6d
je 0x50afb
leaq 0x149331(%rip), %rdi    # 0x199e20
leaq 0xf0106(%rip), %rsi     # 0x140bfc
callq 0xa810
testb $0x1, 0x14936b(%rip)    # 0x199e6d
jne 0x50b17
leaq 0x149315(%rip), %rdi    # 0x199e20
leaq 0xe2e74(%rip), %rsi     # 0x133986
callq 0xa810
jmp 0x50b19
movl -0x4(%rbp), %eax
movq 0x14849d(%rip), %rcx    # 0x198fc0
subl (%rcx), %eax
cmpl $0x2, %eax
jge 0x50b43
movq 0x1484bf(%rip), %rdi    # 0x198ff0
leaq 0xe18f2(%rip), %rsi     # 0x13242a
callq 0xa5c0
movb $0x1, -0x11(%rbp)
jmp 0x50b6d
movl -0x4(%rbp), %eax
movq 0x148473(%rip), %rcx    # 0x198fc0
subl (%rcx), %eax
cmpl $0x2, %eax
jle 0x50b6b
movq 0x148495(%rip), %rdi    # 0x198ff0
leaq 0xe18db(%rip), %rsi     # 0x13243d
callq 0xa5c0
movb $0x1, -0x11(%rbp)
jmp 0x50b6d
testb $0x1, -0x11(%rbp)
je 0x50b9f
movq 0x14843e(%rip), %rdi    # 0x198fb8
leaq 0xded0c(%rip), %rsi     # 0x12f88d
callq 0xa5c0
movq %rax, %rdi
movq 0x148b40(%rip), %rsi    # 0x1996d0
callq 0xa5c0
movl $0x1, %edi
callq 0xa700
movq -0x10(%rbp), %rax
movq 0x148416(%rip), %rcx    # 0x198fc0
movl (%rcx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movq 0x148408(%rip), %rdx    # 0x198fc0
movl %esi, (%rdx)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x1491f8(%rip), %rdi    # 0x199dc0
callq 0xa810
movq -0x10(%rbp), %rax
movq 0x1483e8(%rip), %rcx    # 0x198fc0
movl (%rcx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movq 0x1483da(%rip), %rdx    # 0x198fc0
movl %esi, (%rdx)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x1491ea(%rip), %rdi    # 0x199de0
callq 0xa810
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
movq -0x1c8(%rbp), %rdi
callq 0xab50