// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x420, %rsp            # imm = 0x420
leaq 0x11b58(%rip), %rdi     # 0x175ea
callq 0x2070
leaq 0x1050f(%rip), %rdi     # 0x15fad
callq 0x2070
leaq 0x10535(%rip), %rdi     # 0x15fdf
callq 0x2070
leaq 0x1055b(%rip), %rdi     # 0x16011
callq 0x2070
leaq 0x10581(%rip), %rdi     # 0x16043
callq 0x2070
leaq 0x10543(%rip), %rdi     # 0x16011
callq 0x2070
leaq 0x1059b(%rip), %rdi     # 0x16075
callq 0x2070
leaq 0x104c7(%rip), %rdi     # 0x15fad
callq 0x2070
movl $0x8, %edi
leaq 0x509(%rip), %rsi       # 0x6000
callq 0x2120
movl $0x4, %edi
leaq 0x4f8(%rip), %rsi       # 0x6000
callq 0x2120
movl $0xb, %edi
leaq 0x4e7(%rip), %rsi       # 0x6000
callq 0x2120
callq 0x2090
movq %rax, 0x21b76e(%rip)    # 0x221298
leaq 0x21b76f(%rip), %rdi    # 0x2212a0
leaq 0x11ab2(%rip), %rsi     # 0x175ea
callq 0x2060
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl 0x17737(%rip), %eax     # 0x1d284
jge 0x5d30
movslq -0x8(%rbp), %rax
leaq 0x17732(%rip), %rsi     # 0x1d290
imulq $0x408, %rax, %rax      # imm = 0x408
addq %rax, %rsi
leaq -0x418(%rbp), %rdi
movl $0x408, %edx            # imm = 0x408
callq 0x2160
leaq -0x418(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
leaq 0x21b712(%rip), %rsi    # 0x2212a0
callq 0x2110
cmpl $0x0, %eax
je 0x5c14
leaq 0x21b701(%rip), %rdi    # 0x2212a0
leaq 0x11a44(%rip), %rsi     # 0x175ea
callq 0x2110
cmpl $0x0, %eax
je 0x5bdb
cmpl $0x0, 0x21b8e9(%rip)    # 0x2214a0
je 0x5bca
movl 0x21b8e5(%rip), %eax    # 0x2214a4
addl $0x1, %eax
movl %eax, 0x21b8dc(%rip)    # 0x2214a4
jmp 0x5bd9
movl 0x21b8d8(%rip), %eax    # 0x2214a8
addl $0x1, %eax
movl %eax, 0x21b8cf(%rip)    # 0x2214a8
jmp 0x5bdb
movl $0x1, 0x21b8bb(%rip)    # 0x2214a0
leaq -0x418(%rbp), %rsi
addq $0x208, %rsi            # imm = 0x208
leaq 0x21b6a6(%rip), %rdi    # 0x2212a0
callq 0x2060
leaq 0x104a1(%rip), %rdi     # 0x160a7
leaq 0x21b693(%rip), %rsi    # 0x2212a0
movb $0x0, %al
callq 0x20d0
movl $0x1, 0x16646(%rip)     # 0x1c264
leaq 0x16e5b(%rip), %rdi     # 0x1ca80
leaq 0x119be(%rip), %rsi     # 0x175ea
callq 0x2060
leaq 0x16638(%rip), %rdi     # 0x1c270
leaq 0x119ab(%rip), %rsi     # 0x175ea
callq 0x2060
movl $0x0, 0x16e22(%rip)     # 0x1ca70
leaq -0x418(%rbp), %rsi
addq $0x8, %rsi
leaq 0x1045c(%rip), %rdi     # 0x160bc
movb $0x0, %al
callq 0x20d0
movq 0x16372(%rip), %rax     # 0x1bfe0
movq (%rax), %rdi
callq 0x2180
callq *-0x418(%rbp)
xorl %eax, %eax
cmpl $0x0, 0x21b81b(%rip)    # 0x2214a0
movb %al, -0x419(%rbp)
je 0x5c9d
cmpl $0x0, 0x165d0(%rip)     # 0x1c264
setne %al
movb %al, -0x419(%rbp)
movb -0x419(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x21b7f2(%rip)    # 0x2214a0
cmpl $0x0, 0x165af(%rip)     # 0x1c264
je 0x5ce8
movl 0x21b7ef(%rip), %eax    # 0x2214ac
addl $0x1, %eax
movl %eax, 0x21b7e6(%rip)    # 0x2214ac
movl $0x2, %edi
callq 0x6110
leaq 0x103f3(%rip), %rdi     # 0x160ca
callq 0x2070
movl $0x10, %edi
callq 0x6110
jmp 0x5d20
movl 0x21b7c2(%rip), %eax    # 0x2214b0
addl $0x1, %eax
movl %eax, 0x21b7b9(%rip)    # 0x2214b0
movl $0x4, %edi
callq 0x6110
leaq 0x103ca(%rip), %rdi     # 0x160d2
leaq 0x16d71(%rip), %rsi     # 0x1ca80
movb $0x0, %al
callq 0x20d0
movl $0x10, %edi
callq 0x6110
jmp 0x5d22
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x5b44
cmpl $0x0, 0x21b769(%rip)    # 0x2214a0
je 0x5d4a
movl 0x21b765(%rip), %eax    # 0x2214a4
addl $0x1, %eax
movl %eax, 0x21b75c(%rip)    # 0x2214a4
jmp 0x5d59
movl 0x21b758(%rip), %eax    # 0x2214a8
addl $0x1, %eax
movl %eax, 0x21b74f(%rip)    # 0x2214a8
callq 0x2090
movq %rax, 0x21b753(%rip)    # 0x2214b8
leaq 0x1187e(%rip), %rdi     # 0x175ea
callq 0x2070
leaq 0x10368(%rip), %rdi     # 0x160e0
callq 0x2070
leaq 0x10394(%rip), %rdi     # 0x16118
callq 0x2070
leaq 0x103c0(%rip), %rdi     # 0x16150
callq 0x2070
leaq 0x103ec(%rip), %rdi     # 0x16188
movb $0x0, %al
callq 0x20d0
movl $0x6, %edi
callq 0x6110
movl 0x21b4dd(%rip), %esi    # 0x221290
leaq 0x103dd(%rip), %rdi     # 0x16197
movb $0x0, %al
callq 0x20d0
movl $0x10, %edi
callq 0x6110
movl $0x7c, %edi
callq 0x2030
movl $0x2, %edi
callq 0x6110
movl 0x21b6bf(%rip), %esi    # 0x2214a4
leaq 0x103b7(%rip), %rdi     # 0x161a3
movb $0x0, %al
callq 0x20d0
movl $0x10, %edi
callq 0x6110
movl $0x7c, %edi
callq 0x2030
movl $0x4, %edi
callq 0x6110
movl 0x21b691(%rip), %esi    # 0x2214a8
leaq 0x10392(%rip), %rdi     # 0x161b0
movb $0x0, %al
callq 0x20d0
movl $0x10, %edi
callq 0x6110
leaq 0x1020b(%rip), %rdi     # 0x16041
callq 0x2070
leaq 0x1037b(%rip), %rdi     # 0x161bd
movb $0x0, %al
callq 0x20d0
movl $0x6, %edi
callq 0x6110
movl 0x1742b(%rip), %esi     # 0x1d284
leaq 0x10337(%rip), %rdi     # 0x16197
movb $0x0, %al
callq 0x20d0
movl $0x10, %edi
callq 0x6110
movl $0x7c, %edi
callq 0x2030
movl $0x2, %edi
callq 0x6110
movl 0x21b621(%rip), %esi    # 0x2214ac
leaq 0x10311(%rip), %rdi     # 0x161a3
movb $0x0, %al
callq 0x20d0
movl $0x10, %edi
callq 0x6110
movl $0x7c, %edi
callq 0x2030
movl $0x4, %edi
callq 0x6110
movl 0x21b5f3(%rip), %esi    # 0x2214b0
leaq 0x102ec(%rip), %rdi     # 0x161b0
movb $0x0, %al
callq 0x20d0
movl $0x10, %edi
callq 0x6110
leaq 0x10165(%rip), %rdi     # 0x16041
callq 0x2070
leaq 0x102e4(%rip), %rdi     # 0x161cc
movb $0x0, %al
callq 0x20d0
movl $0x6, %edi
callq 0x6110
movl 0x16361(%rip), %esi     # 0x1c260
leaq 0x10291(%rip), %rdi     # 0x16197
movb $0x0, %al
callq 0x20d0
movl $0x10, %edi
callq 0x6110
movl $0x7c, %edi
callq 0x2030
movl $0x2, %edi
callq 0x6110
movl 0x16337(%rip), %esi     # 0x1c268
leaq 0x1026b(%rip), %rdi     # 0x161a3
movb $0x0, %al
callq 0x20d0
movl $0x10, %edi
callq 0x6110
movl $0x7c, %edi
callq 0x2030
movl $0x4, %edi
callq 0x6110
movl 0x1731d(%rip), %esi     # 0x1d280
leaq 0x10246(%rip), %rdi     # 0x161b0
movb $0x0, %al
callq 0x20d0
movl $0x10, %edi
callq 0x6110
leaq 0x100bf(%rip), %rdi     # 0x16041
callq 0x2070
leaq 0x101c2(%rip), %rdi     # 0x16150
callq 0x2070
leaq 0x11650(%rip), %rdi     # 0x175ea
callq 0x2070
movq 0x21b512(%rip), %rax    # 0x2214b8
subq 0x21b2eb(%rip), %rax    # 0x221298
cvtsi2sd %rax, %xmm0
movsd 0xff26(%rip), %xmm1     # 0x15ee0
divsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
leaq 0x1020c(%rip), %rdi     # 0x161db
movb $0x1, %al
callq 0x20d0
cmpl $0x0, 0x21b4cb(%rip)    # 0x2214a8
jle 0x5fe8
movl $0x1, -0x4(%rbp)
jmp 0x5fef
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x420, %rsp            # imm = 0x420
popq %rbp
retq
nopl (%rax,%rax)