#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getenv(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ stderr;
void sigcnt() {
  char *pbuf = getenv("PIPE_COLOR");
  if (pbuf != NULL) {
    printf("%s%s\n", "\x1b[", pbuf);
  } else {
    fprintf(stderr, "%s\n", "Must set ansi code in PIPE_COLOR");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<sigcnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117f <sigcnt+0x3f>
mov    -0x8(%rbp),%rdx
lea    0xe92(%rip),%rdi
lea    0xe91(%rip),%rsi
call   1040 <printf@plt>
jmp    11a5 <sigcnt+0x65>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
lea    0xe73(%rip),%rsi
lea    0xe73(%rip),%rdx
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigcnt>:
push   %rax
lea    0xed7(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1169 <sigcnt+0x29>
lea    0xea7(%rip),%rdi
lea    0xea6(%rip),%rsi
mov    %rax,%rdx
pop    %rax
jmp    1040 <printf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
lea    0xe89(%rip),%rdx
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"PIPE_COLOR\00"
@.str.1 = [6 x i8] c"%s%s\0A\00"
@.str.2 = [3 x i8] c"\1B[\00"
@stderr = global i32 0
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [33 x i8] c"Must set ansi code in PIPE_COLOR\00"
define void @sigcnt() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %12
8: ; preds = %0
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"PIPE_COLOR\00"
@.str.1 = [6 x i8] c"%s%s\0A\00"
@.str.2 = [3 x i8] c"\1B[\00"
@stderr = global i32 0
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [33 x i8] c"Must set ansi code in PIPE_COLOR\00"
define void @sigcnt() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %1)
ret void
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}