#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 */
scalar_t__ isatty(int);
int /*<<< orphan*/ printf(char *, ...);
void print_header(int type, char *string) {
  if (isatty(1)) {
    printf("\n\t\t%s%s %s\n\n", (type & (1 << 3)) ? "Uncalibrated " : "\t",
           (type & (1 << 4)) ? "float" : "double", string);
    if (type & (1 << 8))
      printf("BDims\tPDims\t%% Fit\tIters\tNansec\t%% Chng\tMFlopsS\tMB/sec\n");
    else
      printf("BSize\tPSize\t%% Fit\tIters\tNansec\t%% Chng\tMFlopsS\tMB/sec\n");
    printf("-----\t-----\t-----\t------\t------\t------\t-------\t------\n");
  }
}


x86 assembly (clang, -O0):
<print_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <isatty@plt>
cmp    $0x0,%rax
je     11cb <print_header+0xab>
mov    -0x4(%rbp),%ecx
and    $0x8,%ecx
lea    0xecb(%rip),%rsi
lea    0xeb6(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
mov    -0x4(%rbp),%ecx
and    $0x10,%ecx
lea    0xeb8(%rip),%rdx
lea    0xeab(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
mov    -0x10(%rbp),%rcx
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     11af <print_header+0x8f>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11bd <print_header+0x9d>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_header>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0x1,%edi
call   1040 <isatty@plt>
test   %rax,%rax
je     11b5 <print_header+0x85>
test   $0x8,%bl
lea    0xec9(%rip),%rax
lea    0xeb4(%rip),%rsi
cmove  %rax,%rsi
test   $0x10,%bl
lea    0xebc(%rip),%rax
lea    0xeaf(%rip),%rdx
cmove  %rax,%rdx
lea    0xe87(%rip),%rdi
mov    %r14,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
test   $0x100,%ebx
lea    0xed2(%rip),%rax
lea    0xe93(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xef1(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"\0A\09\09%s%s %s\0A\0A\00"
@.str.1 = [14 x i8] c"Uncalibrated \00"
@.str.2 = [2 x i8] c"\09\00"
@.str.3 = [6 x i8] c"float\00"
@.str.4 = [7 x i8] c"double\00"
@.str.5 = [56 x i8] c"BDims\09PDims\09%% Fit\09Iters\09Nansec\09%% Chng\09MFlopsS\09MB/sec\0A\00"
@.str.6 = [56 x i8] c"BSize\09PSize\09%% Fit\09Iters\09Nansec\09%% Chng\09MFlopsS\09MB/sec\0A\00"
@.str.7 = [55 x i8] c"-----\09-----\09-----\09------\09------\09------\09-------\09------\0A\00"
define void @print_header(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i64 @isatty(i32 1)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %29
7: ; preds = %2
%8 = load i32, i32* %3
%9 = and i32 %8, 8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%13 = load i32, i32* %3
%14 = and i32 %13, 16
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%18 = load i8*, i8** %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %17, i8* %18)
%20 = load i32, i32* %3
%21 = and i32 %20, 256
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %7
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.5, i64 0, i64 0))
br label %27
25: ; preds = %7
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.6, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
br label %29
29: ; preds = %27, %2
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"\0A\09\09%s%s %s\0A\0A\00"
@.str.1 = [14 x i8] c"Uncalibrated \00"
@.str.2 = [2 x i8] c"\09\00"
@.str.3 = [6 x i8] c"float\00"
@.str.4 = [7 x i8] c"double\00"
@.str.5 = [56 x i8] c"BDims\09PDims\09%% Fit\09Iters\09Nansec\09%% Chng\09MFlopsS\09MB/sec\0A\00"
@.str.6 = [56 x i8] c"BSize\09PSize\09%% Fit\09Iters\09Nansec\09%% Chng\09MFlopsS\09MB/sec\0A\00"
@str = [54 x i8] c"-----\09-----\09-----\09------\09------\09------\09-------\09------\00"
define void @print_header(i32 %0, i8* %1) {
%3 = tail call i64 @isatty(i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2
%6 = and i32 %0, 8
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0)
%9 = and i32 %0, 16
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %11, i8* %1)
%13 = and i32 %0, 256
%14 = icmp eq i32 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.5, i64 0, i64 0)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %15)
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
br label %18
18: ; preds = %5, %2
ret void
}