#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*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void print_bool(const char *name, int on) {
  if (on)
    fputs("\e[1m+", stdout);
  else
    fputs("-", stdout);
  fputs(name, stdout);
  if (on)
    fputs("\e[0m", stdout);
}


x86 assembly (clang, -O0):
<print_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1143 <print_bool+0x33>
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xec7(%rip),%rdi
call   1030 <fputs@plt>
jmp    1158 <print_bool+0x48>
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
cmpl   $0x0,-0xc(%rbp)
je     1189 <print_bool+0x79>
mov    0x2e65(%rip),%rax
mov    (%rax),%esi
lea    0xe84(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bool>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%eax
mov    %rdi,%rbx
mov    0x2ec0(%rip),%r14
mov    (%r14),%esi
test   %eax,%eax
je     1147 <print_bool+0x37>
lea    0xed2(%rip),%rdi
call   1030 <fputs@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
call   1030 <fputs@plt>
lea    0xec3(%rip),%rbx
jmp    1153 <print_bool+0x43>
lea    0xeb8(%rip),%rdi
call   1030 <fputs@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[1m+\00"
@stdout = global i32 0
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @print_bool(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* @stdout
%9 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %13
10: ; preds = %2
%11 = load i32, i32* @stdout
%12 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %7
%14 = load i8*, i8** %3
%15 = load i32, i32* @stdout
%16 = call i32 @fputs(i8* %14, i32 %15)
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = load i32, i32* @stdout
%21 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %19, %13
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[1m+\00"
@stdout = global i32 0
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @print_bool(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = load i32, i32* @stdout
br i1 %3, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %4)
br label %11
7: ; preds = %2
%8 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
%9 = load i32, i32* @stdout
%10 = tail call i32 @fputs(i8* %0, i32 %9)
br label %11
11: ; preds = %5, %7
%12 = phi i8* [ %0, %5 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %7 ]
%13 = load i32, i32* @stdout
%14 = tail call i32 @fputs(i8* %12, i32 %13)
ret void
}