// File: /workspace/github_c_makefile_star2_O2/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
leaq 0x1c(%rsp), %rbx
andl $0x0, (%rbx)
leaq 0x18(%rsp), %r14
andl $0x0, (%r14)
leaq 0x14(%rsp), %r15
andl $0x0, (%r15)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x13cda
movl (%rbx), %esi
movl (%r14), %edx
movl (%r15), %ecx
leaq 0xfedc8(%rip), %rdi     # 0x112004
xorl %eax, %eax
callq 0x13030
leaq 0xfee16(%rip), %rdi     # 0x112060
callq 0x13060
leaq 0xfee11(%rip), %rdi     # 0x112067
callq 0x13060
leaq 0x117ade(%rip), %rax    # 0x12ad40
movq %rax, (%rsp)
leaq 0xfedc1(%rip), %rdi     # 0x11202e
pushq $0x4
popq %rcx
pushq $0xa
popq %r8
pushq $0x1
popq %rbx
movl %ecx, %esi
movq %rdi, %rdx
movl %ebx, %r9d
callq 0x1a804
cmpl $0x14, (%rax)
jne 0x13406
movq %rax, %r14
leaq 0xfefbb(%rip), %rdi     # 0x112252
callq 0x13060
movq %r14, %rdi
callq 0x13b11
leaq 0xfee02(%rip), %rdi     # 0x1120ad
callq 0x13060
leaq 0xfedfd(%rip), %rdi     # 0x1120b4
callq 0x13060
leaq 0x117ac5(%rip), %rax    # 0x12ad88
movq %rax, (%rsp)
leaq 0xfed60(%rip), %rdi     # 0x11202e
pushq $0x4
popq %rcx
pushq $0xa
popq %r8
pushq $0x1
popq %rbx
movl %ecx, %esi
movq %rdi, %rdx
movl %ebx, %r9d
callq 0x1a804
cmpl $0x1b, (%rax)
jne 0x13406
movq %rax, %r14
leaq 0xfef5a(%rip), %rdi     # 0x112252
callq 0x13060
movq %r14, %rdi
callq 0x13b11
leaq 0xfedeb(%rip), %rdi     # 0x1120f7
callq 0x13060
leaq 0xfede6(%rip), %rdi     # 0x1120fe
callq 0x13060
leaq 0xfed0f(%rip), %r15     # 0x112033
pushq $0x1
popq %rbx
pushq $-0x1
popq %rdx
movq %r15, %rdi
movl %ebx, %esi
callq 0x13cea
movq %rax, %r14
leaq 0xfedef(%rip), %rdi     # 0x11212d
callq 0x13060
movq %r14, (%rsp)
pushq $0x4
popq %rcx
pushq $0xa
popq %r8
movq %r15, %rdi
movl %ecx, %esi
movq %r15, %rdx
movl %ebx, %r9d
callq 0x1a804
cmpl $0x4, (%rax)
jne 0x13406
movq %rax, %r15
leaq 0xfeee1(%rip), %rdi     # 0x112252
callq 0x13060
movq %r15, %rdi
callq 0x13b11
movq %r14, %rdi
callq 0x147db
leaq 0xfedda(%rip), %rdi     # 0x112167
callq 0x13060
leaq 0xfedd5(%rip), %rdi     # 0x11216e
callq 0x13060
leaq 0xfec89(%rip), %rdi     # 0x11202e
leaq 0x117994(%rip), %rdx    # 0x12ad40
pushq $0x4
popq %rsi
callq 0x1a7c3
testq %rax, %rax
je 0x1341e
movq %rax, %r14
leaq 0xfee1e(%rip), %rdi     # 0x1121e1
callq 0x13060
leaq 0xfec5f(%rip), %rsi     # 0x11202e
pushq $0x4
popq %rdx
pushq $0xa
popq %rcx
pushq $0x1
popq %rbx
movq %r14, %rdi
movl %ebx, %r8d
callq 0x1a1a3
testq %rax, %rax
je 0x13427
movq %rax, %r14
cmpl $0x14, (%rax)
jne 0x13406
leaq 0xfee5b(%rip), %rdi     # 0x112252
callq 0x13060
movq %r14, %rdi
callq 0x13b11
jmp 0x1343f
leaq 0xfee4a(%rip), %rdi     # 0x112257
callq 0x13060
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0xfed8c(%rip), %rdi     # 0x1121b1
jmp 0x1342e
leaq 0xfedf5(%rip), %rdi     # 0x112223
callq 0x13060
leaq 0xfee18(%rip), %rdi     # 0x112252
callq 0x13060
xorl %ebx, %ebx
jmp 0x13412
nop