#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ *stdout;
scalar_t__ strcmp(char *, char *);
scalar_t__ strncmp(char *, char *, int);
int printSummary(FILE *fp, char *testName, double localMax,
                 unsigned int localSize) {
  if (strcmp(testName, "MPI_RATE") == 0) {
    fprintf(stdout, "\tMaximum Rate         : %6.1f MIO/s (N=%d)\n", localMax,
            localSize);
    fprintf(stdout, "\n %s test completed.\n\n", testName);
    fflush(stdout);
    fprintf(fp, "\n# Maximum Rate : %6.1f MIO/s (N=%d)\n", localMax, localSize);
  } else if (strncmp(testName, "MPI", 3) == 0 ||
             strcmp(testName, "GPU_TRANSFER") == 0 ||
             strncmp(testName, "PHI", 3) == 0) {
    fprintf(stdout, "\tBW Maximum            : %6.1f MB/s (N=%d)\n", localMax,
            localSize);
    fprintf(stdout, "\n %s test completed.\n\n", testName);
    fflush(stdout);
    fprintf(fp, "\n# BW Maximum : %6.1f MB/s (N=%d)\n", localMax, localSize);
  } else {
    fprintf(stdout, "\tFastest %s        : %6.1f GFLOPS (N=%d)\n", testName,
            localMax, localSize);
    fprintf(stdout, "\n %s test completed.\n\n", testName);
    fflush(stdout);
    fprintf(fp, "\n# Fastest %s         : %6.1f GFLOPS (N=%d)\n", testName,
            localMax, localSize);
  }
  return 0;
}


