#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*/ scanf(char *, int *);
int main() {
  int x = 0;
  scanf("%d", &x);
  int a = x / 100;
  int b = x % 100 / 10;
  int c = x % 10;
  printf("%d\n", c * 100 + b * 10 + a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
imul   $0x64,-0x14(%rbp),%esi
imul   $0xa,-0x10(%rbp),%eax
add    %eax,%esi
add    -0xc(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rcx
imul   $0x51eb851f,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
imul   $0x64,%eax,%edx
mov    %ecx,%esi
sub    %edx,%esi
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rdx
add    %edi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
imul   $0x64,%ecx,%ecx
movsbl %sil,%edx
imul   $0x67,%edx,%edx
movzwl %dx,%edx
movswl %dx,%edi
shr    $0xf,%edx
shr    $0xa,%edi
add    %dl,%dil
movzbl %dil,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %sil,%dl
movsbl %dl,%edx
add    %eax,%esi
add    %ecx,%esi
add    %edx,%esi
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\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
store i32 0, i32* %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 100
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = srem i32 %9, 100
%11 = sdiv i32 %10, 10
store i32 %11, i32* %4
%12 = load i32, i32* %2
%13 = srem i32 %12, 10
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = mul nsw i32 %14, 100
%16 = load i32, i32* %4
%17 = mul nsw i32 %16, 10
%18 = add nsw i32 %15, %17
%19 = load i32, i32* %3
%20 = add nsw i32 %18, %19
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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 = sdiv i32 %4, 100
%6 = srem i32 %4, 100
%7 = srem i32 %4, 10
%8 = mul nsw i32 %7, 100
%9 = trunc i32 %6 to i8
%10 = srem i8 %9, 10
%11 = sub nsw i8 0, %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %5, %6
%14 = add nsw i32 %13, %8
%15 = add nsw i32 %14, %12
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %15)
ret i32 0
}