#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*/ printf(char *, unsigned int);
main() {
  unsigned int a = 1, b = 0;
  printf("\nThe logical OR of a and b a is %d ", a | b);
  printf("\nThe logical AND of a and b is %d", a & b);
  printf("\nThe logical Ex Or  of a and b is %d", a ^ b);
  printf("\nThe complememnt of a is %d", ~a);
  printf("\nThe complement of b is %d", ~b);
  printf("\nThe left shift of a is %d", a >> 2);
  printf("\nThe left shift of b is %d", b >> 2);
  printf("\nThe right shift of a is %d", a << 2);
  printf("\nThe right shift of bis %d", b << 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
or     -0xc(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
and    -0xc(%rbp),%esi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
xor    -0xc(%rbp),%esi
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
xor    $0xffffffff,%esi
lea    0xefb(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
xor    $0xffffffff,%esi
lea    0xf05(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
shr    $0x2,%esi
lea    0xf0e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
shr    $0x2,%esi
lea    0xf17(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
shl    $0x2,%esi
lea    0xf20(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
shl    $0x2,%esi
lea    0xf2a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xf0f(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xf23(%rip),%rdi
mov    $0xfffffffe,%esi
call   1030 <printf@plt>
lea    0xf2e(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
lea    0xf38(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xf45(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xf52(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xf5d(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"\0AThe logical OR of a and b a is %d \00"
@.str.1 = [34 x i8] c"\0AThe logical AND of a and b is %d\00"
@.str.2 = [37 x i8] c"\0AThe logical Ex Or of a and b is %d\00"
@.str.3 = [28 x i8] c"\0AThe complememnt of a is %d\00"
@.str.4 = [27 x i8] c"\0AThe complement of b is %d\00"
@.str.5 = [27 x i8] c"\0AThe left shift of a is %d\00"
@.str.6 = [27 x i8] c"\0AThe left shift of b is %d\00"
@.str.7 = [28 x i8] c"\0AThe right shift of a is %d\00"
@.str.8 = [27 x i8] c"\0AThe right shift of bis %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = or i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = and i32 %8, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = xor i32 %12, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %2
%17 = xor i32 %16, -1
%18 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %3
%20 = xor i32 %19, -1
%21 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %2
%23 = lshr i32 %22, 2
%24 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %3
%26 = lshr i32 %25, 2
%27 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %2
%29 = shl i32 %28, 2
%30 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %3
%32 = shl i32 %31, 2
%33 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i32 %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"\0AThe logical OR of a and b a is %d \00"
@.str.1 = [34 x i8] c"\0AThe logical AND of a and b is %d\00"
@.str.2 = [37 x i8] c"\0AThe logical Ex Or of a and b is %d\00"
@.str.3 = [28 x i8] c"\0AThe complememnt of a is %d\00"
@.str.4 = [27 x i8] c"\0AThe complement of b is %d\00"
@.str.5 = [27 x i8] c"\0AThe left shift of a is %d\00"
@.str.6 = [27 x i8] c"\0AThe left shift of b is %d\00"
@.str.7 = [28 x i8] c"\0AThe right shift of a is %d\00"
@.str.8 = [27 x i8] c"\0AThe right shift of bis %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 -2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 -1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), i32 4)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i32 0)
ret i32 0
}