// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/src/memory_avx2.c
// Function: parasail_profile_create_avx_256_8
parasail_profile_t * parasail_profile_create_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; /* number of amino acids in table */
    const int32_t segWidth = 32; /* number of values in vector unit */
    int32_t segLen = 0;
    __m256i* restrict vProfile = NULL;
    int32_t index = 0;
    parasail_profile_t *profile = NULL;

    PARASAIL_CHECK_NULL(matrix);
    /* s1 is ignored for pssm, required for square */
    if (matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) {
        PARASAIL_CHECK_NULL(s1);
    }

    s1Len = matrix->type == PARASAIL_MATRIX_TYPE_SQUARE ? _s1Len : matrix->length;
    n = matrix->size;
    segLen = (s1Len + segWidth - 1) / segWidth;
    vProfile = parasail_memalign___m256i(32, n * segLen);
    if (!vProfile) 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 t;
            j = i;
            for (segNum=0; segNum<segWidth; ++segNum) {
                if (matrix->type == PARASAIL_MATRIX_TYPE_SQUARE) {
                    t.v[segNum] = j >= s1Len ? 0 : matrix->matrix[n*k+matrix->mapper[(unsigned char)s1[j]]];
                }
                else {
                    t.v[segNum] = j >= s1Len ? 0 : matrix->matrix[n*j+matrix->mapper[(unsigned char)matrix->alphabet[k]]];
                }
                j += segLen;
            }
            _mm256_store_si256(&vProfile[index], t.m);
            ++index;
        }
    }

    profile->profile8.score = vProfile;
    profile->free = &parasail_free___m256i;
    return profile;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andq $-0x20, %rsp
subq $0xe0, %rsp
movq %rdi, 0x90(%rsp)
movl %esi, 0x8c(%rsp)
movq %rdx, 0x80(%rsp)
movl $0x0, 0x7c(%rsp)
movl $0x0, 0x78(%rsp)
movl $0x0, 0x74(%rsp)
movl $0x0, 0x70(%rsp)
movl $0x0, 0x6c(%rsp)
movl $0x0, 0x68(%rsp)
movl $0x20, 0x64(%rsp)
movl $0x0, 0x60(%rsp)
movq $0x0, 0x58(%rsp)
movl $0x0, 0x54(%rsp)
movq $0x0, 0x48(%rsp)
cmpq $0x0, 0x80(%rsp)
jne 0x9930e2
movq 0x493f26(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x358f2f(%rip), %rsi    # 0xcebfeb
leaq 0x35d649(%rip), %rdx    # 0xcf070c
leaq 0x35985b(%rip), %rcx    # 0xcec925
movb $0x0, %al
callq 0x19e180
movq $0x0, 0x98(%rsp)
jmp 0x9933c8
jmp 0x9930e4
movq 0x80(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x99313a
jmp 0x9930f4
cmpq $0x0, 0x90(%rsp)
jne 0x993136
movq 0x493ed2(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x358edb(%rip), %rsi    # 0xcebfeb
leaq 0x35d5f5(%rip), %rdx    # 0xcf070c
leaq 0x35961c(%rip), %rcx    # 0xcec73a
movb $0x0, %al
callq 0x19e180
movq $0x0, 0x98(%rsp)
jmp 0x9933c8
jmp 0x993138
jmp 0x99313a
movq 0x80(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x993155
movl 0x8c(%rsp), %eax
movl %eax, 0x1c(%rsp)
jmp 0x993164
movq 0x80(%rsp), %rax
movl 0x34(%rax), %eax
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0x7c(%rsp)
movq 0x80(%rsp), %rax
movl 0x18(%rax), %eax
movl %eax, 0x68(%rsp)
movl 0x7c(%rsp), %eax
addl $0x20, %eax
subl $0x1, %eax
movl $0x20, %ecx
cltd
idivl %ecx
movl %eax, 0x60(%rsp)
movl 0x68(%rsp), %eax
imull 0x60(%rsp), %eax
movslq %eax, %rsi
movl $0x20, %edi
callq 0x992f60
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
jne 0x9931c5
movq $0x0, 0x98(%rsp)
jmp 0x9933c8
movq 0x90(%rsp), %rdi
movl 0x7c(%rsp), %esi
movq 0x80(%rsp), %rdx
callq 0x1c5d00
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0x9931fc
movq $0x0, 0x98(%rsp)
jmp 0x9933c8
movl $0x0, 0x70(%rsp)
movl 0x70(%rsp), %eax
cmpl 0x68(%rsp), %eax
jge 0x99339d
movl $0x0, 0x78(%rsp)
movl 0x78(%rsp), %eax
cmpl 0x60(%rsp), %eax
jge 0x99338b
movl 0x78(%rsp), %eax
movl %eax, 0x74(%rsp)
movl $0x0, 0x6c(%rsp)
cmpl $0x20, 0x6c(%rsp)
jge 0x993333
movq 0x80(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x9932b3
movl 0x74(%rsp), %eax
cmpl 0x7c(%rsp), %eax
jl 0x993263
xorl %eax, %eax
movl %eax, 0x18(%rsp)
jmp 0x9932a2
movq 0x80(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x68(%rsp), %ecx
imull 0x70(%rsp), %ecx
movq 0x80(%rsp), %rdx
movq 0x10(%rdx), %rdx
movq 0x90(%rsp), %rsi
movslq 0x74(%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 0x6c(%rsp), %rax
movb %cl, 0x20(%rsp,%rax)
jmp 0x993317
movl 0x74(%rsp), %eax
cmpl 0x7c(%rsp), %eax
jl 0x9932c5
xorl %eax, %eax
movl %eax, 0x14(%rsp)
jmp 0x993308
movq 0x80(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x68(%rsp), %ecx
imull 0x74(%rsp), %ecx
movq 0x80(%rsp), %rdx
movq 0x10(%rdx), %rdx
movq 0x80(%rsp), %rsi
movq 0x38(%rsi), %rsi
movslq 0x70(%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 0x6c(%rsp), %rax
movb %cl, 0x20(%rsp,%rax)
movl 0x60(%rsp), %eax
addl 0x74(%rsp), %eax
movl %eax, 0x74(%rsp)
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
jmp 0x993238
movq 0x58(%rsp), %rax
movslq 0x54(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
vmovdqa 0x20(%rsp), %ymm0
movq %rax, 0xc8(%rsp)
vmovdqa %ymm0, 0xa0(%rsp)
vmovdqa 0xa0(%rsp), %ymm0
movq 0xc8(%rsp), %rax
vmovdqa %ymm0, (%rax)
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
movl 0x78(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x78(%rsp)
jmp 0x99321a
jmp 0x99338d
movl 0x70(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x70(%rsp)
jmp 0x993204
movq 0x58(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x48(%rsp), %rax
leaq 0x29(%rip), %rcx        # 0x9933e0
movq %rcx, 0x78(%rax)
movq 0x48(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq %rbp, %rsp
popq %rbp
vzeroupper
retq
nopl (%rax,%rax)