// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/tests/test_matrix.c
// Function: main
int main(int argc, char **argv)
{
    parasail_matrix_t *matrix = NULL;
    const parasail_matrix_t *internal_matrix = NULL;
    parasail_matrix_t *user_matrix = NULL;
    parasail_matrix_t *user_matrix_copy = NULL;
    const char *pssm_alphabet = "abcdef";
    const int pssm_values[] = {
        0,  1,  2,  3,   4,  5,
        6,  7,  8,  9,  10, 11,
        12, 13, 14, 15, 16, 17,
        18, 19, 20, 21, 22, 23
    };
    const int pssm_length = 4;

    if (argc == 2) {
        matrix = parasail_matrix_from_file(argv[1]);
        print_matrix(matrix);
        print_mapper(matrix);
        parasail_matrix_free(matrix);
    }
    else {
        printf("missing matrix file argument, skipping that part of the test\n");
    }

    print_matrix(&parasail_blosum62);
    print_mapper(&parasail_blosum62);

    internal_matrix = parasail_matrix_lookup("blosum62");
    if (NULL == internal_matrix) {
        fprintf(stderr, "matrix lookup failed");
        exit(EXIT_FAILURE);
    }

    user_matrix = parasail_matrix_create("ACGT", 2, -1);
    if (NULL == user_matrix) {
        fprintf(stderr, "matrix create failed");
        exit(EXIT_FAILURE);
    }
    print_matrix(user_matrix);
    print_mapper(user_matrix);
    parasail_matrix_free(user_matrix);

    user_matrix = parasail_matrix_create_case_sensitive("AcgT", 2, -1);
    if (NULL == user_matrix) {
        fprintf(stderr, "matrix create failed");
        exit(EXIT_FAILURE);
    }
    print_matrix(user_matrix);
    print_mapper(user_matrix);
    parasail_matrix_free(user_matrix);

    user_matrix = parasail_matrix_create_case_sensitive("ACGTacgt", 2, -1);
    if (NULL == user_matrix) {
        fprintf(stderr, "matrix create failed");
        exit(EXIT_FAILURE);
    }
    print_matrix(user_matrix);
    print_mapper(user_matrix);
    parasail_matrix_free(user_matrix);

    user_matrix = parasail_matrix_copy(internal_matrix);
    if (NULL == user_matrix) {
        fprintf(stderr, "matrix copy failed");
        exit(EXIT_FAILURE);
    }

    parasail_matrix_set_value(user_matrix, 10, 10, 100);
    if (100 != user_matrix->max) {
        fprintf(stderr, "matrix set value failed");
        exit(EXIT_FAILURE);
    }

    parasail_matrix_free(user_matrix);

    user_matrix = parasail_matrix_pssm_create(
            pssm_alphabet,
            pssm_values,
            pssm_length);
    if (NULL == user_matrix) {
        fprintf(stderr, "pssm matrix create failed");
        exit(EXIT_FAILURE);
    }
    print_matrix(user_matrix);
    print_mapper(user_matrix);

    user_matrix_copy = parasail_matrix_copy(user_matrix);
    if (NULL == user_matrix_copy) {
        fprintf(stderr, "pssm matrix copy failed");
        exit(EXIT_FAILURE);
    }
    parasail_matrix_free(user_matrix);

    print_matrix(user_matrix_copy);
    print_mapper(user_matrix_copy);
    parasail_matrix_free(user_matrix_copy);

    user_matrix = parasail_matrix_convert_square_to_pssm(internal_matrix, "asdf", 4);
    print_matrix(user_matrix);
    print_mapper(user_matrix);
    parasail_matrix_free(user_matrix);

    print_matrix(internal_matrix);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
leaq 0x7d24(%rip), %rax      # 0xd004
movq %rax, -0x38(%rbp)
leaq -0xa0(%rbp), %rdi
leaq 0x7e1e(%rip), %rsi      # 0xd110
movl $0x60, %edx
callq 0x50c0
movl $0x4, -0xa4(%rbp)
cmpl $0x2, -0x8(%rbp)
jne 0x533a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x74f0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5640
movq -0x18(%rbp), %rdi
callq 0x57f0
movq -0x18(%rbp), %rdi
callq 0xad60
jmp 0x5348
leaq 0x7cca(%rip), %rdi      # 0xd00b
movb $0x0, %al
callq 0x5070
leaq 0x33719(%rip), %rdi     # 0x38a68
callq 0x5640
leaq 0x3370d(%rip), %rdi     # 0x38a68
callq 0x57f0
leaq 0x7ce2(%rip), %rdi      # 0xd049
callq 0x8560
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq -0x20(%rbp), %rax
jne 0x539a
movq 0x34c79(%rip), %rax     # 0x39ff8
movq (%rax), %rdi
leaq 0x7cc9(%rip), %rsi      # 0xd052
movb $0x0, %al
callq 0x50b0
movl $0x1, %edi
callq 0x5140
leaq 0x7cc6(%rip), %rdi      # 0xd067
movl $0x2, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x9970
movq %rax, -0x28(%rbp)
xorl %eax, %eax
cmpq -0x28(%rbp), %rax
jne 0x53de
movq 0x34c35(%rip), %rax     # 0x39ff8
movq (%rax), %rdi
leaq 0x7cca(%rip), %rsi      # 0xd097
movb $0x0, %al
callq 0x50b0
movl $0x1, %edi
callq 0x5140
movq -0x28(%rbp), %rdi
callq 0x5640
movq -0x28(%rbp), %rdi
callq 0x57f0
movq -0x28(%rbp), %rdi
callq 0xad60
leaq 0x7c6c(%rip), %rdi      # 0xd06c
movl $0x2, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x9ec0
movq %rax, -0x28(%rbp)
xorl %eax, %eax
cmpq -0x28(%rbp), %rax
jne 0x543d
movq 0x34bd6(%rip), %rax     # 0x39ff8
movq (%rax), %rdi
leaq 0x7c6b(%rip), %rsi      # 0xd097
movb $0x0, %al
callq 0x50b0
movl $0x1, %edi
callq 0x5140
movq -0x28(%rbp), %rdi
callq 0x5640
movq -0x28(%rbp), %rdi
callq 0x57f0
movq -0x28(%rbp), %rdi
callq 0xad60
leaq 0x7c12(%rip), %rdi      # 0xd071
movl $0x2, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x9ec0
movq %rax, -0x28(%rbp)
xorl %eax, %eax
cmpq -0x28(%rbp), %rax
jne 0x549c
movq 0x34b77(%rip), %rax     # 0x39ff8
movq (%rax), %rdi
leaq 0x7c0c(%rip), %rsi      # 0xd097
movb $0x0, %al
callq 0x50b0
movl $0x1, %edi
callq 0x5140
movq -0x28(%rbp), %rdi
callq 0x5640
movq -0x28(%rbp), %rdi
callq 0x57f0
movq -0x28(%rbp), %rdi
callq 0xad60
movq -0x20(%rbp), %rdi
callq 0xa510
movq %rax, -0x28(%rbp)
xorl %eax, %eax
cmpq -0x28(%rbp), %rax
jne 0x54ee
movq 0x34b25(%rip), %rax     # 0x39ff8
movq (%rax), %rdi
leaq 0x7bd4(%rip), %rsi      # 0xd0b1
movb $0x0, %al
callq 0x50b0
movl $0x1, %edi
callq 0x5140
movq -0x28(%rbp), %rdi
movl $0xa, %edx
movl $0x64, %ecx
movl %edx, %esi
callq 0xac90
movq -0x28(%rbp), %rcx
movl $0x64, %eax
cmpl 0x1c(%rcx), %eax
je 0x5533
movq 0x34ae0(%rip), %rax     # 0x39ff8
movq (%rax), %rdi
leaq 0x7b58(%rip), %rsi      # 0xd07a
movb $0x0, %al
callq 0x50b0
movl $0x1, %edi
callq 0x5140
movq -0x28(%rbp), %rdi
callq 0xad60
movq -0x38(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
movl $0x4, %edx
callq 0x9ef0
movq %rax, -0x28(%rbp)
xorl %eax, %eax
cmpq -0x28(%rbp), %rax
jne 0x557f
movq 0x34a94(%rip), %rax     # 0x39ff8
movq (%rax), %rdi
leaq 0x7b24(%rip), %rsi      # 0xd092
movb $0x0, %al
callq 0x50b0
movl $0x1, %edi
callq 0x5140
movq -0x28(%rbp), %rdi
callq 0x5640
movq -0x28(%rbp), %rdi
callq 0x57f0
movq -0x28(%rbp), %rdi
callq 0xa510
movq %rax, -0x30(%rbp)
xorl %eax, %eax
cmpq -0x30(%rbp), %rax
jne 0x55c8
movq 0x34a4b(%rip), %rax     # 0x39ff8
movq (%rax), %rdi
leaq 0x7af5(%rip), %rsi      # 0xd0ac
movb $0x0, %al
callq 0x50b0
movl $0x1, %edi
callq 0x5140
movq -0x28(%rbp), %rdi
callq 0xad60
movq -0x30(%rbp), %rdi
callq 0x5640
movq -0x30(%rbp), %rdi
callq 0x57f0
movq -0x30(%rbp), %rdi
callq 0xad60
movq -0x20(%rbp), %rdi
leaq 0x7acd(%rip), %rsi      # 0xd0c4
movl $0x4, %edx
callq 0xa8b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x5640
movq -0x28(%rbp), %rdi
callq 0x57f0
movq -0x28(%rbp), %rdi
callq 0xad60
movq -0x20(%rbp), %rdi
callq 0x5640
xorl %eax, %eax
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)