#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 /*<<< orphan*/ scanf(char *, unsigned int *);
int main() {
  unsigned int n = 0;
  scanf("%d", &n);
  unsigned int firstSet = (n >> 3) & 7;
  unsigned int secondSet = (n >> 24) & 7;
  n &= ~(7 << 24);
  n |= firstSet << 24;
  n &= ~(7 << 3);
  n |= secondSet << 3;
  printf("%d", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
shr    $0x3,%eax
and    $0x7,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x18,%eax
and    $0x7,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf8ffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x18,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffffffc7,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x3,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xecc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %esi,%eax
and    $0xf8ffffc7,%eax
mov    %esi,%ecx
and    $0x38,%ecx
shl    $0x15,%ecx
or     %eax,%ecx
shr    $0x15,%esi
and    $0x38,%esi
or     %ecx,%esi
mov    %esi,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%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 = and i32 %4, -117440569
%6 = shl i32 %4, 21
%7 = and i32 %6, 117440512
%8 = or i32 %7, %5
%9 = lshr i32 %4, 21
%10 = and i32 %9, 56
%11 = or i32 %8, %10
store i32 %11, i32* %1
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}