#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 */
char CHAR_BIT;
void test() {
  char c;
  c = 0 << 0;
  c = 0 << 1;
  c = 1 << 0;
  c = 1 << -0;
  c = 1 >> -0;
  c = 1 << -1;
  c = 1 >> -1;
  c = 1 << c;
  c <<= 0;
  c >>= 0;
  c <<= 1;
  c >>= 1;
  c <<= -1;
  c >>= -1;
  c <<= 999999;
  c >>= 999999;
  c <<= CHAR_BIT;
  c >>= CHAR_BIT;
  c <<= CHAR_BIT + 1;
  c >>= CHAR_BIT + 1;
  (void)((long)c << CHAR_BIT);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movb   $0x0,-0x1(%rbp)
movb   $0x0,-0x1(%rbp)
movb   $0x1,-0x1(%rbp)
movb   $0x1,-0x1(%rbp)
movb   $0x1,-0x1(%rbp)
mov    %al,-0x1(%rbp)
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
shl    $0x0,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x0,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    $0xffffffff,%ecx
shl    %cl,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    $0xffffffff,%ecx
sar    %cl,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    $0xf423f,%ecx
shl    %cl,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    $0xf423f,%ecx
sar    %cl,%eax
mov    %al,-0x1(%rbp)
mov    0x2e4d(%rip),%rax
movsbl (%rax),%ecx
movsbl -0x1(%rbp),%eax
shl    %cl,%eax
mov    %al,-0x1(%rbp)
mov    0x2e3a(%rip),%rax
movsbl (%rax),%ecx
movsbl -0x1(%rbp),%eax
sar    %cl,%eax
mov    %al,-0x1(%rbp)
mov    0x2e27(%rip),%rax
movsbl (%rax),%ecx
add    $0x1,%ecx
movsbl -0x1(%rbp),%eax
shl    %cl,%eax
mov    %al,-0x1(%rbp)
mov    0x2e11(%rip),%rax
movsbl (%rax),%ecx
add    $0x1,%ecx
movsbl -0x1(%rbp),%eax
sar    %cl,%eax
mov    %al,-0x1(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
ret

LLVM IR (-O0):
@CHAR_BIT = global i8 0
define void @test() {
%1 = alloca i8
store i8 0, i8* %1
store i8 0, i8* %1
store i8 1, i8* %1
store i8 1, i8* %1
store i8 1, i8* %1
store i8 poison, i8* %1
store i8 poison, i8* %1
%2 = load i8, i8* %1
%3 = sext i8 %2 to i32
%4 = shl i32 1, %3
%5 = trunc i32 %4 to i8
store i8 %5, i8* %1
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = shl i32 %7, 0
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
%12 = ashr i32 %11, 0
%13 = trunc i32 %12 to i8
store i8 %13, i8* %1
%14 = load i8, i8* %1
%15 = sext i8 %14 to i32
%16 = shl i32 %15, 1
%17 = trunc i32 %16 to i8
store i8 %17, i8* %1
%18 = load i8, i8* %1
%19 = sext i8 %18 to i32
%20 = ashr i32 %19, 1
%21 = trunc i32 %20 to i8
store i8 %21, i8* %1
%22 = load i8, i8* %1
%23 = sext i8 %22 to i32
%24 = shl i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %1
%26 = load i8, i8* %1
%27 = sext i8 %26 to i32
%28 = ashr i32 %27, -1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %1
%30 = load i8, i8* %1
%31 = sext i8 %30 to i32
%32 = shl i32 %31, 999999
%33 = trunc i32 %32 to i8
store i8 %33, i8* %1
%34 = load i8, i8* %1
%35 = sext i8 %34 to i32
%36 = ashr i32 %35, 999999
%37 = trunc i32 %36 to i8
store i8 %37, i8* %1
%38 = load i8, i8* @CHAR_BIT
%39 = sext i8 %38 to i32
%40 = load i8, i8* %1
%41 = sext i8 %40 to i32
%42 = shl i32 %41, %39
%43 = trunc i32 %42 to i8
store i8 %43, i8* %1
%44 = load i8, i8* @CHAR_BIT
%45 = sext i8 %44 to i32
%46 = load i8, i8* %1
%47 = sext i8 %46 to i32
%48 = ashr i32 %47, %45
%49 = trunc i32 %48 to i8
store i8 %49, i8* %1
%50 = load i8, i8* @CHAR_BIT
%51 = sext i8 %50 to i32
%52 = add nsw i32 %51, 1
%53 = load i8, i8* %1
%54 = sext i8 %53 to i32
%55 = shl i32 %54, %52
%56 = trunc i32 %55 to i8
store i8 %56, i8* %1
%57 = load i8, i8* @CHAR_BIT
%58 = sext i8 %57 to i32
%59 = add nsw i32 %58, 1
%60 = load i8, i8* %1
%61 = sext i8 %60 to i32
%62 = ashr i32 %61, %59
%63 = trunc i32 %62 to i8
store i8 %63, i8* %1
%64 = load i8, i8* %1
%65 = sext i8 %64 to i64
%66 = load i8, i8* @CHAR_BIT
%67 = sext i8 %66 to i32
%68 = zext i32 %67 to i64
%69 = shl i64 %65, %68
ret void
}

LLVM IR (-O2):
@CHAR_BIT = global i8 0
define void @test() {
ret void
}