#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 *, ...);
int /*<<< orphan*/ scanf(char *, unsigned int *, int *);
void main() {
  unsigned a, b, c, d;
  int n;
  printf("enter a,n:\n");
  scanf("%o %d", &a, &n);
  b = a << (32 - n);
  c = a >> n;
  d = c | b;
  c = c | b;
  printf("a=%o,%d\nb=%o,%d\nc=%o,%d\n", a, a, b, b, c, c);
  printf("d=%o,%d\n", d, d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x14(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x14(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    -0xc(%rbp),%r9d
mov    -0xc(%rbp),%eax
lea    0xe80(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%al
mov    %eax,%ecx
neg    %cl
mov    %edx,%r8d
shl    %cl,%r8d
mov    %edx,%ebx
mov    %eax,%ecx
ror    %cl,%ebx
mov    %ebx,(%rsp)
lea    0xe8d(%rip),%rdi
mov    %edx,%esi
mov    %r8d,%ecx
mov    %ebx,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe90(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%o %d\00"
@.str.2 = [25 x i8] c"a=%o,%d\0Ab=%o,%d\0Ac=%o,%d\0A\00"
@.str.3 = [9 x i8] c"d=%o,%d\0A\00"
@str = [11 x i8] c"enter a,n:\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = sub nsw i32 32, %8
%10 = shl i32 %7, %9
%11 = lshr i32 %7, %8
%12 = or i32 %10, %11
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %7, i32 %10, i32 %10, i32 %12, i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %12, i32 %12)
ret void
}