// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/src/memory_avx2.c
// Function: parasail_profile_create_stats_avx_256_64
parasail_profile_t * parasail_profile_create_stats_avx_256_64(
        const char * const restrict s1, const int _s1Len,
        const parasail_matrix_t *matrix)
{
    int s1Len = 0;
    int32_t i = 0;
    int32_t j = 0;
    int32_t k = 0;
    int32_t segNum = 0;
    int32_t n = 0;
    const int32_t segWidth = 4; /* number of values in vector unit */
    int32_t segLen = 0;
    __m256i* restrict vProfile = NULL;
    __m256i* restrict vProfileM = NULL;
    __m256i* restrict vProfileS = NULL;
    int32_t index = 0;
    parasail_profile_t *profile = NULL;

    PARASAIL_CHECK_NULL(matrix);
    /* s1 is required for both pssm and square */
    PARASAIL_CHECK_NULL(s1);

    s1Len = matrix->type == PARASAIL_MATRIX_TYPE_SQUARE ? _s1Len : matrix->length;
    n = matrix->size; /* number of amino acids in table */
    segLen = (s1Len + segWidth - 1) / segWidth;
    vProfile = parasail_memalign___m256i(32, n * segLen);
    if (!vProfile) return NULL;
    vProfileM = parasail_memalign___m256i(32, n * segLen);
    if (!vProfileM) return NULL;
    vProfileS = parasail_memalign___m256i(32, n * segLen);
    if (!vProfileS) return NULL;
    profile = parasail_profile_new(s1, s1Len, matrix);
    if (!profile) return NULL;

    for (k=0; k<n; ++k) {
        for (i=0; i<segLen; ++i) {
            __m256i_64_t p;
            __m256i_64_t m;
            __m256i_64_t s;
            j = i;
            for (segNum=0; segNum<segWidth; ++segNum) {
                if (matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) {
                    p.v[segNum] = j >= s1Len ? 0 : matrix->matrix[n*k+matrix->mapper[(unsigned char)s1[j]]];
                }
                else {
                    p.v[segNum] = j >= s1Len ? 0 : matrix->matrix[n*j+matrix->mapper[(unsigned char)matrix->alphabet[k]]];
                }
                m.v[segNum] = j >= s1Len ? 0 : (k == matrix->mapper[(unsigned char)s1[j]]);
                s.v[segNum] = p.v[segNum] > 0;
                j += segLen;
            }
            _mm256_store_si256(&vProfile[index], p.m);
            _mm256_store_si256(&vProfileM[index], m.m);
            _mm256_store_si256(&vProfileS[index], s.m);
            ++index;
        }
    }

    profile->profile64.score = vProfile;
    profile->profile64.matches = vProfileM;
    profile->profile64.similar = vProfileS;
    profile->free = &parasail_free___m256i;
    return profile;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andq $-0x20, %rsp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, 0xf0(%rsp)
movl %esi, 0xec(%rsp)
movq %rdx, 0xe0(%rsp)
movl $0x0, 0xdc(%rsp)
movl $0x0, 0xd8(%rsp)
movl $0x0, 0xd4(%rsp)
movl $0x0, 0xd0(%rsp)
movl $0x0, 0xcc(%rsp)
movl $0x0, 0xc8(%rsp)
movl $0x4, 0xc4(%rsp)
movl $0x0, 0xc0(%rsp)
movq $0x0, 0xb8(%rsp)
movq $0x0, 0xb0(%rsp)
movq $0x0, 0xa8(%rsp)
movl $0x0, 0xa4(%rsp)
movq $0x0, 0x98(%rsp)
cmpq $0x0, 0xe0(%rsp)
jne 0x99537b
movq 0x491c8d(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x356c96(%rip), %rsi    # 0xcebfeb
leaq 0x35b4b5(%rip), %rdx    # 0xcf0811
leaq 0x3575c2(%rip), %rcx    # 0xcec925
movb $0x0, %al
callq 0x19e180
movq $0x0, 0xf8(%rsp)
jmp 0x9958a1
jmp 0x99537d
jmp 0x99537f
cmpq $0x0, 0xf0(%rsp)
jne 0x9953c1
movq 0x491c47(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x356c50(%rip), %rsi    # 0xcebfeb
leaq 0x35b46f(%rip), %rdx    # 0xcf0811
leaq 0x357391(%rip), %rcx    # 0xcec73a
movb $0x0, %al
callq 0x19e180
movq $0x0, 0xf8(%rsp)
jmp 0x9958a1
jmp 0x9953c3
movq 0xe0(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x9953de
movl 0xec(%rsp), %eax
movl %eax, 0x1c(%rsp)
jmp 0x9953ed
movq 0xe0(%rsp), %rax
movl 0x34(%rax), %eax
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0xdc(%rsp)
movq 0xe0(%rsp), %rax
movl 0x18(%rax), %eax
movl %eax, 0xc8(%rsp)
movl 0xdc(%rsp), %eax
addl $0x4, %eax
subl $0x1, %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, 0xc0(%rsp)
movl 0xc8(%rsp), %eax
imull 0xc0(%rsp), %eax
movslq %eax, %rsi
movl $0x20, %edi
callq 0x992f60
movq %rax, 0xb8(%rsp)
cmpq $0x0, 0xb8(%rsp)
jne 0x995466
movq $0x0, 0xf8(%rsp)
jmp 0x9958a1
movl 0xc8(%rsp), %eax
imull 0xc0(%rsp), %eax
movslq %eax, %rsi
movl $0x20, %edi
callq 0x992f60
movq %rax, 0xb0(%rsp)
cmpq $0x0, 0xb0(%rsp)
jne 0x9954a6
movq $0x0, 0xf8(%rsp)
jmp 0x9958a1
movl 0xc8(%rsp), %eax
imull 0xc0(%rsp), %eax
movslq %eax, %rsi
movl $0x20, %edi
callq 0x992f60
movq %rax, 0xa8(%rsp)
cmpq $0x0, 0xa8(%rsp)
jne 0x9954e6
movq $0x0, 0xf8(%rsp)
jmp 0x9958a1
movq 0xf0(%rsp), %rdi
movl 0xdc(%rsp), %esi
movq 0xe0(%rsp), %rdx
callq 0x1c5d00
movq %rax, 0x98(%rsp)
cmpq $0x0, 0x98(%rsp)
jne 0x995526
movq $0x0, 0xf8(%rsp)
jmp 0x9958a1
movl $0x0, 0xd0(%rsp)
movl 0xd0(%rsp), %eax
cmpl 0xc8(%rsp), %eax
jge 0x995842
movl $0x0, 0xd8(%rsp)
movl 0xd8(%rsp), %eax
cmpl 0xc0(%rsp), %eax
jge 0x99582a
movl 0xd8(%rsp), %eax
movl %eax, 0xd4(%rsp)
movl $0x0, 0xcc(%rsp)
cmpl $0x4, 0xcc(%rsp)
jge 0x99573a
movq 0xe0(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x99560f
movl 0xd4(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jl 0x9955b1
xorl %eax, %eax
movl %eax, 0x18(%rsp)
jmp 0x9955f9
movq 0xe0(%rsp), %rax
movq 0x8(%rax), %rax
movl 0xc8(%rsp), %ecx
imull 0xd0(%rsp), %ecx
movq 0xe0(%rsp), %rdx
movq 0x10(%rdx), %rdx
movq 0xf0(%rsp), %rsi
movslq 0xd4(%rsp), %rdi
movzbl (%rsi,%rdi), %esi
addl (%rdx,%rsi,4), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x18(%rsp)
movl 0x18(%rsp), %eax
movslq %eax, %rcx
movslq 0xcc(%rsp), %rax
movq %rcx, 0x60(%rsp,%rax,8)
jmp 0x995687
movl 0xd4(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jl 0x995627
xorl %eax, %eax
movl %eax, 0x14(%rsp)
jmp 0x995673
movq 0xe0(%rsp), %rax
movq 0x8(%rax), %rax
movl 0xc8(%rsp), %ecx
imull 0xd4(%rsp), %ecx
movq 0xe0(%rsp), %rdx
movq 0x10(%rdx), %rdx
movq 0xe0(%rsp), %rsi
movq 0x38(%rsi), %rsi
movslq 0xd0(%rsp), %rdi
movzbl (%rsi,%rdi), %esi
addl (%rdx,%rsi,4), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
movslq %eax, %rcx
movslq 0xcc(%rsp), %rax
movq %rcx, 0x60(%rsp,%rax,8)
movl 0xd4(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jl 0x99569f
xorl %eax, %eax
movl %eax, 0x10(%rsp)
jmp 0x9956d5
movl 0xd0(%rsp), %eax
movq 0xe0(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0xf0(%rsp), %rdx
movslq 0xd4(%rsp), %rsi
movzbl (%rdx,%rsi), %edx
cmpl (%rcx,%rdx,4), %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x10(%rsp)
movl 0x10(%rsp), %eax
movslq %eax, %rcx
movslq 0xcc(%rsp), %rax
movq %rcx, 0x40(%rsp,%rax,8)
movslq 0xcc(%rsp), %rax
cmpq $0x0, 0x60(%rsp,%rax,8)
setg %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
movslq 0xcc(%rsp), %rax
movq %rcx, 0x20(%rsp,%rax,8)
movl 0xc0(%rsp), %eax
addl 0xd4(%rsp), %eax
movl %eax, 0xd4(%rsp)
movl 0xcc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xcc(%rsp)
jmp 0x99557d
movq 0xb8(%rsp), %rax
movslq 0xa4(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
vmovdqa 0x60(%rsp), %ymm0
movq %rax, 0x1a8(%rsp)
vmovdqa %ymm0, 0x180(%rsp)
vmovdqa 0x180(%rsp), %ymm0
movq 0x1a8(%rsp), %rax
vmovdqa %ymm0, (%rax)
movq 0xb0(%rsp), %rax
movslq 0xa4(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
vmovdqa 0x40(%rsp), %ymm0
movq %rax, 0x178(%rsp)
vmovdqa %ymm0, 0x140(%rsp)
vmovdqa 0x140(%rsp), %ymm0
movq 0x178(%rsp), %rax
vmovdqa %ymm0, (%rax)
movq 0xa8(%rsp), %rax
movslq 0xa4(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
vmovdqa 0x20(%rsp), %ymm0
movq %rax, 0x138(%rsp)
vmovdqa %ymm0, 0x100(%rsp)
vmovdqa 0x100(%rsp), %ymm0
movq 0x138(%rsp), %rax
vmovdqa %ymm0, (%rax)
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
movl 0xd8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd8(%rsp)
jmp 0x995550
jmp 0x99582c
movl 0xd0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd0(%rsp)
jmp 0x995531
movq 0xb8(%rsp), %rcx
movq 0x98(%rsp), %rax
movq %rcx, 0x60(%rax)
movq 0xb0(%rsp), %rcx
movq 0x98(%rsp), %rax
movq %rcx, 0x68(%rax)
movq 0xa8(%rsp), %rcx
movq 0x98(%rsp), %rax
movq %rcx, 0x70(%rax)
movq 0x98(%rsp), %rax
leaq -0x24ad(%rip), %rcx     # 0x9933e0
movq %rcx, 0x78(%rax)
movq 0x98(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq 0xf8(%rsp), %rax
movq %rbp, %rsp
popq %rbp
vzeroupper
retq
nopw %cs:(%rax,%rax)