// File: /workspace/github_c_makefile_star2_O1/orangeduck[P]mpc/tests/ptest.c
// Function: pt_run
int pt_run(void) {

  int i;
  double total;
  test_t test;

  puts("");
  puts("    +-------------------------------------------+");
  puts("    | ptest          MicroTesting Magic for C   |");
  puts("    |                                           |");
  puts("    | http://github.com/orangeduck/ptest        |");
  puts("    |                                           |");
  puts("    | Daniel Holden (contact@theorangeduck.com) |");
  puts("    +-------------------------------------------+");

  signal(SIGFPE,  ptest_signal);
  signal(SIGILL,  ptest_signal);
  signal(SIGSEGV, ptest_signal);

  start = clock();
  strcpy(current_suite, "");

  for(i = 0; i < num_tests; i++) {

    test = tests[i];

    /* Check for transition to a new suite */
    if (strcmp(test.suite, current_suite)) {

      /* Don't increment any counter for first entrance */
      if (strcmp(current_suite, "")) {
        if (suite_passing) {
          num_suites_passes++;
        } else {
          num_suites_fails++;
        }
      }

      suite_passing = 1;
      strcpy(current_suite, test.suite);
      printf("\n\n  ===== %s =====\n\n", current_suite);
    }

    /* Run Test */

    test_passing = 1;
    strcpy(assert_err, "");
    strcpy(assert_err_buff, "");
    assert_err_num = 0;
    printf("    | %s ... ", test.name);
    fflush(stdout);

    test.func();

    suite_passing = suite_passing && test_passing;

    if (test_passing) {
      num_tests_passes++;
      pt_color(GREEN);
      puts("Passed!");
      pt_color(DEFAULT);
    } else {
      num_tests_fails++;
      pt_color(RED);
      printf("Failed! \n\n%s\n", assert_err);
      pt_color(DEFAULT);
    }

  }

  if (suite_passing) {
    num_suites_passes++;
  } else {
    num_suites_fails++;
  }

  end = clock();

  puts("");
  puts("  +---------------------------------------------------+");
  puts("  |                      Summary                      |");
  puts("  +---------++------------+-------------+-------------+");

  printf("  | Suites  ||");
  pt_color(YELLOW);  printf(" Total %4d ",  num_suites);
  pt_color(DEFAULT); putchar('|');
  pt_color(GREEN);   printf(" Passed %4d ", num_suites_passes);
  pt_color(DEFAULT); putchar('|');
  pt_color(RED);     printf(" Failed %4d ", num_suites_fails);
  pt_color(DEFAULT); puts("|");

  printf("  | Tests   ||");
  pt_color(YELLOW);  printf(" Total %4d ",  num_tests);
  pt_color(DEFAULT); putchar('|');
  pt_color(GREEN);   printf(" Passed %4d ", num_tests_passes);
  pt_color(DEFAULT); putchar('|');
  pt_color(RED);     printf(" Failed %4d ", num_tests_fails);
  pt_color(DEFAULT); puts("|");

  printf("  | Asserts ||");
  pt_color(YELLOW);  printf(" Total %4d ",  num_asserts);
  pt_color(DEFAULT); putchar('|');
  pt_color(GREEN);   printf(" Passed %4d ", num_assert_passes);
  pt_color(DEFAULT); putchar('|');
  pt_color(RED);     printf(" Failed %4d ", num_assert_fails);
  pt_color(DEFAULT); puts("|");

  puts("  +---------++------------+-------------+-------------+");
  puts("");

  total = (double)(end - start) / CLOCKS_PER_SEC;

  printf("      Total Running Time: %0.3fs\n\n", total);

  if (num_suites_fails > 0) { return 1; } else { return 0; }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movl $0xa, %edi
callq 0x1030
leaq 0xcd5b(%rip), %rbx      # 0x10fad
movq %rbx, %rdi
callq 0x1070
leaq 0xcd7e(%rip), %rdi      # 0x10fdf
callq 0x1070
leaq 0xcda4(%rip), %r14      # 0x11011
movq %r14, %rdi
callq 0x1070
leaq 0xcdc7(%rip), %rdi      # 0x11043
callq 0x1070
movq %r14, %rdi
callq 0x1070
leaq 0xcde5(%rip), %rdi      # 0x11075
callq 0x1070
movq %rbx, %rdi
callq 0x1070
leaq 0x4b1(%rip), %rbx       # 0x4755
movl $0x8, %edi
movq %rbx, %rsi
callq 0x1140
movl $0x4, %edi
movq %rbx, %rsi
callq 0x1140
movl $0xb, %edi
movq %rbx, %rsi
callq 0x1140
callq 0x1090
movq %rax, 0x218f51(%rip)    # 0x21d228
movb $0x0, 0x218f52(%rip)    # 0x21d230
cmpl $0x0, 0x14f2f(%rip)     # 0x19214
jle 0x445d
leaq 0x208(%rsp), %rbx
leaq 0x14f26(%rip), %r14     # 0x19220
xorl %ebp, %ebp
leaq 0x218f2d(%rip), %r13    # 0x21d230
leaq 0xe002(%rip), %r15      # 0x1230c
xorl %r12d, %r12d
movl $0x408, %edx            # imm = 0x408
movq %rsp, %rdi
movq %r14, %rsi
callq 0x1180
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1130
testl %eax, %eax
je 0x4376
cmpb $0x0, 0x218efd(%rip)    # 0x21d230
je 0x4350
cmpl $0x0, 0x2190f4(%rip)    # 0x21d430
leaq 0x2190f1(%rip), %rax    # 0x21d434
leaq 0x2190ee(%rip), %rcx    # 0x21d438
cmoveq %rcx, %rax
incl (%rax)
movl $0x1, 0x2190d6(%rip)    # 0x21d430
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1060
leaq 0xcd3b(%rip), %rdi      # 0x110a7
movq %r13, %rsi
xorl %eax, %eax
callq 0x10d0
movl $0x1, 0x13e74(%rip)     # 0x181f4
movb %bpl, 0x14689(%rip)     # 0x18a10
movb %bpl, 0x13e72(%rip)     # 0x18200
movl $0x0, 0x14668(%rip)     # 0x18a00
leaq 0xcd1d(%rip), %rdi      # 0x110bc
leaq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x10d0
movq 0x13c2e(%rip), %rax     # 0x17fe0
movq (%rax), %rdi
callq 0x11a0
callq *(%rsp)
cmpl $0x0, 0x21906c(%rip)    # 0x21d430
setne %al
movl 0x13e27(%rip), %ecx     # 0x181f4
testl %ecx, %ecx
setne %dl
andb %al, %dl
movzbl %dl, %eax
movl %eax, 0x219053(%rip)    # 0x21d430
testl %ecx, %ecx
je 0x4406
incl 0x219055(%rip)          # 0x21d43c
movq %r15, %rdi
leaq 0xce91(%rip), %rsi      # 0x11282
xorl %eax, %eax
callq 0x10d0
leaq 0xcccb(%rip), %rdi      # 0x110ca
callq 0x1070
jmp 0x4432
incl 0x219034(%rip)          # 0x21d440
movq %r15, %rdi
leaq 0xce78(%rip), %rsi      # 0x1128e
xorl %eax, %eax
callq 0x10d0
leaq 0xccae(%rip), %rdi      # 0x110d2
leaq 0x145e5(%rip), %rsi     # 0x18a10
xorl %eax, %eax
callq 0x10d0
movq %r15, %rdi
leaq 0xce6a(%rip), %rsi      # 0x112a6
xorl %eax, %eax
callq 0x10d0
incq %r12
movslq 0x14dc7(%rip), %rax     # 0x19214
addq $0x408, %r14            # imm = 0x408
cmpq %rax, %r12
jl 0x430d
cmpl $0x0, 0x218fcc(%rip)    # 0x21d430
leaq 0x218fcd(%rip), %rax    # 0x21d438
leaq 0x218fc2(%rip), %rcx    # 0x21d434
cmoveq %rax, %rcx
incl (%rcx)
callq 0x1090
movq %rax, 0x218fc4(%rip)    # 0x21d448
movl $0xa, %edi
callq 0x1030
leaq 0xcc4b(%rip), %rdi      # 0x110e0
callq 0x1070
leaq 0xcc77(%rip), %rdi      # 0x11118
callq 0x1070
leaq 0xcca3(%rip), %rdi      # 0x11150
callq 0x1070
leaq 0xcccf(%rip), %rdi      # 0x11188
xorl %eax, %eax
callq 0x10d0
leaq 0xde45(%rip), %r14      # 0x1230c
leaq 0xcdcc(%rip), %rsi      # 0x1129a
movq %r14, %rdi
xorl %eax, %eax
callq 0x10d0
movl 0x218d42(%rip), %esi    # 0x21d220
leaq 0xccb2(%rip), %rdi      # 0x11197
xorl %eax, %eax
callq 0x10d0
leaq 0xcdb3(%rip), %r15      # 0x112a6
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10d0
movl $0x7c, %edi
callq 0x1030
leaq 0xcd71(%rip), %rsi      # 0x11282
movq %r14, %rdi
xorl %eax, %eax
callq 0x10d0
movl 0x218f13(%rip), %esi    # 0x21d434
leaq 0xcc7b(%rip), %rbp      # 0x111a3
movq %rbp, %rdi
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10d0
movl $0x7c, %edi
callq 0x1030
leaq 0xcd3e(%rip), %rbx      # 0x1128e
movq %r14, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10d0
movl 0x218ed5(%rip), %esi    # 0x21d438
leaq 0xcc46(%rip), %r12      # 0x111b0
movq %r12, %rdi
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10d0
leaq 0xcab9(%rip), %r13      # 0x11041
movq %r13, %rdi
callq 0x1070
leaq 0xcc26(%rip), %rdi      # 0x111bd
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
leaq 0xccf2(%rip), %rsi      # 0x1129a
xorl %eax, %eax
callq 0x10d0
movl 0x14c5f(%rip), %esi     # 0x19214
leaq 0xcbdb(%rip), %rdi      # 0x11197
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10d0
movl $0x7c, %edi
callq 0x1030
movq %r14, %rdi
leaq 0xcc9e(%rip), %rsi      # 0x11282
xorl %eax, %eax
callq 0x10d0
movl 0x218e4b(%rip), %esi    # 0x21d43c
movq %rbp, %rdi
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10d0
movl $0x7c, %edi
callq 0x1030
movq %r14, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10d0
movl 0x218e1b(%rip), %esi    # 0x21d440
movq %r12, %rdi
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10d0
movq %r13, %rdi
callq 0x1070
leaq 0xcb81(%rip), %rdi      # 0x111cc
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
leaq 0xcc3e(%rip), %rsi      # 0x1129a
xorl %eax, %eax
callq 0x10d0
movl 0x13b87(%rip), %esi     # 0x181f0
leaq 0xcb27(%rip), %rdi      # 0x11197
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10d0
movl $0x7c, %edi
callq 0x1030
movq %r14, %rdi
leaq 0xcbea(%rip), %rsi      # 0x11282
xorl %eax, %eax
callq 0x10d0
movl 0x13b53(%rip), %esi     # 0x181f8
movq %rbp, %rdi
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10d0
movl $0x7c, %edi
callq 0x1030
movq %r14, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10d0
movl 0x14b37(%rip), %esi     # 0x19210
movq %r12, %rdi
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10d0
movq %r13, %rdi
callq 0x1070
leaq 0xca51(%rip), %rdi      # 0x11150
callq 0x1070
movl $0xa, %edi
callq 0x1030
movq 0x218d33(%rip), %rax    # 0x21d448
subq 0x218b0c(%rip), %rax    # 0x21d228
cvtsi2sd %rax, %xmm0
divsd 0xc7b7(%rip), %xmm0     # 0x10ee0
leaq 0xcaab(%rip), %rdi      # 0x111db
movb $0x1, %al
callq 0x10d0
xorl %eax, %eax
cmpl $0x0, 0x218cf8(%rip)    # 0x21d438
setg %al
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq