// File: millanek[P]Dsuite/D.cpp
// Function: parseAbbaBabaOptions(int, char**)
void parseAbbaBabaOptions(int argc, char** argv) {
    bool die = false;
    std::vector<string> windowSizeStep;
    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 'w':
                windowSizeStep = split(arg.str(), ',');
                if(windowSizeStep.size() != 2) {std::cerr << "The -w option requires two arguments, separated by a comma ','\n"; exit(EXIT_FAILURE);}
                opt::windowSize = atoi(windowSizeStep[0].c_str());
                opt::windowStep = atoi(windowSizeStep[1].c_str());
                break;
            case 'n': arg >> opt::runName; break;
            case 'g': opt::useGenotypeProbabilities = true; break;
            case 'h':
                std::cout << ABBA_USAGE_MESSAGE;
                exit(EXIT_SUCCESS);
        }
    }
    
    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" << ABBA_USAGE_MESSAGE;
        exit(EXIT_FAILURE);
    }
    
    // Parse the input filenames
    opt::vcfFile = argv[optind++];
    opt::setsFile = argv[optind++];
    opt::testTriosFile = argv[optind++];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x11d80
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movq 0x9fe5b(%rip), %rdx     # 0xbf638
leaq 0x9ec3c(%rip), %rcx     # 0xbe420
xorl %eax, %eax
movl %eax, %r8d
callq 0x8970
movb %al, -0x31(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0x1faa6
movq 0x9f764(%rip), %rax     # 0xbef68
cmpq $0x0, (%rax)
je 0x1f81d
movq 0x9f757(%rip), %rax     # 0xbef68
movq (%rax), %rax
movq %rax, -0x230(%rbp)
jmp 0x1f82d
leaq 0x6bb45(%rip), %rax     # 0x8b369
movq %rax, -0x230(%rbp)
jmp 0x1f82d
movq -0x230(%rbp), %rax
movq %rax, -0x240(%rbp)
leaq -0x1d9(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x8a60
movq -0x240(%rbp), %rsi
movq -0x238(%rbp), %rdx
leaq -0x1d8(%rbp), %rdi
callq 0x9a00
jmp 0x1f86a
leaq -0x1b8(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
movl $0x8, %edx
callq 0x89a0
jmp 0x1f884
leaq -0x1d8(%rbp), %rdi
callq 0x8c08
leaq -0x1d9(%rbp), %rdi
callq 0x8610
movsbl -0x31(%rbp), %eax
movl %eax, -0x244(%rbp)
subl $0x3f, %eax
je 0x1f937
jmp 0x1f8b1
movl -0x244(%rbp), %eax
subl $0x67, %eax
je 0x1fa5f
jmp 0x1f8c2
movl -0x244(%rbp), %eax
subl $0x68, %eax
je 0x1fa68
jmp 0x1f8d3
movl -0x244(%rbp), %eax
subl $0x6e, %eax
je 0x1fa48
jmp 0x1f8e4
movl -0x244(%rbp), %eax
subl $0x77, %eax
je 0x1f940
jmp 0x1fa84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e8(%rbp)
movl %eax, -0x1ec(%rbp)
jmp 0x1f926
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e8(%rbp)
movl %eax, -0x1ec(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x8c08
leaq -0x1d9(%rbp), %rdi
callq 0x8610
jmp 0x1fbda
movb $0x1, -0x11(%rbp)
jmp 0x1fa84
leaq -0x228(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x88a0
jmp 0x1f955
leaq -0x208(%rbp), %rdi
leaq -0x228(%rbp), %rsi
movl $0x2c, %edx
callq 0xaef0
jmp 0x1f96f
leaq -0x30(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x20aa0
leaq -0x208(%rbp), %rdi
callq 0x10760
leaq -0x228(%rbp), %rdi
callq 0x8c08
leaq -0x30(%rbp), %rdi
callq 0x10740
cmpq $0x2, %rax
je 0x1f9ff
movq 0x9f643(%rip), %rdi     # 0xbeff0
leaq 0x6904e(%rip), %rsi     # 0x88a02
callq 0x8590
jmp 0x1f9bb
movl $0x1, %edi
callq 0x86e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e8(%rbp)
movl %eax, -0x1ec(%rbp)
jmp 0x1fa95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e8(%rbp)
movl %eax, -0x1ec(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x8c08
jmp 0x1fa95
leaq -0x30(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x10b10
movq %rax, %rdi
callq 0x8230
movq %rax, %rdi
callq 0x88e0
movl %eax, 0x9fc0e(%rip)     # 0xbf630
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x10b10
movq %rax, %rdi
callq 0x8230
movq %rax, %rdi
callq 0x88e0
movl %eax, 0x9fbee(%rip)     # 0xbf634
jmp 0x1fa84
leaq 0xa0311(%rip), %rsi     # 0xbfd60
leaq -0x1b8(%rbp), %rdi
callq 0x8730
jmp 0x1fa5d
jmp 0x1fa84
movb $0x1, 0xa031a(%rip)     # 0xbfd80
jmp 0x1fa84
movq 0x9fbd1(%rip), %rsi     # 0xbf640
movq 0x9f532(%rip), %rdi     # 0xbefa8
callq 0x8590
jmp 0x1fa7d
xorl %edi, %edi
callq 0x86e0
leaq -0x1b8(%rbp), %rdi
callq 0x8290
jmp 0x1f7cf
leaq -0x1b8(%rbp), %rdi
callq 0x8290
jmp 0x1fbda
movl -0x4(%rbp), %eax
movq 0x9f500(%rip), %rcx     # 0xbefb0
subl (%rcx), %eax
cmpl $0x3, %eax
jge 0x1fae9
movq 0x9f532(%rip), %rdi     # 0xbeff0
leaq 0x68f7d(%rip), %rsi     # 0x88a42
callq 0x8590
jmp 0x1facc
movb $0x1, -0x11(%rbp)
jmp 0x1fb15
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e8(%rbp)
movl %eax, -0x1ec(%rbp)
jmp 0x1fbda
movl -0x4(%rbp), %eax
movq 0x9f4bd(%rip), %rcx     # 0xbefb0
subl (%rcx), %eax
cmpl $0x3, %eax
jle 0x1fb13
movq 0x9f4ef(%rip), %rdi     # 0xbeff0
leaq 0x68f4d(%rip), %rsi     # 0x88a55
callq 0x8590
jmp 0x1fb0f
movb $0x1, -0x11(%rbp)
jmp 0x1fb15
testb $0x1, -0x11(%rbp)
je 0x1fb56
movq 0x9f486(%rip), %rdi     # 0xbefa8
leaq 0x68911(%rip), %rsi     # 0x8843a
callq 0x8590
movq %rax, -0x250(%rbp)
jmp 0x1fb37
movq -0x250(%rbp), %rdi
movq 0x9fafb(%rip), %rsi     # 0xbf640
callq 0x8590
jmp 0x1fb4c
movl $0x1, %edi
callq 0x86e0
movq -0x10(%rbp), %rax
movq 0x9f44f(%rip), %rdx     # 0xbefb0
movslq (%rdx), %rcx
movl %ecx, %esi
incl %esi
movl %esi, (%rdx)
movq (%rax,%rcx,8), %rsi
leaq 0xa018b(%rip), %rdi     # 0xbfd00
callq 0x87c0
jmp 0x1fb7c
movq -0x10(%rbp), %rax
movq 0x9f429(%rip), %rdx     # 0xbefb0
movslq (%rdx), %rcx
movl %ecx, %esi
incl %esi
movl %esi, (%rdx)
movq (%rax,%rcx,8), %rsi
leaq 0xa0185(%rip), %rdi     # 0xbfd20
callq 0x87c0
jmp 0x1fba2
movq -0x10(%rbp), %rax
movq 0x9f403(%rip), %rdx     # 0xbefb0
movslq (%rdx), %rcx
movl %ecx, %esi
incl %esi
movl %esi, (%rdx)
movq (%rax,%rcx,8), %rsi
leaq 0xa017f(%rip), %rdi     # 0xbfd40
callq 0x87c0
jmp 0x1fbc8
leaq -0x30(%rbp), %rdi
callq 0x10760
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x10760
movq -0x1e8(%rbp), %rdi
callq 0x8a50
nop