// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/src/memory.c
// Function: parasail_matrix_pssm_create_internal
static parasail_matrix_t* parasail_matrix_pssm_create_internal(
        const char *alphabet, const int *values, const int length, int case_sensitive)
{
    parasail_matrix_t *retval = NULL;
    int *matrix = NULL;
    int *mapper = NULL;
    char *alphabet_copy = NULL;
    size_t size = 0;
    size_t size1 = 0;
    size_t i = 0;
    size_t j = 0;
    size_t c = 0;
    size_t v = 0;
    int min = INT_MAX;
    int max = INT_MIN;

    PARASAIL_CHECK_NULL(alphabet);
    PARASAIL_CHECK_NULL(values);
    if (length <= 0) {
        fprintf(stderr, "%s: length must be > 0\n", __func__);
        return NULL;
    }

    size = strlen(alphabet);
    if (size >= INT_MAX) {
        fprintf(stderr, "%s: alphabet is too large\n", __func__);
        return NULL;
    }
    size1 = size + 1;

    PARASAIL_CALLOC(matrix, int, size1*length);

    /* find min and max values */
    for (i=0; i<size*length; ++i) {
        min = values[i] < min ? values[i] : min;
        max = values[i] > max ? values[i] : max;
    }

    for (i=0; i<(size_t)length; ++i) {
        for (j=0; j<size; ++j) {
            matrix[c++] = values[v++];
        }
        matrix[c++] = min;
    }

    PARASAIL_CALLOC(mapper, int, 256);
    parasail_memset_int(mapper, (int)size, 256);
    if (case_sensitive) {
        for (i=0; i<size; ++i) {
            mapper[(unsigned char)alphabet[i]] = (int)i;
        }
    }
    else {
        for (i=0; i<size; ++i) {
            mapper[toupper((unsigned char)alphabet[i])] = (int)i;
            mapper[tolower((unsigned char)alphabet[i])] = (int)i;
        }
    }

    PARASAIL_CALLOC(alphabet_copy, char, size1+1);
    (void)memcpy(alphabet_copy, alphabet, sizeof(char) * size);
    alphabet_copy[size] = '*';
    alphabet_copy[size1] = '\0';

    PARASAIL_NEW(retval, parasail_matrix_t);
    retval->name = "";
    retval->matrix = matrix;
    retval->mapper = mapper;
    retval->size = (int)size1;
    retval->max = max;
    retval->min = min;
    retval->user_matrix = matrix;
    retval->type = PARASAIL_MATRIX_TYPE_PSSM;
    retval->length = length;
    retval->alphabet = alphabet_copy;
    retval->query = NULL;
    return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movl $0x7fffffff, -0x74(%rbp) # imm = 0x7FFFFFFF
movl $0x80000000, -0x78(%rbp) # imm = 0x80000000
cmpq $0x0, -0x10(%rbp)
jne 0x1c4eb1
movq 0xc62153(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0xb2715c(%rip), %rsi    # 0xcebfeb
leaq 0xb27823(%rip), %rdx    # 0xcec6b9
leaq 0xb277f8(%rip), %rcx    # 0xcec695
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x1c53a9
jmp 0x1c4eb3
jmp 0x1c4eb5
cmpq $0x0, -0x18(%rbp)
jne 0x1c4eef
movq 0xc62115(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0xb2711e(%rip), %rsi    # 0xcebfeb
leaq 0xb277e5(%rip), %rdx    # 0xcec6b9
leaq 0xb27803(%rip), %rcx    # 0xcec6de
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x1c53a9
jmp 0x1c4ef1
cmpl $0x0, -0x1c(%rbp)
jg 0x1c4f23
movq 0xc620da(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0xb277dd(%rip), %rsi    # 0xcec6e5
leaq 0xb277aa(%rip), %rdx    # 0xcec6b9
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x1c53a9
movq -0x10(%rbp), %rdi
callq 0x19e050
movq %rax, -0x48(%rbp)
cmpq $0x7fffffff, -0x48(%rbp) # imm = 0x7FFFFFFF
jb 0x1c4f66
movq 0xc62097(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0xb27753(%rip), %rsi    # 0xcec69e
leaq 0xb27767(%rip), %rdx    # 0xcec6b9
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x1c53a9
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq %rcx, %rax
shlq $0x2, %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rdi
callq 0x19e150
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x1c4fca
movq 0xc62037(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
movq -0x80(%rbp), %rcx
leaq 0xb26f0e(%rip), %rsi    # 0xcebebd
leaq 0xb27703(%rip), %rdx    # 0xcec6b9
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x1c53a9
jmp 0x1c4fcc
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x48(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
imulq %rdx, %rcx
cmpq %rcx, %rax
jae 0x1c5064
movq -0x18(%rbp), %rax
movq -0x58(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x74(%rbp), %eax
jge 0x1c500c
movq -0x18(%rbp), %rax
movq -0x58(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x9c(%rbp)
jmp 0x1c5015
movl -0x74(%rbp), %eax
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
movl %eax, -0x74(%rbp)
movq -0x18(%rbp), %rax
movq -0x58(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x78(%rbp), %eax
jle 0x1c5041
movq -0x18(%rbp), %rax
movq -0x58(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xa0(%rbp)
jmp 0x1c504a
movl -0x78(%rbp), %eax
movl %eax, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
movl %eax, -0x78(%rbp)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x1c4fd4
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cmpq %rcx, %rax
jae 0x1c50ec
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x1c50c5
movq -0x18(%rbp), %rax
movq -0x70(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x70(%rbp)
movl (%rax,%rcx,4), %edx
movq -0x30(%rbp), %rax
movq -0x68(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x68(%rbp)
movl %edx, (%rax,%rcx,4)
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x1c5081
movl -0x74(%rbp), %edx
movq -0x30(%rbp), %rax
movq -0x68(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x68(%rbp)
movl %edx, (%rax,%rcx,4)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x1c506c
jmp 0x1c50ee
movq $0x400, -0x88(%rbp) # imm = 0x400
movq -0x88(%rbp), %rdi
callq 0x19e150
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1c5143
movq 0xc61ec1(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
movq -0x88(%rbp), %rcx
leaq 0xb26d95(%rip), %rsi    # 0xcebebd
leaq 0xb2758a(%rip), %rdx    # 0xcec6b9
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x1c53a9
jmp 0x1c5145
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rax
movl %eax, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x1c36f0
cmpl $0x0, -0x20(%rbp)
je 0x1c519d
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x1c5198
movq -0x58(%rbp), %rax
movl %eax, %edx
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x58(%rbp), %rsi
movzbl (%rcx,%rsi), %ecx
movl %edx, (%rax,%rcx,4)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x1c5167
jmp 0x1c523c
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x1c523a
movq -0x58(%rbp), %rax
movl %eax, -0xbc(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x10(%rbp), %rax
movq -0x58(%rbp), %rcx
movzbl (%rax,%rcx), %edi
callq 0x19e210
movl -0xbc(%rbp), %edx
movl %eax, %ecx
movq -0xb8(%rbp), %rax
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0x58(%rbp), %rax
movl %eax, -0xac(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rax
movq -0x58(%rbp), %rcx
movzbl (%rax,%rcx), %edi
callq 0x19e1a0
movl -0xac(%rbp), %edx
movl %eax, %ecx
movq -0xa8(%rbp), %rax
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x1c51a5
jmp 0x1c523c
jmp 0x1c523e
movq -0x50(%rbp), %rax
addq $0x1, %rax
shlq $0x0, %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rdi
callq 0x19e150
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x1c529b
movq 0xc61d69(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
movq -0x90(%rbp), %rcx
leaq 0xb26c3d(%rip), %rsi    # 0xcebebd
leaq 0xb27432(%rip), %rdx    # 0xcec6b9
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x1c53a9
jmp 0x1c529d
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x48(%rbp), %rdx
shlq $0x0, %rdx
callq 0x19e0a0
movq -0x40(%rbp), %rax
movq -0x48(%rbp), %rcx
movb $0x2a, (%rax,%rcx)
movq -0x40(%rbp), %rax
movq -0x50(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq $0x48, -0x98(%rbp)
movq -0x98(%rbp), %rdi
callq 0x19e150
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x1c531f
movq 0xc61ce5(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
movq -0x98(%rbp), %rcx
leaq 0xb26bb9(%rip), %rsi    # 0xcebebd
leaq 0xb273ae(%rip), %rdx    # 0xcec6b9
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x1c53a9
jmp 0x1c5321
movq -0x28(%rbp), %rax
leaq 0xac818a(%rip), %rcx    # 0xc8d4b6
movq %rcx, (%rax)
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x50(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x18(%rax)
movl -0x78(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl -0x74(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rax
movl $0x1, 0x30(%rax)
movl -0x1c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x34(%rax)
movq -0x40(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)