// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/src/memory_sse.c
// Function: parasail_profile_create_sse_128_32
parasail_profile_t * parasail_profile_create_sse_128_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; /* number of amino acids in table */
    const int32_t segWidth = 4; /* 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_32_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->profile32.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 $0x4, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movq $0x0, -0x78(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x3825bf
movq 0xaa4a45(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x969a4e(%rip), %rsi    # 0xcebfeb
leaq 0x96ab97(%rip), %rdx    # 0xced13b
leaq 0x96a37a(%rip), %rcx    # 0xcec925
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x28(%rbp)
jmp 0x38282d
jmp 0x3825c1
movq -0x40(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x38260b
jmp 0x3825cd
cmpq $0x0, -0x30(%rbp)
jne 0x382607
movq 0xaa49fd(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x969a06(%rip), %rsi    # 0xcebfeb
leaq 0x96ab4f(%rip), %rdx    # 0xced13b
leaq 0x96a147(%rip), %rcx    # 0xcec73a
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x28(%rbp)
jmp 0x38282d
jmp 0x382609
jmp 0x38260b
movq -0x40(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x382620
movl -0x34(%rbp), %eax
movl %eax, -0x94(%rbp)
jmp 0x38262d
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 $0x4, %eax
subl $0x1, %eax
movl $0x4, %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 0x382680
movq $0x0, -0x28(%rbp)
jmp 0x38282d
movq -0x30(%rbp), %rdi
movl -0x44(%rbp), %esi
movq -0x40(%rbp), %rdx
callq 0x1c5d00
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
jne 0x3826a8
movq $0x0, -0x28(%rbp)
jmp 0x38282d
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0x38280a
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x60(%rbp), %eax
jge 0x3827fa
movl -0x48(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl $0x0, -0x54(%rbp)
cmpl $0x4, -0x54(%rbp)
jge 0x3827b6
movq -0x40(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x382746
movl -0x4c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jl 0x382701
xorl %eax, %eax
movl %eax, -0x98(%rbp)
jmp 0x382733
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), %ecx
movslq -0x54(%rbp), %rax
movl %ecx, -0x90(%rbp,%rax,4)
jmp 0x38279f
movl -0x4c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jl 0x382758
xorl %eax, %eax
movl %eax, -0x9c(%rbp)
jmp 0x38278e
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), %ecx
movslq -0x54(%rbp), %rax
movl %ecx, -0x90(%rbp,%rax,4)
movl -0x60(%rbp), %eax
addl -0x4c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x3826db
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 0x3826c2
jmp 0x3827fc
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x3826af
movq -0x68(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x78(%rbp), %rax
leaq -0x651(%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
nopw (%rax,%rax)