#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__ getenv(char *);
int /*<<< orphan*/ printf(char *);
void print_csv_header() {
  if (getenv("source")) {
    printf("source,");
  }
  if (getenv("passtime")) {
    printf("passtime,");
  }
  printf("time,mode,vbatt,ibatt,ibus3v3,ibus5v0,comm_temp,eps_temp,batt_temp,"
         "power,service_e,service_r,byline\n");
}


x86 assembly (clang, -O0):
<print_csv_header>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     1146 <print_csv_header+0x26>
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     1168 <print_csv_header+0x48>
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_csv_header>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     114e <print_csv_header+0x1e>
lea    0xebe(%rip),%rdi
call   1050 <printf@plt>
lea    0xeba(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     116b <print_csv_header+0x3b>
lea    0xeb2(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb0(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"source\00"
@.str.1 = [8 x i8] c"source,\00"
@.str.2 = [9 x i8] c"passtime\00"
@.str.3 = [10 x i8] c"passtime,\00"
@.str.4 = [101 x i8] c"time,mode,vbatt,ibatt,ibus3v3,ibus5v0,comm_temp,eps_temp,batt_temp,power,service_e,service_r,byline\0A\00"
define void @print_csv_header() {
%1 = call i64 @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = call i64 @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = call i32 @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"source\00"
@.str.1 = [8 x i8] c"source,\00"
@.str.2 = [9 x i8] c"passtime\00"
@.str.3 = [10 x i8] c"passtime,\00"
@str = [100 x i8] c"time,mode,vbatt,ibatt,ibus3v3,ibus5v0,comm_temp,eps_temp,batt_temp,power,service_e,service_r,byline\00"
define void @print_csv_header() {
%1 = tail call i64 @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i64 @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @str, i64 0, i64 0))
ret void
}