// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/src/memory_sse.c
// Function: parasail_profile_create_sse_128_8
parasail_profile_t * parasail_profile_create_sse_128_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 = 16; /* number of values in vector unit */
    int32_t segLen = 0;
    __m128i* 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___m128i(16, 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) {
            __m128i_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;
            }
            _mm_store_si128(&vProfile[index], t.m);
            ++index;
        }
    }

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x30(%rbp)
movl %esi, -0x34(%rbp)
movq %rdx, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
movl $0x10, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movq $0x0, -0x78(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x381f4f
movq 0xaa50b5(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x96a0be(%rip), %rsi    # 0xcebfeb
leaq 0x96b1c2(%rip), %rdx    # 0xced0f6
leaq 0x96a9ea(%rip), %rcx    # 0xcec925
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x28(%rbp)
jmp 0x3821c1
jmp 0x381f51
movq -0x40(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x381f9b
jmp 0x381f5d
cmpq $0x0, -0x30(%rbp)
jne 0x381f97
movq 0xaa506d(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x96a076(%rip), %rsi    # 0xcebfeb
leaq 0x96b17a(%rip), %rdx    # 0xced0f6
leaq 0x96a7b7(%rip), %rcx    # 0xcec73a
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x28(%rbp)
jmp 0x3821c1
jmp 0x381f99
jmp 0x381f9b
movq -0x40(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x381fb0
movl -0x34(%rbp), %eax
movl %eax, -0x94(%rbp)
jmp 0x381fbd
movq -0x40(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, -0x94(%rbp)
movl -0x94(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x58(%rbp)
movl -0x44(%rbp), %eax
addl $0x10, %eax
subl $0x1, %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %eax, -0x60(%rbp)
movl -0x58(%rbp), %eax
imull -0x60(%rbp), %eax
movslq %eax, %rsi
movl $0x10, %edi
callq 0x381e20
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
jne 0x382010
movq $0x0, -0x28(%rbp)
jmp 0x3821c1
movq -0x30(%rbp), %rdi
movl -0x44(%rbp), %esi
movq -0x40(%rbp), %rdx
callq 0x1c5d00
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
jne 0x382038
movq $0x0, -0x28(%rbp)
jmp 0x3821c1
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0x38219e
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x60(%rbp), %eax
jge 0x38218e
movl -0x48(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl $0x0, -0x54(%rbp)
cmpl $0x10, -0x54(%rbp)
jge 0x38214a
movq -0x40(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x3820d8
movl -0x4c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jl 0x382091
xorl %eax, %eax
movl %eax, -0x98(%rbp)
jmp 0x3820c3
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x58(%rbp), %ecx
imull -0x50(%rbp), %ecx
movq -0x40(%rbp), %rdx
movq 0x10(%rdx), %rdx
movq -0x30(%rbp), %rsi
movslq -0x4c(%rbp), %rdi
movzbl (%rsi,%rdi), %esi
addl (%rdx,%rsi,4), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %eax
movb %al, %cl
movslq -0x54(%rbp), %rax
movb %cl, -0x90(%rbp,%rax)
jmp 0x382133
movl -0x4c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jl 0x3820ea
xorl %eax, %eax
movl %eax, -0x9c(%rbp)
jmp 0x382120
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x58(%rbp), %ecx
imull -0x4c(%rbp), %ecx
movq -0x40(%rbp), %rdx
movq 0x10(%rdx), %rdx
movq -0x40(%rbp), %rsi
movq 0x38(%rsi), %rsi
movslq -0x50(%rbp), %rdi
movzbl (%rsi,%rdi), %esi
addl (%rdx,%rsi,4), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
movb %al, %cl
movslq -0x54(%rbp), %rax
movb %cl, -0x90(%rbp,%rax)
movl -0x60(%rbp), %eax
addl -0x4c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x38206b
movq -0x68(%rbp), %rax
movslq -0x6c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movdqa -0x90(%rbp), %xmm0
movq %rax, -0x8(%rbp)
movdqa %xmm0, -0x20(%rbp)
movdqa -0x20(%rbp), %xmm0
movq -0x8(%rbp), %rax
movdqa %xmm0, (%rax)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x382052
jmp 0x382190
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x38203f
movq -0x68(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x78(%rbp), %rax
leaq 0x1b(%rip), %rcx        # 0x3821d0
movq %rcx, 0x78(%rax)
movq -0x78(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nop