#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_total(size_t count_pass, size_t count_skip, size_t count_fail) {
  printf("\n\nTotals:");
  if (count_pass)
    printf(" %zu "
           "\033[32m"
           "passed"
           "\033[0m",
           count_pass);
  else
    printf(" %zu "
           "passed",
           count_pass);
  if (count_skip)
    printf(", %zu "
           "\033[33m"
           "skipped"
           "\033[0m",
           count_skip);
  else
    printf(", %zu "
           "skipped",
           count_skip);
  if (count_fail)
    printf(", %zu "
           "\033[31m"
           "failed\n"
           "\033[0m",
           count_fail);
  else
    printf(", %zu "
           "failed\n",
           count_fail);
}


x86 assembly (clang, -O0):
<print_total>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1154 <print_total+0x44>
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1166 <print_total+0x56>
mov    -0x8(%rbp),%rsi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
je     1188 <print_total+0x78>
mov    -0x10(%rbp),%rsi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119a <print_total+0x8a>
mov    -0x10(%rbp),%rsi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x18(%rbp)
je     11bc <print_total+0xac>
mov    -0x18(%rbp),%rsi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ce <print_total+0xbe>
mov    -0x18(%rbp),%rsi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_total>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %rbx,%rbx
je     113d <print_total+0x2d>
lea    0xed2(%rip),%rdi
mov    %rbx,%rsi
jmp    1146 <print_total+0x36>
lea    0xedb(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
test   %r15,%r15
je     115e <print_total+0x4e>
lea    0xed2(%rip),%rdi
mov    %r15,%rsi
jmp    1167 <print_total+0x57>
lea    0xedd(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
test   %r14,%r14
je     117f <print_total+0x6f>
lea    0xed6(%rip),%rdi
mov    %r14,%rsi
jmp    1188 <print_total+0x78>
lea    0xee1(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\0A\0ATotals:\00"
@.str.1 = [21 x i8] c" %zu \1B[32mpassed\1B[0m\00"
@.str.2 = [12 x i8] c" %zu passed\00"
@.str.3 = [23 x i8] c", %zu \1B[33mskipped\1B[0m\00"
@.str.4 = [14 x i8] c", %zu skipped\00"
@.str.5 = [23 x i8] c", %zu \1B[31mfailed\0A\1B[0m\00"
@.str.6 = [14 x i8] c", %zu failed\0A\00"
define void @print_total(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = load i64, i64* %4
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i64, i64* %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i64 %11)
br label %16
13: ; preds = %3
%14 = load i64, i64* %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i64 %14)
br label %16
16: ; preds = %13, %10
%17 = load i64, i64* %5
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i64, i64* %5
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 %20)
br label %25
22: ; preds = %16
%23 = load i64, i64* %5
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i64 %23)
br label %25
25: ; preds = %22, %19
%26 = load i64, i64* %6
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = load i64, i64* %6
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i64 %29)
br label %34
31: ; preds = %25
%32 = load i64, i64* %6
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i64 %32)
br label %34
34: ; preds = %31, %28
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\0A\0ATotals:\00"
@.str.1 = [21 x i8] c" %zu \1B[32mpassed\1B[0m\00"
@.str.2 = [12 x i8] c" %zu passed\00"
@.str.3 = [23 x i8] c", %zu \1B[33mskipped\1B[0m\00"
@.str.4 = [14 x i8] c", %zu skipped\00"
@.str.5 = [23 x i8] c", %zu \1B[31mfailed\0A\1B[0m\00"
@.str.6 = [14 x i8] c", %zu failed\0A\00"
define void @print_total(i64 %0, i64 %1, i64 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %0, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i64 %0)
br label %10
8: ; preds = %3
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i64 0)
br label %10
10: ; preds = %8, %6
%11 = icmp eq i64 %1, 0
br i1 %11, label %14, label %12
12: ; preds = %10
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 %1)
br label %16
14: ; preds = %10
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i64 0)
br label %16
16: ; preds = %14, %12
%17 = icmp eq i64 %2, 0
br i1 %17, label %20, label %18
18: ; preds = %16
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i64 %2)
br label %22
20: ; preds = %16
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i64 0)
br label %22
22: ; preds = %20, %18
ret void
}