#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void std_bool_put(const void *restrict self, const char *restrict format,
                  FILE *restrict stream) {
  (void)format;
  if (!self)
    fputs("<"
          "bool"
          " "
          "(NULL)"
          ">",
          stream);
  else if (*(const bool *)self)
    fputs("<"
          "bool"
          " "
          "true"
          ">",
          stream);
  else
    fputs("<"
          "bool"
          " "
          "false"
          ">",
          stream);
}


x86 assembly (clang, -O0):
<std_bool_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1144 <std_bool_put+0x34>
mov    -0x18(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <fputs@plt>
jmp    117b <std_bool_put+0x6b>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1166 <std_bool_put+0x56>
mov    -0x18(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <fputs@plt>
jmp    1176 <std_bool_put+0x66>
mov    -0x18(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <fputs@plt>
jmp    117b <std_bool_put+0x6b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_bool_put>:
mov    %rdx,%rcx
test   %rdi,%rdi
je     1133 <std_bool_put+0x23>
cmpl   $0x0,(%rdi)
je     1149 <std_bool_put+0x39>
lea    0xeea(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>
lea    0xec6(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>
lea    0xeca(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"<bool (NULL)>\00"
@.str.1 = [12 x i8] c"<bool true>\00"
@.str.2 = [13 x i8] c"<bool false>\00"
define void @std_bool_put(i8* noalias %0, i8* noalias %1, i32* noalias %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i32*, i32** %6
%12 = call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %11)
br label %25
13: ; preds = %3
%14 = load i8*, i8** %4
%15 = bitcast i8* %14 to i32*
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = load i32*, i32** %6
%20 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %19)
br label %24
21: ; preds = %13
%22 = load i32*, i32** %6
%23 = call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32* %22)
br label %24
24: ; preds = %21, %18
br label %25
25: ; preds = %24, %10
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"<bool (NULL)>\00"
@.str.1 = [12 x i8] c"<bool true>\00"
@.str.2 = [13 x i8] c"<bool false>\00"
define void @std_bool_put(i8* noalias %0, i8* noalias nocapture readnone %1, i32* noalias nocapture %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 13, i64 1, i32* %2)
br label %15
7: ; preds = %3
%8 = bitcast i8* %0 to i32*
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i64 11, i64 1, i32* %2)
br label %15
13: ; preds = %7
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 12, i64 1, i32* %2)
br label %15
15: ; preds = %11, %13, %5
ret void
}