// File: /workspace/github_cpp_makefile_star2_O1/ctSkennerton[P]fxtract/util/tap.c
// Function: cleanup
static void
_cleanup(void)
{
    /* If we forked, don't do cleanup in child! */
    if (getpid() != test_pid)
        return;

    LOCK;

    /* If plan_no_plan() wasn't called, and we don't have a plan,
       and we're not skipping everything, then something happened
       before we could produce any output */
    if(!no_plan && !have_plan && !skip_all) {
        _diag("Looks like your test died before it could output anything.");
        UNLOCK;
        return;
    }

    if(test_died) {
        _diag("Looks like your test died just after %d.", test_count);
        UNLOCK;
        return;
    }

    /* No plan provided, but now we know how many tests were run, and can
       print the header at the end */
    if(!skip_all && (no_plan || !have_plan)) {
        fprintf(tap_out, "1..%d\n", test_count);
    }

    if((have_plan && !no_plan) && e_tests < test_count) {
        _diag("Looks like you planned %d tests but ran %d extra.",
              e_tests, test_count - e_tests);
        if(failures) {
            _diag("Looks like you failed %d tests of %d run.",
                  failures, test_count);
        }
        UNLOCK;
        return;
    }

    if((have_plan || !no_plan) && e_tests > test_count) {
        _diag("Looks like you planned %d tests but only ran %d.",
              e_tests, test_count);
        if(failures) {
            _diag("Looks like you failed %d tests of %d run.",
                  failures, test_count);
        }
        UNLOCK;
        return;
    }

    if(failures)
        _diag("Looks like you failed %d tests of %d.",
              failures, test_count);

    UNLOCK;
}

// Assembly:
pushq %rax
callq 0x32f0
cmpl 0x3df0(%rip), %eax      # 0xb7e0
jne 0x7af5
movb 0x4004(%rip), %al       # 0xba00
movb 0x3ff6(%rip), %cl       # 0xb9f8
movl %eax, %esi
orb %cl, %sil
movb 0x3ff7(%rip), %dl       # 0xba04
orb %dl, %sil
testb $0x1, %sil
je 0x7a34
cmpb $0x1, 0x3fdf(%rip)      # 0xb9fc
jne 0x7a43
movl 0x3d93(%rip), %esi      # 0xb7b8
leaq 0x12ae(%rip), %rdi      # 0x8cda
xorl %eax, %eax
popq %rcx
jmp 0x78e5
leaq 0x1264(%rip), %rdi      # 0x8c9f
xorl %eax, %eax
popq %rcx
jmp 0x78e5
notb %al
andb %cl, %al
orb %al, %dl
testb $0x1, %dl
jne 0x7a69
movq 0x3d5b(%rip), %rdi      # 0xb7b0
movl 0x3d5d(%rip), %edx      # 0xb7b8
leaq 0x12a1(%rip), %rsi      # 0x8d03
xorl %eax, %eax
callq 0x32d0
movb 0x3f89(%rip), %al       # 0xb9f8
xorb $0x1, %al
movb 0x3f89(%rip), %cl       # 0xba00
movl %eax, %edx
orb %cl, %dl
testb $0x1, %dl
jne 0x7a99
movl 0x3f82(%rip), %esi      # 0xba08
movl 0x3d2c(%rip), %edx      # 0xb7b8
subl %esi, %edx
jbe 0x7a99
leaq 0x1273(%rip), %rdi      # 0x8d0a
jmp 0x7ab6
andb %cl, %al
testb $0x1, %al
jne 0x7ad6
movl 0x3f63(%rip), %esi      # 0xba08
movl 0x3d0d(%rip), %edx      # 0xb7b8
cmpl %edx, %esi
jbe 0x7ad6
leaq 0x12b0(%rip), %rdi      # 0x8d66
xorl %eax, %eax
callq 0x78e5
movl 0x3cf9(%rip), %esi      # 0xb7bc
testl %esi, %esi
je 0x7af5
movl 0x3ceb(%rip), %edx      # 0xb7b8
leaq 0x1268(%rip), %rdi      # 0x8d3c
jmp 0x7aed
movl 0x3ce0(%rip), %esi      # 0xb7bc
testl %esi, %esi
je 0x7af5
movl 0x3cd2(%rip), %edx      # 0xb7b8
leaq 0x12aa(%rip), %rdi      # 0x8d97
xorl %eax, %eax
popq %rcx
jmp 0x78e5
popq %rax
retq