// File: /workspace/github_c_makefile_star2_O0/giannisdravilas[P]Disease-Monitor/tests/../include/acutest.h
// Function: test_run__
static void
test_run__(const struct test__* test, int index, int master_index)
{
    int failed = 1;
    test_timer_type__ start, end;

    test_current_unit__ = test;
    test_current_already_logged__ = 0;
    test_timer_get_time__(&start);

    if(!test_no_exec__) {

#if defined(ACUTEST_UNIX__)

        pid_t pid;
        int exit_code;

        /* Make sure the child starts with empty I/O buffers. */
        fflush(stdout);
        fflush(stderr);

        pid = fork();
        if(pid == (pid_t)-1) {
            test_error__("Cannot fork. %s [%d]", strerror(errno), errno);
            failed = 1;
        } else if(pid == 0) {
            /* Child: Do the test. */
            test_worker__ = 1;
            failed = (test_do_run__(test, index) != 0);
            exit(failed ? 1 : 0);
        } else {
            /* Parent: Wait until child terminates and analyze its exit code. */
            waitpid(pid, &exit_code, 0);
            if(WIFEXITED(exit_code)) {
                switch(WEXITSTATUS(exit_code)) {
                    case 0:   failed = 0; break;   /* test has passed. */
                    case 1:   /* noop */ break;    /* "normal" failure. */
                    default:  test_error__("Unexpected exit code [%d]", WEXITSTATUS(exit_code));
                }
            } else if(WIFSIGNALED(exit_code)) {
                char tmp[32];
                const char* signame;
                switch(WTERMSIG(exit_code)) {
                    case SIGINT:  signame = "SIGINT"; break;
                    case SIGHUP:  signame = "SIGHUP"; break;
                    case SIGQUIT: signame = "SIGQUIT"; break;
                    case SIGABRT: signame = "SIGABRT"; break;
                    case SIGKILL: signame = "SIGKILL"; break;
                    case SIGSEGV: signame = "SIGSEGV"; break;
                    case SIGILL:  signame = "SIGILL"; break;
                    case SIGTERM: signame = "SIGTERM"; break;
                    default:      sprintf(tmp, "signal %d", WTERMSIG(exit_code)); signame = tmp; break;
                }
                test_error__("Test interrupted by %s.", signame);
            } else {
                test_error__("Test ended in an unexpected way [%d].", exit_code);
            }
        }

#elif defined(ACUTEST_WIN__)

        char buffer[512] = {0};
        STARTUPINFOA startupInfo;
        PROCESS_INFORMATION processInfo;
        DWORD exitCode;

        /* Windows has no fork(). So we propagate all info into the child
         * through a command line arguments. */
        _snprintf(buffer, sizeof(buffer)-1,
                 "%s --worker=%d %s --no-exec --no-summary %s --verbose=%d --color=%s -- \"%s\"",
                 test_argv0__, index, test_timer__ ? "--time" : "",
                 test_tap__ ? "--tap" : "", test_verbose_level__,
                 test_colorize__ ? "always" : "never",
                 test->name);
        memset(&startupInfo, 0, sizeof(startupInfo));
        startupInfo.cb = sizeof(STARTUPINFO);
        if(CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &startupInfo, &processInfo)) {
            WaitForSingleObject(processInfo.hProcess, INFINITE);
            GetExitCodeProcess(processInfo.hProcess, &exitCode);
            CloseHandle(processInfo.hThread);
            CloseHandle(processInfo.hProcess);
            failed = (exitCode != 0);
            if(exitCode > 1) {
                switch(exitCode) {
                    case 3:             test_error__("Aborted."); break;
                    case 0xC0000005:    test_error__("Access violation."); break;
                    default:            test_error__("Test ended in an unexpected way [%lu].", exitCode); break;
                }
            }
        } else {
            test_error__("Cannot create unit test subprocess [%ld].", GetLastError());
            failed = 1;
        }

#else

        /* A platform where we don't know how to run child process. */
        failed = (test_do_run__(test, index) != 0);

#endif

    } else {
        /* Child processes suppressed through --no-exec. */
        failed = (test_do_run__(test, index) != 0);
    }
    test_timer_get_time__(&end);

    test_current_unit__ = NULL;

    test_stat_run_units__++;
    if(failed)
        test_stat_failed_units__++;

    test_set_success__(master_index, !failed);
    test_set_duration__(master_index, test_timer_diff__(start, end));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, 0xb4b1(%rip)      # 0xf548
