#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 header_display(int show_date, int show_time, int show_mb) {
  if (show_date) {
    printf("      ");
  }
  if (show_time) {
    printf("         ");
  }
  printf("%-6s %10s %7s %5s %10s\n", "", "in", "", "", "out");
  if (show_date) {
    printf("date  ");
  }
  if (show_time) {
    printf("time     ");
  }
  printf("%-6s %10s %7s %5s ", "iface", show_mb ? "mbytes" : "bytes", "pkts",
         "err");
  printf("%10s %7s %5s %5s\n", show_mb ? "mbytes" : "bytes", "pkts", "err",
         "coll");
}


x86 assembly (clang, -O0):
<header_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1139 <header_display+0x29>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1151 <header_display+0x41>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    0xec2(%rip),%r8
lea    0xebc(%rip),%rdx
lea    0xeb8(%rip),%r9
mov    %r8,%rsi
mov    %r8,%rcx
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
je     1192 <header_display+0x82>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
je     11aa <header_display+0x9a>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%ecx
lea    0xea0(%rip),%rdx
lea    0xe98(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xe71(%rip),%rdi
lea    0xe7d(%rip),%rsi
lea    0xe83(%rip),%rcx
lea    0xe81(%rip),%r8
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%ecx
lea    0xe65(%rip),%rsi
lea    0xe5d(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe5f(%rip),%rdi
lea    0xe4f(%rip),%rdx
lea    0xe4d(%rip),%rcx
lea    0xe5c(%rip),%r8
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<header_display>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
test   %edi,%edi
je     112d <header_display+0x1d>
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %ebp,%ebp
je     113f <header_display+0x2f>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0xed5(%rip),%rdx
lea    0xecd(%rip),%rcx
lea    0xeca(%rip),%r9
mov    %rcx,%rsi
mov    %rcx,%r8
xor    %eax,%eax
call   1030 <printf@plt>
test   %ebx,%ebx
je     117a <header_display+0x6a>
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %ebp,%ebp
je     118c <header_display+0x7c>
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %r14d,%r14d
lea    0xebe(%rip),%rax
lea    0xeb6(%rip),%rbx
cmove  %rax,%rbx
lea    0xe92(%rip),%rdi
lea    0xe9e(%rip),%rsi
lea    0xea4(%rip),%rbp
lea    0xea2(%rip),%r14
mov    %rbx,%rdx
mov    %rbp,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe8f(%rip),%rdi
lea    0xe9a(%rip),%r8
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r14,%rcx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c" \00"
@.str.1 = [10 x i8] c" \00"
@.str.2 = [24 x i8] c"%-6s %10s %7s %5s %10s\0A\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [3 x i8] c"in\00"
@.str.5 = [4 x i8] c"out\00"
@.str.6 = [7 x i8] c"date \00"
@.str.7 = [10 x i8] c"time \00"
@.str.8 = [19 x i8] c"%-6s %10s %7s %5s \00"
@.str.9 = [6 x i8] c"iface\00"
@.str.10 = [7 x i8] c"mbytes\00"
@.str.11 = [6 x i8] c"bytes\00"
@.str.12 = [5 x i8] c"pkts\00"
@.str.13 = [4 x i8] c"err\00"
@.str.14 = [18 x i8] c"%10s %7s %5s %5s\0A\00"
@.str.15 = [5 x i8] c"coll\00"
define void @header_display(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %3
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %11
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %22
22: ; preds = %20, %16
%23 = load i32, i32* %5
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %27
27: ; preds = %25, %22
%28 = load i32, i32* %6
%29 = icmp ne i32 %28, 0
%30 = zext i1 %29 to i64
%31 = select i1 %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%33 = load i32, i32* %6
%34 = icmp ne i32 %33, 0
%35 = zext i1 %34 to i64
%36 = select i1 %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c" \00"
@.str.1 = [10 x i8] c" \00"
@.str.2 = [24 x i8] c"%-6s %10s %7s %5s %10s\0A\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [3 x i8] c"in\00"
@.str.5 = [4 x i8] c"out\00"
@.str.6 = [7 x i8] c"date \00"
@.str.7 = [10 x i8] c"time \00"
@.str.8 = [19 x i8] c"%-6s %10s %7s %5s \00"
@.str.9 = [6 x i8] c"iface\00"
@.str.10 = [7 x i8] c"mbytes\00"
@.str.11 = [6 x i8] c"bytes\00"
@.str.12 = [5 x i8] c"pkts\00"
@.str.13 = [4 x i8] c"err\00"
@.str.14 = [18 x i8] c"%10s %7s %5s %5s\0A\00"
@.str.15 = [5 x i8] c"coll\00"
define void @header_display(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = icmp eq i32 %1, 0
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br i1 %4, label %15, label %13
13: ; preds = %11
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
br i1 %8, label %18, label %16
16: ; preds = %15
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %18
18: ; preds = %16, %15
%19 = icmp eq i32 %2, 0
%20 = select i1 %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
ret void
}