#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main() {
  unsigned int a, buff[20], i = 0, b = 0;
  scanf(" %d", &a);
  do {
    buff[i++] = a % 10;
  } while ((a /= 10) > 0);
  a = --i;
  b = i / 2;
  for (i; i > b; i--) {
    if (buff[i] != buff[a - i]) {
      printf("N\n");
      return EXIT_SUCCESS;
    }
  }
  printf("S\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x64(%rbp)
movl   $0x0,-0x68(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    -0x64(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x64(%rbp)
mov    %eax,%eax
mov    %edx,-0x60(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
ja     114d <main+0x2d>
mov    -0x64(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x64(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x64(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x68(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x68(%rbp),%eax
jbe    11ec <main+0xcc>
mov    -0x64(%rbp),%eax
mov    -0x60(%rbp,%rax,4),%eax
mov    -0x8(%rbp),%ecx
sub    -0x64(%rbp),%ecx
mov    %ecx,%ecx
cmp    -0x60(%rbp,%rcx,4),%eax
je     11d9 <main+0xb9>
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e11(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1204 <main+0xe4>
jmp    11de <main+0xbe>
mov    -0x64(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x64(%rbp)
jmp    1197 <main+0x77>
lea    0xe14(%rip),%rdi
call   1030 <printf@plt>
mov    0x2de1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0xfffffffe,%eax
mov    0xc(%rsp),%edx
mov    $0xcccccccd,%r8d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x2(%rax),%r9d
mov    %edx,%ecx
imul   %r8,%rcx
shr    $0x23,%rcx
lea    (%rcx,%rcx,1),%esi
lea    (%rsi,%rsi,4),%edi
mov    %edx,%esi
sub    %edi,%esi
mov    %esi,0x10(%rsp,%r9,4)
add    $0x1,%eax
cmp    $0x9,%edx
mov    %ecx,%edx
ja     1150 <main+0x30>
lea    0x1(%rax),%edx
mov    %edx,0xc(%rsp)
mov    %edx,%r9d
shr    %r9d
lea    0xe79(%rip),%rdi
cmp    %r9d,%edx
jbe    11cc <main+0xac>
lea    0xe6f(%rip),%r8
cmp    0x10(%rsp),%esi
jne    11c9 <main+0xa9>
mov    $0x1,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %r9d,%eax
jbe    11cc <main+0xac>
mov    %eax,%edx
mov    0x10(%rsp,%rdx,4),%edx
mov    %esi,%ecx
add    $0xffffffff,%eax
add    $0x1,%esi
cmp    0x10(%rsp,%rcx,4),%edx
je     11b0 <main+0x90>
mov    %r8,%rdi
call   1030 <puts@plt>
mov    0x2e08(%rip),%rax
mov    (%rax),%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c" %d\00"
@.str.1 = [3 x i8] c"N\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.2 = [3 x i8] c"S\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [20 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %7
7: ; preds = %14, %0
%8 = load i32, i32* %2
%9 = urem i32 %8, 10
%10 = load i32, i32* %4
%11 = add i32 %10, 1
store i32 %11, i32* %4
%12 = zext i32 %10 to i64
%13 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 %12
store i32 %9, i32* %13
br label %14
14: ; preds = %7
%15 = load i32, i32* %2
%16 = udiv i32 %15, 10
store i32 %16, i32* %2
%17 = icmp ugt i32 %16, 0
br i1 %17, label %7, label %18
18: ; preds = %14
%19 = load i32, i32* %4
%20 = add i32 %19, -1
store i32 %20, i32* %4
store i32 %20, i32* %2
%21 = load i32, i32* %4
%22 = udiv i32 %21, 2
store i32 %22, i32* %5
%23 = load i32, i32* %4
br label %24
24: ; preds = %44, %18
%25 = load i32, i32* %4
%26 = load i32, i32* %5
%27 = icmp ugt i32 %25, %26
br i1 %27, label %28, label %47
28: ; preds = %24
%29 = load i32, i32* %4
%30 = zext i32 %29 to i64
%31 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = load i32, i32* %2
%34 = load i32, i32* %4
%35 = sub i32 %33, %34
%36 = zext i32 %35 to i64
%37 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = icmp ne i32 %32, %38
br i1 %39, label %40, label %43
40: ; preds = %28
%41 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%42 = load i32, i32* @EXIT_SUCCESS
store i32 %42, i32* %1
br label %50
43: ; preds = %28
br label %44
44: ; preds = %43
%45 = load i32, i32* %4
%46 = add i32 %45, -1
store i32 %46, i32* %4
br label %24
47: ; preds = %24
%48 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%49 = load i32, i32* @EXIT_SUCCESS
store i32 %49, i32* %1
br label %50
50: ; preds = %47, %40
%51 = load i32, i32* %1
ret i32 %51
}

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
@EXIT_SUCCESS = global i32 0
@str = [2 x i8] c"S\00"
@str.3 = [2 x i8] c"N\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
br label %7
7: ; preds = %7, %0
%8 = phi i32 [ %14, %7 ], [ %6, %0 ]
%9 = phi i32 [ %11, %7 ], [ 0, %0 ]
%10 = urem i32 %8, 10
%11 = add i32 %9, 1
%12 = zext i32 %9 to i64
%13 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %12
store i32 %10, i32* %13
%14 = udiv i32 %8, 10
%15 = icmp ult i32 %8, 10
br i1 %15, label %16, label %7
16: ; preds = %7
store i32 %9, i32* %1
%17 = lshr i32 %9, 1
%18 = icmp ugt i32 %9, %17
br i1 %18, label %19, label %36
19: ; preds = %16
%20 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%21 = load i32, i32* %20
%22 = icmp eq i32 %10, %21
br i1 %22, label %23, label %36
23: ; preds = %19, %27
%24 = phi i32 [ %25, %27 ], [ %9, %19 ]
%25 = add i32 %24, -1
%26 = icmp ugt i32 %25, %17
br i1 %26, label %27, label %36
27: ; preds = %23
%28 = zext i32 %25 to i64
%29 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = sub i32 %9, %25
%32 = zext i32 %31 to i64
%33 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = icmp eq i32 %30, %34
br i1 %35, label %23, label %36
36: ; preds = %27, %23, %19, %16
%37 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0), %16 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0), %19 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0), %23 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0), %27 ]
%38 = call i32 @puts(i8* dereferenceable(1) %37)
%39 = load i32, i32* @EXIT_SUCCESS
ret i32 %39
}