#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*/ assert(int);
int bic(int, int);
int bis(int, int);
int bool_or(int, int);
int bool_xor(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 0x4200ab12, b = 0x0100ff00;
  printf("%.8x\n", bis(a, b));
  printf("%.8x\n", bic(a, b));
  assert(bool_or(a, b) == (a | b));
  assert(bic(~0, a) == ~a);
  assert(bic(~0, b) == ~b);
  assert(bool_xor(a, b) == (a ^ b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4200ab12,-0x8(%rbp)
movl   $0x100ff00,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1080 <bis@plt>
mov    %eax,%esi
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1070 <bic@plt>
mov    %eax,%esi
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <bool_or@plt>
mov    -0x8(%rbp),%ecx
or     -0xc(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%esi
mov    $0xffffffff,%edi
call   1070 <bic@plt>
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0xc(%rbp),%esi
mov    $0xffffffff,%edi
call   1070 <bic@plt>
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <bool_xor@plt>
mov    -0x8(%rbp),%ecx
xor    -0xc(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4200ab12,%edi
mov    $0x100ff00,%esi
call   1080 <bis@plt>
lea    0xe89(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x4200ab12,%edi
mov    $0x100ff00,%esi
call   1070 <bic@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x4200ab12,%edi
mov    $0x100ff00,%esi
call   1040 <bool_or@plt>
xor    %edi,%edi
cmp    $0x4300ff12,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0xffffffff,%edi
mov    $0x4200ab12,%esi
call   1070 <bic@plt>
xor    %edi,%edi
cmp    $0xbdff54ed,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0xffffffff,%edi
mov    $0x100ff00,%esi
call   1070 <bic@plt>
xor    %edi,%edi
cmp    $0xfeff00ff,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0x4200ab12,%edi
mov    $0x100ff00,%esi
call   1060 <bool_xor@plt>
xor    %edi,%edi
cmp    $0x43005412,%eax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.8x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1107340050, i32* %2
store i32 16842496, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @bis(i32 %4, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @bic(i32 %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @bool_or(i32 %12, i32 %13)
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = or i32 %15, %16
%18 = icmp eq i32 %14, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i32, i32* %2
%22 = call i32 @bic(i32 -1, i32 %21)
%23 = load i32, i32* %2
%24 = xor i32 %23, -1
%25 = icmp eq i32 %22, %24
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = load i32, i32* %3
%29 = call i32 @bic(i32 -1, i32 %28)
%30 = load i32, i32* %3
%31 = xor i32 %30, -1
%32 = icmp eq i32 %29, %31
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
%35 = load i32, i32* %2
%36 = load i32, i32* %3
%37 = call i32 @bool_xor(i32 %35, i32 %36)
%38 = load i32, i32* %2
%39 = load i32, i32* %3
%40 = xor i32 %38, %39
%41 = icmp eq i32 %37, %40
%42 = zext i1 %41 to i32
%43 = call i32 @assert(i32 %42)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.8x\0A\00"
define i32 @main() {
%1 = tail call i32 @bis(i32 1107340050, i32 16842496)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @bic(i32 1107340050, i32 16842496)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @bool_or(i32 1107340050, i32 16842496)
%6 = icmp eq i32 %5, 1124138770
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @bic(i32 -1, i32 1107340050)
%10 = icmp eq i32 %9, -1107340051
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @bic(i32 -1, i32 16842496)
%14 = icmp eq i32 %13, -16842497
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i32 @bool_xor(i32 1107340050, i32 16842496)
%18 = icmp eq i32 %17, 1124094994
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
ret i32 0
}