// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/bndm_t.c
// Function: main
int main(int argc, char **argv)
{
    plan_tests(1);
    char dflt[] = "one", *patt = argc > 1 ? argv[1] : dflt;
    char const *util = getenv("util") ? getenv("util") : ".";
    char const *file = argc > 1 ? argv[1] : "words";
    FILE *fp = fopenf("r", "%s/%s", util, file);
    if (!fp) return fprintf(stderr, "bndm_t: cannot open %s\n", file);
    int patlen = strlen(patt), lines = 0, goods = 0, hits = 0;
    char buf[999];

    while (fgets(buf, sizeof buf, fp)) {
        lines++;
        char *cp = strstr(buf, patt);
        hits += !!cp;
        if (cp == bndmem(buf, strlen(buf) - 1, patt, patlen)) ++goods;
        else fprintf(stderr, "# failed: %s", buf);
    }
    ok(goods == lines, "strstr == bndmem %d/%d times (%d hits)", goods, lines, hits);

    return exit_status();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rsi, %rbx
movl %edi, %ebp
movl $0x1, %edi
callq 0x52fe
movl $0x656e6f, 0x14(%rsp)   # imm = 0x656E6F
cmpl $0x2, %ebp
jl 0x3534
movq 0x8(%rbx), %r15
movq %r15, 0x8(%rsp)
jmp 0x3545
leaq 0x2ace(%rip), %r15      # 0x6009
leaq 0x14(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x2ab8(%rip), %rdi      # 0x6004
callq 0x3230
testq %rax, %rax
leaq 0x345f(%rip), %rdx      # 0x69ba
cmovneq %rax, %rdx
leaq 0x351f(%rip), %rdi      # 0x6a85
leaq 0x2aa2(%rip), %rsi      # 0x600f
xorl %ebx, %ebx
movq %r15, %rcx
xorl %eax, %eax
callq 0x42d1
testq %rax, %rax
je 0x36c5
movq %rax, %r13
movq 0x8(%rsp), %rdi
callq 0x30a0
movq %rax, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x3e7, %esi            # imm = 0x3E7
movq %r13, %rdx
callq 0x32c0
movl $0x0, %r15d
testq %rax, %rax
je 0x364b
leaq 0x20(%rsp), %r12
movq $0x0, (%rsp)
xorl %ebx, %ebx
xorl %r15d, %r15d
movq 0x8(%rsp), %r14
movq %r12, %rdi
movq %r14, %rsi
callq 0x3050
movq %rax, %rbp
cmpq $0x1, %rax
movq (%rsp), %rax
sbbl $-0x1, %eax
movq %rax, (%rsp)
movq %r12, %rdi
callq 0x30a0
leal -0x1(%rax), %esi
movq %r12, %rdi
movq %r14, %rdx
movq 0x18(%rsp), %rcx
callq 0x36f4
cmpq %rax, %rbp
jne 0x3625
incl %ebx
movq %r12, %rdi
movl $0x3e7, %esi            # imm = 0x3E7
movq %r13, %rdx
callq 0x32c0
incl %r15d
testq %rax, %rax
jne 0x35cc
jmp 0x3642
movq 0x59b4(%rip), %rax      # 0x8fe0
movq (%rax), %rdi
leaq 0x29f7(%rip), %rsi      # 0x602d
movq %r12, %rdx
xorl %eax, %eax
callq 0x3290
jmp 0x360b
cmpl %ebx, %r15d
jne 0x3677
movq (%rsp), %rbx
leaq 0x29f6(%rip), %r10      # 0x6048
leaq 0x29e6(%rip), %r11      # 0x603f
leaq 0x29da(%rip), %r9       # 0x603a
movl $0x1, %esi
xorl %edi, %edi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %eax, %eax
pushq %rbx
pushq %r15
pushq %r15
jmp 0x369f
leaq 0x29ca(%rip), %r10      # 0x6048
leaq 0x29ba(%rip), %r11      # 0x603f
leaq 0x29ae(%rip), %r9       # 0x603a
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %eax, %eax
pushq (%rsp)
pushq %r15
pushq %rbx
pushq %r10
pushq $0x2a
pushq %r11
callq 0x4a18
addq $0x30, %rsp
callq 0x55a0
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5914(%rip), %rax      # 0x8fe0
movq (%rax), %rdi
leaq 0x293f(%rip), %rsi      # 0x6015
movq %r15, %rdx
xorl %eax, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3290
nopl (%rax)