// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/src/nw.c
// Function: parasail_nw_rowcol
parasail_result_t* ENAME(
        const char * const restrict _s1, const int _s1Len,
        const char * const restrict _s2, const int s2Len,
        const int open, const int gap, const parasail_matrix_t *matrix)
{
    /* declare local variables */
    parasail_result_t *result = NULL;
    int * restrict s1 = NULL;
    int * restrict s2 = NULL;
    int * restrict H = NULL;
    int * restrict F = NULL;
    int s1Len = 0;
    int i = 0;
    int j = 0;

    /* validate inputs */
    PARASAIL_CHECK_NULL(_s2);
    PARASAIL_CHECK_GT0(s2Len);
    PARASAIL_CHECK_GE0(open);
    PARASAIL_CHECK_GE0(gap);
    PARASAIL_CHECK_NULL(matrix);
    if (matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) {
        PARASAIL_CHECK_NULL(_s1);
        PARASAIL_CHECK_GT0(_s1Len);
    }

    /* initialize stack variables */
    s1Len = matrix->type == PARASAIL_MATRIX_TYPE_SQUARE ? _s1Len : matrix->length;

    /* initialize result */
#ifdef PARASAIL_TABLE
    result = parasail_result_new_table1(s1Len, s2Len);
#else
#ifdef PARASAIL_ROWCOL
    result = parasail_result_new_rowcol1(s1Len, s2Len);
#else
    result = parasail_result_new();
#endif
#endif
    if (!result) return NULL;

    /* set known flags */
    result->flag |= PARASAIL_FLAG_NW | PARASAIL_FLAG_NOVEC
        | PARASAIL_FLAG_BITS_INT | PARASAIL_FLAG_LANES_1;
#ifdef PARASAIL_TABLE
    result->flag |= PARASAIL_FLAG_TABLE;
#endif
#ifdef PARASAIL_ROWCOL
    result->flag |= PARASAIL_FLAG_ROWCOL;
#endif

    /* initialize heap variables */
    s2 = parasail_memalign_int(16, s2Len);
    H = parasail_memalign_int(16, s2Len+1);
    F = parasail_memalign_int(16, s2Len+1);

    /* validate heap variables */
    if (!s2) return NULL;
    if (!H) return NULL;
    if (!F) return NULL;

    if (matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) {
        s1 = parasail_memalign_int(16, s1Len);
        if (!s1) return NULL;
        for (i=0; i<s1Len; ++i) {
            s1[i] = matrix->mapper[(unsigned char)_s1[i]];
        }
    }

    for (j=0; j<s2Len; ++j) {
        s2[j] = matrix->mapper[(unsigned char)_s2[j]];
    }

    /* upper left corner */
    H[0] = 0;
    F[0] = NEG_INF_32;
    
    /* first row */
    for (j=1; j<=s2Len; ++j) {
        H[j] = -open -(j-1)*gap;
        F[j] = NEG_INF_32;
    }

    /* iter over first sequence */
    for (i=1; i<=s1Len; ++i) {
        const int * const restrict matrow =
            matrix->type == PARASAIL_MATRIX_TYPE_SQUARE ?
            &matrix->matrix[matrix->size*s1[i-1]] :
            &matrix->matrix[matrix->size*(i-1)];
        /* init first column */
        int NH = H[0];
        int WH = -open - (i-1)*gap;
        int E = NEG_INF_32;
        H[0] = WH;
        for (j=1; j<=s2Len; ++j) {
            int H_dag;
            int E_opn;
            int E_ext;
            int F_opn;
            int F_ext;
            int NWH = NH;
            NH = H[j];
            F_opn = NH - open;
            F_ext = F[j] - gap;
            F[j] = MAX(F_opn, F_ext);
            E_opn = WH - open;
            E_ext = E    - gap;
            E    = MAX(E_opn, E_ext);
            H_dag = NWH + matrow[s2[j-1]];
            WH = MAX(H_dag, E);
            WH = MAX(WH, F[j]);
            H[j] = WH;
#ifdef PARASAIL_TABLE
            result->tables->score_table[1LL*(i-1)*s2Len + (j-1)] = WH;
#endif
        }
#ifdef PARASAIL_ROWCOL
        result->rowcols->score_col[i-1] = WH;
#endif
    }
#ifdef PARASAIL_ROWCOL
    for (j=1; j<=s2Len; ++j) {
        result->rowcols->score_row[j-1] = H[j];
    }
#endif

    result->score = H[s2Len];
    result->end_query = s1Len-1;
    result->end_ref = s2Len-1;

    parasail_free(F);
    parasail_free(H);
    parasail_free(s2);
    if (matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) {
        parasail_free(s1);
    }

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
movl $0x0, -0x64(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x2ac53c
movq 0xb7aac8(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0xa3fad1(%rip), %rsi    # 0xcebfeb
leaq 0x9fe9b6(%rip), %rdx    # 0xcaaed7
leaq 0xa401d5(%rip), %rcx    # 0xcec6fd
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x2acb81
jmp 0x2ac53e
jmp 0x2ac540
cmpl $0x0, -0x24(%rbp)
jg 0x2ac579
movq 0xb7aa8b(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0xa401aa(%rip), %rsi    # 0xcec701
leaq 0x9fe979(%rip), %rdx    # 0xcaaed7
leaq 0xa401b0(%rip), %rcx    # 0xcec715
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x2acb81
jmp 0x2ac57b
jmp 0x2ac57d
cmpl $0x0, -0x28(%rbp)
jge 0x2ac5b6
movq 0xb7aa4e(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0xa40187(%rip), %rsi    # 0xcec71b
leaq 0x9fe93c(%rip), %rdx    # 0xcaaed7
leaq 0xa4018e(%rip), %rcx    # 0xcec730
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x2acb81
jmp 0x2ac5b8
jmp 0x2ac5ba
cmpl $0x0, -0x2c(%rbp)
jge 0x2ac5f3
movq 0xb7aa11(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0xa4014a(%rip), %rsi    # 0xcec71b
leaq 0x9fe8ff(%rip), %rdx    # 0xcaaed7
leaq 0xa40156(%rip), %rcx    # 0xcec735
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x2acb81
jmp 0x2ac5f5
jmp 0x2ac5f7
cmpq $0x0, 0x10(%rbp)
jne 0x2ac631
movq 0xb7a9d3(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0xa3f9dc(%rip), %rsi    # 0xcebfeb
leaq 0x9fe8c1(%rip), %rdx    # 0xcaaed7
leaq 0xa40308(%rip), %rcx    # 0xcec925
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x2acb81
jmp 0x2ac633
movq 0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x2ac6ba
jmp 0x2ac63f
cmpq $0x0, -0x10(%rbp)
jne 0x2ac679
movq 0xb7a98b(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0xa3f994(%rip), %rsi    # 0xcebfeb
leaq 0x9fe879(%rip), %rdx    # 0xcaaed7
leaq 0xa400d4(%rip), %rcx    # 0xcec739
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x2acb81
jmp 0x2ac67b
jmp 0x2ac67d
cmpl $0x0, -0x14(%rbp)
jg 0x2ac6b6
movq 0xb7a94e(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0xa4006d(%rip), %rsi    # 0xcec701
leaq 0x9fe83c(%rip), %rdx    # 0xcaaed7
leaq 0xa4009b(%rip), %rcx    # 0xcec73d
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x2acb81
jmp 0x2ac6b8
jmp 0x2ac6ba
movq 0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x2ac6cf
movl -0x14(%rbp), %eax
movl %eax, -0x98(%rbp)
jmp 0x2ac6dc
movq 0x10(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %edi
movl -0x24(%rbp), %esi
callq 0x1c3af0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2ac708
movq $0x0, -0x8(%rbp)
jmp 0x2acb81
movq -0x38(%rbp), %rax
movl 0xc(%rax), %ecx
orl $0x1400101, %ecx        # imm = 0x1400101
movl %ecx, 0xc(%rax)
movq -0x38(%rbp), %rax
movl 0xc(%rax), %ecx
orl $0x40000, %ecx          # imm = 0x40000
movl %ecx, 0xc(%rax)
movslq -0x24(%rbp), %rsi
movl $0x10, %edi
callq 0x1c35d0
movq %rax, -0x48(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
movl $0x10, %edi
callq 0x1c35d0
movq %rax, -0x50(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
movl $0x10, %edi
callq 0x1c35d0
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x2ac77c
movq $0x0, -0x8(%rbp)
jmp 0x2acb81
cmpq $0x0, -0x50(%rbp)
jne 0x2ac790
movq $0x0, -0x8(%rbp)
jmp 0x2acb81
cmpq $0x0, -0x58(%rbp)
jne 0x2ac7a4
movq $0x0, -0x8(%rbp)
jmp 0x2acb81
movq 0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x2ac812
movslq -0x5c(%rbp), %rsi
movl $0x10, %edi
callq 0x1c35d0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x2ac7d4
movq $0x0, -0x8(%rbp)
jmp 0x2acb81
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x2ac810
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movslq -0x60(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
movq -0x40(%rbp), %rax
movslq -0x60(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x2ac7db
jmp 0x2ac812
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x2ac84e
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movslq -0x64(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
movq -0x48(%rbp), %rax
movslq -0x64(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x2ac819
movq -0x50(%rbp), %rax
movl $0x0, (%rax)
movq -0x58(%rbp), %rax
movl $0xc0000000, (%rax)     # imm = 0xC0000000
movl $0x1, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x2ac8a7
xorl %edx, %edx
subl -0x28(%rbp), %edx
movl -0x64(%rbp), %eax
subl $0x1, %eax
imull -0x2c(%rbp), %eax
subl %eax, %edx
movq -0x50(%rbp), %rax
movslq -0x64(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x58(%rbp), %rax
movslq -0x64(%rbp), %rcx
movl $0xc0000000, (%rax,%rcx,4) # imm = 0xC0000000
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x2ac869
movl $0x1, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jg 0x2acae4
movq 0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x2ac8f7
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbp), %rcx
movl 0x18(%rcx), %ecx
movq -0x40(%rbp), %rdx
movl -0x60(%rbp), %esi
subl $0x1, %esi
movslq %esi, %rsi
imull (%rdx,%rsi,4), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
jmp 0x2ac920
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rbp), %rcx
movl 0x18(%rcx), %ecx
movl -0x60(%rbp), %edx
subl $0x1, %edx
imull %edx, %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x50(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x74(%rbp)
xorl %eax, %eax
subl -0x28(%rbp), %eax
movl -0x60(%rbp), %ecx
subl $0x1, %ecx
imull -0x2c(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x78(%rbp)
movl $0xc0000000, -0x7c(%rbp) # imm = 0xC0000000
movl -0x78(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x2acabb
movl -0x74(%rbp), %eax
movl %eax, -0x94(%rbp)
movq -0x50(%rbp), %rax
movslq -0x64(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
subl -0x28(%rbp), %eax
movl %eax, -0x8c(%rbp)
movq -0x58(%rbp), %rax
movslq -0x64(%rbp), %rcx
movl (%rax,%rcx,4), %eax
subl -0x2c(%rbp), %eax
movl %eax, -0x90(%rbp)
movl -0x8c(%rbp), %eax
cmpl -0x90(%rbp), %eax
jle 0x2ac9be
movl -0x8c(%rbp), %eax
movl %eax, -0xa4(%rbp)
jmp 0x2ac9ca
movl -0x90(%rbp), %eax
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %edx
movq -0x58(%rbp), %rax
movslq -0x64(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x78(%rbp), %eax
subl -0x28(%rbp), %eax
movl %eax, -0x84(%rbp)
movl -0x7c(%rbp), %eax
subl -0x2c(%rbp), %eax
movl %eax, -0x88(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x88(%rbp), %eax
jle 0x2aca0f
movl -0x84(%rbp), %eax
movl %eax, -0xa8(%rbp)
jmp 0x2aca1b
movl -0x88(%rbp), %eax
movl %eax, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x94(%rbp), %eax
movq -0x70(%rbp), %rcx
movq -0x48(%rbp), %rdx
movl -0x64(%rbp), %esi
subl $0x1, %esi
movslq %esi, %rsi
movslq (%rdx,%rsi,4), %rdx
addl (%rcx,%rdx,4), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jle 0x2aca58
movl -0x80(%rbp), %eax
movl %eax, -0xac(%rbp)
jmp 0x2aca61
movl -0x7c(%rbp), %eax
movl %eax, -0xac(%rbp)
movl -0xac(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %eax
movq -0x58(%rbp), %rcx
movslq -0x64(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x2aca85
movl -0x78(%rbp), %eax
movl %eax, -0xb0(%rbp)
jmp 0x2aca96
movq -0x58(%rbp), %rax
movslq -0x64(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xb0(%rbp)
movl -0xb0(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %edx
movq -0x50(%rbp), %rax
movslq -0x64(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x2ac95f
movl -0x78(%rbp), %edx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movl -0x60(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x2ac8ae
movl $0x1, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x2acb20
movq -0x50(%rbp), %rax
movslq -0x64(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movl -0x64(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x2acaeb
movq -0x50(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movl -0x5c(%rbp), %ecx
subl $0x1, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x58(%rbp), %rdi
callq 0x1c3590
movq -0x50(%rbp), %rdi
callq 0x1c3590
movq -0x48(%rbp), %rdi
callq 0x1c3590
movq 0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x2acb79
movq -0x40(%rbp), %rdi
callq 0x1c3590
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nop