#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 w1 = 0177777u, w2 = 0444u;
  unsigned int shift(unsigned int value, int n);
  if ((5) > 0) {
    (w1) <<= (5);
  } else {
    (w1) >>= -(5);
  }
  printf("%o\t", w1);
  w1 = 0177777u;
  printf("%o\n", w1 << 5);
  if ((-6) > 0) {
    (w1) <<= (-6);
  } else {
    (w1) >>= -(-6);
  }
  printf("%o\t", w1);
  w1 = 0177777u;
  printf("%o\n", w1 >> 6);
  if ((0) > 0) {
    (w2) <<= (0);
  } else {
    (w2) >>= -(0);
  }
  printf("%o\t", w2);
  w2 = 0444u;
  printf("%o\n", w2 >> 0);
  if ((-3) > 0) {
    (w1) <<= (-3);
  } else {
    (w1) >>= -(-3);
  }
  if ((3) > 0) {
    (w1) <<= (3);
  } else {
    (w1) >>= -(3);
  }
  printf("%o\n", w1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffff,-0x8(%rbp)
movl   $0x124,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x5,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffff,-0x8(%rbp)
mov    -0x8(%rbp),%esi
shl    $0x5,%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
shr    $0x6,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffff,-0x8(%rbp)
mov    -0x8(%rbp),%esi
shr    $0x6,%esi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
shr    $0x0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x124,-0xc(%rbp)
mov    -0xc(%rbp),%esi
shr    $0x0,%esi
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
shr    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%r14
mov    %r14,%rdi
mov    $0x1fffe0,%esi
call   1030 <printf@plt>
lea    0xed5(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1fffe0,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x3ff,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3ff,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x124,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x124,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfff8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%o\09\00"
@.str.1 = [4 x i8] c"%o\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 65535, i32* %2
store i32 292, i32* %3
%4 = load i32, i32* %2
%5 = shl i32 %4, 5
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 65535, i32* %2
%8 = load i32, i32* %2
%9 = shl i32 %8, 5
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
%12 = lshr i32 %11, 6
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
store i32 65535, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 6
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %3
%19 = lshr i32 %18, 0
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %20)
store i32 292, i32* %3
%22 = load i32, i32* %3
%23 = lshr i32 %22, 0
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %2
%26 = lshr i32 %25, 3
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = shl i32 %27, 3
store i32 %28, i32* %2
%29 = load i32, i32* %2
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%o\09\00"
@.str.1 = [4 x i8] c"%o\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2097120)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 2097120)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1023)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1023)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 292)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 292)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 65528)
ret i32 0
}