// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/src/memory_avx2.c
// Function: parasail_profile_create_stats_avx_256_8
parasail_profile_t * parasail_profile_create_stats_avx_256_8(
        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 = 32; /* 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_8_t p;
            __m256i_8_t m;
            __m256i_8_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->profile8.score = vProfile;
    profile->profile8.matches = vProfileM;
    profile->profile8.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 $0x20, 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 0x9940eb
movq 0x492f1d(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x357f26(%rip), %rsi    # 0xcebfeb
leaq 0x35c6cb(%rip), %rdx    # 0xcf0797
leaq 0x358852(%rip), %rcx    # 0xcec925
movb $0x0, %al
callq 0x19e180
movq $0x0, 0xf8(%rsp)
jmp 0x99460b
jmp 0x9940ed
jmp 0x9940ef
cmpq $0x0, 0xf0(%rsp)
jne 0x994131
movq 0x492ed7(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x357ee0(%rip), %rsi    # 0xcebfeb
leaq 0x35c685(%rip), %rdx    # 0xcf0797
leaq 0x358621(%rip), %rcx    # 0xcec73a
movb $0x0, %al
callq 0x19e180
movq $0x0, 0xf8(%rsp)
jmp 0x99460b
jmp 0x994133
movq 0xe0(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x99414e
movl 0xec(%rsp), %eax
movl %eax, 0x1c(%rsp)
jmp 0x99415d
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 $0x20, %eax
subl $0x1, %eax
movl $0x20, %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 0x9941d6
movq $0x0, 0xf8(%rsp)
jmp 0x99460b
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 0x994216
movq $0x0, 0xf8(%rsp)
jmp 0x99460b
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 0x994256
movq $0x0, 0xf8(%rsp)
jmp 0x99460b
movq 0xf0(%rsp), %rdi
movl 0xdc(%rsp), %esi
movq 0xe0(%rsp), %rdx
callq 0x1c5d00
movq %rax, 0x98(%rsp)
cmpq $0x0, 0x98(%rsp)
jne 0x994296
movq $0x0, 0xf8(%rsp)
jmp 0x99460b
movl $0x0, 0xd0(%rsp)
movl 0xd0(%rsp), %eax
cmpl 0xc8(%rsp), %eax
jge 0x9945ac
movl $0x0, 0xd8(%rsp)
movl 0xd8(%rsp), %eax
cmpl 0xc0(%rsp), %eax
jge 0x994594
movl 0xd8(%rsp), %eax
movl %eax, 0xd4(%rsp)
movl $0x0, 0xcc(%rsp)
cmpl $0x20, 0xcc(%rsp)
jge 0x9944a4
movq 0xe0(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x99437d
movl 0xd4(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jl 0x994321
xorl %eax, %eax
movl %eax, 0x18(%rsp)
jmp 0x994369
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
movb %al, %cl
movslq 0xcc(%rsp), %rax
movb %cl, 0x60(%rsp,%rax)
jmp 0x9943f3
movl 0xd4(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jl 0x994395
xorl %eax, %eax
movl %eax, 0x14(%rsp)
jmp 0x9943e1
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
movb %al, %cl
movslq 0xcc(%rsp), %rax
movb %cl, 0x60(%rsp,%rax)
movl 0xd4(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jl 0x99440b
xorl %eax, %eax
movl %eax, 0x10(%rsp)
jmp 0x994441
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
movb %al, %cl
movslq 0xcc(%rsp), %rax
movb %cl, 0x40(%rsp,%rax)
movslq 0xcc(%rsp), %rax
movsbl 0x60(%rsp,%rax), %eax
cmpl $0x0, %eax
setg %al
andb $0x1, %al
movzbl %al, %eax
movb %al, %cl
movslq 0xcc(%rsp), %rax
movb %cl, 0x20(%rsp,%rax)
movl 0xc0(%rsp), %eax
addl 0xd4(%rsp), %eax
movl %eax, 0xd4(%rsp)
movl 0xcc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xcc(%rsp)
jmp 0x9942ed
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 0x9942c0
jmp 0x994596
movl 0xd0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd0(%rsp)
jmp 0x9942a1
movq 0xb8(%rsp), %rcx
movq 0x98(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0xb0(%rsp), %rcx
movq 0x98(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0xa8(%rsp), %rcx
movq 0x98(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x98(%rsp), %rax
leaq -0x1217(%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
nopl (%rax,%rax)