#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*/ assert(int);
int main() {
  int x;
  x = 1073741824;
  int y;
  y = x << 1;
  assert(y == -2147483648);
  y = x << 32;
  assert(y == 0);
  y = x << 100;
  assert(y == 0);
  y = x >> 32;
  assert(y == 0);
  y = x >> 100;
  assert(y == 0);
  y = x >> 1;
  assert(y == 536870912);
  x = -2147483648;
  y = x >> 31;
  assert(y == -1);
  x = 1;
  y = x << 31;
  assert(y == -2147483648);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x40000000,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0xffffffff80000000,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x20000000,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x80000000,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1f,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0xffffffff80000000,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
call   1030 <assert@plt>
call   1030 <assert@plt>
call   1030 <assert@plt>
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1073741824, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 1
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, -2147483648
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %2
%12 = shl i32 %11, 32
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32, i32* %2
%18 = shl i32 %17, 100
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load i32, i32* %2
%24 = ashr i32 %23, 32
store i32 %24, i32* %3
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, 0
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = load i32, i32* %2
%30 = ashr i32 %29, 100
store i32 %30, i32* %3
%31 = load i32, i32* %3
%32 = icmp eq i32 %31, 0
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
%35 = load i32, i32* %2
%36 = ashr i32 %35, 1
store i32 %36, i32* %3
%37 = load i32, i32* %3
%38 = icmp eq i32 %37, 536870912
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
store i32 -2147483648, i32* %2
%41 = load i32, i32* %2
%42 = ashr i32 %41, 31
store i32 %42, i32* %3
%43 = load i32, i32* %3
%44 = icmp eq i32 %43, -1
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
store i32 1, i32* %2
%47 = load i32, i32* %2
%48 = shl i32 %47, 31
store i32 %48, i32* %3
%49 = load i32, i32* %3
%50 = sext i32 %49 to i64
%51 = icmp eq i64 %50, -2147483648
%52 = zext i1 %51 to i32
%53 = call i32 @assert(i32 %52)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 poison)
%3 = tail call i32 @assert(i32 poison)
%4 = tail call i32 @assert(i32 poison)
%5 = tail call i32 @assert(i32 poison)
%6 = tail call i32 @assert(i32 1)
%7 = tail call i32 @assert(i32 1)
%8 = tail call i32 @assert(i32 1)
ret i32 0
}