#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 char, int, unsigned char);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  unsigned char a = 15;
  unsigned char c = 0;
  int b = 0;
  scanf("%d", &b);
  printf("%d<<%d = %d\n", a, b, a << b);
  printf("%d>>%d = %d\n", a, b, a >> b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0xf,-0x5(%rbp)
movb   $0x0,-0x6(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebb(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x5(%rbp),%al
mov    %al,-0xe(%rbp)
mov    -0xc(%rbp),%edx
movzbl -0x5(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0xe(%rbp),%cl
lea    0xe99(%rip),%rdi
movzbl %cl,%esi
movzbl %al,%ecx
call   1030 <printf@plt>
mov    -0x5(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%edx
movzbl -0x5(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    -0xd(%rbp),%cl
lea    0xe7f(%rip),%rdi
movzbl %cl,%esi
movzbl %al,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
mov    $0xf,%ebx
mov    $0xf,%eax
shl    %cl,%eax
movzbl %al,%eax
lea    0xeab(%rip),%rdi
mov    $0xf,%esi
mov    %ecx,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    0xc(%rsp),%ecx
shr    %cl,%ebx
lea    0xe9d(%rip),%rdi
mov    $0xf,%esi
mov    %ecx,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"%d<<%d = %d\0A\00"
@.str.2 = [13 x i8] c"%d>>%d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
store i32 0, i32* %1
store i8 15, i8* %2
store i8 0, i8* %3
store i32 0, i32* %4
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = load i8, i8* %2
%7 = load i32, i32* %4
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = load i32, i32* %4
%11 = shl i32 %9, %10
%12 = trunc i32 %11 to i8
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %6, i32 %7, i8 zeroext %12)
%14 = load i8, i8* %2
%15 = load i32, i32* %4
%16 = load i8, i8* %2
%17 = zext i8 %16 to i32
%18 = load i32, i32* %4
%19 = ashr i32 %17, %18
%20 = trunc i32 %19 to i8
%21 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %14, i32 %15, i8 zeroext %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"%d<<%d = %d\0A\00"
@.str.2 = [13 x i8] c"%d>>%d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = shl i32 15, %4
%6 = trunc i32 %5 to i8
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8 zeroext 15, i32 %4, i8 zeroext %6)
%8 = load i32, i32* %1
%9 = lshr i32 15, %8
%10 = trunc i32 %9 to i8
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8 zeroext 15, i32 %8, i8 zeroext %10)
ret i32 0
}