// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/src/memory_sse.c
// Function: parasail_profile_create_stats_sse_128_8
parasail_profile_t * parasail_profile_create_stats_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;
    const int32_t segWidth = 16; /* number of values in vector unit */
    int32_t segLen = 0;
    __m128i* restrict vProfile = NULL;
    __m128i* restrict vProfileM = NULL;
    __m128i* 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___m128i(16, n * segLen);
    if (!vProfile) return NULL;
    vProfileM = parasail_memalign___m128i(16, n * segLen);
    if (!vProfileM) return NULL;
    vProfileS = parasail_memalign___m128i(16, 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) {
            __m128i_8_t p;
            __m128i_8_t m;
            __m128i_8_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;
            }
            _mm_store_si128(&vProfile[index], p.m);
            _mm_store_si128(&vProfileM[index], m.m);
            _mm_store_si128(&vProfileS[index], s.m);
            ++index;
        }
    }

    profile->profile8.score = vProfile;
    profile->profile8.matches = vProfileM;
    profile->profile8.similar = vProfileS;
    profile->free = &parasail_free___m128i;
    return profile;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x70(%rbp)
movl %esi, -0x74(%rbp)
movq %rdx, -0x80(%rbp)
movl $0x0, -0x84(%rbp)
movl $0x0, -0x88(%rbp)
movl $0x0, -0x8c(%rbp)
movl $0x0, -0x90(%rbp)
movl $0x0, -0x94(%rbp)
movl $0x0, -0x98(%rbp)
movl $0x10, -0x9c(%rbp)
movl $0x0, -0xa0(%rbp)
movq $0x0, -0xa8(%rbp)
movq $0x0, -0xb0(%rbp)
movq $0x0, -0xb8(%rbp)
movl $0x0, -0xbc(%rbp)
movq $0x0, -0xc8(%rbp)
cmpq $0x0, -0x80(%rbp)
jne 0x382cf6
movq 0xaa430e(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x969317(%rip), %rsi    # 0xcebfeb
leaq 0x96a4a6(%rip), %rdx    # 0xced181
leaq 0x969c43(%rip), %rcx    # 0xcec925
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x68(%rbp)
jmp 0x383172
jmp 0x382cf8
jmp 0x382cfa
cmpq $0x0, -0x70(%rbp)
jne 0x382d34
movq 0xaa42d0(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0x9692d9(%rip), %rsi    # 0xcebfeb
leaq 0x96a468(%rip), %rdx    # 0xced181
leaq 0x969a1a(%rip), %rcx    # 0xcec73a
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x68(%rbp)
jmp 0x383172
jmp 0x382d36
movq -0x80(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x382d4b
movl -0x74(%rbp), %eax
movl %eax, -0x104(%rbp)
jmp 0x382d58
movq -0x80(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, -0x104(%rbp)
movl -0x104(%rbp), %eax
movl %eax, -0x84(%rbp)
movq -0x80(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x98(%rbp)
movl -0x84(%rbp), %eax
addl $0x10, %eax
subl $0x1, %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %eax, -0xa0(%rbp)
movl -0x98(%rbp), %eax
imull -0xa0(%rbp), %eax
movslq %eax, %rsi
movl $0x10, %edi
callq 0x381e20
movq %rax, -0xa8(%rbp)
cmpq $0x0, -0xa8(%rbp)
jne 0x382dc3
movq $0x0, -0x68(%rbp)
jmp 0x383172
movl -0x98(%rbp), %eax
imull -0xa0(%rbp), %eax
movslq %eax, %rsi
movl $0x10, %edi
callq 0x381e20
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0xb0(%rbp)
jne 0x382dfb
movq $0x0, -0x68(%rbp)
jmp 0x383172
movl -0x98(%rbp), %eax
imull -0xa0(%rbp), %eax
movslq %eax, %rsi
movl $0x10, %edi
callq 0x381e20
movq %rax, -0xb8(%rbp)
cmpq $0x0, -0xb8(%rbp)
jne 0x382e33
movq $0x0, -0x68(%rbp)
jmp 0x383172
movq -0x70(%rbp), %rdi
movl -0x84(%rbp), %esi
movq -0x80(%rbp), %rdx
callq 0x1c5d00
movq %rax, -0xc8(%rbp)
cmpq $0x0, -0xc8(%rbp)
jne 0x382e64
movq $0x0, -0x68(%rbp)
jmp 0x383172
movl $0x0, -0x90(%rbp)
movl -0x90(%rbp), %eax
cmpl -0x98(%rbp), %eax
jge 0x38311f
movl $0x0, -0x88(%rbp)
movl -0x88(%rbp), %eax
cmpl -0xa0(%rbp), %eax
jge 0x383109
movl -0x88(%rbp), %eax
movl %eax, -0x8c(%rbp)
movl $0x0, -0x94(%rbp)
cmpl $0x10, -0x94(%rbp)
jge 0x38304d
movq -0x80(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x382f34
movl -0x8c(%rbp), %eax
cmpl -0x84(%rbp), %eax
jl 0x382ee1
xorl %eax, %eax
movl %eax, -0x108(%rbp)
jmp 0x382f1c
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x98(%rbp), %ecx
imull -0x90(%rbp), %ecx
movq -0x80(%rbp), %rdx
movq 0x10(%rdx), %rdx
movq -0x70(%rbp), %rsi
movslq -0x8c(%rbp), %rdi
movzbl (%rsi,%rdi), %esi
addl (%rdx,%rsi,4), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x108(%rbp)
movl -0x108(%rbp), %eax
movb %al, %cl
movslq -0x94(%rbp), %rax
movb %cl, -0xe0(%rbp,%rax)
jmp 0x382fa1
movl -0x8c(%rbp), %eax
cmpl -0x84(%rbp), %eax
jl 0x382f4c
xorl %eax, %eax
movl %eax, -0x10c(%rbp)
jmp 0x382f8b
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x98(%rbp), %ecx
imull -0x8c(%rbp), %ecx
movq -0x80(%rbp), %rdx
movq 0x10(%rdx), %rdx
movq -0x80(%rbp), %rsi
movq 0x38(%rsi), %rsi
movslq -0x90(%rbp), %rdi
movzbl (%rsi,%rdi), %esi
addl (%rdx,%rsi,4), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x10c(%rbp)
movl -0x10c(%rbp), %eax
movb %al, %cl
movslq -0x94(%rbp), %rax
movb %cl, -0xe0(%rbp,%rax)
movl -0x8c(%rbp), %eax
cmpl -0x84(%rbp), %eax
jl 0x382fb9
xorl %eax, %eax
movl %eax, -0x110(%rbp)
jmp 0x382fe7
movl -0x90(%rbp), %eax
movq -0x80(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x70(%rbp), %rdx
movslq -0x8c(%rbp), %rsi
movzbl (%rdx,%rsi), %edx
cmpl (%rcx,%rdx,4), %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x110(%rbp)
movl -0x110(%rbp), %eax
movb %al, %cl
movslq -0x94(%rbp), %rax
movb %cl, -0xf0(%rbp,%rax)
movslq -0x94(%rbp), %rax
movsbl -0xe0(%rbp,%rax), %eax
cmpl $0x0, %eax
setg %al
andb $0x1, %al
movzbl %al, %eax
movb %al, %cl
movslq -0x94(%rbp), %rax
movb %cl, -0x100(%rbp,%rax)
movl -0xa0(%rbp), %eax
addl -0x8c(%rbp), %eax
movl %eax, -0x8c(%rbp)
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x382eb2
movq -0xa8(%rbp), %rax
movslq -0xbc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movdqa -0xe0(%rbp), %xmm0
movq %rax, -0x8(%rbp)
movdqa %xmm0, -0x20(%rbp)
movdqa -0x20(%rbp), %xmm0
movq -0x8(%rbp), %rax
movdqa %xmm0, (%rax)
movq -0xb0(%rbp), %rax
movslq -0xbc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movdqa -0xf0(%rbp), %xmm0
movq %rax, -0x28(%rbp)
movdqa %xmm0, -0x40(%rbp)
movdqa -0x40(%rbp), %xmm0
movq -0x28(%rbp), %rax
movdqa %xmm0, (%rax)
movq -0xb8(%rbp), %rax
movslq -0xbc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movdqa -0x100(%rbp), %xmm0
movq %rax, -0x48(%rbp)
movdqa %xmm0, -0x60(%rbp)
movdqa -0x60(%rbp), %xmm0
movq -0x48(%rbp), %rax
movdqa %xmm0, (%rax)
movl -0xbc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0x382e8a
jmp 0x38310b
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
jmp 0x382e6e
movq -0xa8(%rbp), %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0xb0(%rbp), %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0xb8(%rbp), %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0xc8(%rbp), %rax
leaq -0xf93(%rip), %rcx      # 0x3821d0
movq %rcx, 0x78(%rax)
movq -0xc8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nop