movl $0x0, 0xb49f(%rip)      # 0xf540
leaq -0x28(%rbp), %rdi
callq 0x54b0
cmpl $0x0, 0xb0c3(%rip)      # 0xf174
jne 0x42a7
movq 0xaf1a(%rip), %rax      # 0xefd8
movq (%rax), %rdi
callq 0x21b0
movq 0xaf2b(%rip), %rax      # 0xeff8
movq (%rax), %rdi
callq 0x21b0
callq 0x2270
movl %eax, -0x3c(%rbp)
cmpl $-0x1, -0x3c(%rbp)
jne 0x4118
callq 0x2040
movl (%rax), %edi
callq 0x2260
movq %rax, -0x70(%rbp)
callq 0x2040
movq -0x70(%rbp), %rsi
movl (%rax), %edx
leaq 0x7df4(%rip), %rdi      # 0xbef9
movb $0x0, %al
callq 0x54e0
movl $0x1, -0x14(%rbp)
jmp 0x42a5
cmpl $0x0, -0x3c(%rbp)
jne 0x4157
movl $0x1, 0xb580(%rip)      # 0xf6a8
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x55e0
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %ecx
xorl %edi, %edi
movl $0x1, %eax
cmpl $0x0, %ecx
cmovnel %eax, %edi
callq 0x2240
movl -0x3c(%rbp), %edi
leaq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x21f0
movl -0x40(%rbp), %eax
andl $0x7f, %eax
cmpl $0x0, %eax
jne 0x41b4
movzwl -0x40(%rbp), %eax
shrl $0x8, %eax
movl %eax, -0x74(%rbp)
testl %eax, %eax
je 0x418a
jmp 0x4180
movl -0x74(%rbp), %eax
subl $0x1, %eax
je 0x4193
jmp 0x4195
movl $0x0, -0x14(%rbp)
jmp 0x41af
jmp 0x41af
movl -0x40(%rbp), %esi
andl $0xff00, %esi           # imm = 0xFF00
sarl $0x8, %esi
leaq 0x7d66(%rip), %rdi      # 0xbf0e
movb $0x0, %al
callq 0x54e0
jmp 0x42a1
movl -0x40(%rbp), %eax
andl $0x7f, %eax
addl $0x1, %eax
movsbl %al, %eax
sarl %eax
cmpl $0x0, %eax
jle 0x428e
movl -0x40(%rbp), %eax
andl $0x7f, %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x80(%rbp)
subl $0xe, %eax
ja 0x425a
movq -0x80(%rbp), %rax
leaq 0x6e3b(%rip), %rcx      # 0xb024
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x7d2f(%rip), %rax      # 0xbf28
movq %rax, -0x68(%rbp)
jmp 0x427a
leaq 0x7d29(%rip), %rax      # 0xbf2f
movq %rax, -0x68(%rbp)
jmp 0x427a
leaq 0x7d23(%rip), %rax      # 0xbf36
movq %rax, -0x68(%rbp)
jmp 0x427a
leaq 0x7d1e(%rip), %rax      # 0xbf3e
movq %rax, -0x68(%rbp)
jmp 0x427a
leaq 0x7d19(%rip), %rax      # 0xbf46
movq %rax, -0x68(%rbp)
jmp 0x427a
leaq 0x7d14(%rip), %rax      # 0xbf4e
movq %rax, -0x68(%rbp)
jmp 0x427a
leaq 0x7d0f(%rip), %rax      # 0xbf56
movq %rax, -0x68(%rbp)
jmp 0x427a
leaq 0x7d09(%rip), %rax      # 0xbf5d
movq %rax, -0x68(%rbp)
jmp 0x427a
leaq -0x60(%rbp), %rdi
movl -0x40(%rbp), %edx
andl $0x7f, %edx
leaq 0x7cfa(%rip), %rsi      # 0xbf65
movb $0x0, %al
callq 0x2230
leaq -0x60(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rsi
leaq 0x7cea(%rip), %rdi      # 0xbf6f
movb $0x0, %al
callq 0x54e0
jmp 0x429f
movl -0x40(%rbp), %esi
leaq 0x7cef(%rip), %rdi      # 0xbf87
movb $0x0, %al
callq 0x54e0
jmp 0x42a1
jmp 0x42a3
jmp 0x42a5
jmp 0x42c1
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x55e0
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x14(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x54b0
movq $0x0, 0xb273(%rip) # 0xf548
movl 0xb3d9(%rip), %eax      # 0xf6b4
addl $0x1, %eax
movl %eax, 0xb3d0(%rip)      # 0xf6b4
cmpl $0x0, -0x14(%rbp)
je 0x42f9
movl 0xb3c8(%rip), %eax      # 0xf6b8
addl $0x1, %eax
movl %eax, 0xb3bf(%rip)      # 0xf6b8
movl -0x10(%rbp), %edi
cmpl $0x0, -0x14(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %esi
callq 0x5800
movl -0x10(%rbp), %eax
movl %eax, -0x84(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x4ea0
movl -0x84(%rbp), %edi
callq 0x5840
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)