#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*/ print(char *);
int /*<<< orphan*/ printid(int);
int main() {
  int a = 1, b = 0, c;
  c = a & b;
  print("c  0");
  printid(c);
  c = a | a;
  print("c  1");
  printid(c);
  c = a | b;
  print("c  1");
  printid(c);
  c = a ^ a;
  print("c  0");
  printid(c);
  c = (a ^ a) || (a | b);
  print("c  1");
  printid(c);
  c = (a ^ a) && (a | b);
  print("c  0");
  printid(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%edi
call   1040 <printid@plt>
mov    -0x8(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    0xe9b(%rip),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%edi
call   1040 <printid@plt>
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    0xe7e(%rip),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%edi
call   1040 <printid@plt>
mov    -0x8(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    0xe5c(%rip),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%edi
call   1040 <printid@plt>
mov    -0x8(%rbp),%ecx
xor    -0x8(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jne    11d4 <main+0xb4>
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
lea    0xe1f(%rip),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%edi
call   1040 <printid@plt>
mov    -0x8(%rbp),%ecx
xor    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
je     1216 <main+0xf6>
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
lea    0xdd8(%rip),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%edi
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
mov    %r14,%rdi
call   1030 <print@plt>
xor    %edi,%edi
call   1040 <printid@plt>
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
call   1030 <print@plt>
mov    $0x1,%edi
call   1040 <printid@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    $0x1,%edi
call   1040 <printid@plt>
mov    %r14,%rdi
call   1030 <print@plt>
xor    %edi,%edi
call   1040 <printid@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    $0x1,%edi
call   1040 <printid@plt>
mov    %r14,%rdi
call   1030 <print@plt>
xor    %edi,%edi
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"c 0\00"
@.str.1 = [5 x i8] c"c 1\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = and i32 %5, %6
store i32 %7, i32* %4
%8 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = call i32 @printid(i32 %9)
%11 = load i32, i32* %2
%12 = load i32, i32* %2
%13 = or i32 %11, %12
store i32 %13, i32* %4
%14 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* %4
%16 = call i32 @printid(i32 %15)
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = or i32 %17, %18
store i32 %19, i32* %4
%20 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* %4
%22 = call i32 @printid(i32 %21)
%23 = load i32, i32* %2
%24 = load i32, i32* %2
%25 = xor i32 %23, %24
store i32 %25, i32* %4
%26 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%27 = load i32, i32* %4
%28 = call i32 @printid(i32 %27)
%29 = load i32, i32* %2
%30 = load i32, i32* %2
%31 = xor i32 %29, %30
%32 = icmp ne i32 %31, 0
br i1 %32, label %38, label %33
33: ; preds = %0
%34 = load i32, i32* %2
%35 = load i32, i32* %3
%36 = or i32 %34, %35
%37 = icmp ne i32 %36, 0
br label %38
38: ; preds = %33, %0
%39 = phi i1 [ true, %0 ], [ %37, %33 ]
%40 = zext i1 %39 to i32
store i32 %40, i32* %4
%41 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%42 = load i32, i32* %4
%43 = call i32 @printid(i32 %42)
%44 = load i32, i32* %2
%45 = load i32, i32* %2
%46 = xor i32 %44, %45
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %53
48: ; preds = %38
%49 = load i32, i32* %2
%50 = load i32, i32* %3
%51 = or i32 %49, %50
%52 = icmp ne i32 %51, 0
br label %53
53: ; preds = %48, %38
%54 = phi i1 [ false, %38 ], [ %52, %48 ]
%55 = zext i1 %54 to i32
store i32 %55, i32* %4
%56 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%57 = load i32, i32* %4
%58 = call i32 @printid(i32 %57)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"c 0\00"
@.str.1 = [5 x i8] c"c 1\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(i32 0)
%3 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printid(i32 1)
%5 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @printid(i32 1)
%7 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @printid(i32 0)
%9 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @printid(i32 1)
%11 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @printid(i32 0)
ret i32 0
}