#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_on_screen(char *programName, double tsec, int size, double gflops,
                     int flag) {
  printf("\n\t---------------%s----------------\n\n", programName);
  printf("\t\tNUM_OF_INTERVALS\t TIME_SEC\t gflops \n");
  if (flag == 1)
    printf("\t\t%d\t%f\t %lf\t", size, tsec, gflops);
  else
    printf("\t\t%d\t\t\t%lf \t%s\t", size, tsec, "---");
  printf("\n\n\t----------------------------------------------");
}


x86 assembly (clang, -O0):
<print_on_screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x24(%rbp)
jne    1176 <print_on_screen+0x66>
mov    -0x14(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xee3(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    1193 <print_on_screen+0x83>
mov    -0x14(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
lea    0xed6(%rip),%rdi
lea    0xf0d(%rip),%rdx
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_on_screen>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edx,%ebp
movsd  %xmm1,0x10(%rsp)
mov    %esi,%ebx
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rsi
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf28(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x1,%ebp
jne    1176 <print_on_screen+0x56>
lea    0xec7(%rip),%rdi
mov    %ebx,%esi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
jmp    1193 <print_on_screen+0x73>
lea    0xeb7(%rip),%rdi
lea    0xeee(%rip),%rdx
mov    %ebx,%esi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"\0A\09---------------%s----------------\0A\0A\00"
@.str.1 = [39 x i8] c"\09\09NUM_OF_INTERVALS\09 TIME_SEC\09 gflops \0A\00"
@.str.2 = [14 x i8] c"\09\09%d\09%f\09 %lf\09\00"
@.str.3 = [16 x i8] c"\09\09%d\09\09\09%lf \09%s\09\00"
@.str.4 = [4 x i8] c"---\00"
@.str.5 = [50 x i8] c"\0A\0A\09----------------------------------------------\00"
define void @print_on_screen(i8* %0, double %1, i32 %2, double %3, i32 %4) {
%6 = alloca i8*
%7 = alloca double
%8 = alloca i32
%9 = alloca double
%10 = alloca i32
store i8* %0, i8** %6
store double %1, double* %7
store i32 %2, i32* %8
store double %3, double* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* %10
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %21
16: ; preds = %5
%17 = load i32, i32* %8
%18 = load double, double* %7
%19 = load double, double* %9
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %17, double %18, double %19)
br label %25
21: ; preds = %5
%22 = load i32, i32* %8
%23 = load double, double* %7
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %22, double %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %25
25: ; preds = %21, %16
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"\0A\09---------------%s----------------\0A\0A\00"
@.str.2 = [14 x i8] c"\09\09%d\09%f\09 %lf\09\00"
@.str.3 = [16 x i8] c"\09\09%d\09\09\09%lf \09%s\09\00"
@.str.4 = [4 x i8] c"---\00"
@.str.5 = [50 x i8] c"\0A\0A\09----------------------------------------------\00"
@str = [38 x i8] c"\09\09NUM_OF_INTERVALS\09 TIME_SEC\09 gflops \00"
define void @print_on_screen(i8* %0, double %1, i32 %2, double %3, i32 %4) {
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%8 = icmp eq i32 %4, 1
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %2, double %1, double %3)
br label %13
11: ; preds = %5
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %2, double %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0))
ret void
}