#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 PrintSumm(char *type, int nfail, int nrun, int nerrs) {
  if (nfail > 0)
    printf("%3s driver: %d out of %d tests failed to pass the threshold\n",
           type, nfail, nrun);
  else
    printf("All tests for %3s driver passed the threshold (%6d tests run)\n",
           type, nrun);
  if (nerrs > 0)
    printf("%6d error messages recorded\n", nerrs);
}


x86 assembly (clang, -O0):
<PrintSumm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    114c <PrintSumm+0x3c>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1161 <PrintSumm+0x51>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
jle    117c <PrintSumm+0x6c>
mov    -0x14(%rbp),%esi
lea    0xf07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintSumm>:
push   %rbx
mov    %ecx,%ebx
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
test   %edx,%edx
jle    1141 <PrintSumm+0x31>
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %ebx,%ebx
jle    1155 <PrintSumm+0x45>
lea    0xf45(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>
lea    0xef5(%rip),%rdi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
test   %ebx,%ebx
jg     1130 <PrintSumm+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [61 x i8] c"%3s driver: %d out of %d tests failed to pass the threshold\0A\00"
@.str.1 = [63 x i8] c"All tests for %3s driver passed the threshold (%6d tests run)\0A\00"
@.str.2 = [29 x i8] c"%6d error messages recorded\0A\00"
define void @PrintSumm(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13, i32 %14)
br label %20
16: ; preds = %4
%17 = load i8*, i8** %5
%18 = load i32, i32* %7
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* %17, i32 %18)
br label %20
20: ; preds = %16, %11
%21 = load i32, i32* %8
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %8
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %23, %20
ret void
}

LLVM IR (-O2):
@.str = [61 x i8] c"%3s driver: %d out of %d tests failed to pass the threshold\0A\00"
@.str.1 = [63 x i8] c"All tests for %3s driver passed the threshold (%6d tests run)\0A\00"
@.str.2 = [29 x i8] c"%6d error messages recorded\0A\00"
define void @PrintSumm(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %2)
br label %10
8: ; preds = %4
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %2)
br label %10
10: ; preds = %8, %6
%11 = icmp sgt i32 %3, 0
br i1 %11, label %12, label %14
12: ; preds = %10
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %3)
br label %14
14: ; preds = %12, %10
ret void
}