// File: c2-d2[P]disty/src/main.cpp
// Function: parse_arguments(int, char const**, params_t&)
void parse_arguments(int argc, const char **argv, params_t &params) {
    if (argc==1){
        cerr << USAGE << endl;
        exit(1);
    }

    int c;
    while ((c = getopt(argc, (char *const *)argv, "hvi:s:n:")) >= 0) {
        switch (c) {
            case 'h': {
                cout << USAGE << endl;
                exit(0);
            }
            case 'v': {
                cout << DISTY_VERSION << endl;
                exit(0);
            }
            case 'i': {
                int val=atoi(optarg);
                assert(val>=0);
                assert(val<(int)input_t::_MAX);
                params.input=static_cast<input_t>(val);
                break;
            }
            case 's': {
                int val=atoi(optarg);
                assert(val>=0);
                assert(val<(int)n_strategy_t::_MAX);
                params.n_strategy=static_cast<n_strategy_t>(val);
                break;
            }
            case 'n': {
                float val=atof(optarg);
                assert(val>=0.0);
                assert(val<=1.0);
                params.skip_n=val;
                break;
            }
            case '?': {
                cerr << "Unknown error" << endl;
                exit(1);
            }
            default: {
                cerr << "Unknown option " << c << endl;
                exit(1);
            }
        }
    }

    argc -= optind;
    argv += optind;

    if(argc != 1){
        cerr << USAGE << endl;
        exit(1);
    }
    else {
        params.fasta_fn=string(argv[0]);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpl $0x1, -0x4(%rbp)
jne 0x25e8
movq 0xaa2d(%rip), %rdi      # 0xcff0
leaq 0xac4e(%rip), %rsi      # 0xd218
callq 0x21c0
movq %rax, %rdi
movq 0xa9cf(%rip), %rsi      # 0xcfa8
callq 0x2210
movl $0x1, %edi
callq 0x2290
jmp 0x25ea
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x5fc0(%rip), %rdx      # 0x85b8
callq 0x2050
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jl 0x285d
movl -0x1c(%rbp), %eax
addl $-0x3f, %eax
movl %eax, %ecx
movq %rcx, -0x68(%rbp)
subl $0x37, %eax
ja 0x2821
movq -0x68(%rbp), %rax
leaq 0x59e7(%rip), %rcx      # 0x8010
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xa98f(%rip), %rdi      # 0xcfc8
leaq 0xabd8(%rip), %rsi      # 0xd218
callq 0x21c0
movq %rax, %rdi
movq 0xa959(%rip), %rsi      # 0xcfa8
callq 0x2210
xorl %edi, %edi
callq 0x2290
movq 0xa966(%rip), %rdi      # 0xcfc8
leaq 0x5f58(%rip), %rsi      # 0x85c1
callq 0x21d0
movq %rax, %rdi
movq 0xa930(%rip), %rsi      # 0xcfa8
callq 0x2210
xorl %edi, %edi
callq 0x2290
movq 0xa925(%rip), %rax      # 0xcfb0
movq (%rax), %rdi
callq 0x2310
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jl 0x269e
jmp 0x26bd
leaq 0x5f22(%rip), %rdi      # 0x85c7
leaq 0x5f22(%rip), %rsi      # 0x85ce
movl $0xbb, %edx
leaq 0x5f23(%rip), %rcx      # 0x85db
callq 0x2110
cmpl $0x2, -0x20(%rbp)
jge 0x26c5
jmp 0x26e4
leaq 0x5f44(%rip), %rdi      # 0x8610
leaq 0x5efb(%rip), %rsi      # 0x85ce
movl $0xbc, %edx
leaq 0x5efc(%rip), %rcx      # 0x85db
callq 0x2110
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x20(%rax)
jmp 0x2858
movq 0xa8b6(%rip), %rax      # 0xcfb0
movq (%rax), %rdi
callq 0x2310
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x270d
jmp 0x272c
leaq 0x5eb3(%rip), %rdi      # 0x85c7
leaq 0x5eb3(%rip), %rsi      # 0x85ce
movl $0xc2, %edx
leaq 0x5eb4(%rip), %rcx      # 0x85db
callq 0x2110
cmpl $0x5, -0x24(%rbp)
jge 0x2734
jmp 0x2753
leaq 0x5eec(%rip), %rdi      # 0x8627
leaq 0x5e8c(%rip), %rsi      # 0x85ce
movl $0xc3, %edx
leaq 0x5e8d(%rip), %rcx      # 0x85db
callq 0x2110
movl -0x24(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
jmp 0x2858
movq 0xa847(%rip), %rax      # 0xcfb0
movq (%rax), %rdi
callq 0x22c0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x28(%rbp)
movss -0x28(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x278e
jmp 0x27ad
leaq 0x5eae(%rip), %rdi      # 0x8643
leaq 0x5e32(%rip), %rsi      # 0x85ce
movl $0xc9, %edx
leaq 0x5e33(%rip), %rcx      # 0x85db
callq 0x2110
movss -0x28(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x584a(%rip), %xmm0     # 0x8008
ucomisd %xmm1, %xmm0
jb 0x27c6
jmp 0x27e5
leaq 0x5e7f(%rip), %rdi      # 0x864c
leaq 0x5dfa(%rip), %rsi      # 0x85ce
movl $0xca, %edx
leaq 0x5dfb(%rip), %rcx      # 0x85db
callq 0x2110
movss -0x28(%rbp), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x28(%rax)
jmp 0x2858
movq 0xa7f4(%rip), %rdi      # 0xcff0
leaq 0x5e52(%rip), %rsi      # 0x8655
callq 0x21d0
movq %rax, %rdi
movq 0xa796(%rip), %rsi      # 0xcfa8
callq 0x2210
movl $0x1, %edi
callq 0x2290
movq 0xa7c8(%rip), %rdi      # 0xcff0
leaq 0x5e34(%rip), %rsi      # 0x8663
callq 0x21d0
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x2360
movq %rax, %rdi
movq 0xa75f(%rip), %rsi      # 0xcfa8
callq 0x2210
movl $0x1, %edi
callq 0x2290
jmp 0x25ea
movq 0xa76c(%rip), %rax      # 0xcfd0
movl (%rax), %ecx
movl -0x4(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x4(%rbp)
movq 0xa75b(%rip), %rax      # 0xcfd0
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
cmpl $0x1, -0x4(%rbp)
je 0x28bb
movq 0xa75a(%rip), %rdi      # 0xcff0
leaq 0xa97b(%rip), %rsi      # 0xd218
callq 0x21c0
movq %rax, %rdi
movq 0xa6fc(%rip), %rsi      # 0xcfa8
callq 0x2210
movl $0x1, %edi
callq 0x2290
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
leaq -0x49(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x2380
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0x4030
jmp 0x28e6
movq -0x18(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x22a0
leaq -0x48(%rbp), %rdi
callq 0x23e8
leaq -0x49(%rbp), %rdi
callq 0x2230
jmp 0x291e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x49(%rbp), %rdi
callq 0x2230
jmp 0x2927
addq $0x80, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x2370