// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/src/memory_sse.c
// Function: parasail_profile_create_sse_128_16
parasail_profile_t * parasail_profile_create_sse_128_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; /* number of amino acids in table */
    const int32_t segWidth = 8; /* 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_16_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->profile16.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 $0x8, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movq $0x0, -0x78(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x38228f
movq 0xaa4d75(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x969d7e(%rip), %rsi    # 0xcebfeb
leaq 0x96aea4(%rip), %rdx    # 0xced118
leaq 0x96a6aa(%rip), %rcx    # 0xcec925
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x28(%rbp)
jmp 0x382505
jmp 0x382291
movq -0x40(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x3822db
jmp 0x38229d
cmpq $0x0, -0x30(%rbp)
jne 0x3822d7
movq 0xaa4d2d(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x969d36(%rip), %rsi    # 0xcebfeb
leaq 0x96ae5c(%rip), %rdx    # 0xced118
leaq 0x96a477(%rip), %rcx    # 0xcec73a
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x28(%rbp)
jmp 0x382505
jmp 0x3822d9
jmp 0x3822db
movq -0x40(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x3822f0
movl -0x34(%rbp), %eax
movl %eax, -0x94(%rbp)
jmp 0x3822fd
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 $0x8, %eax
subl $0x1, %eax
movl $0x8, %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 0x382350
movq $0x0, -0x28(%rbp)
jmp 0x382505
movq -0x30(%rbp), %rdi
movl -0x44(%rbp), %esi
movq -0x40(%rbp), %rdx
callq 0x1c5d00
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
jne 0x382378
movq $0x0, -0x28(%rbp)
jmp 0x382505
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0x3824e2
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x60(%rbp), %eax
jge 0x3824d2
movl -0x48(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl $0x0, -0x54(%rbp)
cmpl $0x8, -0x54(%rbp)
jge 0x38248e
movq -0x40(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x38241a
movl -0x4c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jl 0x3823d1
xorl %eax, %eax
movl %eax, -0x98(%rbp)
jmp 0x382403
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
movw %ax, %cx
movslq -0x54(%rbp), %rax
movw %cx, -0x90(%rbp,%rax,2)
jmp 0x382477
movl -0x4c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jl 0x38242c
xorl %eax, %eax
movl %eax, -0x9c(%rbp)
jmp 0x382462
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
movw %ax, %cx
movslq -0x54(%rbp), %rax
movw %cx, -0x90(%rbp,%rax,2)
movl -0x60(%rbp), %eax
addl -0x4c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x3823ab
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 0x382392
jmp 0x3824d4
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x38237f
movq -0x68(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x78(%rbp), %rax
leaq -0x329(%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 %cs:(%rax,%rax)