#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*/ printInt(char, int);
void bitOperation() {
  int x = 10;
  int y = 12;
  int z = x & y;
  int v = ~x;
  int b = x ^ y;
  int n = x | y;
  int m = x << 3;
  int l = x >> 3;
  printInt('x', x);
  printInt('y', y);
  printInt('z', z);
  printInt('v', v);
  printInt('b', b);
  printInt('n', n);
  printInt('m', m);
  printInt('l', l);
  printInt('l', l);
}


x86 assembly (clang, -O0):
<bitOperation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x78,%edi
call   1030 <printInt@plt>
mov    -0x8(%rbp),%esi
mov    $0x79,%edi
call   1030 <printInt@plt>
mov    -0xc(%rbp),%esi
mov    $0x7a,%edi
call   1030 <printInt@plt>
mov    -0x10(%rbp),%esi
mov    $0x76,%edi
call   1030 <printInt@plt>
mov    -0x14(%rbp),%esi
mov    $0x62,%edi
call   1030 <printInt@plt>
mov    -0x18(%rbp),%esi
mov    $0x6e,%edi
call   1030 <printInt@plt>
mov    -0x1c(%rbp),%esi
mov    $0x6d,%edi
call   1030 <printInt@plt>
mov    -0x20(%rbp),%esi
mov    $0x6c,%edi
call   1030 <printInt@plt>
mov    -0x20(%rbp),%esi
mov    $0x6c,%edi
call   1030 <printInt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitOperation>:
push   %rax
mov    $0x78,%edi
mov    $0xa,%esi
call   1030 <printInt@plt>
mov    $0x79,%edi
mov    $0xc,%esi
call   1030 <printInt@plt>
mov    $0x7a,%edi
mov    $0x8,%esi
call   1030 <printInt@plt>
mov    $0x76,%edi
mov    $0xfffffff5,%esi
call   1030 <printInt@plt>
mov    $0x62,%edi
mov    $0x6,%esi
call   1030 <printInt@plt>
mov    $0x6e,%edi
mov    $0xe,%esi
call   1030 <printInt@plt>
mov    $0x6d,%edi
mov    $0x50,%esi
call   1030 <printInt@plt>
mov    $0x6c,%edi
mov    $0x1,%esi
call   1030 <printInt@plt>
mov    $0x6c,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <printInt@plt>

LLVM IR (-O0):
define void @bitOperation() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 10, i32* %1
store i32 12, i32* %2
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = and i32 %9, %10
store i32 %11, i32* %3
%12 = load i32, i32* %1
%13 = xor i32 %12, -1
store i32 %13, i32* %4
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = xor i32 %14, %15
store i32 %16, i32* %5
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = or i32 %17, %18
store i32 %19, i32* %6
%20 = load i32, i32* %1
%21 = shl i32 %20, 3
store i32 %21, i32* %7
%22 = load i32, i32* %1
%23 = ashr i32 %22, 3
store i32 %23, i32* %8
%24 = load i32, i32* %1
%25 = call i32 @printInt(i8 signext 120, i32 %24)
%26 = load i32, i32* %2
%27 = call i32 @printInt(i8 signext 121, i32 %26)
%28 = load i32, i32* %3
%29 = call i32 @printInt(i8 signext 122, i32 %28)
%30 = load i32, i32* %4
%31 = call i32 @printInt(i8 signext 118, i32 %30)
%32 = load i32, i32* %5
%33 = call i32 @printInt(i8 signext 98, i32 %32)
%34 = load i32, i32* %6
%35 = call i32 @printInt(i8 signext 110, i32 %34)
%36 = load i32, i32* %7
%37 = call i32 @printInt(i8 signext 109, i32 %36)
%38 = load i32, i32* %8
%39 = call i32 @printInt(i8 signext 108, i32 %38)
%40 = load i32, i32* %8
%41 = call i32 @printInt(i8 signext 108, i32 %40)
ret void
}

LLVM IR (-O2):
define void @bitOperation() {
%1 = tail call i32 @printInt(i8 signext 120, i32 10)
%2 = tail call i32 @printInt(i8 signext 121, i32 12)
%3 = tail call i32 @printInt(i8 signext 122, i32 8)
%4 = tail call i32 @printInt(i8 signext 118, i32 -11)
%5 = tail call i32 @printInt(i8 signext 98, i32 6)
%6 = tail call i32 @printInt(i8 signext 110, i32 14)
%7 = tail call i32 @printInt(i8 signext 109, i32 80)
%8 = tail call i32 @printInt(i8 signext 108, i32 1)
%9 = tail call i32 @printInt(i8 signext 108, i32 1)
ret void
}