// File: /workspace/github_c_makefile_star2_O3/debbiemarkslab[P]plmc/src/main.c
// Function: main
int main(int argc, char **argv) {
    char *alignFile = NULL;
    char *outputFile = NULL;
    char *couplingsFile = NULL;
    char *weightsFile = NULL;
    char *weightsOutputFile = NULL;
    options_t *options = default_options();

    /* Print usage if no arguments */
    if (argc == 1) {
        fprintf(stderr, "%s", usage);
        exit(1);
    }

    /* Parse command line arguments */
    for (int arg = 1; arg < argc; arg++) {
        if ((arg < argc-1) && (strcmp(argv[arg], "--output") == 0
                    || strcmp(argv[arg], "-o") == 0)) {
            outputFile = argv[++arg];
        } else if ((arg < argc-1) && (strcmp(argv[arg], "--alphabet") == 0
                    || strcmp(argv[arg], "-a") == 0)) {
            options->alphabet = argv[++arg];
        } else if ((arg < argc-1) && (strcmp(argv[arg], "--couplings") == 0
                    || strcmp(argv[arg], "-c") == 0)) {
            couplingsFile = argv[++arg];
        } else if ((arg < argc-1) && (strcmp(argv[arg], "--lambdah") == 0
                    || strcmp(argv[arg], "-lh") == 0)) {
            options->lambdaH = atof(argv[++arg]);
        } else if ((arg < argc-1) && (strcmp(argv[arg], "--lambdae") == 0
                    || strcmp(argv[arg], "-le") == 0)) {
            options->lambdaE = atof(argv[++arg]);
        } else if ((arg < argc-1) && (strcmp(argv[arg], "--lambdag") == 0
                    || strcmp(argv[arg], "-lg") == 0)) {
            options->lambdaGroup = atof(argv[++arg]);
        } else if ((arg < argc-1) && (strcmp(argv[arg], "--theta") == 0
                    || strcmp(argv[arg], "-t") == 0)) {
            options->theta = atof(argv[++arg]);
        } else if ((arg < argc-1) && (strcmp(argv[arg], "--scale") == 0
                    || strcmp(argv[arg], "-s") == 0)) {
            options->scale = atof(argv[++arg]);
        } else if ((arg < argc-1)  && (strcmp(argv[arg], "--maxiter") == 0
                    || strcmp(argv[arg], "-m") == 0)) {
            options->maxIter = atoi(argv[++arg]);
        } else if ((arg < argc-1) && (strcmp(argv[arg], "--independent") == 0
                    || strcmp(argv[arg], "-i") == 0)) {
            options->usePairs = 0;
            fprintf(stderr, "Independent model not yet implemented\n");
            exit(0);
        } else if ((arg < argc-1) && (strcmp(argv[arg], "--gapreduce") == 0
                    || strcmp(argv[arg], "-g") == 0)) {
            options->estimatorMAP = INFER_MAP_PLM_GAPREDUCE;
        } else if ((arg < argc-1) && (strcmp(argv[arg], "--estimatele") == 0
                    || strcmp(argv[arg], "-ee") == 0)) {
            options->zeroAPC = 1;
        } else if ((arg < argc-1) && (strcmp(argv[arg], "--focus") == 0
                    || strcmp(argv[arg], "-f") == 0)) {
            options->target = argv[++arg];
        } else if ((arg < argc-1) && strcmp(argv[arg], "--fast") == 0) {
            options->sgd = 1;
            options->fastWeights = 100;
        } else if ((arg < argc-1) && (strcmp(argv[arg], "--weights") == 0
                    || strcmp(argv[arg], "-w") == 0)) {
            weightsFile = argv[++arg];
        } else if ((arg < argc-1) && (strcmp(argv[arg], "--save-weights") == 0)) {
            weightsOutputFile = argv[++arg];
        } else if ((arg < argc-1) && (strcmp(argv[arg], "--ncores") == 0
                    || strcmp(argv[arg], "-n") == 0)) {
            #if defined(_OPENMP)
                if (strcmp(argv[arg + 1], "max") == 0) {
                    int maxThreads = omp_get_max_threads();
                    /* Redundant, but serves as sanity check */
                    omp_set_num_threads(maxThreads);
                    fprintf(stderr, "OpenMP: Using %d of %d threads\n",
                        maxThreads, maxThreads);
                } else {
                    int numThreads = atoi(argv[arg + 1]);
                    int maxThreads = omp_get_max_threads();
                    if (numThreads >= 1 && numThreads <= maxThreads) {
                        omp_set_num_threads(numThreads);
                        fprintf(stderr, "OpenMP: Using %d of %d threads\n",
                            numThreads, maxThreads);
                    } else if (numThreads > maxThreads) {
                        omp_set_num_threads(maxThreads);
                        fprintf(stderr, "OpenMP: More threads requested than "
                            "available. Using %d of %d threads instead.\n",
                            maxThreads, maxThreads);
                    } else {
                        omp_set_num_threads(1);
                        fprintf(stderr, "OpenMP: Using 1 of %d threads\n",
                            maxThreads);
                    }
                }
                arg++;
            #else
                fprintf(stderr, "Error (-n/--ncores) only available when "
                    "compiled with OpenMP\n");
                exit(1);
            #endif
        } else if (strcmp(argv[arg], "--help") == 0
                    || strcmp(argv[arg], "-h") == 0) {
            fprintf(stderr, "%s", usage);
            exit(1);
        }
    }
    alignFile = argv[argc - 1];

    run_plmc(alignFile, outputFile, couplingsFile, weightsFile, weightsOutputFile, options);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movl %edi, %r15d
xorl %eax, %eax
callq 0x4ae0
movq %rax, 0x8(%rsp)
cmpl $0x1, %r15d
je 0xc955
jle 0xc8f5
leal -0x1(%r15), %eax
movl %eax, 0x34(%rsp)
movl $0x1, %ebx
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movslq %ebx, %r12
movq (%r14,%r12,8), %r13
cmpl 0x34(%rsp), %ebx
jge 0xc84e
movq %r13, %rdi
leaq 0x1e7a(%rip), %rsi      # 0xe222
callq 0x1170
testl %eax, %eax
je 0xc412
movb (%r13), %bpl
cmpb $0x2d, %bpl
jne 0xc426
cmpb $0x6f, 0x1(%r13)
jne 0xc3c9
cmpb $0x0, 0x2(%r13)
je 0xc412
movq %r13, %rdi
leaq 0x1e58(%rip), %rsi      # 0xe22b
callq 0x1170
testl %eax, %eax
je 0xc55a
cmpb $0x61, 0x1(%r13)
jne 0xc590
cmpb $0x0, 0x2(%r13)
je 0xc55a
movq %r13, %rdi
leaq 0x1e36(%rip), %rsi      # 0xe236
callq 0x1170
testl %eax, %eax
jne 0xc5ad
jmp 0xc5c3
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rax
movq %rax, 0x28(%rsp)
jmp 0xc87e
movq %r13, %rdi
leaq 0x1dfb(%rip), %rsi      # 0xe22b
callq 0x1170
testl %eax, %eax
je 0xc55a
movq %r13, %rdi
leaq 0x1def(%rip), %rsi      # 0xe236
callq 0x1170
testl %eax, %eax
je 0xc5c3
movq %r13, %rdi
leaq 0x1de4(%rip), %rsi      # 0xe242
callq 0x1170
testl %eax, %eax
je 0xc572
movq %r13, %rdi
leaq 0x1dd7(%rip), %rsi      # 0xe24c
callq 0x1170
testl %eax, %eax
je 0xc572
movq %r13, %rdi
leaq 0x1dc4(%rip), %rsi      # 0xe250
callq 0x1170
testl %eax, %eax
je 0xc5d7
movq %r13, %rdi
leaq 0x1db7(%rip), %rsi      # 0xe25a
callq 0x1170
testl %eax, %eax
je 0xc5d7
movq %r13, %rdi
leaq 0x1da4(%rip), %rsi      # 0xe25e
callq 0x1170
testl %eax, %eax
je 0xc5f5
movq %r13, %rdi
leaq 0x1d97(%rip), %rsi      # 0xe268
callq 0x1170
testl %eax, %eax
je 0xc5f5
movq %r13, %rdi
leaq 0x1d84(%rip), %rsi      # 0xe26c
callq 0x1170
testl %eax, %eax
je 0xc613
cmpb $0x2d, %bpl
jne 0xc631
cmpb $0x74, 0x1(%r13)
jne 0xc511
cmpb $0x0, 0x2(%r13)
je 0xc613
movq %r13, %rdi
leaq 0x1d59(%rip), %rsi      # 0xe274
callq 0x1170
testl %eax, %eax
je 0xc694
cmpb $0x73, 0x1(%r13)
jne 0xc6b2
cmpb $0x0, 0x2(%r13)
je 0xc694
movq %r13, %rdi
leaq 0x1d34(%rip), %rsi      # 0xe27c
callq 0x1170
testl %eax, %eax
jne 0xc6cb
jmp 0xc71a
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rax
movq 0x8(%rsp), %rcx
movq %rax, 0x8(%rcx)
jmp 0xc87e
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x1090
movq 0x8(%rsp), %rax
movsd %xmm0, 0x40(%rax)
jmp 0xc87e
movq %r13, %rdi
leaq 0x1c9c(%rip), %rsi      # 0xe236
callq 0x1170
testl %eax, %eax
je 0xc5c3
cmpb $0x2d, %bpl
jne 0xc454
cmpb $0x63, 0x1(%r13)
jne 0xc454
cmpb $0x0, 0x2(%r13)
jne 0xc454
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rax
movq %rax, 0x20(%rsp)
jmp 0xc87e
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x1090
movq 0x8(%rsp), %rax
movsd %xmm0, 0x48(%rax)
jmp 0xc87e
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x1090
movq 0x8(%rsp), %rax
movsd %xmm0, 0x50(%rax)
jmp 0xc87e
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x1090
movq 0x8(%rsp), %rax
movsd %xmm0, 0x30(%rax)
jmp 0xc87e
movq %r13, %rdi
leaq 0x1c39(%rip), %rsi      # 0xe274
callq 0x1170
testl %eax, %eax
je 0xc694
movq %r13, %rdi
leaq 0x1c2e(%rip), %rsi      # 0xe27c
callq 0x1170
testl %eax, %eax
je 0xc71a
movq %r13, %rdi
leaq 0x1c21(%rip), %rsi      # 0xe286
callq 0x1170
testl %eax, %eax
je 0xc95a
cmpb $0x2d, %bpl
je 0xc6f0
movq %r13, %rdi
leaq 0x1c39(%rip), %rsi      # 0xe2bb
callq 0x1170
testl %eax, %eax
jne 0xc765
jmp 0xc88e
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x1090
movq 0x8(%rsp), %rax
movsd %xmm0, 0x38(%rax)
jmp 0xc87e
movq %r13, %rdi
leaq 0x1bc0(%rip), %rsi      # 0xe27c
callq 0x1170
testl %eax, %eax
je 0xc71a
cmpb $0x2d, %bpl
jne 0xc65b
cmpb $0x6d, 0x1(%r13)
jne 0xc6d9
cmpb $0x0, 0x2(%r13)
je 0xc71a
movq %r13, %rdi
leaq 0x1ba3(%rip), %rsi      # 0xe286
callq 0x1170
testl %eax, %eax
je 0xc95a
cmpb $0x69, 0x1(%r13)
jne 0xc736
cmpb $0x0, 0x2(%r13)
je 0xc95a
movq %r13, %rdi
leaq 0x1baf(%rip), %rsi      # 0xe2bb
callq 0x1170
testl %eax, %eax
jne 0xc753
jmp 0xc88e
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x11e0
movq 0x8(%rsp), %rcx
movl %eax, 0x1c(%rcx)
jmp 0xc87e
movq %r13, %rdi
leaq 0x1b7b(%rip), %rsi      # 0xe2bb
callq 0x1170
testl %eax, %eax
je 0xc88e
cmpb $0x2d, %bpl
jne 0xc765
cmpb $0x67, 0x1(%r13)
jne 0xc765
cmpb $0x0, 0x2(%r13)
je 0xc88e
movq %r13, %rdi
leaq 0x1b58(%rip), %rsi      # 0xe2c7
callq 0x1170
testl %eax, %eax
je 0xc89c
movq %r13, %rdi
leaq 0x1b4e(%rip), %rsi      # 0xe2d4
callq 0x1170
testl %eax, %eax
je 0xc89c
movq %r13, %rdi
leaq 0x1b3b(%rip), %rsi      # 0xe2d8
callq 0x1170
testl %eax, %eax
je 0xc8aa
cmpb $0x2d, %bpl
jne 0xc7c2
cmpb $0x66, 0x1(%r13)
jne 0xc7c2
cmpb $0x0, 0x2(%r13)
je 0xc8aa
movq %r13, %rdi
leaq 0x1b14(%rip), %rsi      # 0xe2e0
callq 0x1170
testl %eax, %eax
je 0xc8be
movq %r13, %rdi
leaq 0x1b04(%rip), %rsi      # 0xe2e7
callq 0x1170
testl %eax, %eax
je 0xc8d3
cmpb $0x2d, %bpl
jne 0xc808
cmpb $0x77, 0x1(%r13)
jne 0xc808
cmpb $0x0, 0x2(%r13)
je 0xc8d3
movq %r13, %rdi
leaq 0x1adf(%rip), %rsi      # 0xe2f1
callq 0x1170
testl %eax, %eax
je 0xc8e4
movq %r13, %rdi
leaq 0x1ad7(%rip), %rsi      # 0xe300
callq 0x1170
testl %eax, %eax
je 0xc964
cmpb $0x2d, %bpl
jne 0xc84e
cmpb $0x6e, 0x1(%r13)
jne 0xc84e
cmpb $0x0, 0x2(%r13)
je 0xc964
movq %r13, %rdi
leaq 0x1aef(%rip), %rsi      # 0xe347
callq 0x1170
testl %eax, %eax
je 0xc950
cmpb $0x2d, (%r13)
jne 0xc87e
cmpb $0x68, 0x1(%r13)
jne 0xc87e
cmpb $0x0, 0x2(%r13)
je 0xc950
incl %ebx
cmpl %r15d, %ebx
jl 0xc38d
jmp 0xc919
movq 0x8(%rsp), %rax
movl $0x1, 0x18(%rax)
jmp 0xc87e
movq 0x8(%rsp), %rax
movl $0x1, 0x58(%rax)
jmp 0xc87e
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
jmp 0xc87e
movq 0x8(%rsp), %rax
movl $0x1, 0x20(%rax)
movl $0x64, 0x28(%rax)
jmp 0xc87e
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rax
movq %rax, 0x18(%rsp)
jmp 0xc87e
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rax
movq %rax, 0x10(%rsp)
jmp 0xc87e
movq $0x0, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movslq %r15d, %rax
movq -0x8(%r14,%rax,8), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %r9
callq 0x4b37
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2351
callq 0x23bd
movq 0x8(%rsp), %rdi
callq 0x2395
callq 0x2370