#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 *, ...);
int main() {
  unsigned int m, n, compn;
  int k;
  scanf("%u", &n);
  m = n & 1;
  if (m)
    printf("\nn is odd");
  else
    printf("\nn is even");
  compn = ~n;
  if ((compn & 1) && (compn & (1 << 1)))
    printf("\nn is divisible by 4\n");
  else
    printf("\nn is not divisible by 4\n");
  m = n << 1;
  printf("\n2n = %u\n", m);
  printf("\nk:?\n");
  scanf("%d", &k);
  m = n << k | n >> ((sizeof(int) * 8) - k);
  printf("\nm after left rotation by k bits = %u\n", m);
  m = n >> k | n << ((sizeof(int) * 8) - k);
  printf("\nm after right rotation by k bits = %u\n", m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1167 <main+0x47>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1175 <main+0x55>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11af <main+0x8f>
mov    -0x10(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     11af <main+0x8f>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11bd <main+0x9d>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6c(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    %cl,%eax
mov    -0xc(%rbp),%edx
movslq -0x14(%rbp),%rsi
mov    $0x20,%ecx
sub    %rsi,%rcx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
shr    %cl,%eax
mov    -0xc(%rbp),%edx
movslq -0x14(%rbp),%rsi
mov    $0x20,%ecx
sub    %rsi,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
testb  $0x1,(%rsp)
lea    0xec0(%rip),%rax
lea    0xeaf(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
testb  $0x3,(%rsp)
lea    0xf28(%rip),%rax
lea    0xf03(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    (%rsp),%esi
add    %esi,%esi
lea    0xe92(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xe82(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%cl
rol    %cl,%esi
lea    0xe69(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%cl
ror    %cl,%esi
lea    0xe79(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
@.str.1 = [10 x i8] c"\0An is odd\00"
@.str.2 = [11 x i8] c"\0An is even\00"
@.str.3 = [22 x i8] c"\0An is divisible by 4\0A\00"
@.str.4 = [26 x i8] c"\0An is not divisible by 4\0A\00"
@.str.5 = [10 x i8] c"\0A2n = %u\0A\00"
@.str.6 = [6 x i8] c"\0Ak:?\0A\00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [39 x i8] c"\0Am after left rotation by k bits = %u\0A\00"
@.str.9 = [40 x i8] c"\0Am after right rotation by k bits = %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = and i32 %7, 1
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %15
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* %3
%17 = xor i32 %16, -1
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = and i32 %18, 1
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %27
21: ; preds = %15
%22 = load i32, i32* %4
%23 = and i32 %22, 2
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %29
27: ; preds = %21, %15
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
br label %29
29: ; preds = %27, %25
%30 = load i32, i32* %3
%31 = shl i32 %30, 1
store i32 %31, i32* %2
%32 = load i32, i32* %2
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %32)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%35 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %5)
%36 = load i32, i32* %3
%37 = load i32, i32* %5
%38 = shl i32 %36, %37
%39 = load i32, i32* %3
%40 = load i32, i32* %5
%41 = sext i32 %40 to i64
%42 = sub i64 32, %41
%43 = trunc i64 %42 to i32
%44 = lshr i32 %39, %43
%45 = or i32 %38, %44
store i32 %45, i32* %2
%46 = load i32, i32* %2
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i32 %46)
%48 = load i32, i32* %3
%49 = load i32, i32* %5
%50 = lshr i32 %48, %49
%51 = load i32, i32* %3
%52 = load i32, i32* %5
%53 = sext i32 %52 to i64
%54 = sub i64 32, %53
%55 = trunc i64 %54 to i32
%56 = shl i32 %51, %55
%57 = or i32 %50, %56
store i32 %57, i32* %2
%58 = load i32, i32* %2
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i32 %58)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@.str.1 = [10 x i8] c"\0An is odd\00"
@.str.2 = [11 x i8] c"\0An is even\00"
@.str.5 = [10 x i8] c"\0A2n = %u\0A\00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [39 x i8] c"\0Am after left rotation by k bits = %u\0A\00"
@.str.9 = [40 x i8] c"\0Am after right rotation by k bits = %u\0A\00"
@str = [25 x i8] c"\0An is not divisible by 4\00"
@str.10 = [5 x i8] c"\0Ak:?\00"
@str.11 = [21 x i8] c"\0An is divisible by 4\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %9)
%11 = load i32, i32* %1
%12 = and i32 %11, 3
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.11, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0)
%15 = call i32 @puts(i8* dereferenceable(1) %14)
%16 = load i32, i32* %1
%17 = shl i32 %16, 1
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %17)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.10, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %2)
%21 = load i32, i32* %1
%22 = load i32, i32* %2
%23 = shl i32 %21, %22
%24 = sub i32 32, %22
%25 = lshr i32 %21, %24
%26 = or i32 %25, %23
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %1
%29 = load i32, i32* %2
%30 = lshr i32 %28, %29
%31 = sub i32 32, %29
%32 = shl i32 %28, %31
%33 = or i32 %32, %30
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i32 %33)
ret i32 0
}