x86 assembly (clang, -O0):
<printSummary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11dc <printSummary+0x9c>
mov    0x2e67(%rip),%rax
mov    (%rax),%rdi
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%edx
lea    0xe7e(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe8e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e2b(%rip),%rax
mov    (%rax),%rdi
call   1060 <fflush@plt>
mov    -0x8(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%edx
lea    0xe7c(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
jmp    1310 <printSummary+0x1d0>
mov    -0x10(%rbp),%rdi
lea    0xe8b(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1234 <printSummary+0xf4>
mov    -0x10(%rbp),%rdi
lea    0xe70(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1234 <printSummary+0xf4>
mov    -0x10(%rbp),%rdi
lea    0xe63(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    129e <printSummary+0x15e>
mov    0x2da5(%rip),%rax
mov    (%rax),%rdi
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%edx
lea    0xe3a(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    0x2d85(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rdx
lea    0xdcc(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2d69(%rip),%rax
mov    (%rax),%rdi
call   1060 <fflush@plt>
mov    -0x8(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%edx
lea    0xe21(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
jmp    130b <printSummary+0x1cb>
mov    0x2d3b(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rdx
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%ecx
lea    0xe1b(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    0x2d17(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rdx
lea    0xd5e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2cfb(%rip),%rax
mov    (%rax),%rdi
call   1060 <fflush@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%ecx
lea    0xdfc(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
jmp    1310 <printSummary+0x1d0>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSummary>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r12d
movsd  %xmm0,0x8(%rsp)
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     126b <printSummary+0x12b>
lea    0xef8(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1222 <printSummary+0xe2>
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1222 <printSummary+0xe2>
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1222 <printSummary+0xe2>
mov    0x2e1c(%rip),%rbp
mov    0x0(%rbp),%rdi
lea    0xf07(%rip),%rsi
mov    %rbx,%rdx
movsd  0x8(%rsp),%xmm0
mov    %r12d,%ecx
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    0x0(%rbp),%rdi
lea    0xe48(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%rdi
call   1060 <fflush@plt>
lea    0xef9(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
movsd  0x8(%rsp),%xmm0
mov    %r12d,%ecx
mov    $0x1,%al
call   1050 <fprintf@plt>
jmp    12c2 <printSummary+0x182>
mov    0x2db7(%rip),%rbp
mov    0x0(%rbp),%rdi
lea    0xe53(%rip),%rsi
movsd  0x8(%rsp),%xmm0
mov    %r12d,%edx
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    0x0(%rbp),%rdi
lea    0xde6(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%rdi
call   1060 <fflush@plt>
lea    0xe4a(%rip),%rsi
jmp    12af <printSummary+0x16f>
mov    0x2d6e(%rip),%r15
mov    (%r15),%rdi
lea    0xd8d(%rip),%rsi
movsd  0x8(%rsp),%xmm0
mov    %r12d,%edx
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    (%r15),%rdi
lea    0xd9f(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%rdi
call   1060 <fflush@plt>
lea    0xd9d(%rip),%rsi
mov    %r14,%rdi
movsd  0x8(%rsp),%xmm0
mov    %r12d,%edx
mov    $0x1,%al
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"MPI_RATE\00"
@stdout = global i32* null
@.str.1 = [44 x i8] c"\09Maximum Rate : %6.1f MIO/s (N=%d)\0A\00"
@.str.2 = [23 x i8] c"\0A %s test completed.\0A\0A\00"
@.str.3 = [38 x i8] c"\0A# Maximum Rate : %6.1f MIO/s (N=%d)\0A\00"
@.str.4 = [4 x i8] c"MPI\00"
@.str.5 = [13 x i8] c"GPU_TRANSFER\00"
@.str.6 = [4 x i8] c"PHI\00"
@.str.7 = [44 x i8] c"\09BW Maximum : %6.1f MB/s (N=%d)\0A\00"
@.str.8 = [35 x i8] c"\0A# BW Maximum : %6.1f MB/s (N=%d)\0A\00"
@.str.9 = [42 x i8] c"\09Fastest %s : %6.1f GFLOPS (N=%d)\0A\00"
@.str.10 = [45 x i8] c"\0A# Fastest %s : %6.1f GFLOPS (N=%d)\0A\00"
define i32 @printSummary(i32* %0, i8* %1, double %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca double
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store double %2, double* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %6
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %26
12: ; preds = %4
%13 = load i32*, i32** @stdout
%14 = load double, double* %7
%15 = load i32, i32* %8
%16 = call i32 (i32*, i8*, ...) @fprintf(i32* %13, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), double %14, i32 %15)
%17 = load i32*, i32** @stdout
%18 = load i8*, i8** %6
%19 = call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = load i32*, i32** @stdout
%21 = call i32 @fflush(i32* %20)
%22 = load i32*, i32** %5
%23 = load double, double* %7
%24 = load i32, i32* %8
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %23, i32 %24)
br label %69
26: ; preds = %4
%27 = load i8*, i8** %6
%28 = call i64 @strncmp(i8* %27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%29 = icmp eq i64 %28, 0
br i1 %29, label %38, label %30
30: ; preds = %26
%31 = load i8*, i8** %6
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %38, label %34
34: ; preds = %30
%35 = load i8*, i8** %6
%36 = call i64 @strncmp(i8* %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 3)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %52
38: ; preds = %34, %30, %26
%39 = load i32*, i32** @stdout
%40 = load double, double* %7
%41 = load i32, i32* %8
%42 = call i32 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0), double %40, i32 %41)
%43 = load i32*, i32** @stdout
%44 = load i8*, i8** %6
%45 = call i32 (i32*, i8*, ...) @fprintf(i32* %43, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %44)
%46 = load i32*, i32** @stdout
%47 = call i32 @fflush(i32* %46)
%48 = load i32*, i32** %5
%49 = load double, double* %7
%50 = load i32, i32* %8
%51 = call i32 (i32*, i8*, ...) @fprintf(i32* %48, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), double %49, i32 %50)
br label %68
52: ; preds = %34
%53 = load i32*, i32** @stdout
%54 = load i8*, i8** %6
%55 = load double, double* %7
%56 = load i32, i32* %8
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), i8* %54, double %55, i32 %56)
%58 = load i32*, i32** @stdout
%59 = load i8*, i8** %6
%60 = call i32 (i32*, i8*, ...) @fprintf(i32* %58, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %59)
%61 = load i32*, i32** @stdout
%62 = call i32 @fflush(i32* %61)
%63 = load i32*, i32** %5
%64 = load i8*, i8** %6
%65 = load double, double* %7
%66 = load i32, i32* %8
%67 = call i32 (i32*, i8*, ...) @fprintf(i32* %63, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.10, i64 0, i64 0), i8* %64, double %65, i32 %66)
br label %68
68: ; preds = %52, %38
br label %69
69: ; preds = %68, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"MPI_RATE\00"
@stdout = global i32* null
@.str.1 = [44 x i8] c"\09Maximum Rate : %6.1f MIO/s (N=%d)\0A\00"
@.str.2 = [23 x i8] c"\0A %s test completed.\0A\0A\00"
@.str.3 = [38 x i8] c"\0A# Maximum Rate : %6.1f MIO/s (N=%d)\0A\00"
@.str.4 = [4 x i8] c"MPI\00"
@.str.5 = [13 x i8] c"GPU_TRANSFER\00"
@.str.6 = [4 x i8] c"PHI\00"
@.str.7 = [44 x i8] c"\09BW Maximum : %6.1f MB/s (N=%d)\0A\00"
@.str.8 = [35 x i8] c"\0A# BW Maximum : %6.1f MB/s (N=%d)\0A\00"
@.str.9 = [42 x i8] c"\09Fastest %s : %6.1f GFLOPS (N=%d)\0A\00"
@.str.10 = [45 x i8] c"\0A# Fastest %s : %6.1f GFLOPS (N=%d)\0A\00"
define i32 @printSummary(i32* nocapture %0, i8* %1, double %2, i32 %3) {
%5 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32*, i32** @stdout
%9 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), double %2, i32 %3)
%10 = load i32*, i32** @stdout
%11 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%12 = load i32*, i32** @stdout
%13 = tail call i32 @fflush(i32* %12)
%14 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %2, i32 %3)
br label %40
15: ; preds = %4
%16 = tail call i64 @strncmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%17 = icmp eq i64 %16, 0
br i1 %17, label %24, label %18
18: ; preds = %15
%19 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = tail call i64 @strncmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 3)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %32
24: ; preds = %21, %18, %15
%25 = load i32*, i32** @stdout
%26 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0), double %2, i32 %3)
%27 = load i32*, i32** @stdout
%28 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%29 = load i32*, i32** @stdout
%30 = tail call i32 @fflush(i32* %29)
%31 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), double %2, i32 %3)
br label %40
32: ; preds = %21
%33 = load i32*, i32** @stdout
%34 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), i8* %1, double %2, i32 %3)
%35 = load i32*, i32** @stdout
%36 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %35, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%37 = load i32*, i32** @stdout
%38 = tail call i32 @fflush(i32* %37)
%39 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.10, i64 0, i64 0), i8* %1, double %2, i32 %3)
br label %40
40: ; preds = %24, %32, %7
ret i32 0
}