#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*/ fprint_invalid(int /*<<< orphan*/ *, unsigned char *,
                                  unsigned char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void fprint_boolean(FILE *f, unsigned char *p, unsigned char *e) {
  if (p != e - 1) {
    fprint_invalid(f, p, e);
    return;
  } else if (*p)
    fprintf(f, "TRUE");
  else
    fprintf(f, "FALSE");
}


x86 assembly (clang, -O0):
<fprint_boolean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
add    $0xffffffffffffffff,%rcx
cmp    %rcx,%rax
je     115f <fprint_boolean+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <fprint_invalid@plt>
jmp    1196 <fprint_boolean+0x76>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1181 <fprint_boolean+0x61>
mov    -0x8(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1191 <fprint_boolean+0x71>
mov    -0x8(%rbp),%rdi
lea    0xe79(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1196 <fprint_boolean+0x76>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_boolean>:
mov    %rdi,%rcx
lea    -0x1(%rdx),%rax
cmp    %rsi,%rax
je     1134 <fprint_boolean+0x14>
mov    %rcx,%rdi
jmp    1030 <fprint_invalid@plt>
cmpb   $0x0,(%rsi)
je     114f <fprint_boolean+0x2f>
lea    0xec0(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
jmp    1040 <fwrite@plt>
lea    0xeaf(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"TRUE\00"
@.str.1 = [6 x i8] c"FALSE\00"
define void @fprint_boolean(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %6
%9 = getelementptr inbounds i8, i8* %8, i64 -1
%10 = icmp ne i8* %7, %9
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @fprint_invalid(i32* %12, i8* %13, i8* %14)
br label %27
16: ; preds = %3
%17 = load i8*, i8** %5
%18 = load i8, i8* %17
%19 = icmp ne i8 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32*, i32** %4
%22 = call i32 @fprintf(i32* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %26
23: ; preds = %16
%24 = load i32*, i32** %4
%25 = call i32 @fprintf(i32* %24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %26
26: ; preds = %23, %20
br label %27
27: ; preds = %11, %26
ret void
}

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