#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 *);
int main(void) {
  int n, n1, n2, n3, n4, n5;
  printf("enter the number: ");
  scanf("%d", &n);
  n5 = n % 10;
  n4 = (n % 100 - n % 10) / 10;
  n3 = (n % 1000 - n % 100) / 100;
  n2 = (n % 10000 - n % 1000) / 1000;
  n1 = (n % 100000 - n % 10000) / 10000;
  if (n1 == n5 && n2 == n4)
    printf("\n\nYES!!! YES!!");
  else
    printf("\n('_') not polindrome");
  printf("\t%d %d %d %d %d", n1, n2, n3, n4, n5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x2c(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x2c(%rbp),%eax
sub    %edx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    -0x28(%rbp),%eax
sub    %edx,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    -0x24(%rbp),%eax
sub    %edx,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x186a0,%ecx
cltd
idiv   %ecx
mov    %edx,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%eax
sub    %edx,%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    122a <main+0x10a>
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    122a <main+0x10a>
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1238 <main+0x118>
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %eax,%r15d
sub    %ecx,%r15d
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
mov    %eax,%r12d
sub    %ecx,%r12d
mov    %r12d,%ecx
sub    %r15d,%ecx
movsbl %cl,%ecx
imul   $0x67,%ecx,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
shr    $0xa,%edx
add    %cl,%dl
movsbl %dl,%r14d
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
mov    %eax,%ebp
sub    %ecx,%ebp
imul   $0x68db8bad,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2c,%rcx
add    %edx,%ecx
imul   $0x2710,%ecx,%edx
mov    %eax,%ecx
sub    %edx,%ecx
imul   $0x14f8b589,%rax,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x2d,%rdx
add    %esi,%edx
imul   $0x186a0,%edx,%edx
sub    %edx,%eax
sub    %ecx,%eax
sub    %ebp,%ecx
movswl %cx,%edx
imul   $0xffff8313,%edx,%edx
shr    $0x10,%edx
add    %ecx,%edx
movzwl %dx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
sar    $0x9,%edx
add    %ecx,%edx
movswl %dx,%r13d
cltq
imul   $0x68db8bad,%rax,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x2c,%rbx
add    %eax,%ebx
mov    %ebx,%eax
xor    %r15d,%eax
mov    %r13d,%ecx
xor    %r14d,%ecx
lea    0xdc6(%rip),%rdx
lea    0xdce(%rip),%rdi
or     %eax,%ecx
cmove  %rdx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
sub    %r12d,%ebp
movswl %bp,%eax
imul   $0x147b,%eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x13,%ecx
add    %eax,%ecx
lea    0xdba(%rip),%rdi
mov    %ebx,%esi
mov    %r13d,%edx
mov    %r14d,%r8d
mov    %r15d,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"enter the number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"\0A\0AYES!!! YES!!\00"
@.str.3 = [22 x i8] c"\0A('_') not polindrome\00"
@.str.4 = [16 x i8] c"\09%d %d %d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = srem i32 %10, 10
store i32 %11, i32* %7
%12 = load i32, i32* %2
%13 = srem i32 %12, 100
%14 = load i32, i32* %2
%15 = srem i32 %14, 10
%16 = sub nsw i32 %13, %15
%17 = sdiv i32 %16, 10
store i32 %17, i32* %6
%18 = load i32, i32* %2
%19 = srem i32 %18, 1000
%20 = load i32, i32* %2
%21 = srem i32 %20, 100
%22 = sub nsw i32 %19, %21
%23 = sdiv i32 %22, 100
store i32 %23, i32* %5
%24 = load i32, i32* %2
%25 = srem i32 %24, 10000
%26 = load i32, i32* %2
%27 = srem i32 %26, 1000
%28 = sub nsw i32 %25, %27
%29 = sdiv i32 %28, 1000
store i32 %29, i32* %4
%30 = load i32, i32* %2
%31 = srem i32 %30, 100000
%32 = load i32, i32* %2
%33 = srem i32 %32, 10000
%34 = sub nsw i32 %31, %33
%35 = sdiv i32 %34, 10000
store i32 %35, i32* %3
%36 = load i32, i32* %3
%37 = load i32, i32* %7
%38 = icmp eq i32 %36, %37
br i1 %38, label %39, label %45
39: ; preds = %0
%40 = load i32, i32* %4
%41 = load i32, i32* %6
%42 = icmp eq i32 %40, %41
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %47
45: ; preds = %39, %0
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %47
47: ; preds = %45, %43
%48 = load i32, i32* %3
%49 = load i32, i32* %4
%50 = load i32, i32* %5
%51 = load i32, i32* %6
%52 = load i32, i32* %7
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %48, i32 %49, i32 %50, i32 %51, i32 %52)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"enter the number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"\0A\0AYES!!! YES!!\00"
@.str.3 = [22 x i8] c"\0A('_') not polindrome\00"
@.str.4 = [16 x i8] c"\09%d %d %d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = srem i32 %5, 10
%7 = srem i32 %5, 100
%8 = sub nsw i32 %7, %6
%9 = trunc i32 %8 to i8
%10 = sdiv i8 %9, 10
%11 = sext i8 %10 to i32
%12 = srem i32 %5, 1000
%13 = srem i32 %5, 10000
%14 = sub nsw i32 %13, %12
%15 = trunc i32 %14 to i16
%16 = sdiv i16 %15, 1000
%17 = sext i16 %16 to i32
%18 = srem i32 %5, 100000
%19 = sub nsw i32 %18, %13
%20 = sdiv i32 %19, 10000
%21 = icmp eq i32 %20, %6
%22 = icmp eq i32 %17, %11
%23 = select i1 %21, i1 %22, i1 false
%24 = select i1 %23, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %24)
%26 = sub nsw i32 %12, %7
%27 = trunc i32 %26 to i16
%28 = sdiv i16 %27, 100
%29 = sext i16 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %20, i32 %17, i32 %29, i32 %11, i32 %6)
ret i32 0
}