// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/src/memory_avx2.c
// Function: parasail_profile_create_stats_avx_256_16
parasail_profile_t * parasail_profile_create_stats_avx_256_16(
        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 = 16; /* 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_16_t p;
            __m256i_16_t m;
            __m256i_16_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->profile16.score = vProfile;
    profile->profile16.matches = vProfileM;
    profile->profile16.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 $0x10, 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 0x99471b
movq 0x4928ed(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x3578f6(%rip), %rsi    # 0xcebfeb
leaq 0x35c0c3(%rip), %rdx    # 0xcf07bf
leaq 0x358222(%rip), %rcx    # 0xcec925
movb $0x0, %al
callq 0x19e180
movq $0x0, 0xf8(%rsp)
jmp 0x994c43
jmp 0x99471d
jmp 0x99471f
cmpq $0x0, 0xf0(%rsp)
jne 0x994761
movq 0x4928a7(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x3578b0(%rip), %rsi    # 0xcebfeb
leaq 0x35c07d(%rip), %rdx    # 0xcf07bf
leaq 0x357ff1(%rip), %rcx    # 0xcec73a
movb $0x0, %al
callq 0x19e180
movq $0x0, 0xf8(%rsp)
jmp 0x994c43
jmp 0x994763
movq 0xe0(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x99477e
movl 0xec(%rsp), %eax
movl %eax, 0x1c(%rsp)
jmp 0x99478d
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 $0x10, %eax
subl $0x1, %eax
movl $0x10, %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 0x994806
movq $0x0, 0xf8(%rsp)
jmp 0x994c43
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 0x994846
movq $0x0, 0xf8(%rsp)
jmp 0x994c43
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 0x994886
movq $0x0, 0xf8(%rsp)
jmp 0x994c43
movq 0xf0(%rsp), %rdi
movl 0xdc(%rsp), %esi
movq 0xe0(%rsp), %rdx
callq 0x1c5d00
movq %rax, 0x98(%rsp)
cmpq $0x0, 0x98(%rsp)
jne 0x9948c6
movq $0x0, 0xf8(%rsp)
jmp 0x994c43
movl $0x0, 0xd0(%rsp)
movl 0xd0(%rsp), %eax
cmpl 0xc8(%rsp), %eax
jge 0x994be4
movl $0x0, 0xd8(%rsp)
movl 0xd8(%rsp), %eax
cmpl 0xc0(%rsp), %eax
jge 0x994bcc
movl 0xd8(%rsp), %eax
movl %eax, 0xd4(%rsp)
movl $0x0, 0xcc(%rsp)
cmpl $0x10, 0xcc(%rsp)
jge 0x994adc
movq 0xe0(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x9949af
movl 0xd4(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jl 0x994951
xorl %eax, %eax
movl %eax, 0x18(%rsp)
jmp 0x994999
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
movw %ax, %cx
movslq 0xcc(%rsp), %rax
movw %cx, 0x60(%rsp,%rax,2)
jmp 0x994a27
movl 0xd4(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jl 0x9949c7
xorl %eax, %eax
movl %eax, 0x14(%rsp)
jmp 0x994a13
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
movw %ax, %cx
movslq 0xcc(%rsp), %rax
movw %cx, 0x60(%rsp,%rax,2)
movl 0xd4(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jl 0x994a3f
xorl %eax, %eax
movl %eax, 0x10(%rsp)
jmp 0x994a75
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
movw %ax, %cx
movslq 0xcc(%rsp), %rax
movw %cx, 0x40(%rsp,%rax,2)
movslq 0xcc(%rsp), %rax
movswl 0x60(%rsp,%rax,2), %eax
cmpl $0x0, %eax
setg %al
andb $0x1, %al
movzbl %al, %eax
movw %ax, %cx
movslq 0xcc(%rsp), %rax
movw %cx, 0x20(%rsp,%rax,2)
movl 0xc0(%rsp), %eax
addl 0xd4(%rsp), %eax
movl %eax, 0xd4(%rsp)
movl 0xcc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xcc(%rsp)
jmp 0x99491d
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 0x9948f0
jmp 0x994bce
movl 0xd0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd0(%rsp)
jmp 0x9948d1
movq 0xb8(%rsp), %rcx
movq 0x98(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0xb0(%rsp), %rcx
movq 0x98(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0xa8(%rsp), %rcx
movq 0x98(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x98(%rsp), %rax
leaq -0x184f(%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)