// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/src/memory_avx2.c
// Function: parasail_profile_create_stats_avx_256_32
parasail_profile_t * parasail_profile_create_stats_avx_256_32(
        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 = 8; /* 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_32_t p;
            __m256i_32_t m;
            __m256i_32_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->profile32.score = vProfile;
    profile->profile32.matches = vProfileM;
    profile->profile32.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 $0x8, 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 0x994d5b
movq 0x4922ad(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x3572b6(%rip), %rsi    # 0xcebfeb
leaq 0x35baac(%rip), %rdx    # 0xcf07e8
leaq 0x357be2(%rip), %rcx    # 0xcec925
movb $0x0, %al
callq 0x19e180
movq $0x0, 0xf8(%rsp)
jmp 0x995270
jmp 0x994d5d
jmp 0x994d5f
cmpq $0x0, 0xf0(%rsp)
jne 0x994da1
movq 0x492267(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x357270(%rip), %rsi    # 0xcebfeb
leaq 0x35ba66(%rip), %rdx    # 0xcf07e8
leaq 0x3579b1(%rip), %rcx    # 0xcec73a
movb $0x0, %al
callq 0x19e180
movq $0x0, 0xf8(%rsp)
jmp 0x995270
jmp 0x994da3
movq 0xe0(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x994dbe
movl 0xec(%rsp), %eax
movl %eax, 0x1c(%rsp)
jmp 0x994dcd
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 $0x8, %eax
subl $0x1, %eax
movl $0x8, %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 0x994e46
movq $0x0, 0xf8(%rsp)
jmp 0x995270
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 0x994e86
movq $0x0, 0xf8(%rsp)
jmp 0x995270
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 0x994ec6
movq $0x0, 0xf8(%rsp)
jmp 0x995270
movq 0xf0(%rsp), %rdi
movl 0xdc(%rsp), %esi
movq 0xe0(%rsp), %rdx
callq 0x1c5d00
movq %rax, 0x98(%rsp)
cmpq $0x0, 0x98(%rsp)
jne 0x994f06
movq $0x0, 0xf8(%rsp)
jmp 0x995270
movl $0x0, 0xd0(%rsp)
movl 0xd0(%rsp), %eax
cmpl 0xc8(%rsp), %eax
jge 0x995211
movl $0x0, 0xd8(%rsp)
movl 0xd8(%rsp), %eax
cmpl 0xc0(%rsp), %eax
jge 0x9951f9
movl 0xd8(%rsp), %eax
movl %eax, 0xd4(%rsp)
movl $0x0, 0xcc(%rsp)
cmpl $0x8, 0xcc(%rsp)
jge 0x995109
movq 0xe0(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x994feb
movl 0xd4(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jl 0x994f91
xorl %eax, %eax
movl %eax, 0x18(%rsp)
jmp 0x994fd9
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), %ecx
movslq 0xcc(%rsp), %rax
movl %ecx, 0x60(%rsp,%rax,4)
jmp 0x99505f
movl 0xd4(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jl 0x995003
xorl %eax, %eax
movl %eax, 0x14(%rsp)
jmp 0x99504f
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), %ecx
movslq 0xcc(%rsp), %rax
movl %ecx, 0x60(%rsp,%rax,4)
movl 0xd4(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jl 0x995077
xorl %eax, %eax
movl %eax, 0x10(%rsp)
jmp 0x9950ad
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), %ecx
movslq 0xcc(%rsp), %rax
movl %ecx, 0x40(%rsp,%rax,4)
movslq 0xcc(%rsp), %rax
cmpl $0x0, 0x60(%rsp,%rax,4)
setg %al
andb $0x1, %al
movzbl %al, %ecx
movslq 0xcc(%rsp), %rax
movl %ecx, 0x20(%rsp,%rax,4)
movl 0xc0(%rsp), %eax
addl 0xd4(%rsp), %eax
movl %eax, 0xd4(%rsp)
movl 0xcc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xcc(%rsp)
jmp 0x994f5d
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 0x994f30
jmp 0x9951fb
movl 0xd0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd0(%rsp)
jmp 0x994f11
movq 0xb8(%rsp), %rcx
movq 0x98(%rsp), %rax
movq %rcx, 0x48(%rax)
movq 0xb0(%rsp), %rcx
movq 0x98(%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0xa8(%rsp), %rcx
movq 0x98(%rsp), %rax
movq %rcx, 0x58(%rax)
movq 0x98(%rsp), %rax
leaq -0x1e7c(%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