#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 = 1, d = 0;
  a &= b;
  print("a  0");
  printid(a);
  a |= c;
  print("a  1");
  printid(a);
  a |= c;
  print("a  1");
  printid(a);
  a ^= c;
  print("a  0");
  printid(a);
  a &= b;
  print("a  0");
  printid(a);
  c &= d;
  print("c  1");
  printid(c);
  b ^= c;
  print("b  0");
  printid(b);
  b |= c;
  print("b  0");
  printid(b);
  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)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    0xea5(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
mov    -0x10(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    0xe8d(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
mov    -0x10(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    0xe70(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
mov    -0x10(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    0xe4e(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    0xe31(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
mov    -0x14(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    0xe1e(%rip),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%edi
call   1040 <printid@plt>
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xe06(%rip),%rdi
call   1030 <print@plt>
mov    -0xc(%rbp),%edi
call   1040 <printid@plt>
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xde9(%rip),%rdi
call   1030 <print@plt>
mov    -0xc(%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    %r14,%rdi
call   1030 <print@plt>
xor    %edi,%edi
call   1040 <printid@plt>
lea    0xe80(%rip),%rdi
call   1030 <print@plt>
xor    %edi,%edi
call   1040 <printid@plt>
lea    0xe72(%rip),%rbx
mov    %rbx,%rdi
call   1030 <print@plt>
xor    %edi,%edi
call   1040 <printid@plt>
mov    %rbx,%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"a 0\00"
@.str.1 = [5 x i8] c"a 1\00"
@.str.2 = [5 x i8] c"c 1\00"
@.str.3 = [5 x i8] c"b 0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = and i32 %7, %6
store i32 %8, i32* %2
%9 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %2
%11 = call i32 @printid(i32 %10)
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%16 = load i32, i32* %2
%17 = call i32 @printid(i32 %16)
%18 = load i32, i32* %4
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%22 = load i32, i32* %2
%23 = call i32 @printid(i32 %22)
%24 = load i32, i32* %4
%25 = load i32, i32* %2
%26 = xor i32 %25, %24
store i32 %26, i32* %2
%27 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%28 = load i32, i32* %2
%29 = call i32 @printid(i32 %28)
%30 = load i32, i32* %3
%31 = load i32, i32* %2
%32 = and i32 %31, %30
store i32 %32, i32* %2
%33 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%34 = load i32, i32* %2
%35 = call i32 @printid(i32 %34)
%36 = load i32, i32* %5
%37 = load i32, i32* %4
%38 = and i32 %37, %36
store i32 %38, i32* %4
%39 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%40 = load i32, i32* %4
%41 = call i32 @printid(i32 %40)
%42 = load i32, i32* %4
%43 = load i32, i32* %3
%44 = xor i32 %43, %42
store i32 %44, i32* %3
%45 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%46 = load i32, i32* %3
%47 = call i32 @printid(i32 %46)
%48 = load i32, i32* %4
%49 = load i32, i32* %3
%50 = or i32 %49, %48
store i32 %50, i32* %3
%51 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%52 = load i32, i32* %3
%53 = call i32 @printid(i32 %52)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"a 0\00"
@.str.1 = [5 x i8] c"a 1\00"
@.str.2 = [5 x i8] c"c 1\00"
@.str.3 = [5 x i8] c"b 0\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, i64 0, i64 0))
%10 = tail call i32 @printid(i32 0)
%11 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%12 = tail call i32 @printid(i32 0)
%13 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%14 = tail call i32 @printid(i32 0)
%15 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%16 = tail call i32 @printid(i32 0)
ret i32 0
}