#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 const *, char *,
                           char *);
int /*<<< orphan*/ stderr;
__attribute__((hcos_noinstrument)) void check_bool(const char *name,
                                                   int reported, int expected) {
  if ((reported && !expected) || (expected && !reported))
    do {
      fprintf(
          stderr,
          "FAIL: "
          "Reported %s did not match expected. Reported: %s, Expected: %s\n",
          name, reported ? "true" : "false", expected ? "true" : "false");
      exit(1);
    } while (1);
}


x86 assembly (clang, -O0):
<check_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1146 <check_bool+0x26>
cmpl   $0x0,-0x10(%rbp)
je     115a <check_bool+0x3a>
cmpl   $0x0,-0x10(%rbp)
je     11b2 <check_bool+0x92>
cmpl   $0x0,-0xc(%rbp)
jne    11b2 <check_bool+0x92>
jmp    115f <check_bool+0x3f>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%esi
lea    0xed5(%rip),%rcx
lea    0xec9(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%rcx
mov    -0x10(%rbp),%esi
lea    0xebd(%rip),%r8
lea    0xeb1(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%r8
lea    0xe5d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_bool>:
mov    %rdi,%rax
test   %esi,%esi
je     112b <check_bool+0xb>
test   %edx,%edx
je     1134 <check_bool+0x14>
test   %esi,%esi
jne    1133 <check_bool+0x13>
test   %edx,%edx
jne    1134 <check_bool+0x14>
ret
push   %rax
test   %esi,%esi
lea    0xf0d(%rip),%rsi
lea    0xf01(%rip),%r8
mov    %r8,%rcx
cmove  %rsi,%rcx
test   %edx,%edx
mov    0x2e8b(%rip),%rdx
mov    (%rdx),%edi
cmove  %rsi,%r8
lea    0xe9e(%rip),%rsi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [70 x i8] c"FAIL: Reported %s did not match expected. Reported: %s, Expected: %s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define void @check_bool(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %9, %3
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %34
15: ; preds = %12
%16 = load i32, i32* %5
%17 = icmp ne i32 %16, 0
br i1 %17, label %34, label %18
18: ; preds = %15, %9
br label %19
19: ; preds = %32, %18
%20 = load i32, i32* @stderr
%21 = load i8*, i8** %4
%22 = load i32, i32* %5
%23 = icmp ne i32 %22, 0
%24 = zext i1 %23 to i64
%25 = select i1 %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%26 = load i32, i32* %6
%27 = icmp ne i32 %26, 0
%28 = zext i1 %27 to i64
%29 = select i1 %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%30 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* %21, i8* %25, i8* %29)
%31 = call i32 @exit(i32 1)
unreachable
32: ; No predecessors!
br i1 true, label %19, label %33
33: ; preds = %32
br label %34
34: ; preds = %33, %15, %12
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [70 x i8] c"FAIL: Reported %s did not match expected. Reported: %s, Expected: %s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define void @check_bool(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = icmp ne i32 %2, 0
%6 = or i1 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = icmp eq i32 %2, 0
%9 = icmp ne i32 %1, 0
%10 = or i1 %9, %8
br i1 %10, label %17, label %11
11: ; preds = %3, %7
%12 = load i32, i32* @stderr
%13 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%14 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%15 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %13, i8* %14)
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %7
ret void
}