// File: /workspace/github_c_makefile_star2_O3/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 0x32eff
movl (%rbx), %esi
movl (%r14), %edx
movl (%r15), %ecx
leaq 0xe8f19(%rip), %rdi     # 0x11b004
xorl %eax, %eax
callq 0x13030
leaq 0xe8f67(%rip), %rdi     # 0x11b060
callq 0x13060
leaq 0xe8f62(%rip), %rdi     # 0x11b067
callq 0x13060
leaq 0x116c2f(%rip), %rax    # 0x148d40
movq %rax, (%rsp)
leaq 0xe8f12(%rip), %rdi     # 0x11b02e
movl $0x1, %ebx
movl $0x4, %esi
movq %rdi, %rdx
movl $0x4, %ecx
movl $0xa, %r8d
movl $0x1, %r9d
callq 0x391c0
cmpl $0x14, (%rax)
jne 0x322e4
movq %rax, %r14
leaq 0xe9100(%rip), %rdi     # 0x11b252
callq 0x13060
movq %r14, %rdi
callq 0x32d38
leaq 0xe8f47(%rip), %rdi     # 0x11b0ad
callq 0x13060
leaq 0xe8f42(%rip), %rdi     # 0x11b0b4
callq 0x13060
leaq 0x116c0a(%rip), %rax    # 0x148d88
movq %rax, (%rsp)
leaq 0xe8ea5(%rip), %rdi     # 0x11b02e
movl $0x1, %ebx
movl $0x4, %esi
movq %rdi, %rdx
movl $0x4, %ecx
movl $0xa, %r8d
movl $0x1, %r9d
callq 0x391c0
cmpl $0x1b, (%rax)
jne 0x322e4
movq %rax, %r14
leaq 0xe9093(%rip), %rdi     # 0x11b252
callq 0x13060
movq %r14, %rdi
callq 0x32d38
leaq 0xe8f24(%rip), %rdi     # 0x11b0f7
callq 0x13060
leaq 0xe8f1f(%rip), %rdi     # 0x11b0fe
callq 0x13060
leaq 0xe8e48(%rip), %r15     # 0x11b033
movl $0x1, %ebx
movq %r15, %rdi
movl $0x1, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x32f12
movq %rax, %r14
leaq 0xe8f21(%rip), %rdi     # 0x11b12d
callq 0x13060
movq %r14, (%rsp)
movq %r15, %rdi
movl $0x4, %esi
movq %r15, %rdx
movl $0x4, %ecx
movl $0xa, %r8d
movl $0x1, %r9d
callq 0x391c0
cmpl $0x4, (%rax)
jne 0x322e4
movq %rax, %r15
leaq 0xe9009(%rip), %rdi     # 0x11b252
callq 0x13060
movq %r15, %rdi
callq 0x32d38
movq %r14, %rdi
callq 0x338de
leaq 0xe8f02(%rip), %rdi     # 0x11b167
callq 0x13060
leaq 0xe8efd(%rip), %rdi     # 0x11b16e
callq 0x13060
leaq 0xe8db1(%rip), %rdi     # 0x11b02e
leaq 0x116abc(%rip), %rdx    # 0x148d40
movl $0x4, %esi
callq 0x3917f
testq %rax, %rax
je 0x322fc
movq %rax, %rbx
leaq 0xe8f44(%rip), %rdi     # 0x11b1e1
callq 0x13060
leaq 0xe8d85(%rip), %rsi     # 0x11b02e
movq %rbx, %rdi
movl $0x4, %edx
movl $0xa, %ecx
movl $0x1, %r8d
callq 0x38b5f
testq %rax, %rax
je 0x32305
movq %rax, %rbx
cmpl $0x14, (%rax)
jne 0x32321
leaq 0xe8f7d(%rip), %rdi     # 0x11b252
callq 0x13060
movq %rbx, %rdi
callq 0x32d38
jmp 0x3231d
leaq 0xe8f6c(%rip), %rdi     # 0x11b257
callq 0x13060
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0xe8eae(%rip), %rdi     # 0x11b1b1
jmp 0x3230c
leaq 0xe8f17(%rip), %rdi     # 0x11b223
callq 0x13060
leaq 0xe8f3a(%rip), %rdi     # 0x11b252
callq 0x13060
xorl %ebx, %ebx
jmp 0x322f0
leaq 0xe8f2f(%rip), %rdi     # 0x11b257
callq 0x13060
movl $0x1, %ebx
jmp 0x322f0