// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %rsi, %r14
movl %edi, %r15d
xorl %eax, %eax
callq 0x5688
movq %rax, (%rsp)
cmpl $0x1, %r15d
je 0xd0ba
jle 0xd05b
leal -0x1(%r15), %ebp
movl $0x1, %ebx
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movslq %ebx, %r12
cmpl %ebp, %ebx
jge 0xced7
movq (%r14,%r12,8), %r13
movq %r13, %rdi
leaq 0x2635(%rip), %rsi      # 0xf236
callq 0x1160
testl %eax, %eax
je 0xcf0e
movq %r13, %rdi
leaq 0x2627(%rip), %rsi      # 0xf23f
callq 0x1160
testl %eax, %eax
je 0xcf0e
movq %r13, %rdi
leaq 0x2613(%rip), %rsi      # 0xf242
callq 0x1160
testl %eax, %eax
je 0xcf22
movq %r13, %rdi
leaq 0x2607(%rip), %rsi      # 0xf24d
callq 0x1160
testl %eax, %eax
je 0xcf22
movq %r13, %rdi
leaq 0x25f3(%rip), %rsi      # 0xf250
callq 0x1160
testl %eax, %eax
je 0xcf39
movq %r13, %rdi
leaq 0x25e8(%rip), %rsi      # 0xf25c
callq 0x1160
testl %eax, %eax
je 0xcf39
movq %r13, %rdi
leaq 0x25d4(%rip), %rsi      # 0xf25f
callq 0x1160
testl %eax, %eax
je 0xcf4d
movq %r13, %rdi
leaq 0x25c7(%rip), %rsi      # 0xf269
callq 0x1160
testl %eax, %eax
je 0xcf4d
movq %r13, %rdi
leaq 0x25b4(%rip), %rsi      # 0xf26d
callq 0x1160
testl %eax, %eax
je 0xcf6a
movq %r13, %rdi
leaq 0x25a7(%rip), %rsi      # 0xf277
callq 0x1160
testl %eax, %eax
je 0xcf6a
movq %r13, %rdi
leaq 0x2594(%rip), %rsi      # 0xf27b
callq 0x1160
testl %eax, %eax
je 0xcf87
movq %r13, %rdi
leaq 0x2587(%rip), %rsi      # 0xf285
callq 0x1160
testl %eax, %eax
je 0xcf87
movq %r13, %rdi
leaq 0x2574(%rip), %rsi      # 0xf289
callq 0x1160
testl %eax, %eax
je 0xcfa1
movq %r13, %rdi
leaq 0x2565(%rip), %rsi      # 0xf291
callq 0x1160
testl %eax, %eax
je 0xcfa1
movq %r13, %rdi
leaq 0x2551(%rip), %rsi      # 0xf294
callq 0x1160
testl %eax, %eax
je 0xcfbb
movq %r13, %rdi
leaq 0x2542(%rip), %rsi      # 0xf29c
callq 0x1160
testl %eax, %eax
je 0xcfbb
movq %r13, %rdi
leaq 0x252e(%rip), %rsi      # 0xf29f
callq 0x1160
testl %eax, %eax
je 0xcfd5
movq %r13, %rdi
leaq 0x2521(%rip), %rsi      # 0xf2a9
callq 0x1160
testl %eax, %eax
je 0xcfd5
movq %r13, %rdi
leaq 0x250d(%rip), %rsi      # 0xf2ac
callq 0x1160
testl %eax, %eax
je 0xd0bf
movq %r13, %rdi
leaq 0x2504(%rip), %rsi      # 0xf2ba
callq 0x1160
testl %eax, %eax
je 0xd0bf
movq %r13, %rdi
leaq 0x2517(%rip), %rsi      # 0xf2e4
callq 0x1160
testl %eax, %eax
je 0xcfed
movq %r13, %rdi
leaq 0x250c(%rip), %rsi      # 0xf2f0
callq 0x1160
testl %eax, %eax
je 0xcfed
movq %r13, %rdi
leaq 0x24f8(%rip), %rsi      # 0xf2f3
callq 0x1160
testl %eax, %eax
je 0xcffa
movq %r13, %rdi
leaq 0x24ee(%rip), %rsi      # 0xf300
callq 0x1160
testl %eax, %eax
je 0xcffa
movq %r13, %rdi
leaq 0x24db(%rip), %rsi      # 0xf304
callq 0x1160
testl %eax, %eax
je 0xd007
movq %r13, %rdi
leaq 0x24cc(%rip), %rsi      # 0xf30c
callq 0x1160
testl %eax, %eax
je 0xd007
movq %r13, %rdi
leaq 0x24b8(%rip), %rsi      # 0xf30f
callq 0x1160
testl %eax, %eax
je 0xd036
movq %r13, %rdi
leaq 0x24a8(%rip), %rsi      # 0xf316
callq 0x1160
testl %eax, %eax
je 0xd025
movq %r13, %rdi
leaq 0x249b(%rip), %rsi      # 0xf320
callq 0x1160
testl %eax, %eax
je 0xd025
movq %r13, %rdi
leaq 0x2487(%rip), %rsi      # 0xf323
callq 0x1160
testl %eax, %eax
je 0xd04a
movq %r13, %rdi
leaq 0x247f(%rip), %rsi      # 0xf332
callq 0x1160
testl %eax, %eax
je 0xd0c8
movq %r13, %rdi
leaq 0x2471(%rip), %rsi      # 0xf33b
callq 0x1160
testl %eax, %eax
je 0xd0c8
movq (%r14,%r12,8), %r13
movq %r13, %rdi
leaq 0x2497(%rip), %rsi      # 0xf37c
callq 0x1160
testl %eax, %eax
je 0xd0b5
movq %r13, %rdi
leaq 0x2487(%rip), %rsi      # 0xf383
callq 0x1160
testl %eax, %eax
jne 0xd018
jmp 0xd0b5
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rax
movq %rax, 0x20(%rsp)
jmp 0xd018
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rax
movq (%rsp), %rcx
movq %rax, 0x8(%rcx)
jmp 0xd018
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rax
movq %rax, 0x18(%rsp)
jmp 0xd018
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x1090
movq (%rsp), %rax
movsd %xmm0, 0x40(%rax)
jmp 0xd018
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x1090
movq (%rsp), %rax
movsd %xmm0, 0x48(%rax)
jmp 0xd018
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x1090
movq (%rsp), %rax
movsd %xmm0, 0x50(%rax)
jmp 0xd018
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x1090
movq (%rsp), %rax
movsd %xmm0, 0x30(%rax)
jmp 0xd018
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x1090
movq (%rsp), %rax
movsd %xmm0, 0x38(%rax)
jmp 0xd018
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rdi
callq 0x11d0
movq (%rsp), %rcx
movl %eax, 0x1c(%rcx)
jmp 0xd018
movq (%rsp), %rax
movl $0x1, 0x18(%rax)
jmp 0xd018
movq (%rsp), %rax
movl $0x1, 0x58(%rax)
jmp 0xd018
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rax
movq (%rsp), %rcx
movq %rax, (%rcx)
incl %ebx
cmpl %r15d, %ebx
jl 0xcbe8
jmp 0xd07f
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rax
movq %rax, 0x10(%rsp)
jmp 0xd018
movq (%rsp), %rax
movl $0x1, 0x20(%rax)
movl $0x64, 0x28(%rax)
jmp 0xd018
leal 0x1(%r12), %ebx
movq 0x8(%r14,%r12,8), %rax
movq %rax, 0x8(%rsp)
jmp 0xd018
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movslq %r15d, %rax
movq -0x8(%r14,%rax,8), %rdi
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %r8
movq (%rsp), %r9
callq 0x56df
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2d7c
callq 0x2de8
movq (%rsp), %rdi
callq 0x2dc0
callq 0x2d9b