// File: /workspace/github_cpp_makefile_star2_O2/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 0x53ec(%rip), %eax      # 0xc7e0
jne 0x74fe
movb 0x5600(%rip), %cl       # 0xca00
movb 0x55f2(%rip), %al       # 0xc9f8
movl %ecx, %esi
orb %al, %sil
movb 0x55f3(%rip), %dl       # 0xca04
orb %dl, %sil
testb $0x1, %sil
je 0x7438
cmpb $0x1, 0x55db(%rip)      # 0xc9fc
jne 0x7447
movl 0x538f(%rip), %esi      # 0xc7b8
leaq 0x18c2(%rip), %rdi      # 0x8cf2
xorl %eax, %eax
popq %rcx
jmp 0x72ed
leaq 0x1878(%rip), %rdi      # 0x8cb7
xorl %eax, %eax
popq %rcx
jmp 0x72ed
movl %ecx, %esi
notb %sil
andb %al, %sil
orb %sil, %dl
testb $0x1, %dl
jne 0x747e
movq 0x5352(%rip), %rdi      # 0xc7b0
movl 0x5354(%rip), %edx      # 0xc7b8
leaq 0x18b0(%rip), %rsi      # 0x8d1b
xorl %eax, %eax
callq 0x32d0
movb 0x5580(%rip), %al       # 0xc9f8
movb 0x5582(%rip), %cl       # 0xca00
xorb $0x1, %al
movl %eax, %edx
orb %cl, %dl
testb $0x1, %dl
jne 0x74a2
movl 0x5579(%rip), %esi      # 0xca08
movl 0x5323(%rip), %edx      # 0xc7b8
subl %esi, %edx
jbe 0x74a2
leaq 0x1882(%rip), %rdi      # 0x8d22
jmp 0x74bf
andb %cl, %al
testb $0x1, %al
jne 0x74df
movl 0x555a(%rip), %esi      # 0xca08
movl 0x5304(%rip), %edx      # 0xc7b8
cmpl %edx, %esi
jbe 0x74df
leaq 0x18bf(%rip), %rdi      # 0x8d7e
xorl %eax, %eax
callq 0x72ed
movl 0x52f0(%rip), %esi      # 0xc7bc
testl %esi, %esi
je 0x74fe
movl 0x52e2(%rip), %edx      # 0xc7b8
leaq 0x1877(%rip), %rdi      # 0x8d54
jmp 0x74f6
movl 0x52d7(%rip), %esi      # 0xc7bc
testl %esi, %esi
je 0x74fe
movl 0x52c9(%rip), %edx      # 0xc7b8
leaq 0x18b9(%rip), %rdi      # 0x8daf
xorl %eax, %eax
popq %rcx
jmp 0x72ed
popq %rax
retq