// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/tests/test_openmp.c
// Function: main
int main(int argc, char **argv)
{
    double timer_clock = 0.0;
    unsigned long i = 0;
    size_t limit = 0;
    char *filename_database = NULL;
    parasail_sequences_t *sequences_database = NULL;
    size_t seq_count_database = 0;
    char *filename_queries = NULL;
    parasail_sequences_t *sequences_queries = NULL;
    size_t seq_count_queries = 0;
    char *endptr = NULL;
    char *funcname1 = NULL;
    char *funcname2 = NULL;
    parasail_function_t *function1 = NULL;
    parasail_function_t *function2 = NULL;
    int banded = 0;
    int kbandsize = 3;
    int c = 0;
    char *matrixname = "blosum62";
    const parasail_matrix_t *matrix = NULL;
    int gap_open = 10;
    int gap_extend = 1;
    int N = 1;
    int saturated = 0;
    int smallest_first = 0;
    int biggest_first = 0;
    int truncate = 0;
    int iterations = 1;
    int func_cutoff = 0;
    int iter = 0;
    stats_t stats_time;

    stats_clear(&stats_time);

    while ((c = getopt(argc, argv, "a:A:c:b:f:k:q:o:e:slt:i:")) != -1) {
        switch (c) {
            case 'a':
                funcname1 = optarg;
                break;
            case 'A':
                funcname2 = optarg;
                break;
            case 'b':
                matrixname = optarg;
                break;
            case 'c':
                errno = 0;
                func_cutoff = strtol(optarg, &endptr, 10);
                if (errno) {
                    perror("strtol");
                    exit(1);
                }
                break;
            case 'f':
                filename_database = optarg;
                break;
            case 'q':
                filename_queries = optarg;
                break;
            case 'k':
                errno = 0;
                kbandsize = strtol(optarg, &endptr, 10);
                if (errno) {
                    perror("strtol");
                    exit(1);
                }
                break;
            case 'i':
                errno = 0;
                iterations = strtol(optarg, &endptr, 10);
                if (errno) {
                    perror("strtol");
                    exit(1);
                }
                break;
            case 'o':
                errno = 0;
                gap_open = strtol(optarg, &endptr, 10);
                if (errno) {
                    perror("strtol");
                    exit(1);
                }
                break;
            case 'e':
                errno = 0;
                gap_extend = strtol(optarg, &endptr, 10);
                if (errno) {
                    perror("strtol");
                    exit(1);
                }
                break;
            case 's':
                smallest_first = 1;
                break;
            case 'l':
                biggest_first = 1;
                break;
            case 't':
                errno = 0;
                truncate = strtol(optarg, &endptr, 10);
                if (errno) {
                    perror("strtol");
                    exit(1);
                }
                break;
            case '?':
                if (optopt == 'a'
                        || optopt == 'b'
                        || optopt == 'e'
                        || optopt == 'f'
                        || optopt == 'i'
                        || optopt == 'n'
                        || optopt == 'o'
                        || optopt == 't')
                {
                    fprintf(stderr,
                            "Option -%c requires an argument.\n",
                            optopt);
                }
                else if (isprint(optopt)) {
                    fprintf(stderr, "Unknown option `-%c'.\n",
                            optopt);
                }
                else {
                    fprintf(stderr,
                            "Unknown option character `\\x%x'.\n",
                            optopt);
                }
                exit(1);
            default:
                fprintf(stderr, "default case in getopt\n");
                exit(1);
        }
    }

    if (smallest_first && biggest_first) {
        fprintf(stderr, "cannot choose both smallest and biggest first\n");
        exit(1);
    }

    /* select the function */
    if (funcname1) {
        function1 = parasail_lookup_function(funcname1);
#if HAVE_SSE2
        if (NULL == function1) {
            if (0 == strcmp(funcname1, "ssw_16")) {
                function1 = ssw_16;
            }
            else if (0 == strcmp(funcname1, "ssw_8")) {
                function1 = ssw;
            }
        }
#endif
        if (NULL == function1 && NULL != strstr(funcname1, "nw_banded")) {
            banded = 1;
        }
        if (NULL == function1 && 0 == banded) {
            fprintf(stderr, "Specified function1 not found.\n");
            exit(1);
        }
    }
    else {
        fprintf(stderr, "No alignment function1 specified.\n");
        exit(1);
    }

    if (funcname2) {
        function2 = parasail_lookup_function(funcname2);
        if (NULL == function2) {
            fprintf(stderr, "Specified function2 not found.\n");
            exit(1);
        }
    }

    /* select the substitution matrix */
    if (matrixname) {
        matrix = parasail_matrix_lookup(matrixname);
        if (NULL == matrix) {
            fprintf(stderr, "Specified substitution matrix not found.\n");
            exit(1);
        }
    }

    if (filename_database) {
        sequences_database = parasail_sequences_from_file(filename_database);
        seq_count_database = sequences_database->l;
    }
    else {
        fprintf(stderr, "missing database filename\n");
        exit(1);
    }

    limit = binomial_coefficient(seq_count_database, 2);
    /*printf("%lu choose 2 is %lu\n", seq_count_database, limit);*/

#if defined(_OPENMP)
#pragma omp parallel
    {
#pragma omp single
        {
            N = omp_get_max_threads();
            /*printf("omp_get_max_threads()=%d\n", N);*/
        }
    }
#endif

    if (filename_queries) {
        double total_timer = 0.0;
        sequences_queries = parasail_sequences_from_file(filename_queries);
        seq_count_queries = sequences_queries->l;
        for (i=0; i<seq_count_queries; ++i) {
            int saturated_query = 0;
            double local_timer = 0.0;
            parasail_function_t *function = function1;

            if (func_cutoff > 0) {
                if (sequences_queries->seqs[i].seq.l > (unsigned long)func_cutoff) {
                    function = function2;
                }
            }

            local_timer = timer_real();
#pragma omp parallel
            {
				long long int seq_count_database_signed = seq_count_database;
				long long int j_signed = 0;
#pragma omp for schedule(guided)
                for (j_signed=0; j_signed<seq_count_database_signed; ++j_signed) {
                    parasail_result_t *result = function(
                            sequences_queries->seqs[i].seq.s,
                            sequences_queries->seqs[i].seq.l,
                            sequences_database->seqs[j_signed].seq.s,
                            sequences_database->seqs[j_signed].seq.l,
                            gap_open, gap_extend, matrix);
#pragma omp atomic
                    saturated_query += parasail_result_is_saturated(result);
                    parasail_result_free(result);
                }
            }
            local_timer = timer_real() - local_timer;
            total_timer += local_timer;
            printf("%lu\t %lu\t %d\t %f\n",
                    i, (unsigned long)sequences_queries->seqs[i].seq.l,
                    saturated_query, local_timer);
            fflush(stdout);
        }
        printf("total_time=%f\n", total_timer);
        fflush(stdout);
    }
    else {
        for (iter=0; iter<iterations; ++iter) {
            timer_clock = timer_real();
#pragma omp parallel
            {
                unsigned long a=0;
                unsigned long b=1;
                unsigned long swap=0;
				long long i_signed = 0;
				long long limit_signed = limit;
#pragma omp for schedule(guided)
                for (i_signed=0; i_signed<limit_signed; ++i_signed) {
                    parasail_function_t *function = function1;
                    parasail_result_t *result = NULL;
                    unsigned long query_size;
                    k_combination2(i_signed, &a, &b);
                    if (smallest_first) {
                        if (sequences_database->seqs[a].seq.l > sequences_database->seqs[b].seq.l) {
                            swap = a;
                            a = b;
                            b = swap;
                        }
                    }
                    else if (biggest_first) {
                        if (sequences_database->seqs[a].seq.l < sequences_database->seqs[b].seq.l) {
                            swap = a;
                            a = b;
                            b = swap;
                        }
                    }
                    query_size = sequences_database->seqs[a].seq.l;
                    if (truncate > 0) {
                        if (query_size > (unsigned long)truncate) {
                            query_size = truncate;
                        }
                    }
                    if (func_cutoff > 0) {
                        if (query_size > (unsigned long)func_cutoff) {
                            function = function2;
                        }
                    }
                    if (NULL != function1) {
                        result = function(
                                sequences_database->seqs[a].seq.s, query_size,
                                sequences_database->seqs[b].seq.s, sequences_database->seqs[b].seq.l,
                                gap_open, gap_extend, matrix);
                    }
                    else if (0 != banded) {
                        result = parasail_nw_banded(
                                sequences_database->seqs[a].seq.s, query_size,
                                sequences_database->seqs[b].seq.s, sequences_database->seqs[b].seq.l,
                                gap_open, gap_extend, kbandsize, matrix);
                    }
#pragma omp atomic
                    saturated += parasail_result_is_saturated(result);
                    if (parasail_result_is_saturated(result)) {
#pragma omp critical(printer)
                        {
                            printf("saturated -- (%lu,%lu)\n", a, b);
                        }
                    }
                    parasail_result_free(result);
                }
            }
            timer_clock = timer_real() - timer_clock;
            stats_sample_value(&stats_time, timer_clock);
        }
        printf("%s\t %s\t %d\t %d\t %d\t %d\t %f\t %f\t %f\t %f\n",
                funcname1, matrixname, gap_open, gap_extend, N,
                saturated,
                stats_time._mean, stats_stddev(&stats_time),
                stats_time._min, stats_time._max);
        fflush(stdout);
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %r12
movl %edi, %r13d
leaq 0x48(%rsp), %rax
movq $0x0, (%rax)
movq $0x0, 0x30(%rsp)
movl $0x1, %eax
movq %rax, 0x40(%rsp)
movl $0xa, %eax
movq %rax, 0x38(%rsp)
leaq 0x38ef6d(%rip), %rax    # 0x688100
movq %rax, 0x70(%rsp)
movl $0x3, %eax
movq %rax, 0x78(%rsp)
leaq 0x38ef60(%rip), %rbp    # 0x688109
leaq 0x38ee80(%rip), %r14    # 0x688030
movq $0x0, 0x88(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
xorl %r15d, %r15d
movl $0x0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
movl $0x1, %ecx
movq %rcx, 0x68(%rsp)
movq $0x0, 0x58(%rsp)
movl %r15d, %ebx
movl %r13d, %edi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x29b080
cmpl $0x60, %eax
jle 0x2f923d
addl $-0x61, %eax
cmpl $0x13, %eax
ja 0x2f9b84
movslq (%r14,%rax,4), %rcx
addq %r14, %rcx
movl $0x1, %r15d
jmpq *%rcx
movq 0x5c1d8b(%rip), %rax    # 0x8bafb8
movq (%rax), %rax
movq %rax, 0x88(%rsp)
movl %ebx, %r15d
jmp 0x2f91f5
cmpl $0x41, %eax
jne 0x2f941a
movq 0x5c1d6b(%rip), %rax    # 0x8bafb8
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movl %ebx, %r15d
jmp 0x2f91f5
movl $0x1, 0x50(%rsp)
movl %ebx, %r15d
jmp 0x2f91f5
callq 0x29b030
movl %ebx, %r15d
movq %rax, %rbx
movl $0x0, (%rax)
movq 0x5c1d39(%rip), %rax    # 0x8bafb8
movq (%rax), %rdi
leaq 0x48(%rsp), %rsi
movl $0xa, %edx
callq 0x29b1b0
movq %rax, 0x78(%rsp)
cmpl $0x0, (%rbx)
je 0x2f91f5
jmp 0x2f9b75
callq 0x29b030
movl %ebx, %r15d
movq %rax, %rbx
movl $0x0, (%rax)
movq 0x5c1cfc(%rip), %rax    # 0x8bafb8
movq (%rax), %rdi
leaq 0x48(%rsp), %rsi
movl $0xa, %edx
callq 0x29b1b0
movq %rax, 0x40(%rsp)
cmpl $0x0, (%rbx)
je 0x2f91f5
jmp 0x2f9b6b
movq 0x5c1cd0(%rip), %rax    # 0x8bafb8
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movl %ebx, %r15d
jmp 0x2f91f5
callq 0x29b030
movl %ebx, %r15d
movq %rax, %rbx
movl $0x0, (%rax)
movq 0x5c1ca8(%rip), %rax    # 0x8bafb8
movq (%rax), %rdi
leaq 0x48(%rsp), %rsi
movl $0xa, %edx
callq 0x29b1b0
movq %rax, 0x58(%rsp)
cmpl $0x0, (%rbx)
je 0x2f91f5
jmp 0x2f9b7f
movq 0x5c1c7c(%rip), %rax    # 0x8bafb8
movq (%rax), %rax
movq %rax, 0x70(%rsp)
movl %ebx, %r15d
jmp 0x2f91f5
movq 0x5c1c65(%rip), %rax    # 0x8bafb8
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movl %ebx, %r15d
jmp 0x2f91f5
callq 0x29b030
movl %ebx, %r15d
movq %rax, %rbx
movl $0x0, (%rax)
movq 0x5c1c3d(%rip), %rax    # 0x8bafb8
movq (%rax), %rdi
leaq 0x48(%rsp), %rsi
movl $0xa, %edx
callq 0x29b1b0
movq %rax, 0x68(%rsp)
cmpl $0x0, (%rbx)
je 0x2f91f5
jmp 0x2f9b70
callq 0x29b030
movl %ebx, %r15d
movq %rax, %rbx
movl $0x0, (%rax)
movq 0x5c1c00(%rip), %rax    # 0x8bafb8
movq (%rax), %rdi
leaq 0x48(%rsp), %rsi
movl $0xa, %edx
callq 0x29b1b0
movq %rax, 0x60(%rsp)
cmpl $0x0, (%rbx)
je 0x2f91f5
jmp 0x2f9b7a
callq 0x29b030
movl %ebx, %r15d
movq %rax, %rbx
movl $0x0, (%rax)
movq 0x5c1bc3(%rip), %rax    # 0x8bafb8
movq (%rax), %rdi
leaq 0x48(%rsp), %rsi
movl $0xa, %edx
callq 0x29b1b0
movq %rax, 0x38(%rsp)
cmpl $0x0, (%rbx)
je 0x2f91f5
callq 0x29b2c9
cmpl $-0x1, %eax
jne 0x2f9b61
movl %ebx, 0x28(%rsp)
testl %ebx, %ebx
setne %al
cmpl $0x0, 0x50(%rsp)
setne %cl
andb %al, %cl
cmpb $0x1, %cl
movq 0x88(%rsp), %rbx
je 0x2f9b89
testq %rbx, %rbx
je 0x2f9b8e
movq %rbx, %rdi
callq 0x2fada8
movq %rax, %r12
testq %rax, %rax
jne 0x2f949b
leaq 0x38ed64(%rip), %rsi    # 0x6881cb
movq %rbx, %rdi
callq 0x29b1a0
testl %eax, %eax
je 0x2f9494
leaq 0x38ed58(%rip), %rsi    # 0x6881d2
movq %rbx, %rdi
callq 0x29b1a0
xorl %r12d, %r12d
testl %eax, %eax
leaq 0x721(%rip), %rax       # 0x2f9baf
cmoveq %rax, %r12
jmp 0x2f949b
leaq 0x702(%rip), %r12       # 0x2f9b9d
movb $0x1, %bpl
testq %r12, %r12
jne 0x2f94b9
leaq 0x414607(%rip), %rsi    # 0x70dab1
movq %rbx, %rdi
callq 0x29b070
testq %rax, %rax
sete %bpl
testq %r12, %r12
setne %al
movl %ebp, %ecx
xorb $0x1, %cl
orb %al, %cl
je 0x2f9b93
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
movq 0x70(%rsp), %rbx
je 0x2f94f2
callq 0x2fada8
movq %rax, 0x98(%rsp)
testq %rax, %rax
jne 0x2f94fe
callq 0x29b31d
movq $0x0, 0x98(%rsp)
testq %rbx, %rbx
je 0x2f9515
movq %rbx, %rdi
callq 0x2faf7c
testq %rax, %rax
jne 0x2f9517
callq 0x29b342
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x2f9b98
callq 0x2fc868
movq %rax, %r8
movq 0x8(%rax), %r9
cmpq $0x2, %r9
jae 0x2f9546
xorl %r14d, %r14d
movq 0x30(%rsp), %rdi
jmp 0x2f9578
movl $0x1, %ecx
movl $0x1, %r14d
movq %r9, %rdx
movq 0x30(%rsp), %rdi
imulq %rdx, %r14
leaq -0x1(%rdx), %rsi
movq %r14, %rax
xorl %edx, %edx
divq %rcx
incq %rcx
movq %rsi, %rdx
movq %rax, %r14
cmpq $0x3, %rcx
jne 0x2f9559
testq %rdi, %rdi
movq %r12, 0x30(%rsp)
movq %r8, 0xb0(%rsp)
je 0x2f9701
movq %r9, 0x90(%rsp)
callq 0x2fc868
movq 0x8(%rax), %rcx
movq %rcx, 0x50(%rsp)
testq %rcx, %rcx
je 0x2f9a94
movl 0x58(%rsp), %ecx
movq %rcx, 0x78(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
xorl %r14d, %r14d
movq %rax, 0x18(%rsp)
movq 0xb0(%rsp), %rbp
movq %r12, %r15
cmpl $0x0, 0x58(%rsp)
jle 0x2f95fa
movq (%rax), %rdx
movq %r14, %rcx
shlq $0x6, %rcx
movq 0x78(%rsp), %rsi
cmpq %rsi, 0x20(%rdx,%rcx)
movq %r12, %r15
cmovaq 0x98(%rsp), %r15
callq 0x2fd594
movsd %xmm0, 0xa0(%rsp)
movq 0x90(%rsp), %rbx
testq %rbx, %rbx
movq %r14, 0xa8(%rsp)
jle 0x2f9686
xorl %r13d, %r13d
movq %r15, 0x60(%rsp)
movl $0x28, %r15d
shlq $0x6, %r14
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rax,%r14), %rdi
movl 0x20(%rax,%r14), %esi
movq (%rbp), %rax
movq (%rax,%r15), %rdx
movl -0x8(%rax,%r15), %ecx
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %r8
movq 0x40(%rsp), %r9
callq *0x60(%rsp)
movq %rax, %r12
movq %rax, %rdi
callq 0x2fc359
addl %eax, %r13d
movq %r12, %rdi
callq 0x2fb4ed
addq $0x40, %r15
decq %rbx
jne 0x2f962f
jmp 0x2f9689
xorl %r13d, %r13d
callq 0x2fd594
subsd 0xa0(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x28(%rsp)
movq 0x18(%rsp), %rbx
movq (%rbx), %rax
movq 0xa8(%rsp), %r14
movq %r14, %rcx
shlq $0x6, %rcx
movq 0x20(%rax,%rcx), %rdx
leaq 0x38ebb6(%rip), %rdi    # 0x688280
movq %r14, %rsi
movl %r13d, %ecx
movb $0x1, %al
callq 0x29b040
movq 0x5c18ca(%rip), %rax    # 0x8bafa8
movq (%rax), %rdi
callq 0x29b150
incq %r14
cmpq 0x50(%rsp), %r14
movq 0x30(%rsp), %r12
movq %rbx, %rax
jne 0x2f95d0
jmp 0x2f9a9e
xorpd %xmm0, %xmm0
movq 0x68(%rsp), %r15
testl %r15d, %r15d
jle 0x2f9ab7
movb %bpl, 0x17(%rsp)
movl 0x60(%rsp), %eax
movq %rax, 0xa0(%rsp)
movl 0x58(%rsp), %eax
movq %rax, 0x90(%rsp)
movl %r15d, %eax
movq %rax, 0xb8(%rsp)
decl %r15d
movq %r15, 0x68(%rsp)
xorl %r13d, %r13d
xorpd %xmm5, %xmm5
xorpd %xmm1, %xmm1
xorpd %xmm4, %xmm4
xorl %eax, %eax
movq %r14, 0xa8(%rsp)
movq %rbx, 0x70(%rsp)
movsd %xmm5, 0xc0(%rsp)
movsd %xmm0, 0xc8(%rsp)
movq %rax, 0xd8(%rsp)
movsd %xmm1, 0xe0(%rsp)
movsd %xmm4, 0x80(%rsp)
callq 0x2fd594
movsd %xmm0, 0xd0(%rsp)
testq %r14, %r14
jle 0x2f99e5
xorl %r15d, %r15d
xorps %xmm0, %xmm0
cvtsi2sd %r15, %xmm0
movsd %xmm0, 0x18(%rsp)
addsd %xmm0, %xmm0
ucomisd 0x38e867(%rip), %xmm0   # 0x688028
jb 0x2f97c9
sqrtsd %xmm0, %xmm0
jmp 0x2f97ce
callq 0x29b0f0
callq 0x29b1f0
movsd 0x38e82d(%rip), %xmm2   # 0x688008
addsd %xmm2, %xmm0
movsd 0x38e829(%rip), %xmm3   # 0x688010
movapd %xmm3, %xmm1
maxsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
mulsd 0x38e815(%rip), %xmm0   # 0x688018
movsd 0x18(%rsp), %xmm4
movapd %xmm4, %xmm2
subsd %xmm0, %xmm2
ucomisd %xmm1, %xmm2
jae 0x2f9821
movq 0xb0(%rsp), %rsi
jmp 0x2f983f
movq 0xb0(%rsp), %rsi
addsd %xmm1, %xmm0
addsd %xmm3, %xmm1
movapd %xmm4, %xmm2
subsd %xmm0, %xmm2
ucomisd %xmm1, %xmm2
jae 0x2f9829
cvttsd2si %xmm2, %rax
movsd 0x38e7d4(%rip), %xmm0   # 0x688020
subsd %xmm0, %xmm2
cvttsd2si %xmm2, %rcx
movq %rax, %rbx
sarq $0x3f, %rbx
andq %rcx, %rbx
orq %rax, %rbx
cvttsd2si %xmm1, %rax
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %rcx
movq %rax, %r14
sarq $0x3f, %r14
andq %rcx, %r14
orq %rax, %r14
cmpl $0x0, 0x28(%rsp)
je 0x2f98ac
movq (%rsi), %rax
movq %rbx, %rcx
shlq $0x6, %rcx
movq 0x20(%rax,%rcx), %rcx
movq %r14, %rdx
shlq $0x6, %rdx
cmpq 0x20(%rax,%rdx), %rcx
movq %rbx, %rax
cmovaq %r14, %rax
cmovaq %rbx, %r14
jmp 0x2f98d9
cmpl $0x0, 0x50(%rsp)
je 0x2f98dc
movq (%rsi), %rax
movq %rbx, %rcx
shlq $0x6, %rcx
movq 0x20(%rax,%rcx), %rcx
movq %r14, %rdx
shlq $0x6, %rdx
cmpq 0x20(%rax,%rdx), %rcx
movq %rbx, %rax
cmovbq %r14, %rax
cmovbq %rbx, %r14
movq %rax, %rbx
movq (%rsi), %rax
movq %rbx, %rcx
shlq $0x6, %rcx
movq 0x20(%rax,%rcx), %rdx
movq 0xa0(%rsp), %rsi
cmpq %rsi, %rdx
cmovbq %rdx, %rsi
cmpl $0x0, 0x60(%rsp)
cmovleq %rdx, %rsi
testq %r12, %r12
je 0x2f9952
cmpq 0x90(%rsp), %rsi
movq %r12, %r10
cmovaq 0x98(%rsp), %r10
cmpl $0x0, 0x58(%rsp)
cmovleq %r12, %r10
movq 0x28(%rax,%rcx), %rdi
movq %r14, %rcx
shlq $0x6, %rcx
movq 0x28(%rax,%rcx), %rdx
movl 0x20(%rax,%rcx), %ecx
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %r8
movq 0x40(%rsp), %r9
callq *%r10
jmp 0x2f9994
cmpb $0x0, 0x17(%rsp)
je 0x2f995e
xorl %r12d, %r12d
jmp 0x2f9997
movq 0x28(%rax,%rcx), %rdi
movq %r14, %rcx
shlq $0x6, %rcx
movq 0x28(%rax,%rcx), %rdx
movl 0x20(%rax,%rcx), %ecx
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x78(%rsp), %rax
movl %eax, (%rsp)
movq 0x38(%rsp), %r8
movq 0x40(%rsp), %r9
callq 0x38c7e8
movq %rax, %r12
movq %r12, %rdi
callq 0x2fc359
movl %eax, %ebp
movq %r12, %rdi
callq 0x2fc359
testl %eax, %eax
je 0x2f99c1
leaq 0x38e8ed(%rip), %rdi    # 0x6882a1
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x29b040
addl %ebp, %r13d
movq %r12, %rdi
callq 0x2fb4ed
incq %r15
movq 0xa8(%rsp), %r14
cmpq %r14, %r15
movq 0x30(%rsp), %r12
jne 0x2f97a7
callq 0x2fd594
subsd 0xd0(%rsp), %xmm0
movapd %xmm0, %xmm2
movapd %xmm0, %xmm3
movq 0xd8(%rsp), %rax
testq %rax, %rax
movq 0x70(%rsp), %rbx
je 0x2f9a2b
movsd 0xc0(%rsp), %xmm2
minsd %xmm0, %xmm2
movsd 0xc8(%rsp), %xmm1
maxsd %xmm0, %xmm1
movapd %xmm1, %xmm3
incq %rax
movapd %xmm0, %xmm1
movsd 0x80(%rsp), %xmm4
subsd %xmm4, %xmm1
xorps %xmm5, %xmm5
cvtsi2sd %rax, %xmm5
movapd %xmm1, %xmm6
divsd %xmm5, %xmm6
addsd %xmm6, %xmm4
subsd %xmm4, %xmm0
mulsd %xmm1, %xmm0
movsd 0xe0(%rsp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm3, %xmm0
movapd %xmm2, %xmm5
cmpq 0xb8(%rsp), %rax
jne 0x2f9761
movl 0x68(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
jmp 0x2f9aca
xorpd %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
leaq 0x38e7ed(%rip), %rdi    # 0x688292
movsd 0x28(%rsp), %xmm0
movb $0x1, %al
callq 0x29b040
jmp 0x2f9b3e
xorl %r13d, %r13d
xorpd %xmm4, %xmm4
xorpd %xmm2, %xmm2
xorpd %xmm3, %xmm3
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jb 0x2f9ad6
sqrtsd %xmm1, %xmm1
jmp 0x2f9b0d
movapd %xmm1, %xmm0
movsd %xmm4, 0x80(%rsp)
movsd %xmm2, 0x20(%rsp)
movsd %xmm3, 0x18(%rsp)
callq 0x29b0f0
movsd 0x18(%rsp), %xmm3
movsd 0x20(%rsp), %xmm2
movsd 0x80(%rsp), %xmm4
movapd %xmm0, %xmm1
movq 0x40(%rsp), %r8
movq 0x38(%rsp), %rcx
movl %r13d, (%rsp)
leaq 0x38e797(%rip), %rdi    # 0x6882b9
movq 0x88(%rsp), %rsi
movq %rbx, %rdx
movl $0x1, %r9d
movapd %xmm4, %xmm0
movb $0x4, %al
callq 0x29b040
movq 0x5c1463(%rip), %rax    # 0x8bafa8
movq (%rax), %rdi
callq 0x29b150
xorl %eax, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3f, %eax
jne 0x2f9b84
callq 0x29b230
callq 0x29b2b4
callq 0x29b2de
callq 0x29b2f3
callq 0x29b29f
callq 0x29b308
callq 0x29b3fb
callq 0x29b3d6
callq 0x29b3b1
callq 0x29b38c
callq 0x29b367