#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 PrintSummary(const char *kernelName, const char *optimization,
                  double computeTimeInSeconds, float gflops,
                  double outputTimeInSeconds, const int computeIterations,
                  const int nx, const int ny) {
  printf("=========================== %s =======================\n",
         kernelName);
  printf("Optimization                                 :  %s\n", optimization);
  printf("Kernel time ex. data transfers               :  %lf seconds\n",
         computeTimeInSeconds);
  printf(
      "===================================================================\n");
  printf("Total effective GFLOPs                       :  %lf\n", gflops);
  printf(
      "===================================================================\n");
  printf("2D Grid Size                                 :  %d x %d \n", nx, ny);
  printf("Iterations                                   :  %d\n",
         computeIterations);
  printf("Final Time                                   :  %g\n",
         outputTimeInSeconds);
}


x86 assembly (clang, -O0):
<PrintSummary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movss  %xmm1,-0x1c(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    %edx,-0x2c(%rbp)
mov    %ecx,-0x30(%rbp)
mov    %r8d,-0x34(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xf03(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xf60(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%edx
lea    0xf73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xf9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xfbd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintSummary>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %r8d,%r15d
mov    %ecx,%ebx
mov    %edx,%r14d
movsd  %xmm2,0x10(%rsp)
movss  %xmm1,0x4(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %rsi,%rbp
mov    %rdi,%rsi
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xefc(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xffc(%rip),%rbp
mov    %rbp,%rdi
call   1030 <puts@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xf0c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
lea    0xf2b(%rip),%rdi
mov    %ebx,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf52(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf75(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"=========================== %s =======================\0A\00"
@.str.1 = [52 x i8] c"Optimization : %s\0A\00"
@.str.2 = [61 x i8] c"Kernel time ex. data transfers : %lf seconds\0A\00"
@.str.3 = [69 x i8] c"===================================================================\0A\00"
@.str.4 = [53 x i8] c"Total effective GFLOPs : %lf\0A\00"
@.str.5 = [58 x i8] c"2D Grid Size : %d x %d \0A\00"
@.str.6 = [52 x i8] c"Iterations : %d\0A\00"
@.str.7 = [52 x i8] c"Final Time : %g\0A\00"
define void @PrintSummary(i8* %0, i8* %1, double %2, float %3, double %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca double
%12 = alloca float
%13 = alloca double
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i8* %0, i8** %9
store i8* %1, i8** %10
store double %2, double* %11
store float %3, float* %12
store double %4, double* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load i8*, i8** %9
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = load i8*, i8** %10
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = load double, double* %11
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), double %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.3, i64 0, i64 0))
%24 = load float, float* %12
%25 = fpext float %24 to double
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), double %25)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.3, i64 0, i64 0))
%28 = load i32, i32* %15
%29 = load i32, i32* %16
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0), i32 %28, i32 %29)
%31 = load i32, i32* %14
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.6, i64 0, i64 0), i32 %31)
%33 = load double, double* %13
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), double %33)
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"=========================== %s =======================\0A\00"
@.str.1 = [52 x i8] c"Optimization : %s\0A\00"
@.str.2 = [61 x i8] c"Kernel time ex. data transfers : %lf seconds\0A\00"
@.str.4 = [53 x i8] c"Total effective GFLOPs : %lf\0A\00"
@.str.5 = [58 x i8] c"2D Grid Size : %d x %d \0A\00"
@.str.6 = [52 x i8] c"Iterations : %d\0A\00"
@.str.7 = [52 x i8] c"Final Time : %g\0A\00"
@str.8 = [68 x i8] c"===================================================================\00"
define void @PrintSummary(i8* %0, i8* %1, double %2, float %3, double %4, i32 %5, i32 %6, i32 %7) {
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %0)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), double %2)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.8, i64 0, i64 0))
%13 = fpext float %3 to double
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), double %13)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.8, i64 0, i64 0))
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0), i32 %6, i32 %7)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.6, i64 0, i64 0), i32 %5)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), double %4)
ret void
}