#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, unsigned int, ...);
int main(void) {
  int num1 = 0xFEDCBA98 << 32;
  int num2 = 0xFEDCBA98 >> 36;
  unsigned num3 = 0xFEDCBA98 >> 40;
  printf("0x%#.8x\n", num1);
  printf("0x%#.8x\n", num2);
  printf("0x%#.8x\n", num3);
  int num4 = 0x00000001 << 31;
  unsigned num5 = 0x00000001 << 31;
  num4 >>= 3;
  num5 >>= 3;
  printf("     int: %#x %10d\n", num4, num4);
  printf("unsigned: %#x %10d\n", num5, num5);
  unsigned val1 = 1;
  unsigned val2 = 2;
  unsigned res1 = val1 << val2 >> 1;
  unsigned res2 = val1 << 1 + 2 << 3;
  unsigned res3 = val1 + val2 << 12 * val1 >> val2;
  printf("res: %4d\n", res1);
  printf("res: %4d\n", res2);
  printf("res: %4d\n", res3);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x80000000,-0x14(%rbp)
movl   $0x80000000,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
shr    $0x3,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x1c(%rbp)
movl   $0x2,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x20(%rbp),%ecx
shl    %cl,%eax
shr    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
shl    $0x3,%eax
shl    $0x3,%eax
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
imul   $0xc,-0x1c(%rbp),%ecx
shl    %cl,%eax
mov    -0x20(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2dc7(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0xf0000000,%esi
mov    $0xf0000000,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
mov    $0x10000000,%esi
mov    $0x10000000,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x40,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xc00,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e3f(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"0x%#.8x\0A\00"
@.str.1 = [20 x i8] c" int: %#x %10d\0A\00"
@.str.2 = [20 x i8] c"unsigned: %#x %10d\0A\00"
@.str.3 = [10 x i8] c"res: %4d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
store i32 poison, i32* %2
store i32 poison, i32* %3
store i32 poison, i32* %4
%12 = load i32, i32* %2
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %3
%15 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %4
%17 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %16)
store i32 -2147483648, i32* %5
store i32 -2147483648, i32* %6
%18 = load i32, i32* %5
%19 = ashr i32 %18, 3
store i32 %19, i32* %5
%20 = load i32, i32* %6
%21 = lshr i32 %20, 3
store i32 %21, i32* %6
%22 = load i32, i32* %5
%23 = load i32, i32* %5
%24 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %23)
%25 = load i32, i32* %6
%26 = load i32, i32* %6
%27 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %25, i32 %26)
store i32 1, i32* %7
store i32 2, i32* %8
%28 = load i32, i32* %7
%29 = load i32, i32* %8
%30 = shl i32 %28, %29
%31 = lshr i32 %30, 1
store i32 %31, i32* %9
%32 = load i32, i32* %7
%33 = shl i32 %32, 3
%34 = shl i32 %33, 3
store i32 %34, i32* %10
%35 = load i32, i32* %7
%36 = load i32, i32* %8
%37 = add i32 %35, %36
%38 = load i32, i32* %7
%39 = mul i32 12, %38
%40 = shl i32 %37, %39
%41 = load i32, i32* %8
%42 = lshr i32 %40, %41
store i32 %42, i32* %11
%43 = load i32, i32* %9
%44 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %43)
%45 = load i32, i32* %10
%46 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %11
%48 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %47)
%49 = load i32, i32* @EXIT_SUCCESS
ret i32 %49
}

LLVM IR (-O2):
@.str = [9 x i8] c"0x%#.8x\0A\00"
@.str.1 = [20 x i8] c" int: %#x %10d\0A\00"
@.str.2 = [20 x i8] c"unsigned: %#x %10d\0A\00"
@.str.3 = [10 x i8] c"res: %4d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 poison)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 poison)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 poison)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 -268435456, i32 -268435456)
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 268435456, i32 268435456)
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 2)
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 64)
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 3072)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}