// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/parasail/tests/test_basic.c
// Function: main
int main(int argc, char ** argv)
{
    int major = 0;
    int minor = 0;
    int patch = 0;
    parasail_result_t *result = NULL;
    parasail_matrix_t *matrix = NULL;
    parasail_profile_t *profile = NULL;

    parasail_version(&major, &minor, &patch);
    printf("parasail is using C lib version %d.%d.%d\n", major, minor, patch);

    printf("\ntest1\n");
    printf("result = parasail_sw(\"asdf\", 4, \"asdf\", 4, 10, 1, &parasail_blosum62)\n");
    result = parasail_sw("asdf", 4, "asdf", 4, 10, 1, &parasail_blosum62);
    if (result->score != 20) {
        printf("failed\n");
        return EXIT_FAILURE;
    }
    else {
        printf("pass\n");
    }
    parasail_result_free(result);

    printf("\ntest2\n");
    printf("result = parasail_sw(\"asdf\", 4, \"asdf\", 4, 10, 1, &parasail_pam50)\n");
    result = parasail_sw("asdf", 4, "asdf", 4, 10, 1, &parasail_pam50);
    if (result->score != 27) {
        printf("failed\n");
        return EXIT_FAILURE;
    }
    else {
        printf("pass\n");
    }
    parasail_result_free(result);

    printf("\ntest3\n");
    printf("matrix = parasail_matrix_create(\"acgt\", 1, -1)\n");
    matrix = parasail_matrix_create("acgt", 1, -1);
    printf("result = parasail_sw(\"acgt\", 4, \"acgt\", 4, 10, 1, matrix)\n");
    result = parasail_sw("acgt", 4, "acgt", 4, 10, 1, matrix);
    if (result->score != 4) {
        printf("failed\n");
        return EXIT_FAILURE;
    }
    else {
        printf("pass\n");
    }
    parasail_result_free(result);
    parasail_matrix_free(matrix);

    /* if no vector ISA detected at build-time and/or run-time, this will fail */
    printf("\ntest4\n");
    printf("profile = parasail_profile_create_8(\"asdf\", 4, &parasail_blosum62)\n");
    profile = parasail_profile_create_8("asdf", 4, &parasail_blosum62);
    if (!profile) {
        printf("NULL profile returned; vector ISA not supported\n");
        printf("pass\n");
    }
    else {
        printf("result = parasail_sw_striped_profile_8(profile, \"asdf\", 4, 10, 1)\n");
        result = parasail_sw_striped_profile_8(profile, "asdf", 4, 10, 1);
        if (!result) {
            printf("NULL result returned; vector ISA not supported\n");
            printf("pass\n");
        }
        else {
            if (result->score != 20) {
                printf("failed\n");
                return EXIT_FAILURE;
            }
            else {
                printf("pass\n");
            }
            parasail_result_free(result);
        }
    }

    return 0;

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
xorl %eax, %eax
leaq 0x1c(%rsp), %rbx
movl %eax, (%rbx)
leaq 0x18(%rsp), %r14
movl %eax, (%r14)
leaq 0x14(%rsp), %r15
movl %eax, (%r15)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x32a4c
movl (%rbx), %esi
movl (%r14), %edx
movl (%r15), %ecx
leaq 0xeced9(%rip), %rdi     # 0x11f004
xorl %eax, %eax
callq 0x13030
leaq 0xecf27(%rip), %rdi     # 0x11f060
callq 0x13060
leaq 0xecf22(%rip), %rdi     # 0x11f067
callq 0x13060
leaq 0x119bef(%rip), %rax    # 0x14bd40
movq %rax, (%rsp)
leaq 0xeced2(%rip), %rdi     # 0x11f02e
movl $0x1, %ebx
movl $0x4, %esi
movq %rdi, %rdx
movl $0x4, %ecx
movl $0xa, %r8d
movl $0x1, %r9d
callq 0x38d44
cmpl $0x14, (%rax)
jne 0x32324
movq %rax, %r14
leaq 0xed0c0(%rip), %rdi     # 0x11f252
callq 0x13060
movq %r14, %rdi
callq 0x32891
leaq 0xecf07(%rip), %rdi     # 0x11f0ad
callq 0x13060
leaq 0xecf02(%rip), %rdi     # 0x11f0b4
callq 0x13060
leaq 0x119bca(%rip), %rax    # 0x14bd88
movq %rax, (%rsp)
leaq 0xece65(%rip), %rdi     # 0x11f02e
movl $0x1, %ebx
movl $0x4, %esi
movq %rdi, %rdx
movl $0x4, %ecx
movl $0xa, %r8d
movl $0x1, %r9d
callq 0x38d44
cmpl $0x1b, (%rax)
jne 0x32324
movq %rax, %r14
leaq 0xed053(%rip), %rdi     # 0x11f252
callq 0x13060
movq %r14, %rdi
callq 0x32891
leaq 0xecee4(%rip), %rdi     # 0x11f0f7
callq 0x13060
leaq 0xecedf(%rip), %rdi     # 0x11f0fe
callq 0x13060
leaq 0xece08(%rip), %r15     # 0x11f033
movl $0x1, %ebx
movq %r15, %rdi
movl $0x1, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x32a5f
movq %rax, %r14
leaq 0xecee1(%rip), %rdi     # 0x11f12d
callq 0x13060
movq %r14, (%rsp)
movq %r15, %rdi
movl $0x4, %esi
movq %r15, %rdx
movl $0x4, %ecx
movl $0xa, %r8d
movl $0x1, %r9d
callq 0x38d44
cmpl $0x4, (%rax)
jne 0x32324
movq %rax, %r15
leaq 0xecfc9(%rip), %rdi     # 0x11f252
callq 0x13060
movq %r15, %rdi
callq 0x32891
movq %r14, %rdi
callq 0x3342d
leaq 0xecec2(%rip), %rdi     # 0x11f167
callq 0x13060
leaq 0xecebd(%rip), %rdi     # 0x11f16e
callq 0x13060
leaq 0xecd71(%rip), %rdi     # 0x11f02e
leaq 0x119a7c(%rip), %rdx    # 0x14bd40
movl $0x4, %esi
callq 0x38d03
testq %rax, %rax
je 0x3233c
movq %rax, %rbx
leaq 0xecf04(%rip), %rdi     # 0x11f1e1
callq 0x13060
leaq 0xecd45(%rip), %rsi     # 0x11f02e
movq %rbx, %rdi
movl $0x4, %edx
movl $0xa, %ecx
movl $0x1, %r8d
callq 0x386e3
testq %rax, %rax
je 0x32345
movq %rax, %rbx
cmpl $0x14, (%rax)
jne 0x32361
leaq 0xecf3d(%rip), %rdi     # 0x11f252
callq 0x13060
movq %rbx, %rdi
callq 0x32891
jmp 0x3235d
leaq 0xecf2c(%rip), %rdi     # 0x11f257
callq 0x13060
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0xece6e(%rip), %rdi     # 0x11f1b1
jmp 0x3234c
leaq 0xeced7(%rip), %rdi     # 0x11f223
callq 0x13060
leaq 0xecefa(%rip), %rdi     # 0x11f252
callq 0x13060
xorl %ebx, %ebx
jmp 0x32330
leaq 0xeceef(%rip), %rdi     # 0x11f257
callq 0x13060
movl $0x1, %ebx
jmp 0x32330