// File: /workspace/github_c_makefile_star2_O1/nemequ[P]safe-math/munit/munit.c
// Function: munit_test_runner_run_test_with_params
static void
munit_test_runner_run_test_with_params(MunitTestRunner* runner, const MunitTest* test, const MunitParameter params[]) {
  MunitResult result = MUNIT_OK;
  MunitReport report = {
    0, 0, 0, 0,
#if defined(MUNIT_ENABLE_TIMING)
    0.0, 0.0
#endif
  };

  if (params != NULL) {
    unsigned int output_l = 2;
    fputs("  ", MUNIT_OUTPUT_FILE);
    bool first = true;
    for (const MunitParameter* param = params ; param != NULL && param->name != NULL ; param++) {
      if (!first) {
        fputs(", ", MUNIT_OUTPUT_FILE);
        output_l += 2;
      } else {
        first = false;
      }

      output_l += fprintf(MUNIT_OUTPUT_FILE, "%s=%s", param->name, param->value);
    }
    while (output_l++ < MUNIT_TEST_NAME_LEN) {
      fputc(' ', MUNIT_OUTPUT_FILE);
    }
  }

  fflush(MUNIT_OUTPUT_FILE);

  FILE* stderr_buf;
#if !defined(_WIN32) || defined(__MINGW32__)
  stderr_buf = tmpfile();
#else
  tmpfile_s(&stderr_buf);
#endif
  if (stderr_buf == NULL) {
    munit_log_errno(MUNIT_LOG_ERROR, stderr, "unable to create buffer for stderr");
    result = MUNIT_ERROR;
    goto print_result;
  }

#if !defined(_WIN32)
  if (runner->fork) {
    int pipefd[2] = { -1, -1 };
    if (pipe(pipefd) != 0) {
      munit_log_errno(MUNIT_LOG_ERROR, stderr, "unable to create pipe");
      result = MUNIT_ERROR;
      goto print_result;
    }

    const pid_t fork_pid = fork();
    if (fork_pid == 0) {
      close(pipefd[0]);

      int orig_stderr = munit_replace_stderr(stderr_buf);
      result = munit_test_runner_exec(runner, test, params, &report);
      munit_restore_stderr(orig_stderr);

      ssize_t bytes_written = 0;
      do {
        bytes_written += write(pipefd[1], ((uint8_t*) (&report)) + bytes_written, sizeof(report) - bytes_written);
        if (bytes_written < 0) {
          if (stderr_buf != NULL) {
	    munit_log_errno(MUNIT_LOG_ERROR, stderr, "unable to write to pipe");
	  }
          exit(EXIT_FAILURE);
        }
      } while ((size_t) bytes_written < sizeof(report));

      if (stderr_buf != NULL)
        fclose(stderr_buf);
      close(pipefd[1]);

      exit(EXIT_SUCCESS);
    } else if (fork_pid == -1) {
      close(pipefd[0]);
      close(pipefd[1]);
      if (stderr_buf != NULL) {
	munit_log_errno(MUNIT_LOG_ERROR, stderr, "unable to fork");
      }
      report.failed++;
      result = MUNIT_ERROR;
    } else {
      close(pipefd[1]);
      ssize_t bytes_read = 0;
      do {
        bytes_read += read(pipefd[0], ((uint8_t*) (&report)) + bytes_read, sizeof(report) - bytes_read);
        if (bytes_read < 1) {
          if (stderr_buf != NULL) {
            int status = 0;
            const pid_t changed_pid = waitpid(fork_pid, &status, WNOHANG);

            if ((changed_pid != fork_pid) || WIFCONTINUED(status)) {
	      munit_log_errno(MUNIT_LOG_ERROR, stderr, "unable to read from pipe");
            } else if (WIFEXITED(status)) {
	      munit_logf_internal(MUNIT_LOG_ERROR, stderr_buf, "child exited unexpectedly with status %d", WEXITSTATUS(status));
            } else if (WIFSIGNALED(status)) {
	      munit_logf_internal(MUNIT_LOG_ERROR, stderr_buf, "child killed by signal %d (%s)", WTERMSIG(status), strsignal(WTERMSIG(status)));
            } else if (WIFSTOPPED(status)) {
	      munit_logf_internal(MUNIT_LOG_ERROR, stderr_buf, "child stopped by signal %d", WSTOPSIG(status));
            }
          }
          break;
        }
      } while (bytes_read < (ssize_t) sizeof(report));

      if (bytes_read != sizeof(report)) {
        report.failed++;
      }

      close(pipefd[0]);
      waitpid(fork_pid, NULL, 0);
    }
  } else
#endif
  {
    const volatile int orig_stderr = munit_replace_stderr(stderr_buf);

#if defined(MUNIT_THREAD_LOCAL)
    if (MUNIT_UNLIKELY(setjmp(munit_error_jmp_buf) != 0)) {
      result = MUNIT_FAIL;
      report.failed++;
    } else {
      munit_error_jmp_buf_valid = true;
      result = munit_test_runner_exec(runner, test, params, &report);
    }
#else
    result = munit_test_runner_exec(runner, test, params, &report);
#endif

    munit_restore_stderr(orig_stderr);

    /* Here just so that the label is used on Windows and we don't get
     * a warning */
    goto print_result;
  }

 print_result:

  fputs("[ ", MUNIT_OUTPUT_FILE);
  if (report.failed > 0) {
    munit_test_runner_print_color(runner, MUNIT_RESULT_STRING_FAIL, '1');
    runner->report.failed++;
    result = MUNIT_FAIL;
  } else if (report.errored > 0) {
    munit_test_runner_print_color(runner, MUNIT_RESULT_STRING_ERROR, '1');
    runner->report.errored++;
    result = MUNIT_ERROR;
  } else if (report.skipped > 0) {
    munit_test_runner_print_color(runner, MUNIT_RESULT_STRING_SKIP, '3');
    runner->report.skipped++;
    result = MUNIT_SKIP;
  } else if (report.successful > 1) {
    munit_test_runner_print_color(runner, MUNIT_RESULT_STRING_OK, '2');
#if defined(MUNIT_ENABLE_TIMING)
    fputs(" ] [ ", MUNIT_OUTPUT_FILE);
    munit_print_time(MUNIT_OUTPUT_FILE, report.wall_clock / ((double) report.successful));
    fputs(" / ", MUNIT_OUTPUT_FILE);
    munit_print_time(MUNIT_OUTPUT_FILE, report.cpu_clock / ((double) report.successful));
    fprintf(MUNIT_OUTPUT_FILE, " CPU ]\n  %-" MUNIT_XSTRINGIFY(MUNIT_TEST_NAME_LEN) "s Total: [ ", "");
    munit_print_time(MUNIT_OUTPUT_FILE, report.wall_clock);
    fputs(" / ", MUNIT_OUTPUT_FILE);
    munit_print_time(MUNIT_OUTPUT_FILE, report.cpu_clock);
    fputs(" CPU", MUNIT_OUTPUT_FILE);
#endif
    runner->report.successful++;
    result = MUNIT_OK;
  } else if (report.successful > 0) {
    munit_test_runner_print_color(runner, MUNIT_RESULT_STRING_OK, '2');
#if defined(MUNIT_ENABLE_TIMING)
    fputs(" ] [ ", MUNIT_OUTPUT_FILE);
    munit_print_time(MUNIT_OUTPUT_FILE, report.wall_clock);
    fputs(" / ", MUNIT_OUTPUT_FILE);
    munit_print_time(MUNIT_OUTPUT_FILE, report.cpu_clock);
    fputs(" CPU", MUNIT_OUTPUT_FILE);
#endif
    runner->report.successful++;
    result = MUNIT_OK;
  }
  fputs(" ]\n", MUNIT_OUTPUT_FILE);

  if (stderr_buf != NULL) {
    if (result == MUNIT_FAIL || result == MUNIT_ERROR || runner->show_stderr) {
      fflush(MUNIT_OUTPUT_FILE);

      rewind(stderr_buf);
      munit_splice(fileno(stderr_buf), STDERR_FILENO);

      fflush(stderr);
    }

    fclose(stderr_buf);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x478, %rsp            # imm = 0x478
movq %rdx, %r14
movq %rsi, 0x40(%rsp)
movq %rdi, %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
testq %rdx, %rdx
je 0x4f8b
movq %r12, 0x18(%rsp)
movq 0x50ef(%rip), %r13      # 0x9fd0
movq (%r13), %rsi
leaq 0x212d(%rip), %rdi      # 0x7019
callq 0x3120
cmpq $0x0, (%r14)
movq %r14, 0x60(%rsp)
je 0x4f5c
movb $0x1, %r15b
movl $0x2, %r12d
leaq 0x2016(%rip), %rbx      # 0x6f22
xorl %eax, %eax
movl %eax, %ebp
testb $0x1, %r15b
je 0x4f1d
xorl %eax, %eax
movl %eax, %r15d
jmp 0x4f31
movq (%r13), %rsi
leaq 0x1ff1(%rip), %rdi      # 0x6f19
callq 0x3120
addl $0x2, %r12d
movq (%r13), %rdi
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq %rbx, %rsi
movl %ebp, %eax
callq 0x31d0
addl %r12d, %eax
leaq 0x10(%r14), %rcx
cmpq $0x0, 0x10(%r14)
movl %eax, %r12d
movq %rcx, %r14
jne 0x4f10
jmp 0x4f61
movl $0x2, %eax
cmpl $0x24, %eax
movq 0x18(%rsp), %r12
movq 0x60(%rsp), %r14
ja 0x4f8b
addl $-0x25, %eax
movl $0x20, %ebx
movl %eax, %ebp
movq (%r13), %rsi
movl %ebx, %edi
callq 0x3150
incl %ebp
movl %ebp, %eax
jne 0x4f78
movq 0x503e(%rip), %rbx      # 0x9fd0
movq (%rbx), %rdi
callq 0x3220
callq 0x31a0
movq %rax, %r15
movq %rax, %r13
testq %rax, %rax
je 0x4fde
cmpb $0x1, 0x59(%r12)
jne 0x4ffb
leaq 0x70(%rsp), %rdi
movq $-0x1, (%rdi)
callq 0x3140
testl %eax, %eax
je 0x50de
movq 0x501e(%rip), %rax      # 0x9ff0
movq (%rax), %rdi
leaq 0x1f6f(%rip), %rsi      # 0x6f4b
jmp 0x4fef
movq 0x500b(%rip), %rax      # 0x9ff0
movq (%rax), %rdi
leaq 0x1f39(%rip), %rsi      # 0x6f28
callq 0x5616
movl $0x3, %ebp
jmp 0x504d
movq %r13, %rdi
callq 0x5667
movl %eax, 0x70(%rsp)
movq %fs:0x0, %rax
leaq -0xd0(%rax), %rdi
callq 0x3170
testl %eax, %eax
jne 0x54b4
movb $0x1, %fs:-0xe0
leaq 0x20(%rsp), %rcx
movq %r12, %rdi
movq 0x40(%rsp), %rsi
movq %r14, %rdx
callq 0x56a2
movl %eax, %ebp
movl 0x70(%rsp), %edi
callq 0x5831
movq (%rbx), %rsi
leaq 0x1fe5(%rip), %rdi      # 0x703c
callq 0x3120
cmpl $0x0, 0x28(%rsp)
je 0x5086
leaq 0x1f9a(%rip), %rsi      # 0x7004
movq %r12, %rdi
movl $0x31, %edx
callq 0x584c
incl 0x40(%r12)
movl $0x1, %ebp
jmp 0x5338
cmpl $0x0, 0x2c(%rsp)
je 0x50b0
leaq 0x1f76(%rip), %rsi      # 0x700a
movq %r12, %rdi
movl $0x31, %edx
callq 0x584c
incl 0x44(%r12)
movl $0x3, %ebp
jmp 0x5338
cmpl $0x0, 0x24(%rsp)
je 0x5176
leaq 0x1f4e(%rip), %rsi      # 0x7010
movq %r12, %rdi
movl $0x33, %edx
callq 0x584c
incl 0x3c(%r12)
movl $0x2, %ebp
jmp 0x5338
callq 0x3290
cmpl $-0x1, %eax
je 0x5145
movl %eax, %ebp
movq %r12, 0x18(%rsp)
movq %r13, 0x8(%rsp)
testl %eax, %eax
je 0x54c2
movl %ebp, 0x14(%rsp)
movl 0x74(%rsp), %edi
callq 0x3130
xorl %eax, %eax
movl $0x20, %r14d
movq %rax, %r13
movl 0x70(%rsp), %edi
leaq (%rsp,%rax), %rsi
addq $0x20, %rsi
movq %r14, %rdx
subq %rax, %rdx
callq 0x3160
movq %rax, %r12
addq %r13, %r12
jle 0x525f
movq %r12, %rax
cmpq $0x20, %r12
jl 0x5111
jmp 0x5483
movl 0x70(%rsp), %edi
callq 0x3130
movl 0x74(%rsp), %edi
callq 0x3130
movq 0x4e92(%rip), %rax      # 0x9ff0
movq (%rax), %rdi
leaq 0x1e11(%rip), %rsi      # 0x6f79
callq 0x5616
incl 0x28(%rsp)
jmp 0x4ff4
movl 0x20(%rsp), %r14d
cmpl $0x2, %r14d
jb 0x52b5
leaq 0x1e8a(%rip), %rsi      # 0x7016
movq %r12, %rdi
movl $0x32, %edx
callq 0x584c
movq (%rbx), %rsi
leaq 0x1e79(%rip), %rdi      # 0x701c
callq 0x3120
movq (%rbx), %rdi
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
movl %r14d, %r14d
movl %r14d, %eax
cvtsi2sd %rax, %xmm1
movsd %xmm1, 0x48(%rsp)
divsd %xmm1, %xmm0
movq %r12, %r14
leaq 0x1ec9(%rip), %r12      # 0x709f
movb $0x1, %bpl
movq %r12, %rsi
movl %ebp, %eax
callq 0x31d0
movq (%rbx), %rsi
leaq 0x1e35(%rip), %rdi      # 0x7022
callq 0x3120
movq (%rbx), %rdi
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
divsd 0x48(%rsp), %xmm0
movq %r12, %rsi
movl %ebp, %eax
callq 0x31d0
movq (%rbx), %rdi
leaq 0x1e0b(%rip), %rsi      # 0x7026
leaq 0x173a(%rip), %rdx      # 0x695c
xorl %eax, %eax
callq 0x31d0
movq (%rbx), %rdi
movq %r12, %rsi
movsd 0x58(%rsp), %xmm0
movl %ebp, %eax
callq 0x31d0
movq (%rbx), %rsi
leaq 0x1ddc(%rip), %rdi      # 0x7022
callq 0x3120
movq (%rbx), %rdi
movq %r12, %rsi
movq %r14, %r12
movsd 0x50(%rsp), %xmm0
jmp 0x531c
leaq 0x6c(%rsp), %r13
movl $0x0, (%r13)
movl 0x14(%rsp), %edi
movq %r13, %rsi
movl $0x1, %edx
callq 0x3260
cmpl %ebp, %eax
setne %al
movl (%r13), %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
sete %dl
orb %al, %dl
cmpb $0x1, %dl
jne 0x5418
movq 0x4d4f(%rip), %rax      # 0x9ff0
movq (%rax), %rdi
leaq 0x1cdd(%rip), %rsi      # 0x6f88
callq 0x5616
jmp 0x5483
cmpl $0x1, %r14d
jne 0x5338
leaq 0x1d54(%rip), %rsi      # 0x7016
movq %r12, %rdi
movl $0x32, %edx
callq 0x584c
movq (%rbx), %rsi
leaq 0x1d43(%rip), %rdi      # 0x701c
callq 0x3120
movq (%rbx), %rdi
movsd 0x38(%rsp), %xmm0
movq %r12, %r14
leaq 0x1dae(%rip), %r12      # 0x709f
movb $0x1, %bpl
movq %r12, %rsi
movl %ebp, %eax
callq 0x31d0
movq (%rbx), %rsi
leaq 0x1d1a(%rip), %rdi      # 0x7022
callq 0x3120
movq (%rbx), %rdi
movsd 0x30(%rsp), %xmm0
movq %r12, %rsi
movq %r14, %r12
movl %ebp, %eax
callq 0x31d0
movq (%rbx), %rsi
leaq 0x1d12(%rip), %rdi      # 0x703f
callq 0x3120
incl 0x38(%r14)
xorl %ebp, %ebp
movq (%rbx), %rsi
leaq 0x1d02(%rip), %rdi      # 0x7044
callq 0x3120
testq %r15, %r15
je 0x5406
andl $-0x3, %ebp
cmpl $0x1, %ebp
je 0x5364
cmpb $0x1, 0x5a(%r12)
jne 0x53fe
movq (%rbx), %rdi
callq 0x3220
movq %r13, %rdi
callq 0x3100
movq %r13, 0x8(%rsp)
movq %r13, %rdi
callq 0x3200
movl %eax, %ebp
leaq 0x70(%rsp), %rsi
movl $0x400, %edx            # imm = 0x400
movl %eax, %edi
callq 0x3160
testq %rax, %rax
jle 0x53ea
movl $0x2, %r14d
leaq 0x70(%rsp), %r15
movl $0x400, %r12d           # imm = 0x400
movq %rax, %r13
xorl %eax, %eax
movl %eax, %ebx
leaq (%rsp,%rbx), %rsi
addq $0x70, %rsi
movq %r13, %rdx
subq %rbx, %rdx
movl %r14d, %edi
callq 0x30b0
movq %rax, %rcx
addq %rbx, %rcx
movq %rcx, %rbx
cmpq %r13, %rcx
jb 0x53b1
movl %ebp, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3160
movq %rax, %r13
testq %rax, %rax
jg 0x53ad
movq 0x4bff(%rip), %rax      # 0x9ff0
movq (%rax), %rdi
callq 0x3220
movq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0x30c0
addq $0x478, %rsp            # imm = 0x478
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ecx, %eax
movl %ecx, %ebp
andl $0x7f, %ebp
movq 0x8(%rsp), %r14
je 0x5458
movl %ebp, %ecx
shll $0x18, %ecx
addl $0x1000000, %ecx        # imm = 0x1000000
cmpl $0x2000000, %ecx        # imm = 0x2000000
jl 0x5469
movl %ebp, %edi
callq 0x3230
movq %rax, %r8
leaq 0x1b80(%rip), %rdx      # 0x6fca
xorl %eax, %eax
movl %ebp, %ecx
movq %r14, %rsi
callq 0x458b
jmp 0x5483
movzbl %ah, %ecx
leaq 0x1b3f(%rip), %rdx      # 0x6fa1
xorl %eax, %eax
movq %r14, %rsi
jmp 0x547e
cmpb $0x7f, %al
jne 0x5483
movzbl %ah, %ecx
leaq 0x1b72(%rip), %rdx      # 0x6fe9
xorl %eax, %eax
movq 0x8(%rsp), %rsi
callq 0x458b
cmpq $0x20, %r12
je 0x548d
incl 0x28(%rsp)
movl 0x70(%rsp), %edi
callq 0x3130
xorl %ebp, %ebp
movl %ebp, %esi
movl 0x14(%rsp), %edi
movl %ebp, %edx
callq 0x3260
movq 0x8(%rsp), %r13
movq 0x18(%rsp), %r12
jmp 0x504d
incl 0x28(%rsp)
movl $0x1, %ebp
jmp 0x5044
movl 0x70(%rsp), %edi
callq 0x3130
movq 0x8(%rsp), %rdi
callq 0x5667
movl %eax, %ebp
leaq 0x20(%rsp), %rcx
movq 0x18(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq %r14, %rdx
callq 0x56a2
movl %ebp, %edi
callq 0x5831
xorl %eax, %eax
movl %eax, %ecx
movl $0x20, %ebx
movq %rcx, %r14
movl 0x74(%rsp), %edi
leaq (%rsp,%rcx), %rsi
addq $0x20, %rsi
movq %rbx, %rdx
subq %rcx, %rdx
callq 0x30b0
addq %r14, %rax
js 0x5540
movq %rax, %rcx
cmpq $0x20, %rax
jb 0x54fe
movq 0x8(%rsp), %rdi
callq 0x30c0
movl 0x74(%rsp), %edi
callq 0x3130
xorl %edi, %edi
callq 0x3280
movq 0x4aa9(%rip), %rax      # 0x9ff0
movq (%rax), %rdi
leaq 0x1a10(%rip), %rsi      # 0x6f61
callq 0x5616
movl $0x1, %edi
callq 0x3280