#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);
int main(void) {
  unsigned int a = 128;
  unsigned int j = a << 1;
  unsigned int k = a >> 1;
  printf("j:%u\n", j);
  printf("k:%u\n", k);
  printf("a:%u\n", a);
  printf("%u\n", a << 2 + 1);
  printf("%u\n", (a << 2) + 1);
  printf("%u\n", j & k);
  printf("%u\n", j | k);
  printf("%u\n", ~a);
  printf("%u\n", j ^ k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x80,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
shl    $0x3,%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
shl    $0x2,%esi
add    $0x1,%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
and    -0x10(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
or     -0x10(%rbp),%esi
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
xor    $0xffffffff,%esi
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
xor    -0x10(%rbp),%esi
lea    0xe3f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
mov    $0x100,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x40,%esi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x80,%esi
call   1030 <printf@plt>
lea    0xec3(%rip),%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x201,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x140,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xffffff7f,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x140,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"j:%u\0A\00"
@.str.1 = [6 x i8] c"k:%u\0A\00"
@.str.2 = [6 x i8] c"a:%u\0A\00"
@.str.3 = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 128, i32* %2
%5 = load i32, i32* %2
%6 = shl i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = lshr i32 %7, 1
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %2
%16 = shl i32 %15, 3
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %2
%19 = shl i32 %18, 2
%20 = add i32 %19, 1
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = and i32 %22, %23
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = or i32 %26, %27
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %2
%31 = xor i32 %30, -1
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %3
%34 = load i32, i32* %4
%35 = xor i32 %33, %34
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %35)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"j:%u\0A\00"
@.str.1 = [6 x i8] c"k:%u\0A\00"
@.str.2 = [6 x i8] c"a:%u\0A\00"
@.str.3 = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 256)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 64)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 128)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 1024)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 513)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 320)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 -129)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 320)
ret i32 0
}