#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);
int /*<<< orphan*/ putfun(int);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int x = 10, a, b, n;
  unsigned c;
  scanf("%d", &n);
  a = x >> n;
  c = 0xffff;
  c = c >> (16 - n);
  b = x & c;
  b = b << (16 - n);
  x = a | b;
  putfun(x);
  printf("%d", a | b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
movl   $0xffff,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x10,%ecx
sub    -0x10(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x10,%ecx
sub    -0x10(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <putfun@plt>
mov    -0x8(%rbp),%esi
or     -0xc(%rbp),%esi
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x4(%rsp),%cl
mov    $0xa,%edx
shr    %cl,%edx
mov    $0x10,%al
sub    %cl,%al
mov    $0xffff,%ebp
mov    %eax,%ecx
shr    %cl,%ebp
and    $0xa,%ebp
shl    %cl,%ebp
or     %edx,%ebp
mov    %ebp,%edi
call   1050 <putfun@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = lshr i32 10, %4
%6 = sub nsw i32 16, %4
%7 = lshr i32 65535, %6
%8 = and i32 %7, 10
%9 = shl i32 %8, %6
%10 = or i32 %9, %5
%11 = call i32 @putfun(i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}