// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/src/memory.c
// Function: parasail_matrix_create_internal
static parasail_matrix_t* parasail_matrix_create_internal(
        const char *alphabet, const int match, const int mismatch, 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;

    PARASAIL_CHECK_NULL(alphabet);

    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*size1);

    for (i=0; i<size; ++i) {
        for (j=0; j<size; ++j) {
            if (i == j) {
                matrix[c++] = match;
            }
            else {
                matrix[c++] = mismatch;
            }
        }
        matrix[c++] = 0;
    }
    for (j=0; j<size1; ++j) {
        matrix[c++] = 0;
    }

    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 = match > mismatch ? match : mismatch;
    retval->min = match > mismatch ? mismatch : match;
    retval->user_matrix = matrix;
    retval->type = PARASAIL_MATRIX_TYPE_SQUARE;
    retval->length = retval->size;
    retval->alphabet = alphabet_copy;
    retval->query = NULL;
    return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%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)
cmpq $0x0, -0x10(%rbp)
jne 0x1c491a
movq 0xc626ea(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0xb276f3(%rip), %rsi    # 0xcebfeb
leaq 0xb27d76(%rip), %rdx    # 0xcec675
leaq 0xb27d8f(%rip), %rcx    # 0xcec695
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x1c4d8a
jmp 0x1c491c
movq -0x10(%rbp), %rdi
callq 0x19e050
movq %rax, -0x48(%rbp)
cmpq $0x7fffffff, -0x48(%rbp) # imm = 0x7FFFFFFF
jb 0x1c495f
movq 0xc6269e(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
leaq 0xb27d5a(%rip), %rsi    # 0xcec69e
leaq 0xb27d2a(%rip), %rdx    # 0xcec675
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x1c4d8a
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
imulq -0x50(%rbp), %rax
shlq $0x2, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0x19e150
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x1c49c0
movq 0xc62641(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
movq -0x70(%rbp), %rcx
leaq 0xb27518(%rip), %rsi    # 0xcebebd
leaq 0xb27cc9(%rip), %rdx    # 0xcec675
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x1c4d8a
jmp 0x1c49c2
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x1c4a63
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x1c4a38
movq -0x58(%rbp), %rax
cmpq -0x60(%rbp), %rax
jne 0x1c4a0f
movl -0x14(%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)
jmp 0x1c4a28
movl -0x18(%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)
jmp 0x1c4a2a
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x1c49e0
movq -0x30(%rbp), %rax
movq -0x68(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x68(%rbp)
movl $0x0, (%rax,%rcx,4)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x1c49ca
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x50(%rbp), %rax
jae 0x1c4a9d
movq -0x30(%rbp), %rax
movq -0x68(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x68(%rbp)
movl $0x0, (%rax,%rcx,4)
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x1c4a6b
jmp 0x1c4a9f
movq $0x400, -0x78(%rbp)     # imm = 0x400
movq -0x78(%rbp), %rdi
callq 0x19e150
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1c4aeb
movq 0xc62516(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
movq -0x78(%rbp), %rcx
leaq 0xb273ed(%rip), %rsi    # 0xcebebd
leaq 0xb27b9e(%rip), %rdx    # 0xcec675
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x1c4d8a
jmp 0x1c4aed
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rax
movl %eax, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x1c36f0
cmpl $0x0, -0x1c(%rbp)
je 0x1c4b45
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x1c4b40
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 0x1c4b0f
jmp 0x1c4be4
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x1c4be2
movq -0x58(%rbp), %rax
movl %eax, -0xa4(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x10(%rbp), %rax
movq -0x58(%rbp), %rcx
movzbl (%rax,%rcx), %edi
callq 0x19e210
movl -0xa4(%rbp), %edx
movl %eax, %ecx
movq -0xa0(%rbp), %rax
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0x58(%rbp), %rax
movl %eax, -0x94(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rax
movq -0x58(%rbp), %rcx
movzbl (%rax,%rcx), %edi
callq 0x19e1a0
movl -0x94(%rbp), %edx
movl %eax, %ecx
movq -0x90(%rbp), %rax
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x1c4b4d
jmp 0x1c4be4
jmp 0x1c4be6
movq -0x50(%rbp), %rax
addq $0x1, %rax
shlq $0x0, %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rdi
callq 0x19e150
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x1c4c3a
movq 0xc623c7(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
movq -0x80(%rbp), %rcx
leaq 0xb2729e(%rip), %rsi    # 0xcebebd
leaq 0xb27a4f(%rip), %rdx    # 0xcec675
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x1c4d8a
jmp 0x1c4c3c
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, -0x88(%rbp)
movq -0x88(%rbp), %rdi
callq 0x19e150
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x1c4cbe
movq 0xc62346(%rip), %rax    # 0xe26fd8
movq (%rax), %rdi
movq -0x88(%rbp), %rcx
leaq 0xb2721a(%rip), %rsi    # 0xcebebd
leaq 0xb279cb(%rip), %rdx    # 0xcec675
movb $0x0, %al
callq 0x19e180
movq $0x0, -0x8(%rbp)
jmp 0x1c4d8a
jmp 0x1c4cc0
movq -0x28(%rbp), %rax
leaq 0xac87eb(%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 -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jle 0x1c4d06
movl -0x14(%rbp), %eax
movl %eax, -0xa8(%rbp)
jmp 0x1c4d0f
movl -0x18(%rbp), %eax
movl %eax, -0xa8(%rbp)
movl -0xa8(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jle 0x1c4d2f
movl -0x18(%rbp), %eax
movl %eax, -0xac(%rbp)
jmp 0x1c4d38
movl -0x14(%rbp), %eax
movl %eax, -0xac(%rbp)
movl -0xac(%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 $0x0, 0x30(%rax)
movq -0x28(%rbp), %rax
movl 0x18(%rax), %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 $0xb0, %rsp
popq %rbp
retq
nopw (%rax,%rax)